Exemplo n.º 1
0
 protected function access(&$result)
 {
     parent::access($result);
     if ($this->getUser()->get('portalId')) {
         $this->filterPublished($result);
     }
 }
Exemplo n.º 2
0
 protected function access(&$result)
 {
     parent::access($result);
     if (!$this->getUser()->isAdmin()) {
         $result['whereClause'][] = array('isActive' => true);
     }
     $result['whereClause'][] = array('isSuperAdmin' => false);
 }
Exemplo n.º 3
0
 public function getSelectParams(array $params, $withAcl = false)
 {
     $result = parent::getSelectParams($params, $withAcl);
     if (!$this->hasJoin('users', $result) && !$this->hasLeftJoin('users', $result)) {
         $this->addLeftJoin('users', $result);
         $this->setJoinCondition('users', array('userId' => $this->getUser()->id), $result);
     }
     $this->addUsersColumns($result);
     return $result;
 }
Exemplo n.º 4
0
 public function getSelectParams(array $params, $withAcl = false)
 {
     $result = parent::getSelectParams($params, $withAcl);
     if (!in_array('users', $result['joins']) && !in_array('users', $result['leftJoins'])) {
         $result['leftJoins'][] = 'users';
         $result['joinConditions']['users'] = array('userId' => $this->getUser()->id);
     }
     $result['additionalSelectColumns']['usersMiddle.is_read'] = 'isRead';
     $result['additionalSelectColumns']['usersMiddle.is_important'] = 'isImportant';
     return $result;
 }
Exemplo n.º 5
0
 protected function convertDateTimeWhere($item)
 {
     $result = parent::convertDateTimeWhere($item);
     if (empty($result)) {
         return null;
     }
     $field = $item['field'];
     if ($field != 'dateStart' && $field != 'dateEnd') {
         return $result;
     }
     $fieldDate = $field . 'Date';
     $dateItem = array('field' => $fieldDate, 'type' => $item['type']);
     if (!empty($item['value'])) {
         $dateItem['value'] = $item['value'];
     }
     $result = array('OR' => array('AND' => [$result, $fieldDate . '=' => null], $this->getWherePart($dateItem)));
     return $result;
 }