From e4999b25052d1ad9400a0f9fd5289a49eea1bddc Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 25 Jan 2015 20:04:57 +0100 Subject: More namespace changes Changed version to 3.2.99; Attempt at fixing autoloading fixed enough namespaces to have some demos running --- framework/Util/IDynamicMethods.php | 29 +++++++++ framework/Util/IInstanceCheck.php | 40 ++++++++++++ framework/Util/TClassBehaviorEventParameter.php | 82 +++++++++++++++++++++++++ framework/Util/TRpcClientTypesEnumerable.php | 2 +- 4 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 framework/Util/IDynamicMethods.php create mode 100644 framework/Util/IInstanceCheck.php create mode 100644 framework/Util/TClassBehaviorEventParameter.php (limited to 'framework/Util') diff --git a/framework/Util/IDynamicMethods.php b/framework/Util/IDynamicMethods.php new file mode 100644 index 00000000..1bff167f --- /dev/null +++ b/framework/Util/IDynamicMethods.php @@ -0,0 +1,29 @@ + + * + * Global Events, intra-object events, Class behaviors, expanded behaviors + * @author Brad Anderson + * + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package Prado\Util + */ + +namespace Prado\Util; + +/** + * IDynamicMethods interface. + * IDynamicMethods marks an object to receive undefined global or dynamic events. + * + * @author Brad Anderson + * @package Prado\Util + * @since 3.2.3 + */ +interface IDynamicMethods +{ + public function __dycall($method,$args); +} \ No newline at end of file diff --git a/framework/Util/IInstanceCheck.php b/framework/Util/IInstanceCheck.php new file mode 100644 index 00000000..76c91f7f --- /dev/null +++ b/framework/Util/IInstanceCheck.php @@ -0,0 +1,40 @@ + + * + * Global Events, intra-object events, Class behaviors, expanded behaviors + * @author Brad Anderson + * + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package Prado\Util + */ + +namespace Prado\Util; + +/** + * IInstanceCheck This interface allows objects to determine their own + * 'instanceof' results when {@link TComponent::isa} is called. This is + * important with behaviors because behaviors may want to look like + * particular objects other than themselves. + * + * @author Brad Anderson + * @package Prado\Util + * @since 3.2.3 + */ +interface IInstanceCheck { + /** + * The method checks $this or, if needed, the parameter $instance is of type + * class. In the case of a Class Behavior, the instance to which the behavior + * is attached may be important to determine if $this is an instance + * of a particular class. + * @param class|string the component that this behavior is checking if it is an instanceof. + * @param object the object which the behavior is attached to. default: null + * @return boolean|null if the this or the instance is of type class. When null, no information could be derived and + * the default mechanisms take over. + */ + public function isinstanceof($class,$instance=null); +} \ No newline at end of file diff --git a/framework/Util/TClassBehaviorEventParameter.php b/framework/Util/TClassBehaviorEventParameter.php new file mode 100644 index 00000000..1f6f17cc --- /dev/null +++ b/framework/Util/TClassBehaviorEventParameter.php @@ -0,0 +1,82 @@ + + * + * Global Events, intra-object events, Class behaviors, expanded behaviors + * @author Brad Anderson + * + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package Prado\Util + */ + +namespace Prado\Util; + +/** + * TClassBehaviorEventParameter class. + * TClassBehaviorEventParameter is the parameter sent with the class behavior changes. + * + * @author Brad Anderson + * @package Prado\Util + * @since 3.2.3 + */ +class TClassBehaviorEventParameter extends \Prado\TEventParameter +{ + private $_class; + private $_name; + private $_behavior; + private $_priority; + + /** + * Holds the parameters for the Class Behavior Events + * @param string $class this is the class to get the behavior + * @param string $name the name of the behavior + * @param object $behavior this is the behavior to implement the class behavior + */ + public function __construct($class,$name,$behavior,$priority) + { + $this->_class=$class; + $this->_name=$name; + $this->_behavior=$behavior; + $this->_priority=$priority; + } + + /** + * This is the class to get the behavior + * @return string the class to get the behavior + */ + public function getClass() + { + return $this->_class; + } + + /** + * name of the behavior + * @return string the name to get the behavior + */ + public function getName() + { + return $this->_name; + } + + /** + * This is the behavior which the class is to get + * @return object the behavior to implement + */ + public function getBehavior() + { + return $this->_behavior; + } + + /** + * This is the priority which the behavior is to get + * @return numeric the priority of the behavior + */ + public function getPriority() + { + return $this->_priority; + } +} \ No newline at end of file diff --git a/framework/Util/TRpcClientTypesEnumerable.php b/framework/Util/TRpcClientTypesEnumerable.php index 75852a8c..1a229090 100644 --- a/framework/Util/TRpcClientTypesEnumerable.php +++ b/framework/Util/TRpcClientTypesEnumerable.php @@ -18,7 +18,7 @@ namespace Prado\Util; * @since 3.2 */ -class TRpcClientTypesEnumerable extends TEnumerable +class TRpcClientTypesEnumerable extends \Prado\TEnumerable { const JSON = 'TJsonRpcClient'; const XML = 'TXmlRpcClient'; -- cgit v1.2.3