コード例 #1
0
ファイル: MongaCollection.php プロジェクト: vgrish/tacit
 /**
  * Find an item in a collection based on the provided query.
  *
  * @param null|array|\Closure $query The query to use to select the item.
  * @param array               $fields An array of field names to include in the result.
  *
  * @return null|array The Persistent item array result if found; otherwise null.
  */
 public function findOne($query, $fields = [])
 {
     return $this->peer->findOne($query, $fields);
 }
コード例 #2
0
 /**
  * Finds one file.
  *
  * @param mixed $query  filename or search query
  * @param array $fields metadata fields select/exclude statement
  *
  * @return object|null MongoGridFSFile instance or null when not found.
  */
 public function findOne($query = [], $fields = [])
 {
     if (is_string($query)) {
         return $this->collection->findOne($query, $fields = []);
     }
     return parent::findOne($query, $fields);
 }