protected function setupSubresources()
 {
     foreach (func_get_args() as $name) {
         $constantized = ucfirst(Services_Twilio_Resource::camelize($name));
         $type = "Services_Twilio_Rest_" . $constantized;
         $this->addSubresource($name, new $type($this));
     }
 }
Example #2
0
 public function __construct($client, $uri)
 {
     $name = $this->getResourceName(true);
     /* 
      * By default trim the 's' from the end of the list name to get the
      * instance name (ex Accounts -> Account). This behavior can be
      * overridden by child classes if the rule doesn't work.
      */
     if (!isset($this->instance_name)) {
         $this->instance_name = "Services_Twilio_Rest_" . rtrim($name, 's');
     }
     parent::__construct($client, $uri);
 }