# danog\MadelineProto\TL\TLInterface: 

[Back to index](../../../index.html)

> Author: Daniil Gentili <daniil@daniil.it>  
  

  




## Method list:
* [`getConstructors(): \danog\MadelineProto\TL\TLConstructors`](#getConstructors)
* [`getMethods(): \danog\MadelineProto\TL\TLMethods`](#getMethods)
* [`getDescriptions(): array`](#getDescriptions)
* [`getMethodNamespaces(): array`](#getMethodNamespaces)
* [`getMethodsNamespaced(): array`](#getMethodsNamespaced)
* [`serializeObject(array $type, mixed $object, string $ctx, integer $layer = -1)`](#serializeObject)
* [`serializeMethod(string $method, mixed $arguments, ?array $sent = NULL)`](#serializeMethod)
* [`convertTypeMismatch(string $type, mixed $object): mixed`](#convertTypeMismatch)
* [`getLength((resource|string) $stream, array $type = [  'type' => '',  'connection' => NULL,  'encrypted' => false,]): int`](#getLength)
* [`deserialize((string|resource) $stream, array $type)`](#deserialize)
* [`getSecretLayer(): int`](#getSecretLayer)

## Methods:
### <a name="getConstructors"></a> `getConstructors(): \danog\MadelineProto\TL\TLConstructors`

Get constructors.


#### See also: 
* `\danog\MadelineProto\TL\TLConstructors`




### <a name="getMethods"></a> `getMethods(): \danog\MadelineProto\TL\TLMethods`

Get methods.


#### See also: 
* `\danog\MadelineProto\TL\TLMethods`




### <a name="getDescriptions"></a> `getDescriptions(): array`

Get descriptions.



### <a name="getMethodNamespaces"></a> `getMethodNamespaces(): array`

Get TL namespaces.



### <a name="getMethodsNamespaced"></a> `getMethodsNamespaced(): array`

Get namespaced methods (method => namespace).



### <a name="serializeObject"></a> `serializeObject(array $type, mixed $object, string $ctx, integer $layer = -1)`

Serialize TL object.


Parameters:

* `$type`: `array` TL type definition  
* `$object`: `mixed` Object to serialize  
* `$ctx`: `string` Context  
* `$layer`: `integer` Layer version  



### <a name="serializeMethod"></a> `serializeMethod(string $method, mixed $arguments, ?array $sent = NULL)`

Serialize method.


Parameters:

* `$method`: `string` Method name  
* `$arguments`: `mixed` Arguments  
* `$sent`: `?array` Set to the arguments as sent: the values the deserializer would return for them  



### <a name="convertTypeMismatch"></a> `convertTypeMismatch(string $type, mixed $object): mixed`

Convert a value passed for an object of a TL type to a constructor of that type, as done when serializing it.


Parameters:

* `$type`: `string`   
* `$object`: `mixed`   



### <a name="getLength"></a> `getLength((resource|string) $stream, array $type = [  'type' => '',  'connection' => NULL,  'encrypted' => false,]): int`

Get length of TL payload.


Parameters:

* `$stream`: `(resource|string)` Stream  
* `$type`: `array` Type identifier  


#### See also: 
* `resource`




### <a name="deserialize"></a> `deserialize((string|resource) $stream, array $type)`

Deserialize TL object.


Parameters:

* `$stream`: `(string|resource)` Stream  
* `$type`: `array` Type identifier  


#### See also: 
* `resource`




### <a name="getSecretLayer"></a> `getSecretLayer(): int`

Get secret chat layer version.



---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
