Hello all!
I'm using Zend_Db_Table to query my list of articles.
I would like to use different names for the article's FIELDS in my model and
view that those I used on the database table definition.
I tried different ways with $_cols and _setupMetadata but withouth any
success.
Here is what I tried, and would like to do:
protected $_cols = array(
'id' => 'id',
'autore' => 'author',
'titolo' => 'title',
'riassunto' => 'abstract',
'dataCreazione' => 'created_on',
);
I thought this would map the names on the left side (sorry I wrote them in
italian), to the database actual column names on the right side.
Something like
"SELECT id, author as autore, title as titolo, abstract as riassunto,
created_on as dataCreazione FROM articles
So that I would do this to print the results out:
echo $article->titolo (... and so on)
But it does not work... seems to be totally ignored.
Any nice help or hints?
thank you much
--
View this message in context:
http://www.nabble.com/Zend_Db_Table-changing-%24_cols-to-be-used-model-side-tp17036186p17036186.html
Sent from the Zend Framework mailing list archive at Nabble.com.