function SetIndexWeights($weights) { assert(is_array($weights)); foreach ($weights as $index => $weight) { assert(is_string($index)); assert(is_int($weight)); } $this->_indexweights = $weights; }