Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function load(ObjectManager $manager)
 {
     foreach ($this->data as $categoryReference => $data) {
         /** @var Channel $channel */
         $channel = $this->getReference($data['channel']);
         $entity = new RFMMetricCategory();
         $entity->setChannel($channel)->setCategoryType($data['categoryType'])->setCategoryIndex($data['categoryIndex'])->setMaxValue($data['maxValue'])->setMinValue($data['minValue']);
         $this->setReference($categoryReference, $entity);
         $manager->persist($entity);
     }
     $manager->flush();
 }
Ejemplo n.º 2
0
 /**
  * @param Channel $channel
  *
  * @return RFMMetricCategory
  */
 protected function getCategory($channel)
 {
     $category = new RFMMetricCategory();
     $category->setChannel($channel);
     return $category;
 }