/** * createDbRef. */ public function createDBRef($collection, $a) { $this->time->start(); $return = parent::createDBRef($collection, $a); $time = $this->time->stop(); $this->log(array('type' => 'createDBRef', 'collection' => $collection, 'a' => $a, 'time' => $time)); return $return; }
public function testIsRef() { $this->assertFalse(MongoDBRef::isRef(array())); $this->assertFalse(MongoDBRef::isRef(array('$ns' => 'foo', '$id' => 'bar'))); $ref = $this->object->createDBRef('foo.bar', array('foo' => 'bar')); $this->assertEquals(NULL, $ref); $ref = array('$ref' => 'blog.posts', '$id' => new MongoId('cb37544b9dc71e4ac3116c00')); $this->assertTrue(MongoDBRef::isRef($ref)); }
/** * Wrapper method for MongoDB::createDBRef(). * * @see http://php.net/manual/en/mongodb.createdbref.php * @param string $collection * @param mixed $a * @return array */ public function createDBRef($collection, $a) { return $this->mongoDB->createDBRef($collection, $a); }