Longman\TelegramBot\Entities\KeyboardButton::__call PHP Method

__call() public method

public __call ( $method, $args )
    public function __call($method, $args)
    {
        // Only 1 of these can be set, so clear the others when setting a new one.
        if (in_array($method, ['setRequestContact', 'setRequestLocation'], true)) {
            unset($this->request_contact, $this->request_location);
        }
        return parent::__call($method, $args);
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function __call($method, $args)
 {
     // Only 1 of these can be set, so clear the others when setting a new one.
     if (in_array($method, ['setUrl', 'setCallbackData', 'setSwitchInlineQuery'], true)) {
         unset($this->url, $this->callback_data, $this->switch_inline_query);
     }
     return parent::__call($method, $args);
 }