Phalcon\Db\Adapter\MongoDB\GridFS\Bucket::getIdFromStream PHP Method

getIdFromStream() public method

Gets the ID of the GridFS file associated with a stream.
public getIdFromStream ( resource $stream ) : mixed
$stream resource GridFS stream
return mixed
    public function getIdFromStream($stream)
    {
        $metadata = stream_get_meta_data($stream);
        if ($metadata['wrapper_data'] instanceof StreamWrapper) {
            return $metadata['wrapper_data']->getId();
        }
        // TODO: Throw if we cannot access the ID
    }