/** * New instance * @param bool $setDefaultProperties initialize instance with default properties * @return PHPWord */ public function getInstance($setDefaultProperties = true) { $phpWord = new PHPWord(); if ($setDefaultProperties) { $phpWord->getDocInfo()->setCreator(ArrayHelper::getValue($this->properties, 'creator'))->setLastModifiedBy(ArrayHelper::getValue($this->properties, 'creator'))->setTitle(ArrayHelper::getValue($this->properties, 'title'))->setSubject(ArrayHelper::getValue($this->properties, 'subject'))->setDescription(ArrayHelper::getValue($this->properties, 'description'))->setKeywords(ArrayHelper::getValue($this->properties, 'keywords'))->setCategory(ArrayHelper::getValue($this->properties, 'category'))->setCompany(ArrayHelper::getValue($this->properties, 'company')); } return $phpWord; }