Skip to content

Commit

Permalink
Use newEntity with arguments to use default validator
Browse files Browse the repository at this point in the history
  • Loading branch information
hakito committed Mar 1, 2020
1 parent 251e7e9 commit b1c3345
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Model/Table/PayPalPaymentsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function savePayment($payment, $id = null)

if (empty($record))
{
$record = new \Cake\ORM\Entity();
$record = $this->newEntity(['payment_id' => $paymentId]);
}

if (empty($record->payment_id))
Expand Down Expand Up @@ -81,8 +81,9 @@ public function savePayment($payment, $id = null)
public function createPayment($remittanceIdentifier, &$payment, $okUrl, $cancelUrl)
{
return $this->getConnection()->transactional(function () use ($remittanceIdentifier, &$payment, $okUrl, $cancelUrl) {
$record = new \Cake\ORM\Entity();
$record->remittance_identifier = $remittanceIdentifier;
$record = $this->newEntity([
'remittance_identifier' => $remittanceIdentifier
]);

$this->saveOrFail($record);

Expand Down

0 comments on commit b1c3345

Please sign in to comment.