2008年7月29日星期二

Re: [fw-db] Custom Row Class - _get() from two tiers

Bill Karwin a écrit :
> SiCo007 wrote:
>
>> 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.
>>
>>
>
> I would say this is too much magic, and you're probably going to make your
> app harder to maintain as a result, rather than easier.
>


Is $_cols planned to that purpose ?

protected $_cols = array(
'product_id'=>'id',
'product_name'=>'name',
'category_id'=>'category_id');

That kind of aliases would be fine to abstract column names from
attributes of object.

没有评论: