This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface CRUDInterface extends CRUInterface, DeleteInterface | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserRepository implements CRUInterface | |
{ | |
public function insert($data) | |
{ | |
//acción insert en BD | |
} | |
public function update($data) | |
{ | |
//acción update en BD | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArticleRepository implements CRUInterface, DeleteInterface | |
{ | |
public function insert($data) | |
{ | |
//acción insert en BD | |
} | |
public function update($data) | |
{ | |
//acción update en BD | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interfaz DeleteInterface | |
{ | |
public function delete($data); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interfaz CRUInterface | |
{ | |
public function insert($data); | |
public function update($data); | |
public function findAll($data); | |
public function findById($data); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserRepository implements RepositoryInterface | |
{ | |
public function insert($data) | |
{ | |
//acción insert en BD | |
} | |
public function update($data) | |
{ | |
//acción update en BD | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArticleRepository implements RepositoryInterface | |
{ | |
public function insert($data) | |
{ | |
//acción insert en BD | |
} | |
public function update($data) | |
{ | |
//acción update en BD | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interfaz RepositoryInterface | |
{ | |
public function insert($data); | |
public function update($data); | |
public function delete($data); | |
public function findAll($data); | |
public function findById($data); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$welcomeUser = new Application("Juan Luis"); | |
//Bienvenid@ Juan Luis | |
echo $welcomeUser->getWelcome(new SpanishHello()); | |
//Wellcome Juan Luis | |
echo $welcomeUser->getWelcome(new EnglishHello()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Application | |
{ | |
protected $name; | |
public function __construct($name) | |
{ | |
$this->name = $name; | |
} | |
public function welcome(WelcomeInterface $wellcome) | |
{ |