PHP 클래스 Essence\Media

This class is useful to ensure that any response from any provider will follow the same conventions.
상속: implements IteratorAggregat\IteratorAggregate, implements JsonSerializabl\JsonSerializable
파일 보기 프로젝트 열기: essence/essence 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_properties array These default properties are gathered from the OEmbed and OpenGraph protocols, and provide all the basic informations needed to embed a media.

공개 메소드들

메소드 설명
__construct ( array $properties = [] ) Constructs a Media from the given dataset.
__get ( $property )
__isset ( $property )
__set ( $property, $value )
configure ( array $properties ) Merges the given properties with the current ones.
filledProperties ( ) : array Returns the filled properties.
get ( string $property, mixed $default = null ) : mixed Returns the value of the given property.
getIterator ( ) : ArrayIterator Returns an iterator for the media properties.
has ( string $property ) Returns if there is any value for the given property.
jsonSerialize ( ) : string Returns serialized properties.
properties ( ) : array Returns the entire set of properties.
set ( string $property, string $value ) Sets the value of the given property.
setDefault ( string $property, string $default ) Sets the value of a property if it is empty.
setDefaults ( array $properties ) Sets default values.
setProperties ( array $properties ) Sets the entire set of properties.

메소드 상세

__construct() 공개 메소드

Constructs a Media from the given dataset.
public __construct ( array $properties = [] )
$properties array An array of media informations.

__get() 공개 메소드

또한 보기: get()
public __get ( $property )

__isset() 공개 메소드

또한 보기: has()
public __isset ( $property )

__set() 공개 메소드

또한 보기: set()
public __set ( $property, $value )

configure() 공개 메소드

Merges the given properties with the current ones.
public configure ( array $properties )
$properties array Properties to merge.

filledProperties() 공개 메소드

Returns the filled properties.
public filledProperties ( ) : array
리턴 array Properties.

get() 공개 메소드

Returns the value of the given property.
public get ( string $property, mixed $default = null ) : mixed
$property string Property name.
$default mixed Default value to be returned in case the property doesn't exists.
리턴 mixed The property value, or $default.

getIterator() 공개 메소드

Returns an iterator for the media properties.
public getIterator ( ) : ArrayIterator
리턴 ArrayIterator Iterator.

has() 공개 메소드

Returns if there is any value for the given property.
public has ( string $property )
$property string Property name.

jsonSerialize() 공개 메소드

Returns serialized properties.
public jsonSerialize ( ) : string
리턴 string JSON representation.

properties() 공개 메소드

Returns the entire set of properties.
public properties ( ) : array
리턴 array Properties.

set() 공개 메소드

Sets the value of the given property.
public set ( string $property, string $value )
$property string Property name.
$value string New value.

setDefault() 공개 메소드

Sets the value of a property if it is empty.
public setDefault ( string $property, string $default )
$property string Property name.
$default string Default value.

setDefaults() 공개 메소드

Sets default values.
또한 보기: setDefault()
public setDefaults ( array $properties )
$properties array Default properties.

setProperties() 공개 메소드

Sets the entire set of properties.
public setProperties ( array $properties )
$properties array Properties to set.

프로퍼티 상세

$_properties 보호되어 있는 프로퍼티

These default properties are gathered from the OEmbed and OpenGraph protocols, and provide all the basic informations needed to embed a media.
protected array $_properties
리턴 array