getSchemaManager() 공개 메소드

Returns SchemaManager, used to create/drop indexes/collections/databases.
public getSchemaManager ( ) : SchemaManager
리턴 SchemaManager
예제 #1
0
 /**
  * @return Folder[]
  */
 function createTestDataB()
 {
     $this->dm->getSchemaManager()->dropDocumentCollection('App\\Documents\\Folder');
     $a = new Folder('a');
     $a->addFile(new GenericFile('readme.txt'));
     $a->addFile(new ImageFile('cat.jpg', 460, 320));
     $a->addFile(new ImageFile('dog.jpg', 1000, 800));
     $a->addFile(new GenericFile('notice.pdf'));
     $a->addFile(new GenericFile('logo.zip'));
     $a->addFile(new GenericFile('virus.exe'));
     $b = new Folder('b');
     $b->addFile(new GenericFile('script.php'));
     $this->dm->persist($a);
     $this->dm->persist($b);
     $this->dm->flush();
     $this->dm->clear();
     return array($a, $b);
 }
 public function getSchemaManager()
 {
     return isset($this->schemaManager) ? $this->schemaManager : parent::getSchemaManager();
 }
예제 #3
0
 /**
  * Tear down document manager
  *
  * @param Doctrine\ODM\MongoDB\DocumentManager $odm
  * @return void
  */
 protected function tearDownOdm(\Doctrine\ODM\MongoDB\DocumentManager $odm)
 {
     $odm->getSchemaManager()->dropDatabases();
     $odm->clear();
 }