Exemple #1
0
foreach (\test\db\Find::find() as $obj) {
    eq($list[$i], $obj->value1());
    $i++;
}
$b = false;
foreach (\test\db\Find::find(Q::eq('value1', 'AbC', Q::IGNORE)) as $obj) {
    eq('abc', $obj->value1());
    $b = true;
}
eq(true, $b);
foreach (\test\db\Find::find(Q::neq('value1', 'abc')) as $obj) {
    neq('abc', $obj->value1());
}
$i = 0;
$r = array('aaa', 'bbb', 'ccc');
foreach (\test\db\Find::find(Q::startswith('value1,value2', array('aa'), Q::IGNORE)) as $obj) {
    eq(isset($r[$i]) ? $r[$i] : null, $obj->value1());
    $i++;
}
eq(3, $i);
$i = 0;
$r = array('abc', 'jkl', 'ccc');
foreach (\test\db\Find::find(Q::endswith('value1,value2', array('c'), Q::IGNORE)) as $obj) {
    eq(isset($r[$i]) ? $r[$i] : null, $obj->value1());
    $i++;
}
eq(3, $i);
$i = 0;
$r = array('abc', 'bbb');
foreach (\test\db\Find::find(Q::contains('value1,value2', array('b'))) as $obj) {
    eq(isset($r[$i]) ? $r[$i] : null, $obj->value1());