public function getIndexByName($name) { foreach ($this->indices as $index) { if ($index->getName() == $name) { return $index; } } return null; }