Created
May 29, 2017 15:57
-
-
Save thinkingmedia/5a288e32b95dc78b54b26c9f170e7e07 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
class RestCreateComponent extends RestComponent | |
{ | |
public $components = ['RestError']; | |
public function initialize(array $config) | |
{ | |
parent::initialize($config); | |
$con = $this->getController(); | |
$this->eventManager($con->eventManager()); | |
} | |
public function create() { | |
return $this->RestError->couldNotSave(); | |
} | |
} | |
class RestErrorComponent extends Component | |
{ | |
public function initialize(array $config) | |
{ | |
// this is never called | |
parent::initialize($config); | |
$con = $this->getController(); | |
$this->eventManager($con->eventManager()); | |
} | |
public function couldNotSave() { | |
return "stuff"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment