Esempio n. 1
0
 /**
  *
  * @param Logic_Negotiator_Option $option
  */
 public function __construct(Logic_Negotiator_Option $option = null)
 {
     if ($option != null) {
         $step = $option->getStep();
         $negotiation = $step->getNegotiation();
         $this->_nonAssume = !($negotiation->getOperationType() == 'assume' || $negotiation->getOperationType() == '1');
         $this->customer = $negotiation->getCustomer();
         $this->customerTypeId = $negotiation->getCustomerType();
         $this->brandId = $negotiation->getBranchId();
         $depositAmount = $negotiation->getTotalAmount();
         $duration = $option->getDuration();
         $filter = new Zend_Filter_Int();
         if (strpos($duration, 'M') !== false) {
             $months = $filter->filter($duration);
             $this->depositDays = $months % 12 * 30 + ($months - $months % 12) / 12 * 365;
         } elseif (strpos($duration, 'D') !== false) {
             $this->depositDays = $filter->filter($duration);
         } elseif (strpos($duration, 'Y') !== false) {
             $this->depositDays = $filter->filter($duration) * 365;
         }
         $this->depositAmount = $depositAmount;
         $this->newMoney = $negotiation->isNewMoney();
         $this->currency = $negotiation->getCurrency();
         $this->customerExpectance = $option->getCustomerExpectance();
         $this->counterOfferNo = $step->getOrder();
         parent::__construct();
     } else {
         $this->_debugMode = true;
     }
 }