accessRank = $accessRank; } public function toInteger() { return $this->accessRank; } public function toString() { return self::_toString($this->accessRank); } public static function getAll() { return array_map(function($constantName) { return new self($constantName); }, self::getAllConstants()); } public function validate() { if (!in_array($this->accessRank, self::getAllConstants())) throw new SimpleException('Invalid access rank "%s"', $this->accessRank); } }