Changeset 1452 for trunk/src/main/php/net/stubbles/websites/variantmanager/types/stubRandomVariant.php
- Timestamp:
- 03/23/08 00:38:04 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
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 ?>
