Partial commit
parent
1d7ff4b210
commit
030d35f47e
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\CommandRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: CommandRepository::class)]
|
||||
class Command extends AbstractEntity
|
||||
{
|
||||
use NameableTrait;
|
||||
use ToggleableTrait;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $script = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $comments = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getScript(): ?string
|
||||
{
|
||||
return $this->script;
|
||||
}
|
||||
|
||||
public function setScript(string $script): static
|
||||
{
|
||||
$this->script = $script;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getComments(): ?string
|
||||
{
|
||||
return $this->comments;
|
||||
}
|
||||
|
||||
public function setComments(?string $comments): static
|
||||
{
|
||||
$this->comments = $comments;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Command;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Command>
|
||||
*/
|
||||
class CommandRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Command::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Command[] Returns an array of Command objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('c')
|
||||
// ->andWhere('c.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('c.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Command
|
||||
// {
|
||||
// return $this->createQueryBuilder('c')
|
||||
// ->andWhere('c.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
Loading…
Reference in New Issue