Changeset 53

Show
Ignore:
Timestamp:
11/29/06 21:10:54 (2 years ago)
Author:
mikey
Message:

added possibility of dynamic types (proof of concept, more work has to be put into this if it gets approved)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/XJConf/DefinedTag.php

    r43 r53  
    266266    * 
    267267    * @param  TagDefinition  $tagDef 
     268    * @todo   in case of dynamic types the original type should not get lost  
     269    *         but used to check if the dynamic type is as well an instance of 
     270    *         the original type >>> forcing interfaces/inheritance 
    268271    */ 
    269272    public function setDefinition(TagDefinition $tagDef) 
    270273    { 
    271         $this->tagDef = $tagDef; 
     274        if ($this->hasAttribute('__type') == false) { 
     275            $this->tagDef = $tagDef; 
     276            return; 
     277        } 
     278         
     279        $clonedTagDef = clone $tagDef; 
     280        $this->tagDef = $clonedTagDef; 
     281        $this->tagDef->setType($this->getAttribute('__type')); 
    272282    } 
    273283 
  • trunk/examples/MyClass.php

    r41 r53  
    66 * @author  Frank Kleine <frank.kleine@schlund.de> 
    77 */ 
    8 require dirname(__FILE__) . '/MyInterface.php'; 
     8require_once dirname(__FILE__) . '/MyInterface.php'; 
    99/** 
    1010 * Class for example purposes.