Example #1
0
 /**
  * Creates an instance of an entity.
  *
  * @param \Kreta\Component\Project\Model\Interfaces\ProjectInterface $project The project
  * @param \Kreta\Component\User\Model\Interfaces\UserInterface       $user    The user
  * @param string                                                     $role    The role assigned to the participant
  *
  * @return \Kreta\Component\Project\Model\Interfaces\ParticipantInterface
  */
 public function create(ProjectInterface $project, UserInterface $user, $role = 'ROLE_PARTICIPANT')
 {
     $participant = new $this->className($project, $user);
     $participant->setRole($role);
     $project->addParticipant($participant);
     return $participant;
 }