/**
  * Implement this by setting $obj values (e.g. $obj->setId($row->Id) from a DB row
  * @param GD_Model_Deployment $obj
  * @param Zend_Db_Table_Row_Abstract $row
  */
 protected function populateObjectFromRow(&$obj, Zend_Db_Table_Row_Abstract $row)
 {
     $obj->setId($row->id)->setUsersId($row->users_id)->setProjectsId($row->projects_id)->setWhen($row->when)->setServersId($row->servers_id)->setFromRevision($row->from_revision)->setToRevision($row->to_revision)->setComment($row->comment)->setDeploymentStatusesId($row->deployment_statuses_id);
     $u_map = new GD_Model_UsersMapper();
     $user = new GD_Model_User();
     $u_map->populateObjectFromRow($user, $row->findParentRow('GD_Model_DbTable_Users'));
     $obj->setUser($user);
     $p_map = new GD_Model_ProjectsMapper();
     $project = new GD_Model_Project();
     $p_map->populateObjectFromRow($project, $row->findParentRow('GD_Model_DbTable_Projects'));
     $obj->setProject($project);
     $s_map = new GD_Model_ServersMapper();
     $server = new GD_Model_Server();
     $s_map->populateObjectFromRow($server, $row->findParentRow('GD_Model_DbTable_Servers'));
     $obj->setServer($server);
     $ds_map = new GD_Model_DeploymentStatusesMapper();
     $deployment_status = new GD_Model_DeploymentStatus();
     $ds_map->populateObjectFromRow($deployment_status, $row->findParentRow('GD_Model_DbTable_DeploymentStatuses'));
     $obj->setDeploymentStatus($deployment_status);
 }
Beispiel #2
0
 public function testIdGetAndSet()
 {
     $obj = new GD_Model_Deployment();
     $obj->setId(5);
     $this->assertSame(5, $obj->getId());
 }