hi,
i went through probably all the related posts but still can’t find a solution
in my CActiveRecord class Employee i have a relation
'job' => array(self::HAS_MANY, 'Job', 'personal_id'),
(the Job’s relation to Employee is BELONGS_TO)
i want to display all the job.decscription, that belong to the employee in a CGridView AND make them filterable/searchable
i had partial success (when following the other guides, but it didn’t work anyway) when i changed the relation to HAS_ONE, but can’t make it happen with HAS_MANY
i made a function to display all the descriptions in a comma separated string
public function getDescriptions()
{
foreach ($this->job as $job):
$job[] = $job->description;
endforeach;
if (is_array($job))
return implode(', ', $job);
else
return $job;
}
isn’t there a way to filter the results by searching through the string?
or is there another solution?
thanks in advance