假设我有这个模型
- 用户类.php
- userTable.class.php
我想创建一种方法来更新用户
行动
class userActions extends sfActions {
public function executeUpdateUser(sfWebRequest $request) {
$user_id = $request->getParameter('id');
// here i want to call function to update the user
// updateUser($id);
}
我应该把这个功能放在哪里updateUser($id)
?
ON user.class.php
--> 然后这样称呼它User::updateUser($id);
OR ON userTable.class.php
--> 然后这样称呼它Doctrine_Core::getTable('User')->updateUser($id);