/** * {@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(); }
/** * @param Channel $channel * * @return RFMMetricCategory */ protected function getCategory($channel) { $category = new RFMMetricCategory(); $category->setChannel($channel); return $category; }