merge_email_verifier #3

Merged
tracer merged 23 commits from merge_email_verifier into master 2022-11-04 10:35:23 +01:00
1 changed files with 7 additions and 25 deletions
Showing only changes of commit 3e20a9c644 - Show all commits

View File

@ -2,56 +2,38 @@
namespace App\Entity; namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use App\Repository\PagesRepository; use App\Repository\PagesRepository;
use DateTimeImmutable; use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Sunrise\Slugger\Slugger; use Sunrise\Slugger\Slugger;
#[ORM\Entity(repositoryClass: PagesRepository::class), ORM\HasLifecycleCallbacks] #[ORM\Entity(repositoryClass: PagesRepository::class), ORM\HasLifecycleCallbacks]
#[ApiResource]
#[ApiFilter(filterClass: SearchFilter::class, properties: ['slug' => 'exact'])]
class Pages class Pages
{ {
#[ORM\Id] #[ORM\Id]
#[ORM\GeneratedValue] #[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')] #[ORM\Column(type: 'integer')]
private $id; private ?int $id;
#[ORM\Column(type: 'string', length: 255)] #[ORM\Column(type: 'string', length: 255)]
private $name; private string $name;
#[ORM\Column(type: 'text')] #[ORM\Column(type: 'text')]
private $content; private string $content;
#[ORM\Column(type: 'datetime_immutable')] #[ORM\Column(type: 'datetime_immutable')]
private $createdAt; private ?DateTimeImmutable $createdAt;
#[ORM\Column(type: 'datetime_immutable', nullable: true)] #[ORM\Column(type: 'datetime_immutable', nullable: true)]
private $modifiedAt; private ?DateTimeImmutable $modifiedAt;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'pages')] #[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'pages')]
#[ORM\JoinColumn(nullable: false)] #[ORM\JoinColumn(nullable: false)]
private $owner; private User $owner;
#[ORM\Column(type: 'string', length: 255)] #[ORM\Column(type: 'string', length: 255)]
private $slug; private string $slug;
/**
* @param $id
*/
/* public function __construct(String $name = '', String $content = '')
{
$this->name = $name;
$this->content = $content;
$owner = $userRepository->findOneBy(['username' => 'tracer']);
$this->owner = $owner;
}
*/
public function getId(): ?int public function getId(): ?int
{ {