/** * JSON function, used for autocomplete Input on the finish page. * */ public function getTagsAction() { $q = ''; if ($this->request->hasArgument('q')) { $q = $this->request->getArgument('q'); } $tags = $this->tagRepository->findAllStartingWithLetters($q); $result = array(); foreach ($tags as $tag) { $result[] = array('id' => $this->persistenceManager->getIdentifierByObject($tag), 'text' => $tag->getValue()); } $this->view->assign('value', $result); }
/** * Generate a new Tag * * This command inserts a new Tag record into the database. Mostly used for development while management * tools for tags are not yet available * * @param string $value The value of the tag to generate * @return void */ public function tagCommand($value) { $tag = new Tag($value); $this->tagRepository->add($tag); $this->outputLine('Tag with value "%s" added to the database.', array($value)); }