Location: PHPKode > projects > CenterFlow > app/models/test_session.php
<?php

class TestSession extends AppModel
{
    var $name = 'TestSession';
    
	var $hasMany = array('TestSessionItems'=> array('className'=>'TestSessionItem'));
	var $belongsTo = array('TestPlan'=>array('className'=>'TestPlan'),
						   'Person'=>array('className'=>'Person'));
						   
						   
	function fetchSession($id)
	{			
		//$this->recursive = 2;			   
		$data = $this->findById($id);
		foreach($data['TestSessionItems'] as $num => $session_item)
		{
			$test_items = $this->query("select * from sp_test_items where id = $session_item[test_item_id]");
			$data['TestSessionItems'][$num]['TestItem'] = $test_items[0]['sp_test_items'];
		}
		return $data;
	}
}

?>
Return current item: CenterFlow