/** * Creates a version of the current object and saves it. * * @param ConnectionInterface $con the connection to use * * @return ChildProductVersion A version object */ public function addVersion($con = null) { $this->enforceVersion = false; $version = new ChildProductVersion(); $version->setId($this->getId()); $version->setTaxRuleId($this->getTaxRuleId()); $version->setRef($this->getRef()); $version->setVisible($this->getVisible()); $version->setPosition($this->getPosition()); $version->setTemplateId($this->getTemplateId()); $version->setBrandId($this->getBrandId()); $version->setVirtual($this->getVirtual()); $version->setCreatedAt($this->getCreatedAt()); $version->setUpdatedAt($this->getUpdatedAt()); $version->setVersion($this->getVersion()); $version->setVersionCreatedAt($this->getVersionCreatedAt()); $version->setVersionCreatedBy($this->getVersionCreatedBy()); $version->setProduct($this); $version->save($con); return $version; }