[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/twilio-php/docs/usage/rest/ -> members.rst (source)

   1  =============
   2  Members
   3  =============
   4  
   5  List All Members in a Queue
   6  ============================
   7  
   8  Each queue instance resource has a list of members.
   9  
  10  .. code-block:: php
  11  
  12      $client = new Services_Twilio('AC123', '123');
  13      $queue_sid = 'QQ123';
  14      $queue = $client->account->queues->get('QQ123');
  15      foreach ($queue->members as $member) {
  16          echo "Call Sid: {$member->call_sid}\nWait Time: {$member->wait_time}\n";
  17      }
  18  
  19  Dequeue a Member
  20  =================
  21  
  22  .. code-block:: php
  23  
  24      $client = new Services_Twilio('AC123', '123');
  25      $queue = $client->account->queues->get('QQ123');
  26      foreach ($queue->members as $member) {
  27          // Dequeue the first member and fetch the Forward twimlet for that
  28          // member.
  29          $member->dequeue('http://twimlets.com/forward', 'GET');
  30          break;
  31      }
  32  
  33  Retrieve the Member at the Front of a Queue
  34  ===========================================
  35  
  36  The Members class has a method called ``front`` which can be used to retrieve
  37  the member at the front of the queue.
  38  
  39  .. code-block:: php
  40  
  41      $client = new Services_Twilio('AC123', '123');
  42      $queue = $client->account->queues->get('QQ123');
  43      $firstMember = $queue->members->front();
  44      echo $firstMember->position;
  45      echo $firstMember->call_sid;
  46  


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1