Example #1
0
 /**
  * Check if report with same account and report date already fetched
  *
  * @param \Magento\Paypal\Model\Report\Settlement $report
  * @param string $accountId
  * @param string $reportDate
  * @return $this
  */
 public function loadByAccountAndDate(\Magento\Paypal\Model\Report\Settlement $report, $accountId, $reportDate)
 {
     $adapter = $this->_getReadAdapter();
     $select = $adapter->select()->from($this->getMainTable())->where('account_id = :account_id')->where('report_date = :report_date');
     $data = $adapter->fetchRow($select, array(':account_id' => $accountId, ':report_date' => $reportDate));
     if ($data) {
         $report->addData($data);
     }
     return $this;
 }
Example #2
0
 /**
  * Check if report with same account and report date already fetched
  *
  * @param \Magento\Paypal\Model\Report\Settlement $report
  * @param string $accountId
  * @param string $reportDate
  * @return $this
  */
 public function loadByAccountAndDate(\Magento\Paypal\Model\Report\Settlement $report, $accountId, $reportDate)
 {
     $connection = $this->getConnection();
     $select = $connection->select()->from($this->getMainTable())->where('account_id = :account_id')->where('report_date = :report_date');
     $data = $connection->fetchRow($select, [':account_id' => $accountId, ':report_date' => $reportDate]);
     if ($data) {
         $report->addData($data);
     }
     return $this;
 }