Sulu\Bundle\ContactBundle\Contact\AbstractContactManager::processTags PHP Méthode

processTags() public méthode

Process all tags of request.
public processTags ( $contact, array $tags ) : boolean
$contact The contact on which is worked
$tags array
Résultat boolean True if the processing was successful, otherwise false
    public function processTags($contact, $tags)
    {
        $get = function ($tag) {
            return $tag->getId();
        };
        $delete = function ($tag) use($contact) {
            return $contact->removeTag($tag);
        };
        $update = function () {
            return true;
        };
        $add = function ($tag) use($contact) {
            return $this->addTag($contact, $tag);
        };
        $entities = $contact->getTags();
        $result = $this->processSubEntities($entities, $tags, $get, $add, $update, $delete);
        $this->resetIndexOfSubentites($entities);
        return $result;
    }