PHP 클래스 Longman\TelegramBot\Entities\Entity

This is the base class for all entities.
파일 보기 프로젝트 열기: akalongman/php-telegram-bot 1 사용 예제들

공개 메소드들

메소드 설명
__call ( $method, $args ) : mixed | null Return the variable for the called getter or magically set properties dynamically.
__construct ( array $data, string $bot_name = '' ) Entity constructor.
__toString ( ) : string Perform to string
escapeMarkdown ( string $string ) : string Escape markdown special characters
getProperty ( mixed $property, mixed $default = null ) : mixed Get a property from the current Entity
toJson ( ) : string Perform to json
tryMention ( boolean $escape_markdown = false ) : string | null Try to mention the user

보호된 메소드들

메소드 설명
assignMemberVariables ( array $data ) Helper to set member variables
makePrettyObjectArray ( string $class, string $property ) : array Return an array of nice objects from an array of object arrays
subEntities ( ) : array Get the list of the properties that are themselves Entities
validate ( ) Perform any special entity validation

메소드 상세

__call() 공개 메소드

Return the variable for the called getter or magically set properties dynamically.
public __call ( $method, $args ) : mixed | null
$method
$args
리턴 mixed | null

__construct() 공개 메소드

Entity constructor.
public __construct ( array $data, string $bot_name = '' )
$data array
$bot_name string

__toString() 공개 메소드

Perform to string
public __toString ( ) : string
리턴 string

assignMemberVariables() 보호된 메소드

Helper to set member variables
protected assignMemberVariables ( array $data )
$data array

escapeMarkdown() 공개 메소드

Escape markdown special characters
public escapeMarkdown ( string $string ) : string
$string string
리턴 string

getProperty() 공개 메소드

Get a property from the current Entity
public getProperty ( mixed $property, mixed $default = null ) : mixed
$property mixed
$default mixed
리턴 mixed

makePrettyObjectArray() 보호된 메소드

This method is used to generate pretty object arrays mainly for PhotoSize and Entities object arrays.
protected makePrettyObjectArray ( string $class, string $property ) : array
$class string
$property string
리턴 array

subEntities() 보호된 메소드

Get the list of the properties that are themselves Entities
protected subEntities ( ) : array
리턴 array

toJson() 공개 메소드

Perform to json
public toJson ( ) : string
리턴 string

tryMention() 공개 메소드

Mention the user with the username otherwise print first and last name if the $escape_markdown argument is true special characters are escaped from the output
public tryMention ( boolean $escape_markdown = false ) : string | null
$escape_markdown boolean
리턴 string | null

validate() 보호된 메소드

Perform any special entity validation
protected validate ( )