Exemplo n.º 1
0
	public function save(Project_Models_Project $project)
	{
		$data = array(
			'projectId' => $project->getProjectId(),
			'name' => $project->getName() ,
			'address' => $project->getAddress(),
			'status' => $project->getStatus(),
			'structype' => $project->getStructype(),
			'level' => $project->getLevel(),
			'period' => $project->getPeriod(),
			'startDate' => $project->getStartDate(),
			'contactId' => $project->getContactId(),
			'constructor' => $project->getConstructor(),
			'contractor' => $project->getContractor(),
			'supervisor' => $project->getSupervisor(),
			'designer' => $project->getDesigner(),
			'license' => $project->getLicense(),
			'amount' => $project->getAmount(),
			'constrArea' => $project->getConstrArea(),
			'remark' => $project->getRemark()
		);
		if (null === ($id = $project->getProjectId())) {
			unset($data['projectId']);
			$this->getDbTable()->insert($data);
		} else {
			$this->getDbTable()->update($data, array('projectId = ?' => $project->getProjectId()));
		}
	}