Rev 6 | Rev 13 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 6 | Rev 9 | ||
|---|---|---|---|
| Line 46... | Line 46... | ||
| 46 |    * @param array|Object $a
 | 
            46 |    * @param array|Object $a
 | 
          
| 47 |    * @return FeatureList
 | 
            47 |    * @return FeatureList
 | 
          
| 48 |    */
 | 
            48 |    */
 | 
          
| 49 | public function __construct($a)  | 
            49 | public function __construct($a)  | 
          
| 50 |   {
 | 
            50 |   {
 | 
          
| 51 | $aVars = get_class_vars(__CLASS__);  | 
            51 | $aVars = get_class_vars(get_class($this));  | 
          
| - | 52 | ||
| 52 | while ((list($key, $value) = each($aVars)))  | 
            53 | while ((list($key, $value) = each($aVars)))  | 
          
| 53 |     {
 | 
            54 |     {
 | 
          
| 54 | if (isset($a[$key]))  | 
            55 | if (isset($a[$key]))  | 
          
| 55 |       {
 | 
            56 |       {
 | 
          
| 56 | $this->$key = $a[$key];  | 
            57 | $this->$key = $a[$key];  | 
          
| Line 210... | Line 211... | ||
| 210 |    * @param array|Object $params
 | 
            211 |    * @param array|Object $params
 | 
          
| 211 |    * @return Feature
 | 
            212 |    * @return Feature
 | 
          
| 212 |    */
 | 
            213 |    */
 | 
          
| 213 | public function __construct($params = array())  | 
            214 | public function __construct($params = array())  | 
          
| 214 |   {
 | 
            215 |   {
 | 
          
| - | 216 | $aVars = get_class_vars(get_class($this));  | 
          |
| - | 217 | ||
| 215 | while ((list($key, $value) = each($params)))  | 
            218 | while ((list($key, $value) = each($aVars)))  | 
          
| 216 |     {
 | 
            219 |     {
 | 
          
| 217 | //      if ($key != 'versions')
 | 
            220 | if (isset($params[$key]))  | 
          
| 218 | //      {
 | 
            221 |       {
 | 
          
| 219 | if (property_exists(__CLASS__, $key))  | 
            - | |
| 220 |         {
 | 
            - | |
| 221 | $this->$key = $value;  | 
            222 | $this->$key = $params[$key];  | 
          
| 222 |         }
 | 
            - | |
| 223 | //      }
 | 
            - | |
| 224 | //      else
 | 
            - | |
| 225 | //      {
 | 
            - | |
| 226 | //        $o =& $this->$key;
 | 
            - | |
| 227 | //
 | 
            - | |
| 228 | //        while ((list($key2, $value2) = each($value)))
 | 
            - | |
| 229 | //        {
 | 
            - | |
| 230 | //          $o[$key2] = $value2;
 | 
            - | |
| 231 | //        }
 | 
            - | |
| 232 | //      }
 | 
            223 |       }
 | 
          
| 233 |     }
 | 
            224 |     }
 | 
          
| 234 |   }
 | 
            225 |   }
 | 
          
| 235 | 226 | ||
| 236 |   /**
 | 
            227 |   /**
 | 
          
| 237 |    * Returns <code>' class="safe"'</code> if the feature
 | 
            228 |    * Returns <code>' class="safe"'</code> if the feature
 |