/** * Creates a synonym. * * @param \Netgen\TagsBundle\SPI\Persistence\Tags\SynonymCreateStruct $createStruct * * @return \Netgen\TagsBundle\SPI\Persistence\Tags\Tag The created synonym */ public function addSynonym($createStruct) { $mainTagData = $this->gateway->getBasicTagData($createStruct->mainTagId); $newSynonymId = $this->gateway->createSynonym($createStruct, $mainTagData); $this->updateSubtreeModificationTime($newSynonymId); return $this->load($newSynonymId); }
/** * Creates a new synonym using the given $keyword for tag $tag. * * @throws \RuntimeException * * @param \Netgen\TagsBundle\SPI\Persistence\Tags\SynonymCreateStruct $createStruct * @param array $tag * * @return \Netgen\TagsBundle\SPI\Persistence\Tags\Tag */ public function createSynonym(SynonymCreateStruct $createStruct, array $tag) { try { return $this->innerGateway->createSynonym($createStruct, $tag); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }