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

addNote() protected méthode

Add a new note to the given contact and persist it with the given object manager.
protected addNote ( $contact, array $noteData ) : boolean
$contact
$noteData array
Résultat boolean True if there was no error, otherwise false
    protected function addNote($contact, $noteData)
    {
        $noteEntity = 'SuluContactBundle:Note';
        if (isset($noteData['id'])) {
            throw new EntityIdAlreadySetException($noteEntity, $noteData['id']);
        } else {
            $note = new Note();
            $note->setValue($noteData['value']);
            $this->em->persist($note);
            $contact->addNote($note);
        }
        return true;
    }