<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\CompetenciaRepository")
* @ORM\Table(name="competencia", schema="perseo")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class Competencia
{
/**
* @ORM\Id
* @ORM\Column(type="bigint", options={"unsigned":true})
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $nombre;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $descripcion;
/**
* @ORM\Column(type="smallint", length=2, nullable=true, options={"default":0})
*/
private $orden;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
private $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity="App\Entity\AccionCompetencia", mappedBy="competencia")
*/
private $accionesCompetencia;
public function __construct()
{
$this->accionesCompetencia = new ArrayCollection();
}
public function __toString(): string
{
return $this->getNombre() ?? '---';
}
public function getId(): ?string
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(?string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function getDescripcion(): ?string
{
return $this->descripcion;
}
public function setDescripcion(?string $descripcion): self
{
$this->descripcion = $descripcion;
return $this;
}
public function getOrden(): ?int
{
return $this->orden;
}
public function setOrden(?int $orden): self
{
$this->orden = $orden;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection<int, AccionCompetencia>
*/
public function getAccionesCompetencia(): Collection
{
return $this->accionesCompetencia;
}
public function addAccionesCompetencium(AccionCompetencia $accionesCompetencium): self
{
if (!$this->accionesCompetencia->contains($accionesCompetencium)) {
$this->accionesCompetencia->add($accionesCompetencium);
$accionesCompetencium->setCompetencia($this);
}
return $this;
}
public function removeAccionesCompetencium(AccionCompetencia $accionesCompetencium): self
{
if ($this->accionesCompetencia->removeElement($accionesCompetencium)) {
// set the owning side to null (unless already changed)
if ($accionesCompetencium->getCompetencia() === $this) {
$accionesCompetencium->setCompetencia(null);
}
}
return $this;
}
}