Свойство | Тип | Описание | |
---|---|---|---|
$database | MongoDB database instance. |
Метод | Описание | |
---|---|---|
createDownload ( array | MongoDB\BSON\ObjectID $document ) : |
Creates download command. | |
createUpload ( array $options = [] ) : |
Creates upload command. | |
delete ( mixed $id ) : boolean | Deletes the file with given _id. | |
drop ( ) | ||
ensureIndexes ( boolean $force = false ) | Makes sure that indexes, which are crucial for the file processing, exist at this collection and [[chunkCollection]]. | |
find ( $condition = [], $fields = [], $options = [] ) : |
||
get ( mixed $id ) : |
Retrieves the file with given _id. | |
getChunkCollection ( boolean $refresh = false ) : |
Returns the MongoDB collection for the file chunks. | |
getFileCollection ( boolean $refresh = false ) : |
Returns the MongoDB collection for the files. | |
getPrefix ( ) : string | ||
insertFile ( string $filename, array $metadata = [], array $options = [] ) : mixed | Creates new file in GridFS collection from given local filesystem file. | |
insertFileContent ( string $bytes, array $metadata = [], array $options = [] ) : mixed | Creates new file in GridFS collection with specified content. | |
insertUploads ( string $name, array $metadata = [], array $options = [] ) : mixed | Creates new file in GridFS collection from uploaded file. | |
remove ( $condition = [], $options = [] ) | ||
setPrefix ( string $prefix ) |
Метод | Описание | |
---|---|---|
ensureChunkIndexes ( ) | Ensures indexes at chunk collection. | |
ensureFileIndexes ( ) | Ensures indexes at file collection. |
public createDownload ( array | MongoDB\BSON\ObjectID $document ) : |
||
$document | array | MongoDB\BSON\ObjectID | file document ot be downloaded. |
Результат | file download instance. |
public createUpload ( array $options = [] ) : |
||
$options | array | upload options. |
Результат | file upload instance. |
public ensureIndexes ( boolean $force = false ) | ||
$force | boolean | whether to ignore internal collection instance cache. |
public find ( $condition = [], $fields = [], $options = [] ) : |
||
Результат | cursor for the search results |
public getChunkCollection ( boolean $refresh = false ) : |
||
$refresh | boolean | whether to reload the collection instance even if it is found in the cache. |
Результат | mongo collection instance. |
public getFileCollection ( boolean $refresh = false ) : |
||
$refresh | boolean | whether to reload the collection instance even if it is found in the cache. |
Результат | mongo collection instance. |
public insertFile ( string $filename, array $metadata = [], array $options = [] ) : mixed | ||
$filename | string | name of the file to store. |
$metadata | array | other metadata fields to include in the file document. |
$options | array | list of options in format: optionName => optionValue |
Результат | mixed | the "_id" of the saved file document. This will be a generated [[\MongoId]] unless an "_id" was explicitly specified in the metadata. |
public insertFileContent ( string $bytes, array $metadata = [], array $options = [] ) : mixed | ||
$bytes | string | string of bytes to store. |
$metadata | array | other metadata fields to include in the file document. |
$options | array | list of options in format: optionName => optionValue |
Результат | mixed | the "_id" of the saved file document. This will be a generated [[\MongoId]] unless an "_id" was explicitly specified in the metadata. |
public insertUploads ( string $name, array $metadata = [], array $options = [] ) : mixed | ||
$name | string | name of the uploaded file to store. This should correspond to the file field's name attribute in the HTML form. |
$metadata | array | other metadata fields to include in the file document. |
$options | array | list of options in format: optionName => optionValue |
Результат | mixed | the "_id" of the saved file document. This will be a generated [[\MongoId]] unless an "_id" was explicitly specified in the metadata. |