Optimized ORM-Structure

This commit is contained in:
Kevin Frantz
2018-09-06 15:14:33 +02:00
parent 261b704017
commit a857f515d3
7 changed files with 95 additions and 52 deletions

View File

@@ -1,26 +1,20 @@
<?php
namespace App\Entity;
use Symfony\Component\Security\Core\User\UserInterface;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Attribut\UsernameAttribut;
use App\Entity\Attribut\PasswordAttribut;
/**
*
* @author kevinfrantz
* @ORM\Table(name="source_user")
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
*/
class User extends AbstractSource implements UserInterface, \Serializable
class User extends AbstractSource implements UserInterface
{
/**
* @ORM\Column(type="string", length=25, unique=true)
*/
private $username;
/**
* @ORM\Column(type="string", length=64)
*/
private $password;
use UsernameAttribut,PasswordAttribut;
/**
* @ORM\Column(type="string", length=254, unique=true)
*/
@@ -38,11 +32,6 @@ class User extends AbstractSource implements UserInterface, \Serializable
// $this->salt = md5(uniqid('', true));
}
public function getUsername()
{
return $this->username;
}
public function getSalt()
{
// you *may* need a real salt depending on your encoder
@@ -50,11 +39,6 @@ class User extends AbstractSource implements UserInterface, \Serializable
return null;
}
public function getPassword()
{
return $this->password;
}
public function getRoles()
{
return array('ROLE_USER');