public function addToHistory(DiscountCode $code, Customer $customer)
 {
     $history = new DiscountCodeHistory();
     $history->setCode($code);
     $history->setCustomer($customer);
     $history->setStatus(DiscountCodeHistory::STATUS_APPLIED_ONLY);
     $this->em->persist($history);
     $this->em->flush($history);
 }
 public function setCustomer(\Civix\CoreBundle\Entity\Customer\Customer $customer = NULL)
 {
     $this->__load();
     return parent::setCustomer($customer);
 }