本文整理汇总了PHP中ArrayList::exclude方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayList::exclude方法的具体用法?PHP ArrayList::exclude怎么用?PHP ArrayList::exclude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayList
的用法示例。
在下文中一共展示了ArrayList::exclude方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clear_test
/**
* @param string $id
* @return void
*/
public function clear_test($id)
{
$this->yepnopeTests = $this->yepnopeTests->exclude('id', $id);
}
示例2: testMultipleExcludeThreeArguments
/**
* $list->exclude(array('Name'=>array('bob','phil'), 'Age'=>array(10, 16), 'HasBananas'=>true));
*/
public function testMultipleExcludeThreeArguments() {
$list = new ArrayList(array(
0 => array('Name' => 'bob', 'Age' => 10, 'HasBananas'=>false),
1 => array('Name' => 'phil','Age' => 11, 'HasBananas'=>true),
2 => array('Name' => 'bob', 'Age' => 12, 'HasBananas'=>true),
3 => array('Name' => 'phil','Age' => 12, 'HasBananas'=>true),
4 => array('Name' => 'bob', 'Age' => 14, 'HasBananas'=>false),
4 => array('Name' => 'ann', 'Age' => 14, 'HasBananas'=>true),
5 => array('Name' => 'phil','Age' => 14, 'HasBananas'=>false),
6 => array('Name' => 'bob', 'Age' => 16, 'HasBananas'=>false),
7 => array('Name' => 'phil','Age' => 16, 'HasBananas'=>true),
8 => array('Name' => 'clair','Age' => 16, 'HasBananas'=>true)
));
$list->exclude(array('Name'=>array('bob','phil'),'Age'=>array(10, 16),'HasBananas'=>true));
$expected = array(
0 => array('Name' => 'bob', 'Age' => 10, 'HasBananas'=>false),
1 => array('Name' => 'phil','Age' => 11, 'HasBananas'=>true),
2 => array('Name' => 'bob', 'Age' => 12, 'HasBananas'=>true),
3 => array('Name' => 'phil','Age' => 12, 'HasBananas'=>true),
4 => array('Name' => 'bob', 'Age' => 14, 'HasBananas'=>false),
4 => array('Name' => 'ann', 'Age' => 14, 'HasBananas'=>true),
5 => array('Name' => 'phil','Age' => 14, 'HasBananas'=>false),
6 => array('Name' => 'bob', 'Age' => 16, 'HasBananas'=>false),
8 => array('Name' => 'clair','Age' => 16, 'HasBananas'=>true)
);
$this->assertEquals($expected, $list->toArray());
}