Phalcon\Db\Adapter\MongoDB\GridFS\Bucket::getIdFromStream PHP Méthode

getIdFromStream() public méthode

Gets the ID of the GridFS file associated with a stream.
public getIdFromStream ( resource $stream ) : mixed
$stream resource GridFS stream
Résultat 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
    }