mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 03:07:58 +00:00 
			
		
		
		
	Added Text source
This commit is contained in:
		
							
								
								
									
										21
									
								
								application/src/Entity/Attribut/TextAttribut.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								application/src/Entity/Attribut/TextAttribut.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
trait TextAttribut
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var string
 | 
			
		||||
     */
 | 
			
		||||
    protected $text;
 | 
			
		||||
 | 
			
		||||
    public function getText(): string
 | 
			
		||||
    {
 | 
			
		||||
        return $this->text;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setText(string $text): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->text = $text;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								application/src/Entity/Attribut/TextAttributInterface.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								application/src/Entity/Attribut/TextAttributInterface.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Entity\Attribut;
 | 
			
		||||
 | 
			
		||||
interface TextAttributInterface
 | 
			
		||||
{
 | 
			
		||||
    public function getText(): string;
 | 
			
		||||
 | 
			
		||||
    public function setText(string $text): void;
 | 
			
		||||
}
 | 
			
		||||
@@ -12,7 +12,7 @@ use App\Entity\Source\AbstractSource;
 | 
			
		||||
 * @ORM\Table(name="source_data")
 | 
			
		||||
 * @ORM\InheritanceType("JOINED")
 | 
			
		||||
 * @ORM\DiscriminatorColumn(name="discr", type="string")
 | 
			
		||||
 * @ORM\DiscriminatorMap({"name" = "App\Entity\Source\Primitive\Name\AbstractNameSource"})
 | 
			
		||||
 * @ORM\DiscriminatorMap({"name" = "App\Entity\Source\Primitive\Name\AbstractNameSource","text" = "App\Entity\Source\Primitive\Text\TextSource"})
 | 
			
		||||
 */
 | 
			
		||||
abstract class AbstractPrimitiveSource extends AbstractSource implements PrimitiveSourceInterface
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										23
									
								
								application/src/Entity/Source/Primitive/Text/TextSource.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								application/src/Entity/Source/Primitive/Text/TextSource.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Entity\Source\Primitive\Text;
 | 
			
		||||
 | 
			
		||||
use App\Entity\Source\Primitive\AbstractPrimitiveSource;
 | 
			
		||||
use App\Entity\Attribut\TextAttribut;
 | 
			
		||||
use Doctrine\ORM\Mapping as ORM;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 * @ORM\Entity
 | 
			
		||||
 */
 | 
			
		||||
class TextSource extends AbstractPrimitiveSource implements TextSourceInterface
 | 
			
		||||
{
 | 
			
		||||
    use TextAttribut;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @ORM\Column(type="string")
 | 
			
		||||
     *
 | 
			
		||||
     * @var string
 | 
			
		||||
     */
 | 
			
		||||
    protected $text;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,10 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Entity\Source\Primitive\Text;
 | 
			
		||||
 | 
			
		||||
use App\Entity\Source\Primitive\PrimitiveSourceInterface;
 | 
			
		||||
use App\Entity\Attribut\TextAttributInterface;
 | 
			
		||||
 | 
			
		||||
interface TextSourceInterface extends PrimitiveSourceInterface, TextAttributInterface
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user