parent = $pParent; // Shape collection $this->shapeCollection = new \ArrayObject(); // Set identifier $this->identifier = \md5(\rand(0, 9999) . \time()); // Set Slide Layout if ($this->parent instanceof PhpPresentation) { $arrayMasterSlides = $this->parent->getAllMasterSlides(); $oMasterSlide = \reset($arrayMasterSlides); $arraySlideLayouts = $oMasterSlide->getAllSlideLayouts(); $oSlideLayout = \reset($arraySlideLayouts); $this->setSlideLayout($oSlideLayout); } // Set note $this->setNote(new Note()); } /** * Get slide layout. */ public function getSlideLayout(): ?SlideLayout { return $this->slideLayout; } /** * Set slide layout. */ public function setSlideLayout(SlideLayout $layout): self { $this->slideLayout = $layout; return $this; } /** * Get slide master id. * * @return int */ public function getSlideMasterId() { return $this->slideMasterId; } /** * Set slide master id. * * @param int $masterId * * @return \PhpOffice\PhpPresentation\Slide */ public function setSlideMasterId($masterId = 1) { $this->slideMasterId = $masterId; return $this; } /** * Copy slide (!= clone!). * * @return \PhpOffice\PhpPresentation\Slide */ public function copy() { $copied = clone $this; return $copied; } public function getNote(): Note { return $this->slideNote; } public function setNote(Note $note = null): self { $this->slideNote = (\is_null($note) ? new Note() : $note); $this->slideNote->setParent($this); return $this; } /** * Get the name of the slide. * * @return string */ public function getName(): ?string { return $this->name; } /** * Set the name of the slide. */ public function setName(?string $name = null): self { $this->name = $name; return $this; } /** * @return bool */ public function isVisible() { return $this->isVisible; } /** * @param bool $value * * @return Slide */ public function setIsVisible($value = true) { $this->isVisible = (bool) $value; return $this; } /** * Add an animation to the slide. * * @param \PhpOffice\PhpPresentation\Slide\Animation $animation * * @return Slide */ public function addAnimation($animation) { $this->animations[] = $animation; return $this; } /** * Get collection of animations. * * @return \PhpOffice\PhpPresentation\Slide\Animation[] */ public function getAnimations() { return $this->animations; } /** * Set collection of animations. * * @param \PhpOffice\PhpPresentation\Slide\Animation[] $array * * @return Slide */ public function setAnimations(array $array = []) { $this->animations = $array; return $this; } }