Пример #1
0
 public function credit($methodId, $typeId, $marketId, $presenterId, $userId, Money $cost, $entryUser, $referenceId)
 {
     $result = $this->saveCreate(array("ProductCredit" => array("market_id" => $marketId, "user_id" => $userId, "presenter_id" => $presenterId, "product_credit_type_id" => $typeId, "product_credit_entry_type_id" => $methodId, "product_credit_status_type_id" => self::STATUS_SETTLED, "entry_user" => $entryUser, "amount" => (string) $cost->makePositive(), "reference_id" => $referenceId)));
     if ($result) {
         syslog(LOG_DEBUG, "Credit\tLedger {$this->id}\t{$marketId} {$presenterId}\t{$userId}\t{$cost}");
     } else {
         syslog(LOG_DEBUG, "CreditERROR\tLedger\t{$marketId} {$presenterId}\t{$userId}\t{$cost}");
     }
     return $result;
 }