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

processNotes() public méthode

Process all notes from request.
public processNotes ( Contact $contact, $notes ) : boolean
$contact Sulu\Bundle\ContactBundle\Entity\Contact The contact on which is worked
$notes
Résultat boolean True if the processing was successful, otherwise false
    public function processNotes($contact, $notes)
    {
        $get = function ($note) {
            return $note->getId();
        };
        $delete = function ($note) use($contact) {
            $contact->removeNote($note);
            return true;
        };
        $update = function ($note, $matchedEntry) {
            return $this->updateNote($note, $matchedEntry);
        };
        $add = function ($note) use($contact) {
            return $this->addNote($contact, $note);
        };
        $entities = $contact->getNotes();
        $result = $this->processSubEntities($entities, $notes, $get, $add, $update, $delete);
        $this->resetIndexOfSubentites($entities);
        return $result;
    }