/**
  * Sets the properties of the current object to the value they had at a specific version
  *
  * @param ChildMenuItemVersion $version The version object to use
  * @param ConnectionInterface   $con the connection to use
  * @param array                 $loadedObjects objects that been loaded in a chain of populateFromVersion calls on referrer or fk objects.
  *
  * @return ChildMenuItem The current object (for fluent API support)
  */
 public function populateFromVersion($version, $con = null, &$loadedObjects = array())
 {
     $loadedObjects['ChildMenuItem'][$version->getId()][$version->getVersion()] = $this;
     $this->setId($version->getId());
     $this->setMenuId($version->getMenuId());
     $this->setVisible($version->getVisible());
     $this->setPosition($version->getPosition());
     $this->setTypobj($version->getTypobj());
     $this->setObjet($version->getObjet());
     $this->setCreatedAt($version->getCreatedAt());
     $this->setUpdatedAt($version->getUpdatedAt());
     $this->setVersion($version->getVersion());
     $this->setVersionCreatedAt($version->getVersionCreatedAt());
     $this->setVersionCreatedBy($version->getVersionCreatedBy());
     if ($fkValue = $version->getMenuId()) {
         if (isset($loadedObjects['ChildMenu']) && isset($loadedObjects['ChildMenu'][$fkValue]) && isset($loadedObjects['ChildMenu'][$fkValue][$version->getMenuIdVersion()])) {
             $related = $loadedObjects['ChildMenu'][$fkValue][$version->getMenuIdVersion()];
         } else {
             $related = new ChildMenu();
             $relatedVersion = ChildMenuVersionQuery::create()->filterById($fkValue)->filterByVersion($version->getMenuIdVersion())->findOne($con);
             $related->populateFromVersion($relatedVersion, $con, $loadedObjects);
             $related->setNew(false);
         }
         $this->setMenu($related);
     }
     return $this;
 }