Skip to content

Instantly share code, notes, and snippets.

@diguinhorocks
Created March 14, 2013 18:34
Show Gist options
  • Save diguinhorocks/5163964 to your computer and use it in GitHub Desktop.
Save diguinhorocks/5163964 to your computer and use it in GitHub Desktop.
<?php
class Extension implements IFacExtension
{
public function add()
{
}
public function read()
{
}
public function update($id)
{
}
public function remove($id)
{
}
}
<?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);
}
}
<?php
interface IFacExtension
{
public function add();
public function remove($id);
public function update($id);
public function read($id);
}
<?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