getIndex() публичный Метод

Get index for slide
public getIndex ( AbstractSlide $slide ) : integer
$slide PhpOffice\PhpPresentation\Slide\AbstractSlide
Результат integer
 /**
  * Test create new instance
  */
 public function testConstruct()
 {
     $object = new PhpPresentation();
     $slide = $object->getSlide();
     $this->assertEquals(new DocumentProperties(), $object->getDocumentProperties());
     $this->assertEquals(new DocumentLayout(), $object->getLayout());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->getSlide());
     $this->assertEquals(1, count($object->getAllSlides()));
     $this->assertEquals(0, $object->getIndex($slide));
     $this->assertEquals(1, $object->getSlideCount());
     $this->assertEquals(0, $object->getActiveSlideIndex());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Iterator', $object->getSlideIterator());
 }
Пример #2
0
 /**
  * Re-bind parent
  *
  * @param  \PhpOffice\PhpPresentation\PhpPresentation       $parent
  * @return \PhpOffice\PhpPresentation\Slide
  */
 public function rebindParent(PhpPresentation $parent)
 {
     $this->parent->removeSlideByIndex($this->parent->getIndex($this));
     $this->parent = $parent;
     return $this;
 }