PHP Класс Sokil\Mongo\GridFS

Наследование: extends Collection
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$mongoCollectionClassName

Открытые методы

Метод Описание
deleteFileById ( string | MongoId $id ) : GridFS Delete file by id
getFileById ( MongoId | string | integer $id ) : GridFSFile | null Get file instance by id of document Used \MongoGridFS::findOne() instead of \MongoGridFS::get() due to backward compatibility with old mongo extensions
getFileClassName ( MongoGridFSFile $fileData = null ) : string Override to define class name of file by file data
hydrate ( MongoGridFSFile $data, $useDocumentPool = true ) : Sokil\Mongo\GridFsFile Factory method to get document object from array of stored document
storeBytes ( string $bytes, array $metadata = [] ) : MongoId Create file in GridFS from binary data
storeFile ( string $filename, array $metadata = [] ) : MongoId Create file in GridFS from file in filesystem

Описание методов

deleteFileById() публичный Метод

Delete file by id
public deleteFileById ( string | MongoId $id ) : GridFS
$id string | MongoId id of file's document
Результат GridFS

getFileById() публичный Метод

Get file instance by id of document Used \MongoGridFS::findOne() instead of \MongoGridFS::get() due to backward compatibility with old mongo extensions
public getFileById ( MongoId | string | integer $id ) : GridFSFile | null
$id MongoId | string | integer
Результат GridFSFile | null

getFileClassName() публичный Метод

Override to define class name of file by file data
public getFileClassName ( MongoGridFSFile $fileData = null ) : string
$fileData MongoGridFSFile
Результат string Document class data

hydrate() публичный Метод

Factory method to get document object from array of stored document
public hydrate ( MongoGridFSFile $data, $useDocumentPool = true ) : Sokil\Mongo\GridFsFile
$data MongoGridFSFile
Результат Sokil\Mongo\GridFsFile

storeBytes() публичный Метод

Create file in GridFS from binary data
public storeBytes ( string $bytes, array $metadata = [] ) : MongoId
$bytes string binary data to store in GridFS
$metadata array metadata stored with file
Результат MongoId Id of stored file

storeFile() публичный Метод

Create file in GridFS from file in filesystem
public storeFile ( string $filename, array $metadata = [] ) : MongoId
$filename string name of source file
$metadata array metadata stored with file
Результат MongoId Id of stored file

Описание свойств

$mongoCollectionClassName защищенное свойство

protected $mongoCollectionClassName