Commit b3b8d0cf authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Extraction d'une interface SourceInterface.

parent 40fe4ced
......@@ -2,19 +2,17 @@
namespace UnicaenImport\Entity\Db\Interfaces;
use UnicaenImport\Entity\Db\Source;
/**
* Interface des entités possédant une gestion de l'import.
*
* @see Source
* @see SourceInterface
*/
interface ImportAwareInterface
{
public function setSource(Source $source = null);
public function setSource(SourceInterface $source = null);
/**
* @return Source
* @return SourceInterface
*/
public function getSource();
......
......@@ -12,13 +12,13 @@ use UnicaenImport\Entity\Db\Source;
interface SourceAwareInterface
{
/**
* @param Source $source
* @return $this
* @param SourceInterface $source
* @return self
*/
public function setSource(Source $source = null);
public function setSource(SourceInterface $source = null);
/**
* @return Source
* @return SourceInterface
*/
public function getSource();
}
\ No newline at end of file
<?php
namespace UnicaenImport\Entity\Db\Interfaces;
/**
* SourceInterface
*/
interface SourceInterface
{
/**
* Set code
*
* @param string $code
* @return SourceInterface
*/
public function setCode($code);
/**
* Get code
*
* @return string
*/
public function getCode();
/**
* Set importable
*
* @param boolean $importable
* @return SourceInterface
*/
public function setImportable($importable);
/**
* Get importable
*
* @return boolean
*/
public function getImportable();
/**
* Set libelle
*
* @param string $libelle
* @return SourceInterface
*/
public function setLibelle($libelle);
/**
* Get libelle
*
* @return string
*/
public function getLibelle();
/**
* Get id
*
* @return integer
*/
public function getId();
/**
* Retourne la représentation littérale de cet objet.
*
* @return string
*/
public function __toString();
}
\ No newline at end of file
......@@ -3,6 +3,7 @@
namespace UnicaenImport\Entity\Db;
use Doctrine\ORM\Mapping as ORM;
use UnicaenImport\Entity\Db\Interfaces\SourceInterface;
/**
* Source
......@@ -10,7 +11,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Entity
* @ORM\Table(name="SOURCE")
*/
class Source
class Source implements SourceInterface
{
/**
* @var string
......
......@@ -2,20 +2,20 @@
namespace UnicaenImport\Entity\Db\Traits;
use UnicaenImport\Entity\Db\Source;
use UnicaenImport\Entity\Db\Interfaces\SourceInterface;
trait SourceAwareTrait
{
/**
* @var Source
* @var SourceInterface
*/
protected $source;
/**
* @param Source $source
* @param SourceInterface $source
* @return self
*/
public function setSource(Source $source = null)
public function setSource(SourceInterface $source = null)
{
$this->source = $source;
......@@ -23,7 +23,7 @@ trait SourceAwareTrait
}
/**
* @return Source
* @return SourceInterface
*/
public function getSource()
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment