PHP 트레잇 Webiny\Component\StdLib\StdObject\ArrayObject\ValidatorTrait

파일 보기 프로젝트 열기: Webiny/Framework

공개 메소드들

메소드 설명
inArray ( mixed $value, boolean $strict = false ) : boolean | key Search the array for the given $value.
keyExists ( string | StringObject $key, mixed $default = false ) : boolean | mixed Checks if $key exists in current array as index. If it exists, true is returned.
keyExistsNested ( string | StringObject $key, mixed $default = false ) : boolean | mixed Checks if $key exists in current array as index. If it exists, true is returned.
keysExist ( array $keys = [] ) : boolean Check if all given keys exist in the array

메소드 상세

inArray() 공개 메소드

If $strict is true, both values must be of the same instance type.
public inArray ( mixed $value, boolean $strict = false ) : boolean | key
$value mixed
$strict boolean
리턴 boolean | key Returns the key under which the $value is found, or false.

keyExists() 공개 메소드

If the $key doesn't exist, $default is returned,
public keyExists ( string | StringObject $key, mixed $default = false ) : boolean | mixed
$key string | Webiny\Component\StdLib\StdObject\StringObject\StringObject Array key.
$default mixed If key is not found, $default is returned.
리턴 boolean | mixed True is returned if the key exists, otherwise $default is returned.

keyExistsNested() 공개 메소드

If the $key doesn't exist, $default is returned. This method supports nested keys access: 'level1.level2.level3'
public keyExistsNested ( string | StringObject $key, mixed $default = false ) : boolean | mixed
$key string | Webiny\Component\StdLib\StdObject\StringObject\StringObject Array key. Eg: 'level1.level2.level3'
$default mixed If key is not found, $default is returned.
리턴 boolean | mixed True is returned if the key exists, otherwise $default is returned.

keysExist() 공개 메소드

Check if all given keys exist in the array
public keysExist ( array $keys = [] ) : boolean
$keys array
리턴 boolean