Beispiel #1
0
 function saveInDB()
 {
     $result = SJB_ContractSQL::insert($this->_getHashedFields());
     if ($result) {
         if (!$this->id) {
             $this->id = $result;
         }
         SJB_ContractSQL::updateContractExtraInfoByProductSID($this);
         if ($this->status == 'active') {
             SJB_Acl::copyPermissions($this->product_sid, $this->id, $this->number_of_listings);
         } else {
             SJB_Acl::clearPermissions('contract', $this->id);
         }
         $userInfo = SJB_UserManager::getUserInfoBySID($this->user_sid);
         $user = new SJB_User($userInfo, $userInfo['user_group_sid']);
         $user->updateSubscribeOnceUsersProperties($this->product_sid, $this->user_sid);
     }
     return (bool) $result;
 }