mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 17:29:04 +00:00 
			
		
		
		
	optimized orm structure
This commit is contained in:
		| @@ -26,7 +26,19 @@ use Symfony\Component\Validator\Constraints as Assert; | ||||
|  * @ORM\Table(name="source") | ||||
|  * @ORM\InheritanceType("JOINED") | ||||
|  * @ORM\DiscriminatorColumn(name="discr", type="string") | ||||
|  * @ORM\DiscriminatorMap({"primitive" = "App\Entity\Source\Primitive\AbstractPrimitiveSource", "collection" = "App\Entity\Source\Complex\Collection\AbstractCollectionSource","operation"="App\Entity\Source\Operation\AbstractOperation"}) | ||||
|  * @ORM\DiscriminatorMap({ | ||||
|  * "text" = "App\Entity\Source\Primitive\Text\TextSource", | ||||
|  * "operation"="App\Entity\Source\Operation\AbstractOperation", | ||||
|  * "user" = "App\Entity\Source\Complex\UserSource", | ||||
|  * "fullpersonname" = "App\Entity\Source\Complex\FullPersonNameSource", | ||||
|  * "personidentitysource"="App\Entity\Source\Complex\PersonIdentitySource", | ||||
|  * "fullpersonnamesource"="App\Entity\Source\Complex\FullPersonNameSource", | ||||
|  * "member" = "App\Entity\Source\Complex\Collection\TreeCollectionSource", | ||||
|  * "and" = "App\Entity\Source\Operation\AndOperation", | ||||
|  * "nickname" = "App\Entity\Source\Primitive\Name\NicknameSource", | ||||
|  * "firstname" = "App\Entity\Source\Primitive\Name\FirstNameSource", | ||||
|  * "surname" = "App\Entity\Source\Primitive\Name\SurnameSource" | ||||
|  * }) | ||||
|  * @UniqueEntity("slug",ignoreNull=true) | ||||
|  */ | ||||
| abstract class AbstractSource extends AbstractEntity implements SourceInterface | ||||
|   | ||||
| @@ -3,16 +3,9 @@ | ||||
| namespace App\Entity\Source\Complex; | ||||
|  | ||||
| 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","personidentitysource"="PersonIdentitySource","fullpersonnamesource"="FullPersonNameSource"}) | ||||
|  */ | ||||
| abstract class AbstractComplexSource extends AbstractSource implements ComplexSourceInterface | ||||
| { | ||||
|   | ||||
| @@ -10,12 +10,6 @@ use Doctrine\ORM\Mapping as ORM; | ||||
| use Doctrine\Common\Collections\ArrayCollection; | ||||
|  | ||||
| /** | ||||
|  * @ORM\Entity | ||||
|  * @ORM\Table(name="source_collection") | ||||
|  * @ORM\InheritanceType("JOINED") | ||||
|  * @ORM\DiscriminatorColumn(name="discr", type="string") | ||||
|  * @ORM\DiscriminatorMap({"member" = "TreeCollectionSource"}) | ||||
|  * | ||||
|  * @author kevinfrantz | ||||
|  */ | ||||
| abstract class AbstractCollectionSource extends AbstractSource implements CollectionSourceInterface | ||||
|   | ||||
| @@ -7,9 +7,6 @@ use App\Entity\Attribut\CollectionAttribut; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  * | ||||
|  * @todo remove deprecated trait membersattribut | ||||
|  * @ORM\Table(name="source_group") | ||||
|  * @ORM\Entity | ||||
|  */ | ||||
| class TreeCollectionSource extends AbstractCollectionSource implements TreeCollectionSourceInterface | ||||
|   | ||||
| @@ -12,7 +12,6 @@ use App\Entity\Source\Primitive\Name\FirstNameSourceInterface; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  * @ORM\Table(name="source_combination_fullpersonname") | ||||
|  * @ORM\Entity() | ||||
|  */ | ||||
| class FullPersonNameSource extends AbstractComplexSource implements FullPersonNameSourceInterface | ||||
|   | ||||
| @@ -7,7 +7,6 @@ use Doctrine\ORM\Mapping as ORM; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  * @ORM\Table(name="source_combination_person_identity") | ||||
|  * @ORM\Entity() | ||||
|  */ | ||||
| class PersonIdentitySource extends AbstractComplexSource implements PersonIdentitySourceInterface | ||||
|   | ||||
| @@ -9,7 +9,6 @@ use App\Entity\Attribut\PersonIdentitySourceAttribut; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  * @ORM\Table(name="source_data_user") | ||||
|  * @ORM\Entity(repositoryClass="App\Repository\UserSourceRepository") | ||||
|  */ | ||||
| class UserSource extends AbstractComplexSource implements UserSourceInterface | ||||
|   | ||||
| @@ -13,10 +13,6 @@ use App\Exception\NotProcessedException; | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  * @ORM\Entity | ||||
|  * @ORM\Table(name="source_operation") | ||||
|  * @ORM\InheritanceType("JOINED") | ||||
|  * @ORM\DiscriminatorColumn(name="discr", type="string") | ||||
|  * @ORM\DiscriminatorMap({"and" = "AndOperation"}) | ||||
|  */ | ||||
| abstract class AbstractOperation extends AbstractSource implements OperationInterface | ||||
| { | ||||
|   | ||||
| @@ -8,7 +8,6 @@ use App\Exception\NotDefinedException; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  * @ORM\Table(name="source_operation_and") | ||||
|  * @ORM\Entity() | ||||
|  * | ||||
|  * @todo move to the logic level! | ||||
|   | ||||
| @@ -2,17 +2,10 @@ | ||||
|  | ||||
| namespace App\Entity\Source\Primitive; | ||||
|  | ||||
| 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({"name" = "App\Entity\Source\Primitive\Name\AbstractNameSource","text" = "App\Entity\Source\Primitive\Text\TextSource"}) | ||||
|  */ | ||||
| abstract class AbstractPrimitiveSource extends AbstractSource implements PrimitiveSourceInterface | ||||
| { | ||||
|   | ||||
| @@ -9,22 +9,12 @@ use Symfony\Component\Validator\Constraints as Assert; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  * | ||||
|  * @todo Change to SINGLE_TABLE. JOINED was necessary because SINGLE_TABLE leaded to: | ||||
|  * | ||||
|  * @see << SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DEV_DATABASE.source_data_name' doesn't exist >> | ||||
|  * @ORM\Entity | ||||
|  * @ORM\Table(name="source_data_name") | ||||
|  * @ORM\InheritanceType("JOINED") | ||||
|  * @ORM\DiscriminatorColumn(name="discr", type="string") | ||||
|  * @ORM\DiscriminatorMap({"nickname" = "NicknameSource","firstname" = "FirstNameSource", "surname" = "SurnameSource"}) | ||||
|  */ | ||||
| class AbstractNameSource extends AbstractPrimitiveSource implements NameSourceInterface | ||||
| { | ||||
|     use NameAttribut; | ||||
|  | ||||
|     /** | ||||
|      * @todo Implement an extra assert Layer! - maybe ;) | ||||
|      * @ORM\Column(type="string",length=255) | ||||
|      * @Assert\NotBlank() | ||||
|      * | ||||
|   | ||||
		Reference in New Issue
	
	Block a user