/** * Return the log body * @return array */ public function getBody() { $body = ApiHelper::toArray($this); if (isset($this->options['body'])) { return array_merge_recursive(['options' => ['raw_body' => $this->options['body']]], $body); } return $body; }
/** * Return the attributes of this class in an assoc array * @return array */ public function getBody() { $body = []; foreach ($this->_attributes as $key => $attribute) { if ($attribute instanceof ArrayList) { foreach ($attribute as $objectKey => $object) { $body[$key][$objectKey] = $object->getBody(); } } else { if ($attribute instanceof Link || $attribute instanceof Model) { $body[$key] = $attribute->getBody(); } else { $body[$key] = ApiHelper::toArray($attribute); } } } return $body; }