Retrieves a version object for this entity and a version number

@param   integer $versionNumber The version number to read
@param   ConnectionInterface $con the connection to use

@return  ChildDealerVersion A version object
495370
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildDealerVersionQuery::create()
            ->filterByDealer($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
955498
public function countDealerAdminVersions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerAdminVersionsPartial && !$this->isNew();
        if (null === $this->collDealerAdminVersions || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerAdminVersions) {
                return 0;
            }

            if ($partial && !$criteria) {
                return count($this->getDealerAdminVersions());
            }

            $query = ChildDealerAdminVersionQuery::create(null, $criteria);
            if ($distinct) {
                $query->distinct();
            }

            return $query
                ->filterByDealerAdmin($this)
                ->count($con);
        }

        return count($this->collDealerAdminVersions);
    }
419911
public function addVersion($con = null)
    {
        $this->enforceVersion = false;

        $version = new ChildDealerContactVersion();
        $version->setId($this->getId());
        $version->setDealerId($this->getDealerId());
        $version->setIsDefault($this->getIsDefault());
        $version->setCreatedAt($this->getCreatedAt());
        $version->setUpdatedAt($this->getUpdatedAt());
        $version->setVersion($this->getVersion());
        $version->setVersionCreatedAt($this->getVersionCreatedAt());
        $version->setVersionCreatedBy($this->getVersionCreatedBy());
        $version->setDealerContact($this);
        if (($related = $this->getDealer($con)) && $related->getVersion()) {
            $version->setDealerIdVersion($related->getVersion());
        }
        if ($relateds = $this->getDealerContactInfos($con)->toKeyValue('Id', 'Version')) {
            $version->setDealerContactInfoIds(array_keys($relateds));
            $version->setDealerContactInfoVersions(array_values($relateds));
        }
        $version->save($con);

        return $version;
    }
1358825
public function getDealerContactInfo(ConnectionInterface $con = null)
    {
        if ($this->aDealerContactInfo === null && ($this->id !== null)) {
            $this->aDealerContactInfo = ChildDealerContactInfoQuery::create()->findPk($this->id, $con);
            /* The following can be used additionally to
                guarantee the related object contains a reference
                to this object.  This level of coupling may, however, be
                undesirable since it could result in an only partially populated collection
                in the referenced object.
                $this->aDealerContactInfo->addDealerContactInfoVersions($this);
             */
        }

        return $this->aDealerContactInfo;
    }
937769
public function getAllVersions($con = null)
    {
        $criteria = new Criteria();
        $criteria->addAscendingOrderByColumn(DealerVersionTableMap::VERSION);

        return $this->getDealerVersions($criteria, $con);
    }
1285381
public function getLastVersions($number = 10, $criteria = null, $con = null)
    {
        $criteria = ChildDealerFolderVersionQuery::create(null, $criteria);
        $criteria->addDescendingOrderByColumn(DealerFolderVersionTableMap::VERSION);
        $criteria->limit($number);

        return $this->getDealerFolderVersions($criteria, $con);
    }
1328182
public function rollbackToVersion($versionNumber): Template
    {
        $versionNumber = $versionNumber instanceof VersionNumber
            ? $versionNumber
            : VersionNumber::fromValue($versionNumber);

        $response = $this->client->rollbackToVersion($versionNumber);

        return Template::fromResponse($response);
    }
816385
public function getDealerFolder(ConnectionInterface $con = null)
    {
        if ($this->aDealerFolder === null && ($this->id !== null)) {
            $this->aDealerFolder = ChildDealerFolderQuery::create()->findPk($this->id, $con);
            /* The following can be used additionally to
                guarantee the related object contains a reference
                to this object.  This level of coupling may, however, be
                undesirable since it could result in an only partially populated collection
                in the referenced object.
                $this->aDealerFolder->addDealerFolderVersions($this);
             */
        }

        return $this->aDealerFolder;
    }
321013
public function updateVersion($contentId, $versionNumber, Request $request)
    {
        if (!$this->isUserContent($contentId)) {
            return parent::updateVersion($contentId, $versionNumber, $request);
        }

        $updatedUser = $this->repository->getUserService()->updateUser(
            $this->repository->getUserService()->loadUser($contentId),
            $this->mapRequestToUserUpdateStruct($request)
        );

        return $this->mapUserToVersion($updatedUser, $request);
    }
463106
public function getLastVersionNumber($con = null)
    {
        $v = ChildDealerAdminVersionQuery::create()
            ->filterByDealerAdmin($this)
            ->orderByVersion('desc')
            ->findOne($con);
        if (!$v) {
            return 0;
        }

        return $v->getVersion();
    }
1054141
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildIndexEngineIndexVersionQuery::create()
            ->filterByIndexEngineIndex($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
823023
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildDealerBrandVersionQuery::create()
            ->filterByDealerBrand($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
720261
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildDealerAdminVersionQuery::create()
            ->filterByDealerAdmin($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
672157
public function getVersionNumber() {
        if (!isset($this->versionNumber)) {
            if (!$this->isConnected())
                $this->connect();
            $this->versionNumber = $this->sqlite->version()['versionNumber'];
        }
        return $this->versionNumber;
    }
487026
public function insertVersion(VersionInfo $versionInfo, array $fields)
    {
        try {
            return $this->innerGateway->insertVersion($versionInfo, $fields);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
885988
public function getLastVersions($number = 10, $criteria = null, $con = null)
    {
        $criteria = ChildDealerContactVersionQuery::create(null, $criteria);
        $criteria->addDescendingOrderByColumn(DealerContactVersionTableMap::VERSION);
        $criteria->limit($number);

        return $this->getDealerContactVersions($criteria, $con);
    }
165327
public function publishVersion($contentId, $versionNumber)
    {
        if (!$this->isUserContent($contentId)) {
            parent::publishVersion($contentId, $versionNumber);
        }

        return new NoContent();
    }