Pony.fm/app/models/Commands/CommandBase.php

29 lines
479 B
PHP
Raw Normal View History

2013-07-25 23:33:04 +02:00
<?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();
}