Added new entity draft

This commit is contained in:
Kevin Frantz
2018-09-13 14:39:03 +02:00
parent 0ee29d3456
commit 00965aab5c
23 changed files with 331 additions and 34 deletions

View File

@@ -4,17 +4,26 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
use App\Entity\Attribut\NodeAttribut;
use App\Entity\Attribut\SourceAttributInterface;
use App\Entity\Attribut\SourceAttribut;
use App\Entity\Attribut\IdAttribut;
/**
* @author kevinfrantz
* @ORM\Table(name="source_user")
* @ORM\Table(name="user")
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
*/
class User extends BaseUser implements SourceInterface
class User extends BaseUser implements SourceAttributInterface
{
use NodeAttribut;
use SourceAttribut,IdAttribut;
/**
* @var UserSourceInterface
* @ORM\OneToOne(targetEntity="UserSource",cascade={"persist", "remove"})
* @ORM\JoinColumn(name="source_user_id", referencedColumnName="id")
*/
protected $source;
/**
* @ORM\Column(name="is_active", type="boolean")
*/
@@ -27,24 +36,10 @@ class User extends BaseUser implements SourceInterface
*/
protected $id;
public function setId(int $id): void
{
$this->id = $id;
}
public function getId(): int
{
return $this->id;
}
public function __construct()
{
parent::__construct();
/*
* @todo Remove this later
* @var \App\Entity\User $isActive
*/
$this->isActive = true;
$this->node = new Node();
$this->source = new UserSource();
}
}