function addCollaborator($user, $vars, &$errors) { if (!$user || $user->getId() == $this->getOwnerId()) { return null; } $vars = array_merge(array('ticketId' => $this->getId(), 'userId' => $user->getId()), $vars); if (!($c = Collaborator::add($vars, $errors))) { return null; } $this->collaborators = null; $this->recipients = null; return $c; }