PHP 클래스 Sokil\Mongo\GridFS

상속: extends Collection
파일 보기 프로젝트 열기: sokil/php-mongo 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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