ZF允许您扩展
Zend_Db_Table_Row
类,并告诉Zend_db_table类始终使用它。这样,您就可以访问
zend_db_table_行
功能,同时在顶部添加您自己的逻辑。
你可以这样做
class User_DbTable extends Zend_DB_Table_Abstract{
protected $_name = "user"; // name of the table
protected $_rowClass = "User"; // The name of your Zend_Db_Table_Row class
}
class User extends Zend_Db_Table_Row {
public function set_name($_name){
$this->name = $_name;
}
public function get_name(){
return $this->name;
}
public function set_adresses($_addresses){
$this->addresses = $_addresses;
}
// and so on....
}
你可以看到更多关于
zend_db_table_行
here