Documentation

EncryptedPassportElement extends Entity
in package

Class EncryptedPassportElement

Contains information about documents or other Telegram Passport elements shared with the bot by the user.

Tags
link
https://core.telegram.org/bots/api#encryptedpassportelement

Table of Contents

__call()  : mixed|null
Return the variable for the called getter or magically set properties dynamically.
__construct()  : mixed
Entity constructor.
__toString()  : string
Perform to string
escapeMarkdown()  : string
Escape markdown special characters
getBotUsername()  :
getData()  :
getEmail()  :
getFiles()  : null|array<string|int, PassportFile>
Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
getFrontSide()  :
getHash()  :
getPhoneNumber()  :
getProperty()  : mixed
Get a property from the current Entity
getRawData()  :
getReverseSide()  :
getSelfie()  :
getTranslation()  : null|array<string|int, PassportFile>
Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
getType()  :
toJson()  : string
Perform to json
tryMention()  : string|null
Try to mention the user
assignMemberVariables()  : mixed
Helper to set member variables
makePrettyObjectArray()  : array<string|int, mixed>
Return an array of nice objects from an array of object arrays
subEntities()  : array<string|int, mixed>
Get the list of the properties that are themselves Entities
validate()  : mixed
Perform any special entity validation

Methods

__call()

Return the variable for the called getter or magically set properties dynamically.

public __call( $method,  $args) : mixed|null
Parameters
$method :
$args :
Return values
mixed|null

__construct()

Entity constructor.

public __construct(array<string|int, mixed> $data[, string $bot_username = '' ]) : mixed
Parameters
$data : array<string|int, mixed>
$bot_username : string = ''
Tags
todo

Get rid of the $bot_username, it shouldn't be here!

throws
TelegramException
Return values
mixed

__toString()

Perform to string

public __toString() : string
Return values
string

escapeMarkdown()

Escape markdown special characters

public escapeMarkdown(string $string) : string
Parameters
$string : string
Return values
string

getBotUsername()

public getBotUsername() :

Return the bot name passed to this entity

Return values

getData()

public getData() :

Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “identity_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.

Return values

getEmail()

public getEmail() :

Optional. User's verified email address, available only for “email” type

Return values

getFiles()

Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.

public getFiles() : null|array<string|int, PassportFile>

This method overrides the default getFiles method and returns a nice array of PassportFile objects.

Return values
null|array<string|int, PassportFile>

getFrontSide()

public getFrontSide() :

Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.

Return values

getHash()

public getHash() :

Base64-encoded element hash for using in PassportElementErrorUnspecified

Return values

getPhoneNumber()

public getPhoneNumber() :

Optional. User's verified phone number, available only for “phone_number” type

Return values

getProperty()

Get a property from the current Entity

public getProperty(mixed $property[, mixed $default = null ]) : mixed
Parameters
$property : mixed
$default : mixed = null
Return values
mixed

getRawData()

public getRawData() :

Get the raw data passed to this entity

Return values

getReverseSide()

public getReverseSide() :

Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.

Return values

getSelfie()

public getSelfie() :

Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.

Return values

getTranslation()

Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.

public getTranslation() : null|array<string|int, PassportFile>

This method overrides the default getTranslation method and returns a nice array of PassportFile objects.

Return values
null|array<string|int, PassportFile>

getType()

public getType() :

Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.

Return values

toJson()

Perform to json

public toJson() : string
Return values
string

tryMention()

Try to mention the user

public tryMention([bool $escape_markdown = false ]) : string|null

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

Parameters
$escape_markdown : bool = false
Return values
string|null

assignMemberVariables()

Helper to set member variables

protected assignMemberVariables(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Return values
mixed

makePrettyObjectArray()

Return an array of nice objects from an array of object arrays

protected makePrettyObjectArray(string $class, string $property) : array<string|int, mixed>

This method is used to generate pretty object arrays mainly for PhotoSize and Entities object arrays.

Parameters
$class : string
$property : string
Return values
array<string|int, mixed>

subEntities()

Get the list of the properties that are themselves Entities

protected subEntities() : array<string|int, mixed>
Return values
array<string|int, mixed>

validate()

Perform any special entity validation

protected validate() : mixed
Tags
throws
TelegramException
Return values
mixed

Search results