/** * Creates a version of the current object and saves it. * * @param ConnectionInterface $con the connection to use * * @return ChildMessageVersion A version object */ public function addVersion($con = null) { $this->enforceVersion = false; $version = new ChildMessageVersion(); $version->setId($this->getId()); $version->setName($this->getName()); $version->setSecured($this->getSecured()); $version->setTextLayoutFileName($this->getTextLayoutFileName()); $version->setTextTemplateFileName($this->getTextTemplateFileName()); $version->setHtmlLayoutFileName($this->getHtmlLayoutFileName()); $version->setHtmlTemplateFileName($this->getHtmlTemplateFileName()); $version->setCreatedAt($this->getCreatedAt()); $version->setUpdatedAt($this->getUpdatedAt()); $version->setVersion($this->getVersion()); $version->setVersionCreatedAt($this->getVersionCreatedAt()); $version->setVersionCreatedBy($this->getVersionCreatedBy()); $version->setMessage($this); $version->save($con); return $version; }