/** * Serializes a model object. * @param Arrayable $model * @return array the array representation of the model */ protected function serializeModel($model) { if ($this->request->getIsHead()) { return null; } else { list($fields, $expand) = $this->getRequestedFields(); return $model->toArray($fields, $expand); } }
/** * Serializes a model object. * @param Arrayable $model * @return array the array representation of the model */ protected function serializeModel($model) { return $model->toArray(); }
/** * Serializes a model object. * @param \yii\base\Arrayable $model * @return array the array representation of the model */ protected function serializeModel($model) { list($fields, $expand) = $this->getRequestedFields(); return $model->toArray($fields, $expand); }
/** * Serializes a model object. * @param Arrayable $model * @return array the array representation of the model */ protected function serializeModel($model) { if ($this->request->getIsHead()) { return null; } else { list($fields, $expand) = $this->getRequestedFields(); return ['success' => 1, 'message' => \Yii::$app->response->statusText, 'status' => \Yii::$app->response->getStatusCode(), $this->collectionEnvelope => $model->toArray($fields, $expand)]; } }