コード例 #1
0
ファイル: CppMapper.php プロジェクト: robliuning/Luckyrabbit
	public function save(Pment_Models_Cpp $cpp)
	{
		$data = array(
			'cppId' => $cpp->getCppId(),
			'contactId' => $cpp->getContactId(),
			'postId' => $cpp->getPostId(),
			'projectId' => $cpp->getProjectId(),
			'qualif' => $cpp->getQualif(),
			'startDate' => $cpp->getStartDate(),
			'responsi' => $cpp->getResponsi(),
			'remark' => $cpp->getRemark(),
			'certId' => $cpp->getCertId()
		);
		if (null === ($id = $cpp->getCppId())) {
			unset($data['cppId']);
			return $this->getDbTable()->insert($data);
		} else {
			return $this->getDbTable()->update($data, array('cppId = ?' => $cpp->getCppId()));
		}
	}