ogcore/src/Entity/ImageRepository.php

156 lines
4.0 KiB
PHP

<?php
namespace App\Entity;
use App\Repository\ImageRepositoryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ImageRepositoryRepository::class)]
class ImageRepository extends AbstractEntity
{
const string DEFAULT_USER = 'opengnsys';
use NameableTrait;
#[ORM\Column(length: 255)]
private ?string $ip = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $comments = null;
/**
* @var Collection<int, ImageImageRepository>
*/
#[ORM\OneToMany(mappedBy: 'repository', targetEntity: ImageImageRepository::class)]
private Collection $imageImageRepositories;
#[ORM\Column(length: 255, nullable: true)]
private ?string $user = self::DEFAULT_USER;
#[ORM\Column(length: 255, nullable: true)]
private ?string $sshPort = null;
/**
* @var Collection<int, GitImageRepository>
*/
#[ORM\OneToMany(mappedBy: 'repository', targetEntity: GitImageRepository::class)]
private Collection $gitImageRepositories;
public function __construct()
{
parent::__construct();
$this->imageImageRepositories = new ArrayCollection();
$this->gitImageRepositories = new ArrayCollection();
}
public function getIp(): ?string
{
return $this->ip;
}
public function setIp(string $ip): static
{
$this->ip = $ip;
return $this;
}
public function getComments(): ?string
{
return $this->comments;
}
public function setComments(?string $comments): static
{
$this->comments = $comments;
return $this;
}
/**
* @return Collection<int, ImageImageRepository>
*/
public function getImageImageRepositories(): Collection
{
return $this->imageImageRepositories;
}
public function addImageImageRepository(ImageImageRepository $imageImageRepository): static
{
if (!$this->imageImageRepositories->contains($imageImageRepository)) {
$this->imageImageRepositories->add($imageImageRepository);
$imageImageRepository->setRepository($this);
}
return $this;
}
public function removeImageImageRepository(ImageImageRepository $imageImageRepository): static
{
if ($this->imageImageRepositories->removeElement($imageImageRepository)) {
// set the owning side to null (unless already changed)
if ($imageImageRepository->getRepository() === $this) {
$imageImageRepository->setRepository(null);
}
}
return $this;
}
public function getUser(): ?string
{
return $this->user;
}
public function setUser(?string $user): static
{
$this->user = $user;
return $this;
}
public function getSshPort(): ?string
{
return $this->sshPort;
}
public function setSshPort(?string $sshPort): static
{
$this->sshPort = $sshPort;
return $this;
}
/**
* @return Collection<int, GitImageRepository>
*/
public function getGitImageRepositories(): Collection
{
return $this->gitImageRepositories;
}
public function addGitImageRepository(GitImageRepository $gitImageRepository): static
{
if (!$this->gitImageRepositories->contains($gitImageRepository)) {
$this->gitImageRepositories->add($gitImageRepository);
$gitImageRepository->setImageRepository($this);
}
return $this;
}
public function removeGitImageRepository(GitImageRepository $gitImageRepository): static
{
if ($this->gitImageRepositories->removeElement($gitImageRepository)) {
// set the owning side to null (unless already changed)
if ($gitImageRepository->getImageRepository() === $this) {
$gitImageRepository->setImageRepository(null);
}
}
return $this;
}
}