summaryrefslogtreecommitdiff
path: root/framework/TComponent.php
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-06-20 14:26:39 +0000
committerctrlaltca@gmail.com <>2011-06-20 14:26:39 +0000
commitd4b19712c271c3bf9d16909768c4bd84d617afd5 (patch)
tree103fb4f57818c7eaf2a9591d237299ea146196fd /framework/TComponent.php
parenta57ead00a69cd5240dd7549fa3a7da8d4e717749 (diff)
killed the experimental activecontrols implementation backported from yii
Diffstat (limited to 'framework/TComponent.php')
-rw-r--r--framework/TComponent.php133
1 files changed, 0 insertions, 133 deletions
diff --git a/framework/TComponent.php b/framework/TComponent.php
index ece83636..b29302ec 100644
--- a/framework/TComponent.php
+++ b/framework/TComponent.php
@@ -79,11 +79,6 @@ class TComponent
private $_e=array();
/**
- * @var array models (ported from Yii)
- */
- private $_m=array();
-
- /**
* Returns a property value or an event handler list by property or event name.
* Do not call this method. This is a PHP magic method that we override
* to allow using the following syntax to read a property:
@@ -356,7 +351,6 @@ class TComponent
$method=substr($handler,$pos+1);
if(method_exists($object,$method))
$object->$method($sender,$param);
-
else
throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name,$handler);
}
@@ -457,133 +451,6 @@ class TComponent
public function addParsedObject($object)
{
}
-
- /**
- * Returns the named behavior object.
- * The name 'asa' stands for 'as a'.
- * @param string the behavior name
- * @return IBehavior the behavior object, or null if the behavior does not exist
- */
- public function asa($behavior)
- {
- return isset($this->_m[$behavior]) ? $this->_m[$behavior] : null;
- }
-
- /**
- * Attaches a list of behaviors to the component.
- * Each behavior is indexed by its name and should be an instance of
- * {@link IBehavior}, a string specifying the behavior class, or an
- * array of the following structure:
- * <pre>
- * array(
- * 'class'=>'path.to.BehaviorClass',
- * 'property1'=>'value1',
- * 'property2'=>'value2',
- * )
- * </pre>
- * @param array list of behaviors to be attached to the component
- */
- public function attachBehaviors($behaviors)
- {
- foreach($behaviors as $name=>$behavior)
- $this->attachBehavior($name,$behavior);
- }
-
- /**
- * Detaches all behaviors from the component.
- */
- public function detachBehaviors()
- {
- if($this->_m!==null)
- {
- foreach($this->_m as $name=>$behavior)
- $this->detachBehavior($name);
- $this->_m=null;
- }
- }
-
- /**
- * Attaches a behavior to this component.
- * This method will create the behavior object based on the given
- * configuration. After that, the behavior object will be initialized
- * by calling its {@link IBehavior::attach} method.
- * @param string the behavior's name. It should uniquely identify this behavior.
- * @param mixed the behavior configuration. This is passed as the first
- * parameter to {@link PradoBase::createComponent} to create the behavior object.
- * @return IBehavior the behavior object
- */
- public function attachBehavior($name,$behavior)
- {
- if(!($behavior instanceof IBehavior))
- $behavior=Prado::createComponent($behavior);
- $behavior->setEnabled(true);
- $behavior->attach($this);
- return $this->_m[$name]=$behavior;
- }
-
- /**
- * Detaches a behavior from the component.
- * The behavior's {@link IBehavior::detach} method will be invoked.
- * @param string the behavior's name. It uniquely identifies the behavior.
- * @return IBehavior the detached behavior. Null if the behavior does not exist.
- */
- public function detachBehavior($name)
- {
- if(isset($this->_m[$name]))
- {
- $this->_m[$name]->detach($this);
- $behavior=$this->_m[$name];
- unset($this->_m[$name]);
- return $behavior;
- }
- }
-
- /**
- * Enables all behaviors attached to this component.
- */
- public function enableBehaviors()
- {
- if($this->_m!==null)
- {
- foreach($this->_m as $behavior)
- $behavior->setEnabled(true);
- }
- }
-
- /**
- * Disables all behaviors attached to this component.
- */
- public function disableBehaviors()
- {
- if($this->_m!==null)
- {
- foreach($this->_m as $behavior)
- $behavior->setEnabled(false);
- }
- }
-
- /**
- * Enables an attached behavior.
- * A behavior is only effective when it is enabled.
- * A behavior is enabled when first attached.
- * @param string the behavior's name. It uniquely identifies the behavior.
- */
- public function enableBehavior($name)
- {
- if(isset($this->_m[$name]))
- $this->_m[$name]->setEnabled(true);
- }
-
- /**
- * Disables an attached behavior.
- * A behavior is only effective when it is enabled.
- * @param string the behavior's name. It uniquely identifies the behavior.
- */
- public function disableBehavior($name)
- {
- if(isset($this->_m[$name]))
- $this->_m[$name]->setEnabled(false);
- }
}
/**