infinito/application/src/Entity/AbstractOperation.php

43 lines
975 B
PHP
Raw Normal View History

2018-09-21 13:15:59 +02:00
<?php
2018-09-21 15:48:23 +02:00
2018-09-21 13:15:59 +02:00
namespace App\Entity;
use App\Logic\Result\ResultInterface;
use App\Logic\Operation\OperationInterface;
use App\Logic\Operation\OperandInterface;
use Doctrine\Common\Collections\ArrayCollection;
2018-09-21 15:48:23 +02:00
use Doctrine\ORM\Mapping as ORM;
2018-09-21 13:15:59 +02:00
/**
* @author kevinfrantz
2018-09-21 15:48:23 +02:00
* @ORM\Entity
* @ORM\Table(name="source_operation")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"and" = "AndOperation"})
2018-09-21 13:15:59 +02:00
*/
abstract class AbstractOperation extends AbstractSource implements OperationInterface
{
/**
* The result MUST NOT be saved via Doctrine!
2018-09-21 15:48:23 +02:00
*
2018-09-21 13:15:59 +02:00
* @var ResultInterface
*/
protected $result;
2018-09-21 15:48:23 +02:00
2018-09-21 13:15:59 +02:00
/**
* @var ArrayCollection|OperandInterface[]
*/
protected $operands;
2018-09-21 15:48:23 +02:00
2018-09-21 13:15:59 +02:00
public function getResult(): ResultInterface
{
return $this->result;
}
2018-09-21 15:48:23 +02:00
2018-09-21 13:15:59 +02:00
public function setOperators(ArrayCollection $operands): void
{
$this->operands = $operands;
}
}