field_restrict=array(); $this->id = $id; $sub=array(); if($this->id>0){ $sub[]=array( 'sub_field' => "code_ss_champ", 'values' => $this->id, 'op' => "and", 'not' => false ); } $this->field_restrict[]= array( 'field' => "code_champ", 'values' => 100, 'op' => "and", 'not' => false, 'sub'=> $sub ); } protected function _get_search_type(){ return parent::_get_search_type()."_pfield"; } protected function _get_sign($sorted=false){ $sign = parent::_get_sign($sorted); $sign.= md5('&id='.$this->id); return $sign; } protected function get_full_results_query(){ return 'select distinct notices_custom_origine as id_notice from notices_custom_values join notices on notices_custom_values.notices_custom_origine = notices.notice_id and notices_custom_champ = '.$this->id.' '.$this->_get_typdoc_filter(true); } public function get_full_query() { if($this->user_query === "*"){ return 'select distinct notices_custom_origine as '.$this->object_key.' from notices_custom_values join notices on notices_custom_values.notices_custom_origine = notices.notice_id and notices_custom_champ = '.$this->id.' '.$this->_get_typdoc_filter(true); } return parent::get_full_query(); } }