success !== null) { $result['success'] = $this->success; } $result['data'] = $this->getData(); // Paginierung als letztes anzeigen if ($this->pagination !== null) { $result['pagination'] = $this->pagination; } return $result; } /** * @return array */ public function getData() { return $this->data; } /** * @return array */ public function getPagination() { return $this->pagination; } /** * @return string [item|collection] */ public function getType() { return $this->type; } /** * @param bool $success */ public function setSuccess($success) { $this->success = (bool)$success; } /** * @return bool */ public function isItem() { return $this->type === self::RESULT_TYPE_ITEM; } /** * @return bool */ public function isCollection() { return $this->type === self::RESULT_TYPE_COLLECTION; } }