API Platform 3 Part 1: Mythically Good RESTful APIs
The Serializer
  Unlock this challenge
Login Register

Challenge 1 / 1

Check out the following class:

class FireBreathingAccident
{
    public string $description;

    private \DateTime $breathedAt;

    private int $humansInjured;

    public function __construct(string $description, \DateTime $breathedAt)
    {
        $this->description = $description;
        $this->breathedAt = $breathedAt;
    }

    public function setHumansInjured(int $count)
    {
        $this->humansInjured = $humansInjured;
    }

    public function getHumansInjured(): int
    {
        return $this->humansInjured;
    }

    public function getMoodOfHumansAfter(): string
    {
        return 'a bit mad';
    }
}

What fields would be returned in the API for this class?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.