[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/vendor/kissifrot/php-ixr/src/Client/ -> ClientMulticall.php (source)

   1  <?php
   2  namespace IXR\Client;
   3  
   4  /**
   5   * IXR_ClientMulticall
   6   *
   7   * @package IXR
   8   * @since 1.5.0
   9   */
  10  class ClientMulticall extends Client
  11  {
  12      private $calls = [];
  13  
  14      public function __construct($server, $path = false, $port = 80)
  15      {
  16          parent::__construct($server, $path, $port);
  17          $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
  18      }
  19  
  20      public function addCall()
  21      {
  22          $args = func_get_args();
  23          $methodName = array_shift($args);
  24          $struct = [
  25              'methodName' => $methodName,
  26              'params' => $args
  27          ];
  28          $this->calls[] = $struct;
  29      }
  30  
  31      public function query()
  32      {
  33          // Prepare multicall, then call the parent::query() method
  34          return parent::query('system.multicall', $this->calls);
  35      }
  36  }