public function addIndex(CNabuDataObjectListIndex $index)
    {
        $name = $index->getName();

        if (is_array($this->secondary_indexes)) {
            $this->secondary_indexes[$name] = $index;
        } else {
            $this->secondary_indexes = array($name => $index);
        }

        return $index;
    }