Skip to content
Snippets Groups Projects
Commit b3b8d0cf authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Extraction d'une interface SourceInterface.

parent 40fe4ced
No related branches found
No related tags found
No related merge requests found
...@@ -2,19 +2,17 @@ ...@@ -2,19 +2,17 @@
namespace UnicaenImport\Entity\Db\Interfaces; namespace UnicaenImport\Entity\Db\Interfaces;
use UnicaenImport\Entity\Db\Source;
/** /**
* Interface des entités possédant une gestion de l'import. * Interface des entités possédant une gestion de l'import.
* *
* @see Source * @see SourceInterface
*/ */
interface ImportAwareInterface interface ImportAwareInterface
{ {
public function setSource(Source $source = null); public function setSource(SourceInterface $source = null);
/** /**
* @return Source * @return SourceInterface
*/ */
public function getSource(); public function getSource();
......
...@@ -12,13 +12,13 @@ use UnicaenImport\Entity\Db\Source; ...@@ -12,13 +12,13 @@ use UnicaenImport\Entity\Db\Source;
interface SourceAwareInterface interface SourceAwareInterface
{ {
/** /**
* @param Source $source * @param SourceInterface $source
* @return $this * @return self
*/ */
public function setSource(Source $source = null); public function setSource(SourceInterface $source = null);
/** /**
* @return Source * @return SourceInterface
*/ */
public function getSource(); 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 @@ ...@@ -3,6 +3,7 @@
namespace UnicaenImport\Entity\Db; namespace UnicaenImport\Entity\Db;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use UnicaenImport\Entity\Db\Interfaces\SourceInterface;
/** /**
* Source * Source
...@@ -10,7 +11,7 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -10,7 +11,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Entity * @ORM\Entity
* @ORM\Table(name="SOURCE") * @ORM\Table(name="SOURCE")
*/ */
class Source class Source implements SourceInterface
{ {
/** /**
* @var string * @var string
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
namespace UnicaenImport\Entity\Db\Traits; namespace UnicaenImport\Entity\Db\Traits;
use UnicaenImport\Entity\Db\Source; use UnicaenImport\Entity\Db\Interfaces\SourceInterface;
trait SourceAwareTrait trait SourceAwareTrait
{ {
/** /**
* @var Source * @var SourceInterface
*/ */
protected $source; protected $source;
/** /**
* @param Source $source * @param SourceInterface $source
* @return self * @return self
*/ */
public function setSource(Source $source = null) public function setSource(SourceInterface $source = null)
{ {
$this->source = $source; $this->source = $source;
...@@ -23,7 +23,7 @@ trait SourceAwareTrait ...@@ -23,7 +23,7 @@ trait SourceAwareTrait
} }
/** /**
* @return Source * @return SourceInterface
*/ */
public function getSource() public function getSource()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment