original_string: public function loadData($name) {
  
          $file = sprintf('%s/../Resources/fixtures/%s.yml', __DIR__ , $name);
          if(!file_exists($file)) {
              throw new \Exception(sprintf('fixtures file "%s" not found for name "%s"', $file, $name));
          }
  
          $data = Yaml::parse($file);
  
          $items = [];
          foreach ($data as $args) {
              $item = $this->create($args);
              $this->manager->persist($item);
              $items[] = $item;
          }
  
          $this->manager->flush();
      }
code: public function loadData($name) {
  
          $file = sprintf('%s/../Resources/fixtures/%s.yml', __DIR__ , $name);
          if(!file_exists($file)) {
              throw new \Exception(sprintf('fixtures file "%s" not found for name "%s"', $file, $name));
          }
  
          $data = Yaml::parse($file);
  
          $items = [];
          foreach ($data as $args) {
              $item = $this->create($args);
              $this->manager->persist($item);
              $items[] = $item;
          }
  
          $this->manager->flush();
      }
code_tokens: public function loadData ( $ name ) { $ file = sprintf ( '%s/../Resources/fixtures/%s.yml' , __DIR__ , $ name ) ; if ( ! file_exists ( $ file ) ) { throw new \ Exception ( sprintf ( 'fixtures file "%s" not found for name "%s"' , $ file , $ name ) ) ; } $ data = Yaml :: parse ( $ file ) ; $ items = [ ] ; foreach ( $ data as $ args ) { $ item = $ this -> create ( $ args ) ; $ this -> manager -> persist ( $ item ) ; $ items [ ] = $ item ; } $ this -> manager -> flush ( ) ; }
docstring: Load the data from fixture file and insert it into the database
  
  @param $name
  @throws \Exception
docstring_tokens: Load the data from fixture file and insert it into the database