generated from api-platform/api-platform
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Following step https://api-platform.com/docs/distribution/#bringing-your-own-model Specs from api/src/Entity/Greeting.php had to be removed too.
- Loading branch information
Showing
4 changed files
with
129 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
// api/src/Entity/Book.php | ||
namespace App\Entity; | ||
use ApiPlatform\Metadata\ApiResource; | ||
use Doctrine\Common\Collections\ArrayCollection; | ||
/** A book. */ | ||
#[ApiResource] | ||
class Book | ||
{ | ||
/** The ID of this book. */ | ||
private ?int $id = null; | ||
/** The ISBN of this book (or null if doesn't have one). */ | ||
public ?string $isbn = null; | ||
/** The title of this book. */ | ||
public string $title = ''; | ||
/** The description of this book. */ | ||
public string $description = ''; | ||
/** The author of this book. */ | ||
public string $author = ''; | ||
/** The publication date of this book. */ | ||
public ?\DateTimeImmutable $publicationDate = null; | ||
public function getId(): ?int | ||
{ | ||
return $this->id; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.