mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 03:07:58 +00:00 
			
		
		
		
	Added new entity draft
This commit is contained in:
		@@ -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();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user