type; } /** * Returns an array representation of the object * * @return string[] */ public function toArray(): array { return [ 'type' => $this->getType(), ]; } /** * Constructs object from an array representation * * @param array $data * @return ObjectTypeInterface */ public static function fromArray(array $data): ObjectTypeInterface { $object = new self(); $object->type = $data['type'] ?? null; return $object; } /** * Constructs object from MenuButton * * @param MenuButton $menuButton * @return MenuButtonCommands */ public static function fromMenuButton(MenuButton $menuButton): MenuButtonCommands { $object = new self(); $object->type = $menuButton->getType(); return $object; } }