/** * Creates a version of the current object and saves it. * * @param ConnectionInterface $con the connection to use * * @return ChildMenuItemI18nVersion A version object */ public function addVersion($con = null) { $this->enforceVersion = false; $version = new ChildMenuItemI18nVersion(); $version->setId($this->getId()); $version->setLocale($this->getLocale()); $version->setTitle($this->getTitle()); $version->setDescription($this->getDescription()); $version->setChapo($this->getChapo()); $version->setPostscriptum($this->getPostscriptum()); $version->setCreatedAt($this->getCreatedAt()); $version->setUpdatedAt($this->getUpdatedAt()); $version->setVersion($this->getVersion()); $version->setVersionCreatedAt($this->getVersionCreatedAt()); $version->setVersionCreatedBy($this->getVersionCreatedBy()); $version->setMenuItemI18n($this); $version->save($con); return $version; }