public function findIndexByID($id) { foreach ($this as $index => $view) { if ($view->getID(false) === $id) { return $index; } } return -1; }