diff --git a/old/src/PointToolsBundle/Entity/Blogs/File.php b/old/src/PointToolsBundle/Entity/Blogs/File.php deleted file mode 100644 index 908b171..0000000 --- a/old/src/PointToolsBundle/Entity/Blogs/File.php +++ /dev/null @@ -1,44 +0,0 @@ -remoteUrl = $remoteUrl; - } - - public function getId(): int - { - return $this->id; - } - - public function getRemoteUrl(): string - { - return $this->remoteUrl; - } -} diff --git a/old/src/PointToolsBundle/Repository/Blogs/FileRepository.php b/old/src/PointToolsBundle/Repository/Blogs/FileRepository.php deleted file mode 100644 index a700894..0000000 --- a/old/src/PointToolsBundle/Repository/Blogs/FileRepository.php +++ /dev/null @@ -1,14 +0,0 @@ -getEntityManager()->persist($entity); - } -} diff --git a/src/Entity/Blog/File.php b/src/Entity/Blog/File.php new file mode 100644 index 0000000..0ec9f68 --- /dev/null +++ b/src/Entity/Blog/File.php @@ -0,0 +1,37 @@ +remoteUrl = $remoteUrl; + } + + public function getId(): int + { + return $this->id; + } + + public function getRemoteUrl(): string + { + return $this->remoteUrl; + } +} diff --git a/src/Repository/Blog/FileRepository.php b/src/Repository/Blog/FileRepository.php new file mode 100644 index 0000000..e342391 --- /dev/null +++ b/src/Repository/Blog/FileRepository.php @@ -0,0 +1,33 @@ + + * + * @method File|null find($id, $lockMode = null, $lockVersion = null) + * @method File|null findOneBy(array $criteria, array $orderBy = null) + * @method File[] findAll() + * @method File[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class FileRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, File::class); + } + + public function save(File $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } +}