DigiComp.Sequence/Classes/Domain/Model/Insert.php

79 lines
1.2 KiB
PHP
Raw Normal View History

2014-04-07 15:25:16 +02:00
<?php
declare(strict_types=1);
2014-04-07 15:25:16 +02:00
namespace DigiComp\Sequence\Domain\Model;
use Doctrine\ORM\Mapping as ORM;
2017-03-13 16:59:04 +01:00
use Neos\Flow\Annotations as Flow;
2016-06-24 19:40:43 +02:00
2014-04-07 15:25:16 +02:00
/**
* SequenceInsert
*
* @Flow\Entity
* @ORM\Table(indexes={
* @ORM\Index(name="type_idx", columns={"type"})
* })
2014-04-07 15:25:16 +02:00
*/
2016-06-24 19:40:43 +02:00
class Insert
{
/**
* @var int
* @Flow\Identity
2017-03-13 16:59:04 +01:00
* @ORM\Id
2016-06-24 19:40:43 +02:00
*/
protected int $number;
2014-04-07 15:25:16 +02:00
2016-06-24 19:40:43 +02:00
/**
* @var string
* @Flow\Identity
2017-03-13 16:59:04 +01:00
* @ORM\Id
2016-06-24 19:40:43 +02:00
*/
protected string $type;
2014-04-07 15:25:16 +02:00
2016-06-24 19:40:43 +02:00
/**
2017-03-13 16:59:04 +01:00
* @param int $number
2016-06-24 19:40:43 +02:00
* @param string|object $type
*/
public function __construct(int $number, $type)
2016-06-24 19:40:43 +02:00
{
$this->setNumber($number);
2017-03-13 16:59:04 +01:00
$this->setType($type);
}
/**
* @return int
*/
public function getNumber(): int
2017-03-13 16:59:04 +01:00
{
return $this->number;
2016-06-24 19:40:43 +02:00
}
2014-04-07 15:25:16 +02:00
2016-06-24 19:40:43 +02:00
/**
* @param int $number
*/
public function setNumber(int $number): void
2016-06-24 19:40:43 +02:00
{
$this->number = $number;
}
2014-04-07 15:25:16 +02:00
2016-06-24 19:40:43 +02:00
/**
2017-03-13 16:59:04 +01:00
* @return string
2016-06-24 19:40:43 +02:00
*/
public function getType(): string
2016-06-24 19:40:43 +02:00
{
2017-03-13 16:59:04 +01:00
return $this->type;
2016-06-24 19:40:43 +02:00
}
2014-04-07 15:25:16 +02:00
2016-06-24 19:40:43 +02:00
/**
* @param string|object $type
*/
public function setType($type): void
2016-06-24 19:40:43 +02:00
{
if (is_object($type)) {
$type = get_class($type);
}
$this->type = $type;
}
}