当前位置: 首页>>代码示例>>PHP>>正文


PHP MongoCollection::getName方法代码示例

本文整理汇总了PHP中MongoCollection::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP MongoCollection::getName方法的具体用法?PHP MongoCollection::getName怎么用?PHP MongoCollection::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MongoCollection的用法示例。


在下文中一共展示了MongoCollection::getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pop

 /**
  * @see QueueInterface::pop()
  */
 public function pop()
 {
     $command = array('findandmodify' => $this->collection->getName(), 'remove' => 1, 'fields' => array('task' => 1), 'query' => array('eta' => array('$lte' => new \MongoDate())), 'sort' => array('eta' => 1));
     $result = $this->collection->db->command($command);
     if (!$result['ok']) {
         throw new \RuntimeException($result['errmsg']);
     }
     $data = $result['value'];
     return $data ? $this->serializer->unserialize($data['task']) : false;
 }
开发者ID:rybakit,项目名称:taskqueue,代码行数:13,代码来源:MongoDBQueue.php

示例2: create

 /**
  * Indicate that the table needs to be created.
  *
  * @return bool
  */
 public function create()
 {
     $collection = $this->collection->getName();
     $db = $this->connection->getMongoDB();
     // Ensure the collection is created.
     $db->createCollection($collection);
 }
开发者ID:MartinPham,项目名称:laravel-mongo,代码行数:12,代码来源:Blueprint.php

示例3: generateId

 public function generateId(MongoCollection $collection)
 {
     $collection_name = $collection->getName();
     $document = $this->collection->findAndModify(array('_id' => $collection_name), array('$inc' => array('_max_id' => 1)), null, array('new' => true));
     if (!$document) {
         $this->collection->insert(array('_id' => $collection_name, '_max_id' => $this->autoIncrement));
         return $this->generateId($collection);
     }
     return $document['_max_id'];
 }
开发者ID:aeshion,项目名称:ZeroPHP,代码行数:10,代码来源:AutoIncrementIdStrategy.php

示例4: doMapReduce

 protected function doMapReduce($map, $reduce, array $query, array $options)
 {
     if (is_string($map)) {
         $map = new \MongoCode($map);
     }
     if (is_string($reduce)) {
         $reduce = new \MongoCode($reduce);
     }
     $command = array();
     $command['mapreduce'] = $this->mongoCollection->getName();
     $command['map'] = $map;
     $command['reduce'] = $reduce;
     $command['query'] = $query;
     $command = array_merge($command, $options);
     $result = $this->database->command($command);
     if (!$result['ok']) {
         throw new \RuntimeException($result['errmsg']);
     }
     return $this->database->selectCollection($result['result'])->find();
 }
开发者ID:rybakit,项目名称:mongodb,代码行数:20,代码来源:Collection.php

示例5: doNear

 /**
  * Execute the geoNear command.
  *
  * @see Collection::near()
  * @param array|Point $near
  * @param array       $query
  * @param array       $options
  * @return ArrayIterator
  * @throws ResultException if the command fails
  */
 protected function doNear($near, array $query, array $options)
 {
     $options = isset($options['timeout']) ? $this->convertSocketTimeout($options) : $options;
     if ($near instanceof Point) {
         $near = $near->jsonSerialize();
     }
     $command = array();
     $command['geoNear'] = $this->mongoCollection->getName();
     $command['near'] = $near;
     $command['spherical'] = isset($near['type']);
     $command['query'] = (object) $query;
     $command = array_merge($command, $options);
     $database = $this->database;
     $result = $this->retry(function () use($database, $command) {
         return $database->command($command);
     });
     if (empty($result['ok'])) {
         throw new ResultException($result);
     }
     $arrayIterator = new ArrayIterator(isset($result['results']) ? $result['results'] : array());
     $arrayIterator->setCommandResult($result);
     return $arrayIterator;
 }
开发者ID:pmnyaga,项目名称:mongodb,代码行数:33,代码来源:Collection.php

示例6: generateCacheKey

 /**
  * Generate the unique cache key for the current query.
  *
  * @return string
  */
 public function generateCacheKey()
 {
     $key = array('connection' => $this->connection->getName(), 'collection' => $this->collection->getName(), 'wheres' => $this->wheres, 'columns' => $this->columns, 'groups' => $this->groups, 'orders' => $this->orders, 'offset' => $this->offset, 'aggregate' => $this->aggregate);
     return md5(serialize(array_values($key)));
 }
开发者ID:progamr,项目名称:LearningLocker,代码行数:10,代码来源:Builder.php

示例7: testGetName

 public function testGetName()
 {
     $this->assertEquals($this->object->getName(), 'c');
 }
开发者ID:salathe,项目名称:mongo-php-driver,代码行数:4,代码来源:MongoCollectionTest.php

示例8: dumpCollection

 /**
  * Dumps all objects in a collection
  *
  * @param \MongoCollection $collection     collection
  * @param string           $destinationDir destination dir
  *
  * @return void
  */
 private function dumpCollection(\MongoCollection $collection, $destinationDir)
 {
     foreach ($collection->find() as $record) {
         $this->dumpObject($record, $collection->getName(), $destinationDir);
     }
 }
开发者ID:alebon,项目名称:import-export,代码行数:14,代码来源:CoreExportCommand.php

示例9: getName

 /**
  * Get name of collection
  * 
  * @return string name of collection
  */
 public function getName()
 {
     return $this->_mongoCollection->getName();
 }
开发者ID:agolomazov,项目名称:php-mongo,代码行数:9,代码来源:Collection.php


注:本文中的MongoCollection::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。