PHP 클래스 MabeEnum\Enum

파일 보기 프로젝트 열기: marc-mabe/php-enum 1 사용 예제들

공개 메소드들

메소드 설명
__callStatic ( string $method, array $args ) : static Get an enumerator instance by the given name.
__sleep ( )
__toString ( ) : string Get the name of the enumerator
__wakeup ( )
clear ( ) : void Clear all instantiated enumerators of the called class
get ( static | null | boolean | integer | float | string $value ) : static Get an enumerator instance of the given value or instance
getByName ( string $name ) : static Get an enumerator instance by the given name
getByOrdinal ( integer $ordinal ) : static Get an enumeration instance by the given ordinal number
getConstants ( ) : array Get all available constants of the called class
getEnumerators ( ) : static[] Get a list of enumerator instances ordered by ordinal number
getName ( ) : string Get the name of the enumerator
getOrdinal ( ) : integer Get the ordinal number of the enumerator
getValue ( ) : null | boolean | integer | float | string Get the value of the enumerator
has ( static | null | boolean | integer | float | string $value ) : boolean Is the given enumerator part of this enumeration
is ( mixed $enumerator ) : boolean Compare this enumerator against another and check if it's the same.

비공개 메소드들

메소드 설명
__clone ( )
__construct ( null | boolean | integer | float | string $value, integer | null $ordinal = null ) Constructor
detectConstants ( string $class ) : array Detect all available constants by the given class

메소드 상세

__callStatic() 최종 공개 정적인 메소드

This will be called automatically on calling a method with the same name of a defined enumerator.
final public static __callStatic ( string $method, array $args ) : static
$method string The name of the enumeraotr (called as method)
$args array There should be no arguments
리턴 static

__sleep() 최종 공개 메소드

final public __sleep ( )

__toString() 공개 메소드

Get the name of the enumerator
또한 보기: getName()
public __toString ( ) : string
리턴 string

__wakeup() 최종 공개 메소드

final public __wakeup ( )

clear() 최종 공개 정적인 메소드

NOTE: This can break singleton behavior ... use it with caution!
final public static clear ( ) : void
리턴 void

get() 최종 공개 정적인 메소드

Get an enumerator instance of the given value or instance
final public static get ( static | null | boolean | integer | float | string $value ) : static
$value static | null | boolean | integer | float | string
리턴 static

getByName() 최종 공개 정적인 메소드

Get an enumerator instance by the given name
final public static getByName ( string $name ) : static
$name string The name of the enumerator
리턴 static

getByOrdinal() 최종 공개 정적인 메소드

Get an enumeration instance by the given ordinal number
final public static getByOrdinal ( integer $ordinal ) : static
$ordinal integer The ordinal number or the enumerator
리턴 static

getConstants() 최종 공개 정적인 메소드

Get all available constants of the called class
final public static getConstants ( ) : array
리턴 array

getEnumerators() 최종 공개 정적인 메소드

Get a list of enumerator instances ordered by ordinal number
final public static getEnumerators ( ) : static[]
리턴 static[]

getName() 최종 공개 메소드

Get the name of the enumerator
final public getName ( ) : string
리턴 string

getOrdinal() 최종 공개 메소드

Get the ordinal number of the enumerator
final public getOrdinal ( ) : integer
리턴 integer

getValue() 최종 공개 메소드

Get the value of the enumerator
final public getValue ( ) : null | boolean | integer | float | string
리턴 null | boolean | integer | float | string

has() 최종 공개 정적인 메소드

Is the given enumerator part of this enumeration
final public static has ( static | null | boolean | integer | float | string $value ) : boolean
$value static | null | boolean | integer | float | string
리턴 boolean

is() 최종 공개 메소드

Compare this enumerator against another and check if it's the same.
final public is ( mixed $enumerator ) : boolean
$enumerator mixed
리턴 boolean