extended the row class returned from my Zend_DB_Table. This table returns
data joined from two tables (with the integrity check removed).
The primary table is 'product', all fields are prefixed 'product_'.
The second table is 'product_variant', all fields are prefixed 'variant_'.
Now I can cope with extending the __get() method in order to do away with
the prefix for product_ ($this->product->column instead of
$this->product->product_column) but how would I do it with variant too
($this->product->variant->column instead of $this->product->variant_name)?
i.e. echo $this->product->variant->column;
Would in fact go to product row class and the value variant_column, I don't
know how to get the magic get method to recognise that I want to call a fake
class, this method receives 'variant' as the supposed column name and does
away with 'column'.
I guess my question is how do I fake an object without creating one and
copying the table data to it then using another __get() method in that
class.
Thanks
Simon
-----
Simon
http://www.ajb007.co.uk/
--
View this message in context: http://www.nabble.com/Custom-Row-Class---_get%28%29-from-two-tiers-tp18697512p18697512.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论