Esempio n. 1
0
	public function save(Pment_Models_Seal $seal)
	{
		$data = array(
			'seaId' => $seal->getSeaId(),
			'projectId' => $seal->getProjectId(),
			'sealDate' => $seal->getSealDate(),
			'returnDate' => $seal->getReturnDate(),
			'sealUser' => $seal->getSealUser(),
			'sealFile' =>$seal->getSealFile(),
			'name' => $seal->getName(),
			'contactId' => $seal->getContactId(),
			'reason' => $seal->getReason(),
			'copy' => $seal->getCopy(),
			'takeOut' => $seal->getTakeOut(),
			'remark' => $seal->getRemark()
		);
		if (null === ($id = $seal->getSeaId())) {
			unset($data['seaId']);
			$this->getDbTable()->insert($data);
		} else {
			$this->getDbTable()->update($data, array('seaId = ?' => $seal->getSeaId()));
		}
	}