Exemple #1
0
 /**
  * Get search conditions
  *
  * @return array
  */
 protected function getConditions()
 {
     $cellName = \XLite\Module\XC\Reviews\View\ItemsList\Model\Review::getSessionCellName();
     $searchParams = \XLite\Core\Session::getInstance()->{$cellName};
     if (!is_array($searchParams)) {
         $searchParams = array();
     }
     return $searchParams;
 }
Exemple #2
0
 /**
  * Check if the simple class is used for widget displaying
  *
  * @param array                $column Column
  * @param \XLite\Model\AEntity $entity Entity
  *
  * @return boolean
  */
 protected function isClassColumnVisible(array $column, \XLite\Model\AEntity $entity)
 {
     $result = parent::isClassColumnVisible($column, $entity);
     if ('useForMeta' == $column[static::COLUMN_CODE]) {
         $result = $result && $entity->isApproved();
     }
     return $result;
 }
Exemple #3
0
 /**
  * Handles the request
  *
  * @return void
  */
 public function handleRequest()
 {
     $cellName = \XLite\Module\XC\Reviews\View\ItemsList\Model\Review::getSessionCellName();
     \XLite\Core\Session::getInstance()->{$cellName} = array(\XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_PRODUCT => $this->getProductId());
     parent::handleRequest();
 }
Exemple #4
0
 /**
  * Get search conditions
  *
  * @return array
  */
 protected function getConditions()
 {
     $cellName = \XLite\Module\XC\Reviews\View\ItemsList\Model\Review::getSessionCellName();
     $searchParams = \XLite\Core\Session::getInstance()->{$cellName};
     if (!is_array($searchParams)) {
         $searchParams = array();
         $now = time();
         $startDate = $now - 2592000;
         // One month
         $searchParams['dateRange'] = date('Y-m-d', $startDate) . ' ~ ' . date('Y-m-d', $now);
         \XLite\Core\Session::getInstance()->{$cellName} = $searchParams;
     }
     return $searchParams;
 }