Sokil\Mongo\Collection::getName PHP Méthode

getName() public méthode

Get name of collection
public getName ( ) : string
Résultat string name of collection
    public function getName()
    {
        return $this->collectionName;
    }

Usage Example

Exemple #1
0
 public function testGetDocumentByReference()
 {
     // create document
     $document = $this->collection->createDocument(array('param' => 'value'))->save();
     // invalid col and db
     $foundDocument = $this->collection->getDocumentByReference(array('$ref' => 'some_collection', '$db' => 'some_db', '$id' => $document->getId()), false);
     $this->assertNull($foundDocument);
     /// invalid db
     $foundDocument = $this->collection->getDocumentByReference(array('$ref' => $this->collection->getName(), '$db' => 'some_db', '$id' => $document->getId()), false);
     $this->assertNull($foundDocument);
     // all valid
     $foundDocument = $this->collection->getDocumentByReference(array('$ref' => $this->collection->getName(), '$db' => $this->collection->getDatabase()->getName(), '$id' => $document->getId()), false);
     $this->assertSame((string) $document->getId(), (string) $foundDocument->getId());
 }
All Usage Examples Of Sokil\Mongo\Collection::getName