/** * 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; }
/** * @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; }
/** * @param TaxData $taxdata */ public function setTaxdata($taxdata) { $this->taxdata = $taxdata; $taxdata->setRegistration($this); }