2007-08-16 08:32:49 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Add extension that can be added to an object with Object::add_extension().
|
|
|
|
* For DataObject extensions, use DataObjectDecorator
|
2008-02-25 03:10:37 +01:00
|
|
|
*
|
|
|
|
* @package sapphire
|
|
|
|
* @subpackage core
|
2007-08-16 08:32:49 +02:00
|
|
|
*/
|
|
|
|
abstract class Extension extends Object {
|
2008-03-11 02:30:19 +01:00
|
|
|
/**
|
|
|
|
* This is used by extensions designed to be applied to controllers.
|
|
|
|
* It works the same way as {@link Controller::$allowed_actions}.
|
|
|
|
*/
|
|
|
|
public static $allowed_actions = null;
|
|
|
|
|
2007-08-16 08:32:49 +02:00
|
|
|
/**
|
|
|
|
* The DataObject that owns this decorator.
|
|
|
|
* @var DataObject
|
|
|
|
*/
|
|
|
|
protected $owner;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the owner of this decorator.
|
|
|
|
* @param DataObject $owner
|
|
|
|
*/
|
|
|
|
function setOwner(Object $owner) {
|
|
|
|
$this->owner = $owner;
|
|
|
|
}
|
2009-01-10 12:35:50 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the owner of this decorator
|
|
|
|
*
|
|
|
|
* @return Object
|
|
|
|
*/
|
|
|
|
public function getOwner() {
|
|
|
|
return $this->owner;
|
|
|
|
}
|
2007-08-16 08:32:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|