diff --git a/old/src/PointToolsBundle/Entity/Blogs/PostTag.php b/old/src/PointToolsBundle/Entity/Blogs/PostTag.php deleted file mode 100644 index 59da8f8..0000000 --- a/old/src/PointToolsBundle/Entity/Blogs/PostTag.php +++ /dev/null @@ -1,79 +0,0 @@ -post = $post; - $this->tag = $tag; - $this->text = $text; - } - - public function getId(): int - { - return $this->id; - } - - public function getText(): string - { - return $this->text; - } - - public function getOriginalTagText(): string - { - return $this->tag->getText(); - } - - public function getPost(): Post - { - return $this->post; - } - - public function getTag(): Tag - { - return $this->tag; - } -} diff --git a/old/src/PointToolsBundle/Repository/Blogs/PostTagRepository.php b/old/src/PointToolsBundle/Repository/Blogs/PostTagRepository.php deleted file mode 100644 index f5621cf..0000000 --- a/old/src/PointToolsBundle/Repository/Blogs/PostTagRepository.php +++ /dev/null @@ -1,14 +0,0 @@ -getEntityManager()->persist($entity); - } -} diff --git a/src/Entity/Blog/PostTag.php b/src/Entity/Blog/PostTag.php new file mode 100644 index 0000000..551a501 --- /dev/null +++ b/src/Entity/Blog/PostTag.php @@ -0,0 +1,62 @@ +post = $post; + $this->tag = $tag; + $this->text = $text; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getText(): string + { + return $this->text; + } + + public function getOriginalTagText(): string + { + return $this->tag->getText(); + } + + public function getPost(): Post + { + return $this->post; + } + + public function getTag(): Tag + { + return $this->tag; + } +} diff --git a/src/Repository/Blog/PostTagRepository.php b/src/Repository/Blog/PostTagRepository.php new file mode 100644 index 0000000..2fc8c01 --- /dev/null +++ b/src/Repository/Blog/PostTagRepository.php @@ -0,0 +1,33 @@ + + * + * @method PostTag|null find($id, $lockMode = null, $lockVersion = null) + * @method PostTag|null findOneBy(array $criteria, array $orderBy = null) + * @method PostTag[] findAll() + * @method PostTag[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class PostTagRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, PostTag::class); + } + + public function save(PostTag $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } +}