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;
}