Implemented test and logic for AbstractOperation

This commit is contained in:
Kevin Frantz
2018-10-31 12:15:49 +01:00
parent f576587f32
commit 6540e1dd95
6 changed files with 132 additions and 3 deletions

View File

@@ -3,11 +3,11 @@
namespace App\Entity\Source\Operation;
use App\Logic\Result\ResultInterface;
use App\Logic\Operation\OperationInterface;
use App\Logic\Operation\OperandInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Source\AbstractSource;
use App\Entity\Source\Operation\Attribut\OperandsAttribut;
/**
* @author kevinfrantz
@@ -17,8 +17,10 @@ use App\Entity\Source\AbstractSource;
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"and" = "AndOperation"})
*/
abstract class AbstractOperation extends AbstractSource implements OperationInterface
abstract class AbstractOperation extends AbstractSource implements OperandInterface
{
use OperandsAttribut;
/**
* The result MUST NOT be saved via Doctrine!
*
@@ -31,6 +33,12 @@ abstract class AbstractOperation extends AbstractSource implements OperationInte
*/
protected $operands;
public function __construct()
{
parent::__construct();
$this->operands = new ArrayCollection();
}
public function getResult(): ResultInterface
{
return $this->result;