public function setIndex($index) { if ($index instanceof Index) { $index = $index->getName(); } return $this->setParam('_index', $index); }