Esempio n. 1
0
 /**
  * @plugin ebi.Session
  * @param int $maxlifetime
  * @return boolean
  */
 public function session_gc($maxlifetime)
 {
     try {
         static::find_delete(Q::lt('expires', time() - $maxlifetime));
         static::commit();
         return true;
     } catch (\Exception $e) {
     }
     return false;
 }
Esempio n. 2
0
    }
}
neq(10, $c);
$result = \test\db\Find::find_all(Q::ob(Q::b(Q::eq('value1', 'abc')), Q::b(Q::eq('value2', 'EDC'))));
eq(2, sizeof($result));
eq('EDC', \test\db\Find::find_get(Q::eq('value1', 'jkl'))->value2());
$i = 0;
$r = array('abc', 'def', 'ghi', 'jkl');
foreach (\test\db\RefFind::find() as $obj) {
    eq(isset($r[$i]) ? $r[$i] : null, $obj->value());
    $i++;
}
eq(4, $i);
$i = 0;
$r = array('abc', 'def', 'ghi');
foreach (\test\db\RefRefFind::find() as $obj) {
    eq(isset($r[$i]) ? $r[$i] : null, $obj->value());
    $i++;
}
eq(3, $i);
$i = 0;
$r = array('abc', 'def', 'ghi', 'jkl');
foreach (\test\db\HasFind::find() as $obj) {
    eq(isset($r[$i]) ? $r[$i] : null, $obj->parent()->value1());
    $i++;
}
eq(4, $i);
$result = \test\db\Find::find_all(Q::in('value1', \test\db\SubFind::find_sub('value')));
eq(4, sizeof($result));
$result = \test\db\Find::find_all(Q::in('value1', \test\db\SubFind::find_sub('value', Q::lt('order', 3))));
eq(2, sizeof($result));