コード例 #1
0
ファイル: UserMapper.php プロジェクト: robliuning/Luckyrabbit
	public function save(System_Models_User $user)
	{
		$data = array(
			'id' => $user->getId(),
			'username' => $user->getUserName() ,
			'password' => $user->getPassword(),
			'salt' => $user->getSalt(),
			'groupId' => $user->getGroupId(),
			'contactId' => $user->getContactId(),
			'creatorId' =>$user->getCreatorId(),
			'cTime' => $user->getCTime()
			);
		if (null === ($id = $user->getId())) {
			unset($data['id']);
			$this->getDbTable()->insert($data);
		} else {
			$this->getDbTable()->update($data, array('id = ?' => $user->getId()));
		}
	}