mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Optimized persistence layer annotations
This commit is contained in:
parent
69dbc58954
commit
dfde4e34f5
@ -3,7 +3,17 @@
|
||||
namespace App\Entity\Source\Combination;
|
||||
|
||||
use App\Entity\Source\AbstractSource;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="source_combination")
|
||||
* @ORM\InheritanceType("JOINED")
|
||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||
* @ORM\DiscriminatorMap({"user" = "UserSource","fullpersonname" = "FullPersonNameSource"})
|
||||
*/
|
||||
abstract class AbstractCombinationSource extends AbstractSource implements CombinationSourceInterface
|
||||
{
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ use App\Entity\Source\AbstractSource;
|
||||
* @ORM\Table(name="source_data")
|
||||
* @ORM\InheritanceType("JOINED")
|
||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||
* @ORM\DiscriminatorMap({"user" = "UserSource","name" = "NameSource"})
|
||||
* @ORM\DiscriminatorMap({"name" = "App\Entity\Source\Data\Name\AbstractNameSource"})
|
||||
*/
|
||||
abstract class AbstractDataSource extends AbstractSource implements DataSourceInterface
|
||||
{
|
||||
|
@ -4,7 +4,17 @@ namespace App\Entity\Source\Data\Name;
|
||||
|
||||
use App\Entity\Source\Data\AbstractDataSource;
|
||||
use App\Entity\Attribut\NameAttribut;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="source_data_name")
|
||||
* @ORM\InheritanceType("JOINED")
|
||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||
* @ORM\DiscriminatorMap({"nickname" = "NicknameSource"})
|
||||
*/
|
||||
abstract class AbstractNameSource extends AbstractDataSource implements NameSourceInterface
|
||||
{
|
||||
use NameAttribut;
|
||||
|
@ -8,8 +8,8 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_data_name")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\NameSourceRepository")
|
||||
* @ORM\Table(name="source_data_nickname")
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
final class NicknameSource extends AbstractNameSource implements NicknameSourceInterface
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ class User extends BaseUser implements UserInterface
|
||||
|
||||
/**
|
||||
* @var UserSourceInterface
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Data\UserSource",cascade={"persist", "remove"})
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Combination\UserSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="source_user_id", referencedColumnName="id")
|
||||
*/
|
||||
protected $source;
|
||||
|
Loading…
Reference in New Issue
Block a user