currentUserId = $userId; return $this; } /** * Get search attribute * * @access public * @return string[] */ public function getAttributes() { return array('creator'); } /** * Apply filter * * @access public * @return string */ public function apply() { if ($this->value === 'me') { $this->query->eq(ProjectActivityModel::TABLE . '.creator_id', $this->currentUserId); } else { $this->query->beginOr(); $this->query->ilike('uc.username', '%'.$this->value.'%'); $this->query->ilike('uc.name', '%'.$this->value.'%'); $this->query->closeOr(); } } }