Пример #1
0
 public function createTax(MotivationTax $t)
 {
     try {
         $t->setUpdated(new DateTime());
         $t->setOrderedDate(new DateTime());
         $this->taxEditorTypeHandle($t);
         $this->taxSeasonTypeHandle($t);
         $this->taxSportGroupTypeHandle($t);
         $this->taxDao->save($t);
         $this->invalidateEntityCache($t);
         $this->onCreate($t);
     } catch (DuplicateEntryException $ex) {
         $this->logWarning($ex->getMessage());
         throw new Exceptions\DuplicateEntryException($ex->getMessage(), $ex->getCode(), $ex->getPrevious());
     } catch (\Exception $ex) {
         $this->logError($ex->getMessage());
         throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious());
     }
 }