开发者

How to refer to BaseUsers.class.php in action?

开发者 https://www.devze.com 2023-03-29 21:15 出处:网络
If i will refer to UsersTable.class.php in action i use Doctrine::getTable(\'Users\')->getCity($test);

If i will refer to UsersTable.class.php in action i use

Doctrine::getTable('Users')->getCity($test);

In BaseUsers.class.p开发者_StackOverflow社区hp i have:

@method Users setCity()     Sets the current record's "city" value

How can i refer to this file in action.class.php ?

by the way how can i refet to Users.class.php ?

thanks for help!


city is a property of one object.. with the table you will get a collection.

what you want is:

$users = UsersTable::getInstance()->findByCity('name');

or

$user = UsersTable::getInstance()->find(1); //get your first user
$user->setCity('Zurich'); // set the city-property of the first user to Zurich
$user->getCity(); // will return Zurich
0

精彩评论

暂无评论...
验证码 换一张
取 消