2009年8月14日星期五

[fw-db] Data mapper in quickstart

I'm reading quickstart
http://framework.zend.com/docs/quickstart/create-a-model-and-database-table
and there are imeplemted some methods like

class Default_Model_GuestbookMapper
{
public function save($model);
public function find($id, $model);
public function fetchAll();
}

Why implementing fetchAll() when there is fetchAll() already implemented in
Zend_Db_Table? Maybe this make sense when mapper represents joinning of few
tables into one model? I usually have class per table and implementing,
update this, select that, sometimes joinining etc...
I'm trying to understand data mapper advantage, but I don't see it in the
quickstart.

Can someone reference me to some articles and explanations?

Regards,
Saša Stamenković.
--
View this message in context: http://www.nabble.com/Data-mapper-in-quickstart-tp24974314p24974314.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: