PHP 클래스 Phalcon\Db\Adapter\MongoDB\GridFS\CollectionWrapper

파일 보기 프로젝트 열기: phalcon/incubator 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( MongoDB\Driver\Manager $manager, string $databaseName, string $bucketName, array $collectionOptions = [] ) Constructs a GridFS collection wrapper.
deleteChunksByFilesId ( mixed $id ) Deletes all GridFS chunks for a given file ID.
deleteFileAndChunksById ( mixed $id ) Deletes a GridFS file and related chunks by ID.
dropCollections ( ) Drops the GridFS files and chunks collections.
findFileByFilenameAndRevision ( string $filename, integer $revision ) : stdClas\stdClass | null Finds a GridFS file document for a given filename and revision.
findFileById ( mixed $id ) : stdClas\stdClass | null Finds a GridFS file document for a given ID.
findFiles ( array | object $filter, array $options = [] ) : MongoDB\Driver\Cursor Finds documents from the GridFS bucket's files collection.
getChunksCollection ( ) TODO: Remove this
getChunksIteratorByFilesId ( mixed $id ) : IteratorIterator Returns a chunks iterator for a given file ID.
getFilesCollection ( ) TODO: Remove this
insertChunk ( array | object $chunk ) Inserts a document into the chunks collection.
insertFile ( array | object $file ) Inserts a document into the files collection.
updateFilenameForId ( mixed $id, string $filename ) : UpdateResult Updates the filename field in the file document for a given ID.

비공개 메소드들

메소드 설명
ensureChunksIndex ( ) Create an index on the chunks collection if it does not already exist.
ensureFilesIndex ( ) Create an index on the files collection if it does not already exist.
ensureIndexes ( ) Ensure indexes on the files and chunks collections exist.
isFilesCollectionEmpty ( ) : boolean Returns whether the files collection is empty.

메소드 상세

__construct() 공개 메소드

Constructs a GridFS collection wrapper.
또한 보기: Collection::__construct() for supported options
public __construct ( MongoDB\Driver\Manager $manager, string $databaseName, string $bucketName, array $collectionOptions = [] )
$manager MongoDB\Driver\Manager Manager instance from the driver
$databaseName string Database name
$bucketName string Bucket name
$collectionOptions array Collection options

deleteChunksByFilesId() 공개 메소드

Deletes all GridFS chunks for a given file ID.
public deleteChunksByFilesId ( mixed $id )
$id mixed

deleteFileAndChunksById() 공개 메소드

Deletes a GridFS file and related chunks by ID.
public deleteFileAndChunksById ( mixed $id )
$id mixed

dropCollections() 공개 메소드

Drops the GridFS files and chunks collections.
public dropCollections ( )

findFileByFilenameAndRevision() 공개 메소드

Revision numbers are defined as follows: * 0 = the original stored file * 1 = the first revision * 2 = the second revision * etc… * -2 = the second most recent revision * -1 = the most recent revision
또한 보기: Bucket::downloadToStreamByName()
또한 보기: Bucket::openDownloadStreamByName()
public findFileByFilenameAndRevision ( string $filename, integer $revision ) : stdClas\stdClass | null
$filename string
$revision integer
리턴 stdClas\stdClass | null

findFileById() 공개 메소드

Finds a GridFS file document for a given ID.
public findFileById ( mixed $id ) : stdClas\stdClass | null
$id mixed
리턴 stdClas\stdClass | null

findFiles() 공개 메소드

Finds documents from the GridFS bucket's files collection.
또한 보기: Find::__construct() for supported options
public findFiles ( array | object $filter, array $options = [] ) : MongoDB\Driver\Cursor
$filter array | object Query by which to filter documents
$options array Additional options
리턴 MongoDB\Driver\Cursor

getChunksCollection() 공개 메소드

TODO: Remove this
public getChunksCollection ( )

getChunksIteratorByFilesId() 공개 메소드

Returns a chunks iterator for a given file ID.

getFilesCollection() 공개 메소드

TODO: Remove this
public getFilesCollection ( )

insertChunk() 공개 메소드

Inserts a document into the chunks collection.
public insertChunk ( array | object $chunk )
$chunk array | object Chunk document

insertFile() 공개 메소드

The file document should be inserted after all chunks have been inserted.
public insertFile ( array | object $file )
$file array | object File document

updateFilenameForId() 공개 메소드

Updates the filename field in the file document for a given ID.
public updateFilenameForId ( mixed $id, string $filename ) : UpdateResult
$id mixed
$filename string
리턴 Phalcon\Db\Adapter\MongoDB\UpdateResult