Changeset 1452
- Timestamp:
- 03/23/08 00:38:04 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/websites/variantmanager/types/stubAbstractVariant.php
r1301 r1452 287 287 288 288 /** 289 * return string representation of this variant290 *291 * @return string292 */293 public function __toString()294 {295 $return = '';296 foreach ($this->children as $child) {297 if (strlen($return) > 0) {298 $return .= ',';299 }300 301 $return .= $child->__toString();302 }303 304 return $this->name . '(' . $return . ')';305 }306 307 /**308 289 * template method to hook into __sleep() 309 290 * trunk/src/main/php/net/stubbles/websites/variantmanager/types/stubRandomVariant.php
r1281 r1452 1 1 <?php 2 2 /** 3 * RandomVariant 4 * 5 * Is chosen randomly based on the weight defined 6 * in the configuration. 3 * A variant chosen randomly based on the weight defined in the configuration. 7 4 * 8 5 * @author Niels Schelbach <niels@schlund.de> … … 14 11 stubClassLoader::load('net::stubbles::websites::variantmanager::types::stubAbstractVariant'); 15 12 /** 16 * RandomVariant 17 * 18 * Is chosen randomly based on the weight defined 19 * in the configuration. 13 * A variant chosen randomly based on the weight defined in the configuration. 20 14 * 21 15 * @package stubbles … … 29 23 * @var int 30 24 */ 31 private $weight = 0;25 private $weight = 0; 32 26 /** 33 27 * the choosen sibling 34 28 * 35 * @var array<st ubRandomVariant>29 * @var array<string,int> 36 30 */ 37 31 public static $random = array(); … … 147 141 return $siblings; 148 142 } 149 150 /**151 * return string representation of this variant152 *153 * @return string154 */155 public function __toString()156 {157 return $this->name . '(Random weight=' . $this->weight . ')';158 }159 143 } 160 144 ?>
