Example #1
0
File: index.php Project: Bobtnt/PCG
$bug->setSubject('new bug')->setDescription('My description !')->setReportedBy(1)->setVerifiedBy(2)->setCreatedBy(3)->save();
$newbugid = $bug->getId();
Zend_Debug::Dump($bug->reportedBy->getId());
unset($bug);
$bug = new bug($newbugid);
Zend_Debug::Dump($bug->reportedBy->getId());
echo '<hr>';
$group = new groups(1);
echo $group->users->count();
//Zend_Debug::Dump($group->users);
echo '<hr>';
$u = new user(1);
echo $u->groups_collection->count();
echo '<hr>';
$g = new groups();
$g->save();
$gid = $g->getId();
$g->setName('My new Group ' . $g->getId())->save();
Zend_Debug::Dump($g->getName());
$uc = new user_collection();
$uc->select("SELECT * FROM user");
$i = 0;
foreach ($uc as $u) {
    if ($i == 1) {
        $u->remove();
    }
    $i++;
}
$g->user_collection = $uc;
$g->save();
unset($g);