mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Optimized database schema
This commit is contained in:
parent
b292082c1f
commit
c060dff873
@ -19,12 +19,11 @@ use App\Entity\Source\Collection\TreeCollectionSourceInterface;
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @see https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/inheritance-mapping.html
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="source")
|
||||
* @ORM\InheritanceType("JOINED")
|
||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||
* @ORM\DiscriminatorMap({"user" = "UserSource","name" = "NameSource","collection" = "App\Entity\Source\Collection\AbstractCollectionSource","operation"="App\Entity\Source\Operation\AbstractOperation"})
|
||||
* @ORM\DiscriminatorMap({"data" = "App\Entity\Source\Data\AbstractDataSource", "collection" = "App\Entity\Source\Collection\AbstractCollectionSource","operation"="App\Entity\Source\Operation\AbstractOperation"})
|
||||
*/
|
||||
abstract class AbstractSource extends AbstractEntity implements SourceInterface
|
||||
{
|
||||
|
@ -1,9 +1,18 @@
|
||||
<?php
|
||||
namespace App\Entity\Source\Data;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="source_data")
|
||||
* @ORM\InheritanceType("JOINED")
|
||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||
* @ORM\DiscriminatorMap({"user" = "UserSource","name" = "NameSource"})
|
||||
*/
|
||||
abstract class AbstractDataSource extends AbstractSource implements DataSourceInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_name")
|
||||
* @ORM\Table(name="source_data_name")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\NameSourceRepository")
|
||||
*/
|
||||
final class NameSource extends AbstractDataSource implements NameSourceInterface
|
||||
|
@ -10,7 +10,7 @@ use App\Entity\UserInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_user")
|
||||
* @ORM\Table(name="source_data_user")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserSourceRepository")
|
||||
*/
|
||||
final class UserSource extends AbstractDataSource implements UserSourceInterface
|
||||
|
@ -7,8 +7,8 @@ use FOS\UserBundle\Model\User as BaseUser;
|
||||
use App\Entity\Attribut\SourceAttribut;
|
||||
use App\Entity\Attribut\IdAttribut;
|
||||
use App\Creator\Modificator\Entity\LawModificator;
|
||||
use App\Entity\Source\UserSourceInterface;
|
||||
use App\Entity\Source\UserSource;
|
||||
use App\Entity\Source\Data\UserSourceInterface;
|
||||
use App\Entity\Source\Data\UserSource;
|
||||
use App\Entity\Attribut\VersionAttribut;
|
||||
|
||||
/**
|
||||
@ -22,7 +22,7 @@ class User extends BaseUser implements UserInterface
|
||||
|
||||
/**
|
||||
* @var UserSourceInterface
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\UserSource",cascade={"persist", "remove"})
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Data\UserSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="source_user_id", referencedColumnName="id")
|
||||
*/
|
||||
protected $source;
|
||||
|
Loading…
Reference in New Issue
Block a user