bookboon/api-php

View on GitHub
src/Entity/Detail.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace Bookboon\Api\Entity;

class Detail extends Entity
{
    protected function isValid(array $array) : bool
    {
        return isset($array['title'], $array['body']);
    }

    /**
     * @return string title of details, e.g. description, table of content etc
     */
    public function getTitle()
    {
        return $this->safeGet('title');
    }

    /**
     * @return string html body of current book detail
     */
    public function getBody()
    {
        return $this->safeGet('body');
    }
}