/** * */ 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); }
/** * */ 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); }
public function __construct(APIDI $di) { // Configure the API App $this->setApp(new PhrestAPI($di)); parent::__construct(realpath(__DIR__ . '/../')); }
/** * */ 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); }
/** * @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); }
/** * */ public function create() { $requestOptions = new RequestOptions(); return PhrestSDK::getResponse(self::METHOD_GET, $this->path, $requestOptions); }