Пример #1
0
 /**
  *
  */
 public function create()
 {
     $requestOptions = new RequestOptions();
     if (!isset($this->id)) {
         throw new \Exception("Parameter 'id' is required. It is a GET parameter.");
     }
     return PhrestSDK::getResponse(self::METHOD_DELETE, sprintf($this->path, $this->id), $requestOptions);
 }
Пример #2
0
 /**
  *
  */
 public function create()
 {
     $requestOptions = new RequestOptions();
     $requestOptions->addPostParams(['name' => $this->name, 'email' => $this->email, 'password' => $this->password]);
     if (!isset($this->id)) {
         throw new \Exception("Parameter 'id' is required. It is a GET parameter.");
     }
     return PhrestSDK::getResponse(self::METHOD_PUT, sprintf($this->path, $this->id), $requestOptions);
 }
Пример #3
0
 public function __construct(APIDI $di)
 {
     // Configure the API App
     $this->setApp(new PhrestAPI($di));
     parent::__construct(realpath(__DIR__ . '/../'));
 }
Пример #4
0
 /**
  *
  */
 public function create()
 {
     $requestOptions = new RequestOptions();
     $requestOptions->addPostParams(['name' => $this->name, 'email' => $this->email, 'password' => $this->password]);
     return PhrestSDK::getResponse(self::METHOD_POST, $this->path, $requestOptions);
 }
Пример #5
0
 /**
  * @param                $method
  * @param                $path
  * @param RequestOptions $options
  *
  * @return \Phrest\API\Responses\Response|string
  * @throws \Phalcon\Exception
  */
 protected static function getResponse($method, $path, RequestOptions $options = null)
 {
     return PhrestSDK::getResponse($method, $path, $options);
 }
Пример #6
0
 /**
  *
  */
 public function create()
 {
     $requestOptions = new RequestOptions();
     return PhrestSDK::getResponse(self::METHOD_GET, $this->path, $requestOptions);
 }