Is it possible to access object's properties, when you don't know just how their names will be written?
My problem is that when a query returns Zend_Db_Table_Rowset_Abstract object, there are some fields with names like "name_fr", "name_en", "name_au". I want to access either of them according to the current language used in the application. To achieve this I write the code this way:
$result = $myModel->fetchAll($query)->current();
$row = $result->toArray();
echo 'Your name is '.$row['name_'.$language];
This is very annoying. Is it possible to write a code like this for example:
$result = $myModel->fetchAll($query)->current();
echo 'Your name is '.$result->name_{$language};