예제 #1
0
 public function delete()
 {
     if (!parent::delete()) {
         return false;
     }
     $this->activeRecordFactory->getObject('Ebay\\Processing\\Action\\Item')->getResource()->deleteByAction($this);
     return true;
 }
예제 #2
0
 public function delete()
 {
     if (!parent::delete()) {
         return false;
     }
     $this->getResource()->deleteResultData($this);
     return true;
 }
예제 #3
0
 public function __construct(\Ess\M2ePro\Model\ActiveRecord\Component\Parent\Factory $parentFactory, \Magento\Framework\App\ResourceConnection $resourceConnection, \Ess\M2ePro\Model\Factory $modelFactory, \Ess\M2ePro\Model\ActiveRecord\Factory $activeRecordFactory, \Ess\M2ePro\Helper\Factory $helperFactory, \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [])
 {
     $this->parentFactory = $parentFactory;
     $this->resourceConnection = $resourceConnection;
     parent::__construct($modelFactory, $activeRecordFactory, $helperFactory, $context, $registry, $resource, $resourceCollection, $data);
 }
예제 #4
0
 public function delete()
 {
     $temp = parent::delete();
     $temp && ($this->accountModel = NULL);
     return $temp;
 }
예제 #5
0
 public function _construct()
 {
     parent::_construct();
     $this->_init('Ess\\M2ePro\\Model\\ResourceModel\\Request\\Pending\\Single');
 }
예제 #6
0
 public function _construct()
 {
     parent::_construct();
     $this->_init('Ess\\M2ePro\\Model\\ResourceModel\\Amazon\\Processing\\Action\\Item');
 }
예제 #7
0
 public function _construct()
 {
     parent::_construct();
     $this->_init('Ess\\M2ePro\\Model\\ResourceModel\\Connector\\Command\\Pending\\Requester\\Partial');
 }
예제 #8
0
 public function _construct()
 {
     parent::_construct();
     $this->_init('Ess\\M2ePro\\Model\\ResourceModel\\Order\\Change');
 }
예제 #9
0
 public function _construct()
 {
     parent::_construct();
     $this->_init('Ess\\M2ePro\\Model\\ResourceModel\\Log\\System');
 }
예제 #10
0
 public function _construct()
 {
     parent::_construct();
     $this->_init('Ess\\M2ePro\\Model\\ResourceModel\\Amazon\\Listing\\Product\\Repricing');
 }
예제 #11
0
 public function _construct()
 {
     parent::_construct();
     $this->_init('Ess\\M2ePro\\Model\\ResourceModel\\Ebay\\Order\\ExternalTransaction');
 }
예제 #12
0
 protected function _beforeSave()
 {
     $serialized = serialize($this->getConditions()->asArray());
     $this->setData('conditions_serialized', $serialized);
     return parent::_beforeSave();
 }
예제 #13
0
 public function _construct()
 {
     parent::_construct();
     $this->_init('Ess\\M2ePro\\Model\\ResourceModel\\OperationHistory');
 }
예제 #14
0
 public function _construct()
 {
     parent::_construct();
     $this->_init('Ess\\M2ePro\\Model\\ResourceModel\\Wizard');
 }
예제 #15
0
 /**
  * @param \Ess\M2ePro\Model\ActiveRecord\AbstractModel $model
  * @param string $fieldName
  * @param bool $asObjects
  * @param array $filters
  * @param array $sort
  * @return array|\Ess\M2ePro\Model\ActiveRecord\AbstractModel[]
  * @throws \Ess\M2ePro\Model\Exception\Logic
  */
 protected function getRelatedItems(\Ess\M2ePro\Model\ActiveRecord\AbstractModel $model, $fieldName, $asObjects = false, array $filters = array(), array $sort = array())
 {
     if (is_null($this->getId())) {
         throw new \Ess\M2ePro\Model\Exception\Logic('Method require loaded instance first');
     }
     /** @var $tempCollection \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection */
     $tempCollection = $model->getCollection();
     $tempCollection->addFieldToFilter(new \Zend_Db_Expr("`{$fieldName}`"), $this->getId());
     foreach ($filters as $field => $filter) {
         if ($filter instanceof \Zend_Db_Expr) {
             $tempCollection->getSelect()->where((string) $filter);
             continue;
         }
         $tempCollection->addFieldToFilter(new \Zend_Db_Expr("`{$field}`"), $filter);
     }
     foreach ($sort as $field => $order) {
         $order = strtoupper(trim($order));
         if ($order != \Magento\Framework\Data\Collection::SORT_ORDER_ASC && $order != \Magento\Framework\Data\Collection::SORT_ORDER_DESC) {
             continue;
         }
         $tempCollection->setOrder($field, $order);
     }
     if ((bool) $asObjects) {
         return $tempCollection->getItems();
     }
     $tempArray = $tempCollection->toArray();
     return $tempArray['items'];
 }