コード例 #1
0
 /**
  * Validate a Hosting Service ID
  *
  * Verifies that the hosting service exists.
  *
  * @param string $data Field data
  * @return HostingServiceDBO HostingService DBO for this HostingService ID
  * @throws RecordNotFoundException
  */
 public function validate($data)
 {
     $data = parent::validate($data);
     try {
         $hostingDBO = load_HostingServiceDBO(intval($data));
     } catch (DBRowNotFoundException $e) {
         throw new RecordNotFoundException("HostingService");
     }
     if ($this->fieldConfig['publicitemsonly'] && !$hostingDBO->isPublic()) {
         throw new RecordNotFoundException("HostingService");
     }
     return $hostingDBO;
 }
コード例 #2
0
 /**
  * Set Service ID
  *
  * @param integer $id Hosting Service ID
  */
 public function setServiceID($id)
 {
     $this->setPurchasable(load_HostingServiceDBO($id));
 }