public function createRegistration(User $user, \collection $collection)
    {
        $registration = new Registration();
        $registration->setUser($user);
        $registration->setCollection($collection);
        $this->em->persist($registration);
        $this->em->flush();

        return $registration;
    }
public function createRegistration(User $user, \collection $collection)
    {
        $registration = new Registration();
        $registration->setUser($user);
        $registration->setCollection($collection);
        $this->em->persist($registration);
        $this->em->flush();

        return $registration;
    }
public function createRegistration ( User $ user , \ collection $ collection ) { $ registration = new Registration ( ) ; $ registration -> setUser ( $ user ) ; $ registration -> setCollection ( $ collection ) ; $ this -> em -> persist ( $ registration ) ; $ this -> em -> flush ( ) ; return $ registration ; }
Creates a new registration.

@param User        $user
@param \collection $collection

@return Registration
Creates a new registration .