Exemplo n.º 1
0
 /**
  * Exports tax data from one university.
  *
  * @param University $university
  * @return TaxData
  */
 public static function copyFromUniversity(University $university)
 {
     $taxdata = new TaxData();
     $taxdata->setName($university->getName());
     $taxdata->setAddress($university->getAddress());
     $taxdata->setCity($university->getCity());
     $taxdata->setProvince($university->getProvince());
     $taxdata->setPostcode($university->getPostcode());
     $taxdata->setCif($university->getCif());
     return $taxdata;
 }
Exemplo n.º 2
0
 /**
  * @return Registration
  */
 public function getCurrentRegistration()
 {
     $user = $this->getUser();
     $registration = $this->container->get('ritsiga.repository.registration')->findOneBy(['user' => $user]);
     if (!$registration) {
         $convention = $this->getCurrentSite();
         $registration = new Registration();
         $registration->setConvention($convention);
         $registration->setUser($user);
         $registration->setTaxdata(TaxData::copyFromUniversity($this->getUser()->getUniversity()));
     }
     return $registration;
 }
Exemplo n.º 3
0
 /**
  * @param TaxData $taxdata
  */
 public function setTaxdata($taxdata)
 {
     $this->taxdata = $taxdata;
     $taxdata->setRegistration($this);
 }