Ejemplo n.º 1
0
 public static function check_value($value, $msg = null)
 {
     if (is_null(self::$instance)) {
         self::$instance = new self();
     }
     BasicEnum::check_val(self::$instance, $value, $msg);
 }
Ejemplo n.º 2
0
 /** @brief Constructs service object.
  *
  * @param $id [in] identifier of the desired service.
  * @param $status [in] status of the desired service (see @ref AfsServiceStatus).
  *
  * @exception InvalidArgumentException when @a id or @a status is invalid.
  */
 public function __construct($id, $status = AfsServiceStatus::STABLE)
 {
     if (!is_numeric($id)) {
         throw new InvalidArgumentException('Service id must be integer, invalid value: ' . $id);
     }
     AfsServiceStatus::check_value($status, 'Invalid service status provided: ');
     $this->id = $id;
     $this->status = $status;
 }