/** * Create, not persist, tag given its name * * @param String $name * @return TagManager the generated Tag */ public function createTag($name) { $tag = new Tag(); $tag->setName($name); return $tag; }
/** * This method is used by the workspace import function. * * @param string $name * * @return Tag */ protected function retrieveTag($name) { $tag = $this->objectManager->getRepository('IcapBlogBundle:Tag')->findOneByName($name); if (!$tag) { //let's look if it's scheduled for an Insert... $tag = $this->getTagFromIdentityMapOrScheduledForInsert($name); if (!$tag) { $tag = new Tag(); $tag->setName($name); $this->objectManager->persist($tag); } } return $tag; }
/** * @param string $name * * @return Tag */ protected function retrieveTag($name) { $tag = $this->objectManager->getRepository('IcapBlogBundle:Tag')->findOneByName($name); if (null === $tag) { $tag = new Tag(); $tag->setName($name); } return $tag; }