mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 17:29:04 +00:00 
			
		
		
		
	Adde name source to user
This commit is contained in:
		| @@ -1,27 +1,24 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Entity\Attribut; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * @author kevinfrantz | ||||
|  *         | ||||
|  */ | ||||
| trait NameAttribut { | ||||
|      | ||||
| trait NameAttribut | ||||
| { | ||||
|     /** | ||||
|      *  | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $name; | ||||
|      | ||||
|  | ||||
|     public function setName(string $name): void | ||||
|     { | ||||
|         $this->name = $name; | ||||
|     } | ||||
|      | ||||
|  | ||||
|     public function getName(): string | ||||
|     { | ||||
|         return $this->name; | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,15 +1,13 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Entity\Attribut; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * @author kevinfrantz | ||||
|  *         | ||||
|  */ | ||||
| interface NameAttributInterface | ||||
| { | ||||
|     public function setName(string $name):void; | ||||
|      | ||||
|     public function getName():string; | ||||
| } | ||||
|     public function setName(string $name): void; | ||||
|  | ||||
|     public function getName(): string; | ||||
| } | ||||
|   | ||||
							
								
								
									
										26
									
								
								application/src/Entity/Attribut/NameSourceAttribut.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								application/src/Entity/Attribut/NameSourceAttribut.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Entity\Attribut; | ||||
|  | ||||
| use App\Entity\NameSourceInterface; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  */ | ||||
| trait NameSourceAttribut | ||||
| { | ||||
|     /** | ||||
|      * @var NameSourceInterface | ||||
|      */ | ||||
|     protected $nameSource; | ||||
|  | ||||
|     public function setNameSource(NameSourceInterface $nameSource): void | ||||
|     { | ||||
|         $this->nameSource = $nameSource; | ||||
|     } | ||||
|  | ||||
|     public function getNameSource(): NameSourceInterface | ||||
|     { | ||||
|         return $this->getNameSource(); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,15 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Entity\Attribut; | ||||
|  | ||||
| use App\Entity\NameSourceInterface; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  */ | ||||
| interface NameSourceAttributInterface | ||||
| { | ||||
|     public function setNameSource(NameSourceInterface $nameSource): void; | ||||
|  | ||||
|     public function getNameSource(): NameSourceInterface; | ||||
| } | ||||
| @@ -1,11 +1,11 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Entity; | ||||
|  | ||||
| use App\Entity\Attribut\NameAttribut; | ||||
| use Doctrine\ORM\Mapping as ORM; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * @author kevinfrantz | ||||
|  * @ORM\Table(name="source_name") | ||||
|  * @ORM\Entity(repositoryClass="App\Repository\NameSourceRepository") | ||||
| @@ -13,11 +13,17 @@ use Doctrine\ORM\Mapping as ORM; | ||||
| class NameSource extends AbstractSource implements NameSourceInterface | ||||
| { | ||||
|     use NameAttribut; | ||||
|      | ||||
|  | ||||
|     /** | ||||
|      * @ORM\Column(type="string",length=255) | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     protected $name; | ||||
| } | ||||
|  | ||||
|     public function __construct() | ||||
|     { | ||||
|         parent::__construct(); | ||||
|         $this->name = ''; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,14 +1,12 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Entity; | ||||
|  | ||||
| use App\Entity\Attribut\NameAttributInterface; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * @author kevinfrantz | ||||
|  *         | ||||
|  */ | ||||
| interface NameSourceInterface extends NameAttributInterface | ||||
| interface NameSourceInterface extends NameAttributInterface, SourceInterface | ||||
| { | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -4,6 +4,7 @@ namespace App\Entity; | ||||
|  | ||||
| use Doctrine\ORM\Mapping as ORM; | ||||
| use App\Entity\Attribut\UserAttribut; | ||||
| use App\Entity\Attribut\NameSourceAttribut; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
| @@ -12,13 +13,27 @@ use App\Entity\Attribut\UserAttribut; | ||||
|  */ | ||||
| class UserSource extends AbstractSource implements UserSourceInterface | ||||
| { | ||||
|     use UserAttribut; | ||||
|     use UserAttribut,NameSourceAttribut; | ||||
|  | ||||
|     /** | ||||
|      * @ORM\OneToOne(targetEntity="User") | ||||
|      * @ORM\OneToOne(targetEntity="User",cascade={"persist", "remove"}) | ||||
|      * @ORM\JoinColumn(name="user_id", referencedColumnName="id") | ||||
|      * | ||||
|      * @var User | ||||
|      */ | ||||
|     protected $user; | ||||
|  | ||||
|     /** | ||||
|      * @ORM\OneToOne(targetEntity="NameSource",cascade={"persist", "remove"}) | ||||
|      * @ORM\JoinColumn(name="name_id", referencedColumnName="id") | ||||
|      * | ||||
|      * @var NameSourceInterface | ||||
|      */ | ||||
|     protected $nameSource; | ||||
|  | ||||
|     public function __construct() | ||||
|     { | ||||
|         $this->nameSource = new NameSource(); | ||||
|         parent::__construct(); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -3,10 +3,11 @@ | ||||
| namespace App\Entity; | ||||
|  | ||||
| use App\Entity\Attribut\UserAttributInterface; | ||||
| use App\Entity\Attribut\NameSourceAttributInterface; | ||||
|  | ||||
| /** | ||||
|  * @author kevinfrantz | ||||
|  */ | ||||
| interface UserSourceInterface extends SourceInterface, UserAttributInterface | ||||
| interface UserSourceInterface extends SourceInterface, UserAttributInterface, NameSourceAttributInterface | ||||
| { | ||||
| } | ||||
|   | ||||
| @@ -1,12 +1,10 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Form; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * @author kevinfrantz | ||||
|  *         | ||||
|  */ | ||||
| class NameSourceType | ||||
| { | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,14 +1,12 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Form; | ||||
|  | ||||
| use Symfony\Component\Form\AbstractType; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * @author kevinfrantz | ||||
|  *         | ||||
|  */ | ||||
| class UserSourceType extends AbstractType | ||||
| { | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user