Пример #1
0
 /**
  * @param TermInterface $entity
  * @param array $data
  * @return TermInterface
  *
  * @see AbstractFixture::populateEntity()
  */
 protected function populateEntity($entity, array $data)
 {
     // `term_id`,`title`,`parent_term_id`, `description`, `vocabulary_id`, `active`
     $entity->setId($data[0]);
     $entity->setTitle($data[1]);
     if (!empty($data[2])) {
         $entity->setParent($this->getReference($this->getKey() . $data[2]));
     }
     $entity->setDescription($data[3]);
     $entity->setVocabulary($this->getReference('vocabulary' . $data[4]));
     $entity->setActive((bool) $data[5]);
     return $entity;
 }