Pony.fm/app/models/Commands/CommandBase.php
2013-07-25 16:33:12 -05:00

29 lines
No EOL
479 B
PHP

<?php
namespace Commands;
abstract class CommandBase {
private $_listeners = array();
public function listen($listener) {
$this->_listeners[] = $listener;
}
protected function notify($message, $progress) {
foreach ($this->_listeners as $listener) {
$listener($message, $progress);
}
}
/**
* @return bool
*/
public function authorize() {
return true;
}
/**
* @return CommandResponse
*/
public abstract function execute();
}