コード例 #1
0
 /**
  * Loads the fixtures file by file and saves them to the database
  */
 public function loadFixtures()
 {
     $this->loadFixtureFiles();
     foreach ($this->fixture_files as $file) {
         $fixture_data = Yaml::parse($file);
         // if nothing is specified, we use doctrine orm for persistence
         $persistence = isset($fixture_data['persistence']) ? $fixture_data['persistence'] : 'orm';
         $persister = $this->getPersister($persistence);
         $manager = $persister->getManagerForClass($fixture_data['model']);
         $fixture = $this->getFixtureClass($persistence);
         $fixture = new $fixture($fixture_data, $this, $file);
         $fixture->load($manager, func_get_args());
     }
     if (!is_null($this->acl_manager)) {
         foreach ($this->fixture_files as $file) {
             $fixture = new YamlAclFixture($file, $this);
             $fixture->load($this->acl_manager, func_get_args());
         }
     }
 }
コード例 #2
0
 /**
  * Loads the fixtures file by file and saves them to the database 
  */
 public function loadFixtures()
 {
     $this->loadFixtureFiles();
     foreach ($this->fixture_files as $file) {
         $fixture = new YamlFixture($file, $this);
         $fixture->load($this->object_manager, func_get_args());
     }
     if (!is_null($this->acl_manager)) {
         foreach ($this->fixture_files as $file) {
             $fixture = new YamlAclFixture($file, $this);
             $fixture->load($this->acl_manager, func_get_args());
         }
     }
 }