Last active
October 9, 2015 04:58
-
-
Save weburnit/f2049878190f73d91019 to your computer and use it in GitHub Desktop.
Delegation
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 OfficeDelegation implement BackupPowerDelegateInteface, PrinterDelegateInterface | |
{ | |
public function duringOfficeLogic() | |
{ | |
if($this->powerIsOff()){ | |
$backupPower = new BackupPowerHandler(); | |
$backupPower->setDelegate($this); | |
} | |
} | |
public function successTurnonPowerBackup() | |
{ | |
$this->turnOnPrinter(); | |
} | |
/** | |
* Implement delegation handler for BackupPowerDelegateInteface | |
*/ | |
public function errorTurnonPowerBackup() | |
{ | |
//Doing something on failure | |
} | |
/** | |
* Implement delegation handler for BackupPowerDelegateInteface | |
* @var DocumentInterface[] | |
*/ | |
public function finishedPrintDocuments($documents) | |
{ | |
//Doing something on failure | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment