コード例 #1
0
ファイル: Conference.php プロジェクト: robtro/php-bandwidth
 /**
  * Add a member inside
  * a conference
  *
  * @param id: Catapult id
  * @param params -> List of member parameters
  *       joinTone
  *       leavingTone
  */
 public function addMember($params)
 {
     $args = Ensure::Input($params);
     $url = URIResource::Make($this->path, array($this->id, "members"));
     $memberid = Locator::Find($this->client->post($url, $args->get()));
     return $this->member($memberid);
 }
コード例 #2
0
ファイル: Message.php プロジェクト: romonzaman/php-bandwidth
 /**
  * Send message with additional parameters
  * important rewrite in place of
  * more polymorphic style. 
  * i.e send(from, to, message, calback)
  *
  * @param args:  list of valid parameters
  */
 public function send($args)
 {
     $data = Ensure::Input($args);
     $url = URIResource::Make($this->path);
     if ($data->has("media")) {
         $data->add("media", (string) new MediaURL($data->val("media", $this)));
     }
     $message_id = Locator::Find($this->client->post($url, $data->get()));
     $data->add("id", $message_id);
     return Constructor::Make($this, $data->get(), array("messageId" => "id"));
 }
コード例 #3
0
 /**
  * allocate a new number
  * number must be available
  * or warning will be thrown
  * @param args
  *   number, 
  *   application (one you want to associate this number with)
  *   fallback a fallback option if this isnt available
  */
 public function allocate($args)
 {
     $data = Ensure::Input($args);
     $url = URIResource::Make($this->path);
     $id = Locator::Find($this->client->post($url, $data->get()));
     $data->add("id", $id);
     return Constructor::Make($this, $data->get());
 }
コード例 #4
0
ファイル: Call.php プロジェクト: robtro/php-bandwidth
 /**
  * Accept an incoming
  * call.
  *
  * @return void
  */
 public function accept()
 {
     $url = URIResource::Make($this->path, array($this->id));
     $data = new DataPacket(array("state" => CALL_STATES::active));
     $id = Locator::Find($this->client->post($url, $data->get()));
     $data->add("id", $id);
     return Constructor::Make($this, $data->get());
 }
コード例 #5
0
ファイル: Prototype.php プロジェクト: robtro/php-bandwidth
 /**
  * prototypal add. This needs
  * term to be set as a function 
  * in its caller it will be used
  * to initialize the resulting
  * object
  *
  * Conference->addMember 
  * should return
  * ConferenceMember
  *
  * @params: mix of function arguments as well as object prototypes, terms
  */
 public static function add()
 {
     $args = func_get_args();
     $that = self::get_this($args);
     $term = self::get_term($args);
     $url = URIResource::Make($that->path, array($that->id, $term));
     $id = Locator::Find($that->client->post($url, $args->get()));
     return $this->{$term}($id);
 }