private function _rowToObject(Zend_Db_Table_Row $row) { $statusRow = $row->findParentRow('Project_Model_DbTable_IssueStatus', 'IssueStatus'); $status = new Project_Model_IssueStatus(); $status->setId($statusRow->istut_id)->setTitle($statusRow->istut_title); $typeRow = $row->findParentRow('Project_Model_DbTable_IssueType', 'IssueType'); $type = new Project_Model_IssueType(); $type->setId($typeRow->istyp_id)->setTitle($typeRow->istyp_title); $projectRow = $row->findParentRow('Project_Model_DbTable_Project', 'Project'); $projectMapper = new Project_Model_Mapper_Project(); $project = new Project_Model_Project(); $project = $projectMapper->rowToObject($projectRow); $userRow = $row->findParentRow('User_Model_DbTable_Staffmembre', 'Staffmembre'); $user = new User_Model_Staffmembre(); $user->setId($userRow->usm_id)->setLogin($userRow->usm_login); $issue = new Project_Model_Issue(); $issue->setId($row->iss_id)->setName($row->iss_name)->setDescription($row->iss_desc)->setDate($row->iss_date)->setStatus($status)->setType($type)->setProject($project)->setUser($user); return $issue; }
/** * Retrieves a project given its id at storage layer level * @param integer $projectId * @return Project_Model_Project|boolean */ public function find($projectId) { $projectFind = new Project_Model_Mapper_Project(); if ((int) $projectId !== 0) { $project = $projectFind->find((int) $projectId); return $project; } else { return false; } }
private function _rowToObject(Zend_Db_Table_Row $row) { $projectRow = $row->findParentRow('Project_Model_DbTable_Project', 'Project'); $projectMapper = new Project_Model_Mapper_Project(); $project = new Project_Model_Project(); $project = $projectMapper->rowToObject($projectRow); $jalon = new Project_Model_Jalon(); $jalon->setId($row->jal_id)->setName($row->jal_name)->setDescription($row->jal_description)->setDate($row->jal_date)->setProject($project); return $jalon; }