diff --git a/src/ActiveRecord.php b/src/ActiveRecord.php index 94d6a4c..d2ddf2e 100644 --- a/src/ActiveRecord.php +++ b/src/ActiveRecord.php @@ -230,7 +230,7 @@ public static function batchPerform($action, $data = [], array $options = []) public static function perform($action, $data = [], array $options = []) { - return static::getDb()->createCommand()->perform($action, static::tableName(), $data, $options); + return static::getDb()->createCommand()->perform($action, static::tableName(), $data, $options)->getData(); } /** diff --git a/src/Command.php b/src/Command.php index 4027885..c42e3dc 100644 --- a/src/Command.php +++ b/src/Command.php @@ -39,7 +39,7 @@ public function setRequest(RequestInterface $request) * In API this could be get, search or list request. * @param array $options send options * @throws ResponseErrorException - * @return mixed response data + * @return ResponseInterface response object */ public function search($options = []) { @@ -77,6 +77,13 @@ public function update($table, $columns, $condition = [], array $params = []) return $this->setRequest($request); } + /** + * Sends a request to delete data. + * @param mixed $table entity to update + * @param array $condition + * @param array $params request parameters + * @return $this + */ public function delete($table, $condition, array $params = []) { $request = $this->db->getQueryBuilder()->delete($table, $condition, $params); @@ -90,7 +97,7 @@ public function delete($table, $condition, array $params = []) * @param string $table * @param mixed $body * @param array $params request parameters - * @return mixed response data + * @return ResponseInterface response object */ public function perform($action, $table, $body = [], array $params = []) { @@ -103,7 +110,7 @@ public function perform($action, $table, $body = [], array $params = []) /** * Executes the request. * @param array $options send options - * @return mixed response data + * @return ResponseInterface response object */ public function send($options = []) { @@ -114,7 +121,7 @@ public function send($options = []) Yii::endProfile($profile, $category); $this->db->checkResponse($response); - return $response->getData(); + return $response; } public static function getProfileCategory()