无论如何只获取在具体字段中具有具体值的表的行。
例如:
$24_people = $table->getFieldAndValue('age', 24);
我现在可以通过查询来做到这一点,但是您不会发现这种功能有用吗?或者可能因为某种原因不可能或不方便?
问候
哈维
你的意思是这样的:
$table->createQuery()->where('age = ?', 24);
或者:
$table->findAllByAge(24);
?
是的。
$24_people = Doctrine::getTable('People')->findOneByAge(24);
见教义魔法方法。
http://www.symfony-project.org/doctrine/1_2/en/06-Working-With-Data