Exemplo n.º 1
0
Arquivo: index.php Projeto: Bobtnt/PCG
int(12)
int(100)
*/
echo '<hr>';
/**
 * $bug_collection->get('id == 99') is memory pointer to $otherBug
 * $bug_collection->get('id == 99')->getSubject() return 'my test'
 */
$otherBug->setSubject('my test');
echo $bug_collection->get('id == 99')->getSubject();
$bug_collection->save();
echo '<hr>';
unset($otherBug);
unset($bug_collection);
$mybug = new bug(100);
echo $mybug->getSubject();
echo '<hr>';
$bug = new bug(rand(10, 100));
Zend_Debug::Dump($bug->getId());
$categoryName = $bug->category->getName();
// return "hardware"
$categoryId = $bug->category->getId();
// return 1
$bug->setCategoryId(3)->save();
$categoryId = $bug->category->getId();
// return 3
$categoryName = $bug->category->getName();
// return "between the chair and the keyboard"
$bug = new bug(50);
$bug->reportedBy->getId();
// return 1