mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 17:29:04 +00:00 
			
		
		
		
	Refactored Collection Sources
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
| 
 | ||||
| namespace App\Entity\Source\Attribut; | ||||
| namespace App\Entity\Attribut; | ||||
| 
 | ||||
| use Doctrine\Common\Collections\Collection; | ||||
| use App\Entity\Source\GroupSourceInterface; | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
| 
 | ||||
| namespace App\Entity\Source\Attribut; | ||||
| namespace App\Entity\Attribut; | ||||
| 
 | ||||
| use Doctrine\Common\Collections\Collection; | ||||
| use App\Entity\Source\GroupSourceInterface; | ||||
							
								
								
									
										23
									
								
								application/src/Entity/Attribut/SourceCollectionAttribut.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								application/src/Entity/Attribut/SourceCollectionAttribut.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| <?php | ||||
| namespace App\Entity\Attribut; | ||||
|  | ||||
| use Doctrine\Common\Collections\Collection; | ||||
| use App\Entity\Source\SourceInterface; | ||||
|  | ||||
| trait SourceCollectionAttribut | ||||
| { | ||||
|     /** | ||||
|      * @param Collection|SourceInterface[] $collection | ||||
|      */ | ||||
|     public function setCollection(Collection $collection):void{ | ||||
|          | ||||
|     } | ||||
|      | ||||
|     /** | ||||
|      * @return Collection|SourceInterface[] | ||||
|      */ | ||||
|     public function getCollection():Collection{ | ||||
|          | ||||
|     } | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,18 @@ | ||||
| <?php | ||||
| namespace App\Entity\Attribut; | ||||
|  | ||||
| use Doctrine\Common\Collections\Collection; | ||||
| use App\Entity\Source\SourceInterface; | ||||
|  | ||||
| interface SourceCollectionAttributInterface | ||||
| { | ||||
|     /** | ||||
|      * @param Collection|SourceInterface[] $collection | ||||
|      */ | ||||
|     public function setCollection(Collection $collection):void; | ||||
|      | ||||
|     /** | ||||
|      * @return Collection|SourceInterface[] | ||||
|      */ | ||||
|     public function getCollection():Collection; | ||||
| } | ||||
| @@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping as ORM; | ||||
| use JMS\Serializer\Annotation\Exclude; | ||||
| use App\Entity\AbstractEntity; | ||||
| use Doctrine\Common\Collections\Collection; | ||||
| use App\Entity\Source\Attribut\GroupSourcesAttribut; | ||||
| use App\Entity\Attribut\GroupSourcesAttribut; | ||||
| use App\Entity\Meta\RelationInterface; | ||||
| use App\Entity\Attribut\RelationAttribut; | ||||
| use App\Entity\Meta\Relation; | ||||
| @@ -14,6 +14,7 @@ use App\Entity\Attribut\LawAttribut; | ||||
| use App\Entity\Meta\LawInterface; | ||||
| use App\Entity\Meta\Law; | ||||
| use Doctrine\Common\Collections\ArrayCollection; | ||||
| use App\Entity\Source\Collection\MemberCollectionSource; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
| @@ -41,7 +42,7 @@ abstract class AbstractSource extends AbstractEntity implements SourceInterface | ||||
|      * @todo Implement that just one table on database level is needed! | ||||
|      * @todo Rename table to use the right schema | ||||
|      * | ||||
|      * @var Collection|GroupSource[] | ||||
|      * @var Collection|MemberCollectionSource[] | ||||
|      * @ORM\ManyToMany(targetEntity="GroupSource",mappedBy="members") | ||||
|      */ | ||||
|     protected $groups; | ||||
|   | ||||
| @@ -0,0 +1,9 @@ | ||||
| <?php | ||||
| namespace App\Entity\Source\Collection; | ||||
|  | ||||
| use App\Entity\Source\AbstractSource; | ||||
|  | ||||
| class AbstractCollectionSource extends AbstractSource implements CollectionSourceInterface | ||||
| { | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,8 @@ | ||||
| <?php | ||||
| namespace App\Entity\Source\Collection; | ||||
|  | ||||
| use App\Entity\Source\SourceInterface; | ||||
|  | ||||
| interface CollectionSourceInterface extends SourceInterface | ||||
| {} | ||||
|  | ||||
| @@ -1,19 +1,17 @@ | ||||
| <?php | ||||
| 
 | ||||
| namespace App\Entity\Source; | ||||
| namespace App\Entity\Source\Collection; | ||||
| 
 | ||||
| use Doctrine\ORM\Mapping as ORM; | ||||
| use Doctrine\Common\Collections\Collection; | ||||
| use App\Entity\Attribut\MembersAttributInterface; | ||||
| use App\Entity\Attribut\MembersAttribut; | ||||
| use Doctrine\Common\Collections\ArrayCollection; | ||||
| 
 | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  * @ORM\Table(name="source_group") | ||||
|  * @ORM\Entity | ||||
|  */ | ||||
| final class GroupSource extends AbstractSource implements MembersAttributInterface | ||||
| final class MemberCollectionSource extends AbstractCollectionSource implements MemberCollectionSourceInterface | ||||
| { | ||||
|     use MembersAttribut; | ||||
| 
 | ||||
| @@ -0,0 +1,12 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Entity\Source\Collection; | ||||
|  | ||||
| use App\Entity\Attribut\MembersAttributInterface; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  */ | ||||
| interface MemberCollectionSourceInterface extends MembersAttributInterface,CollectionSourceInterface | ||||
| { | ||||
| } | ||||
| @@ -0,0 +1,17 @@ | ||||
| <?php | ||||
| namespace App\Entity\Source\Collection\Queue; | ||||
|  | ||||
| use App\Entity\Attribut\MembersAttributInterface; | ||||
| use App\Entity\Source\Collection\CollectionSourceInterface; | ||||
| use App\Entity\Source\SourceInterface; | ||||
|  | ||||
| /** | ||||
|  * @todo Implement integration test for two user accessing queue! Check if log works! | ||||
|  * @author kevinfrantz | ||||
|  */ | ||||
| interface QueueSourceInterface extends CollectionSourceInterface, MembersAttributInterface | ||||
| { | ||||
|     public function getPointerPosition():int; | ||||
|      | ||||
|     public function getNextElement():SourceInterface; | ||||
| } | ||||
| @@ -1,14 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Entity\Source; | ||||
|  | ||||
| use App\Entity\Attribut\MembersAttributInterface; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  * | ||||
|  * @todo Map the not jet mapped functions! | ||||
|  */ | ||||
| interface GroupSourceInterface extends MembersAttributInterface | ||||
| { | ||||
| } | ||||
| @@ -4,7 +4,7 @@ namespace App\Entity\Source; | ||||
|  | ||||
| use App\Entity\Attribut\IdAttributInterface; | ||||
| use App\Entity\EntityInterface; | ||||
| use App\Entity\Source\Attribut\GroupSourcesAttributInterface; | ||||
| use App\Entity\Attribut\GroupSourcesAttributInterface; | ||||
| use App\Entity\Attribut\LawAttributInterface; | ||||
| use App\Entity\Attribut\RelationAttributInterface; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user