db = $db; return $this; } /** * Apply filter * * @access public * @return FilterInterface */ public function apply() { $this->query->inSubquery(TaskModel::TABLE.'.id', $this->getSubQuery()); return $this; } /** * Get task ids having this comment * * @access public * @return array */ protected function getSubQuery() { return $this->db ->table(CommentModel::TABLE) ->columns(CommentModel::TABLE.'.task_id') ->ilike(CommentModel::TABLE.'.comment', '%'.$this->value.'%'); } }