Added more documentation

This commit is contained in:
Abel Hoogeveen 2015-08-26 12:29:20 +02:00
parent d27af90a8f
commit 2ec5e8bafd
3 changed files with 69 additions and 2 deletions

View File

@ -2,18 +2,67 @@
namespace FuzeWorks;
/**
* Class Bus
*
* Every class in this framework does somehow extend this class. Because it rocks.
* This class offers a lot of pointers to important core classes, so every class can find other classes.
*
*/
abstract class Bus {
/**
* @var \FuzeWorks\Core
*/
protected $core;
/**
* @var \FuzeWorks\ModHolder
*/
public $mods;
/**
* @var \FuzeWorks\Router
*/
protected $router;
/**
* @var \FuzeWorks\Config
*/
protected $config;
/**
* @var \FuzeWorks\Logger
*/
protected $logger;
/**
* @var \FuzeWorks\Models
*/
protected $models;
/**
* @var \FuzeWorks\Layout
*/
protected $layout;
/**
* @var \FuzeWorks\Events
*/
protected $events;
/**
* @var \FuzeWorks\Modules
*/
protected $modules;
/**
* Create references to our core objects
*
* Because all of these variables are references, they are completely identical / always updated.
* Any class that extends the CoreAbstract class now has access to the whole core.
*
* @param \FuzeWorks\Core $core
*/
protected function __construct(&$core){
$this->core = &$core;
$this->mods = new ModHolder($this->core);
@ -29,7 +78,11 @@ abstract class Bus {
}
// Holds the mods in a seperate object besides the bus
/**
* An object class which holds modules so that other classes can access it.
* This is used so that all classes that somehow extend Bus can access modules
* using $this->mods->MOD_NAME;
*/
class ModHolder {
protected $core;
public function __construct(&$core) {

View File

@ -5,6 +5,6 @@ namespace FuzeWorks;
/**
* Abstract class Controller
*
* Abstract for a Controller data representation, loads the correct parent type
* At this point does nothing, can be extended in the future to allow special controller functions
*/
abstract class Controller extends Bus{}

View File

@ -2,14 +2,25 @@
namespace FuzeWorks;
/**
* Class Event
*
* A simple class for events. The only current purpose is to be able to cancel events, but it can be easily extended.
*/
class Event {
private $cancelled = false;
/**
* @return boolean True if the event is cancelled, false if the event is not cancelled
*/
public function isCancelled() {
return $this->cancelled;
}
/**
* @param boolean $cancelled True if the event is cancelled, false if the event is not cancelled
*/
public function setCancelled($cancelled) {
if ($cancelled == true){
$this->cancelled = true;
@ -19,6 +30,9 @@ class Event {
}
}
/**
* Simple event which will notify components of an event, but does not contain any data
*/
class NotifierEvent extends Event {}
?>