PhpOffice\PhpPresentation\PhpPresentation::copy PHP Method

copy() public method

Copy presentation (!= clone!)
public copy ( ) : PhpPresentation
return PhpPresentation
    public function copy()
    {
        $copied = clone $this;
        $slideCount = count($this->slideCollection);
        for ($i = 0; $i < $slideCount; ++$i) {
            $this->slideCollection[$i] = $this->slideCollection[$i]->copy();
            $this->slideCollection[$i]->rebindParent($this);
        }
        return $copied;
    }

Usage Example

 /**
  * Test copy presentation
  */
 public function testCopy()
 {
     $object = new PhpPresentation();
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->copy());
 }