Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Wishlist.php
Go to the documentation of this file.
1 <?php
13 
19 {
25  protected $_itemsCount = null;
26 
32  protected $_customerIdFieldName = 'customer_id';
33 
39  protected function _construct()
40  {
41  $this->_init('wishlist', 'wishlist_id');
42  }
43 
52  protected function _getLoadSelect($field, $value, $object)
53  {
54  $select = parent::_getLoadSelect($field, $value, $object);
55  if ($field == $this->_customerIdFieldName) {
56  $select->order('wishlist_id ' . \Magento\Framework\DB\Select::SQL_ASC)->limit(1);
57  }
58  return $select;
59  }
60 
66  public function getCustomerIdFieldName()
67  {
69  }
70 
77  public function setCustomerIdFieldName($fieldName)
78  {
79  $this->_customerIdFieldName = $fieldName;
80  return $this;
81  }
82 
86  public function save(\Magento\Framework\Model\AbstractModel $object)
87  {
88  $object->setHasDataChanges(true);
89  return parent::save($object);
90  }
91 }
save(\Magento\Framework\Model\AbstractModel $object)
Definition: Wishlist.php:86
_getLoadSelect($field, $value, $object)
Definition: Wishlist.php:52
$value
Definition: gender.phtml:16
const SQL_ASC
Definition: Select.php:81