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 setCode(\Civix\CoreBundle\Entity\Subscription\DiscountCode $code = NULL)
 {
     $this->__load();
     return parent::setCode($code);
 }