/** * Validate a Product ID * * Verifies that the product exists. * * @param array $config Field configuration * @param string $data Field data * @return ProductDBO Product DBO for this Product ID * @throws RecordNotFoundException */ public function validate($data) { $data = parent::validate($data); try { $productDBO = load_ProductDBO(intval($data)); } catch (DBNoRowsFoundException $e) { throw new RecordNotFoundException("Product"); } return $productDBO; }
/** * Set Product ID * * @param integer $id Product ID */ function setProductID($id) { $this->setPurchasable(load_ProductDBO($id)); }