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;
|
namespace App\Entity\Source\Combination;
|
||||||
|
|
||||||
use App\Entity\Source\AbstractSource;
|
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
|
abstract class AbstractCombinationSource extends AbstractSource implements CombinationSourceInterface
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ use App\Entity\Source\AbstractSource;
|
|||||||
* @ORM\Table(name="source_data")
|
* @ORM\Table(name="source_data")
|
||||||
* @ORM\InheritanceType("JOINED")
|
* @ORM\InheritanceType("JOINED")
|
||||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
* @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
|
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\Source\Data\AbstractDataSource;
|
||||||
use App\Entity\Attribut\NameAttribut;
|
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
|
abstract class AbstractNameSource extends AbstractDataSource implements NameSourceInterface
|
||||||
{
|
{
|
||||||
use NameAttribut;
|
use NameAttribut;
|
||||||
|
@ -8,8 +8,8 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kevinfrantz
|
* @author kevinfrantz
|
||||||
* @ORM\Table(name="source_data_name")
|
* @ORM\Table(name="source_data_nickname")
|
||||||
* @ORM\Entity(repositoryClass="App\Repository\NameSourceRepository")
|
* @ORM\Entity()
|
||||||
*/
|
*/
|
||||||
final class NicknameSource extends AbstractNameSource implements NicknameSourceInterface
|
final class NicknameSource extends AbstractNameSource implements NicknameSourceInterface
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ class User extends BaseUser implements UserInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var UserSourceInterface
|
* @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")
|
* @ORM\JoinColumn(name="source_user_id", referencedColumnName="id")
|
||||||
*/
|
*/
|
||||||
protected $source;
|
protected $source;
|
||||||
|
Loading…
Reference in New Issue
Block a user