public function buildCondition(PlFilter $uf) { /** Tables shortcuts: * pc for profile_corps * pcr for profile_corps_rank */ $sub = $uf->addCorpsRankFilter(); if (is_null($this->id)) { $cond = $sub . '.abbreviation = ' . $this->rank; } else { $cond = $sub . '.id = ' . $this->id; } // XXX(x2006barrois): find a way to get rid of that hardcoded // reference to 'pc'. $cond .= ' AND ' . $uf->getVisibilityConditionForField('pc.corps_pub'); return $cond; }