APIStructure

Recursive API-structure builder and method-runner

Known subclasses

ManyChat\API\NamedAPIStructure, ManyChat\Structure\Fb, ManyChat\Structure\Fb\Page, ManyChat\Structure\Fb\Sending, ManyChat\Structure\Fb\Subscriber
Methods Summary
public
# __construct( string $name , ManyChat\API\BaseAPI $api , ManyChat\API\APIStructure $parent )
public
# __get( string $name )
Creates child structure when user tries to access it as a property of current structure
public
# __set( $name , $value )
Throws exception when user tries to change some property
public
# __isset( string $name )
Returns that every property is set
protected
# getName( )
Returns current structure name
protected
# setName( string $name )
Sets current structure name
protected
# getApi( )
Returns BaseAPI instance
protected
# setApi( ManyChat\API\BaseAPI $api )
Sets BaseAPI instance
protected
# getParent( )
Returns parent APIStructure
protected
# setParent( ManyChat\API\APIStructure $parent )
Sets current structure's parent structure
protected
# getMethodAddress( string $name )
Builds full ManyChat's API method path for current structure e.g. if instance is named 'bar' and has parent structure 'foo', and this method is called for build method 'methodName', it will return '/foo/bar/methodName' string
public
# __call( string $name , array $arguments )
Calls ManyChat's API method $name with $arguments in current structure By default method is called as GET request, but you could specify it with 'method_type' argument in $arguments