/** * insert mtb_tag * * @param EntityManager $em */ private function mtb_tag(EntityManager $em) { $Tags = $em->getRepository('\\Eccube\\Entity\\Master\\Tag')->findAll(); if (0 < count($Tags)) { // すでに使用している場合は登録しない。 return; } foreach ($this->tag_datas as $data) { $Tag = new Tag(); $Tag->setId($data['id'])->setName($data['name'])->setRank($data['rank']); $em->persist($Tag); } }
/** * Get tag_id * use csv export * * @return integer */ public function getTagId() { if (empty($this->Tag)) { return null; } return $this->Tag->getId(); }