subresources[$name] = new $type( $this->client, $this->uri . "/$constantized" ); } } protected function setupSubresource($name) { $constantized = ucfirst(self::camelize($name)); $type = get_class($this) . $constantized; $this->subresources[$name] = new $type( $this->client, $this->uri . "/". $constantized ); } }