本文整理汇总了PHP中People::many方法的典型用法代码示例。如果您正苦于以下问题:PHP People::many方法的具体用法?PHP People::many怎么用?PHP People::many使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类People
的用法示例。
在下文中一共展示了People::many方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMany
public function testMany()
{
$this->_mock = new Mock_Database($this, array(array('many', "SELECT people.*\nFROM people", array(), null, array('return' => array(array('id' => 1, 'passport_id' => 3), array('id' => 2, 'passport_id' => 4)))), array('many', "SELECT passports.*\nFROM passports\nWHERE `id` IN (?, ?)", array(3, 4), null, array('return' => array(array('id' => 3), array('id' => 4))))));
\Snowfire\Database\Model::database($this->_mock);
$people_model = new People();
$passports_model = new Passports();
$this->assertEquals(array(array('id' => 1, 'passport' => array('id' => 3)), array('id' => 2, 'passport' => array('id' => 4))), $people_model->many(array('foreign_models' => array('passports' => $passports_model))));
}