/** * Get index for slide * * @param \PhpOffice\PhpPresentation\Slide\AbstractSlide $slide * @return int * @throws \Exception */ public function getIndex(Slide\AbstractSlide $slide) { $index = null; foreach ($this->slideCollection as $key => $value) { if ($value->getHashCode() == $slide->getHashCode()) { $index = $key; break; } } return $index; }