deblan.io-murph/src/Entity/Blog/PostFollow.php

88 lines
1.7 KiB
PHP
Raw Normal View History

2022-02-06 19:36:10 +01:00
<?php
namespace App\Entity\Blog;
use App\Core\Doctrine\Timestampable;
use App\Core\Entity\EntityInterface;
use App\Repository\Blog\PostFollowRepository;
use Doctrine\ORM\Mapping as ORM;
2022-11-19 20:42:30 +01:00
#[ORM\Entity(repositoryClass: PostFollowRepository::class)]
#[ORM\HasLifecycleCallbacks]
2022-02-06 19:36:10 +01:00
class PostFollow implements EntityInterface
{
use Timestampable;
2022-11-19 20:42:30 +01:00
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
2022-02-06 19:36:10 +01:00
private $id;
2022-11-19 20:42:30 +01:00
#[ORM\Column(type: 'string', length: 255)]
2022-02-06 19:36:10 +01:00
private $hash;
2022-11-19 20:42:30 +01:00
#[ORM\Column(type: 'boolean')]
2022-02-06 19:36:10 +01:00
private $isEnabled;
2022-11-19 20:42:30 +01:00
#[ORM\ManyToOne(targetEntity: Post::class, inversedBy: 'postFollows')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
2022-02-06 19:36:10 +01:00
private $post;
2022-11-19 20:42:30 +01:00
#[ORM\ManyToOne(targetEntity: Comment::class, inversedBy: 'postFollows')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
2022-02-06 19:36:10 +01:00
private $comment;
public function getId(): ?int
{
return $this->id;
}
public function getHash(): ?string
{
return $this->hash;
}
public function setHash(string $hash): self
{
$this->hash = $hash;
return $this;
}
public function getIsEnabled(): ?bool
{
return $this->isEnabled;
}
public function setIsEnabled(bool $isEnabled): self
{
$this->isEnabled = $isEnabled;
return $this;
}
public function getPost(): ?Post
{
return $this->post;
}
public function setPost(?Post $post): self
{
$this->post = $post;
return $this;
}
public function getComment(): ?Comment
{
return $this->comment;
}
public function setComment(?Comment $comment): self
{
$this->comment = $comment;
return $this;
}
}