Esempio n. 1
0
 public function reverseTransform($tags)
 {
     if (is_null($tags) || !$tags) {
         return;
     }
     $values = explode(",", $tags);
     $return = $this->tagManager->loadOrCreateTags($values);
     return $return;
 }
Esempio n. 2
0
 public function getTag(Administration $administration, $tagSlug)
 {
     $tags = $this->tagManager->listAllTags($administration);
     foreach ($tags as $tag) {
         if ($tag->getSlug() == $tagSlug) {
             return $tag->getName();
         }
     }
     return null;
 }
Esempio n. 3
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('tags', 'entity', array('class' => 'HomefinanceBundle:Tag', 'choices' => $this->tagManager->listAllTags(), 'choice_label' => 'name', 'label' => 'rules.action.add_tag.tags.label', 'expanded' => true, 'multiple' => true, 'mapped' => false));
     parent::buildForm($builder, $options);
 }