'Alphabetical A to Z', self::ORDER_ALPHABETICAL_ZA => 'Alphabetical Z to A', self::ORDER_PRICE_LOW => 'Price Low to High', self::ORDER_PRICE_HIGH => 'Price High to Low', ]; protected $_orderFields = [ self::ORDER_ALPHABETICAL_AZ => 'title ASC', self::ORDER_ALPHABETICAL_ZA => 'title DESC', self::ORDER_PRICE_LOW => 'price ASC', self::ORDER_PRICE_HIGH => 'price DESC', ]; protected $_orderId = 0; protected $_changeableIpp = false; protected $_seoPaginator = true; protected $_defaultIpp = 15; public function getOrderBy() { if (null === $this->orderBy) { $this->orderBy = [$this->_firstOrder, $this->_orderFields[$this->_orderId]]; } else if (!is_array($this->orderBy)) { $this->orderBy = [$this->_firstOrder, $this->orderBy]; } return $this->orderBy; } public function getOrderTitles() { return $this->_orderTitles; } /** * @param int $id * @return $this */ public function setOrderId($id) { $id = (int) $id; if (array_key_exists($id, $this->_orderFields)) { $this->_orderId = $id; } return $this; } protected function _getIpp() { parent::_getIpp(); if (!$this->_ipp) { $this->_ipp = $this->_defaultIpp; } return $this->_ipp; } }