Hello everyone,
I am using a function to loop all records and then display it as a string.
public function formatArraytoStringList($object_rel, $object_rel_join, $attribute)
{
$out = array();
if(!empty($object_rel_join))
{
foreach($this->$object_rel as $data)
$out[] = $data->$object_rel_join->$attribute;
}
return implode($out, ", ");
}
$model->formatArraytoStringList('CuisineStore','Cuisine','name')
My question is if I call the method multiple times, will it do the query again or it is already stored somewhere so that I can call it multiple times and not worry about the resource the query is generating?
Thank you friends,
Jian