【发布时间】:2012-12-26 15:59:52
【问题描述】:
据我所知,可以通过以下变体来定义表名:
1) 通过定义方法getSource()
class Table1 extends \Phalcon\Mvc\Model
{
public function getSource()
{
return 'table1';
}
}
2) 通过定义 $_source 属性
protected $_source = 'table1';
3) 哪里需要定义源表?在 initialize() 方法或 __construct() 中,为什么?
4) 或许您还有其他可能的解决方案?
【问题讨论】: