Created
March 14, 2013 18:34
-
-
Save diguinhorocks/5163964 to your computer and use it in GitHub Desktop.
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
<?php | |
class Extension implements IFacExtension | |
{ | |
public function add() | |
{ | |
} | |
public function read() | |
{ | |
} | |
public function update($id) | |
{ | |
} | |
public function remove($id) | |
{ | |
} | |
} |
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
<?php | |
class FacExtension | |
{ | |
public $extension = null; | |
public function __construct(IFacExtension $extension) | |
{ | |
$this->extension = $extension; | |
} | |
public function add() | |
{ | |
return $this->extension->add(); | |
} | |
public function read($id) | |
{ | |
return $this->extension->read($id); | |
} | |
public function update($id) | |
{ | |
return $this->extension->update($id); | |
} | |
public function remove($id) | |
{ | |
return $this->extension->remove($id); | |
} | |
} |
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
<?php | |
interface IFacExtension | |
{ | |
public function add(); | |
public function remove($id); | |
public function update($id); | |
public function read($id); | |
} |
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
<?php | |
include('IFacExtension.php'); | |
include_once('FacExtension.php'); | |
include_once('Extension.php'); | |
$facext = new FacExtension(new Extension()); | |
if ($facext->add()) { | |
echo 'Saved'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment