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  ChildSkillVersion A version object
547702
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildSkillVersionQuery::create()
            ->filterBySkill($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
798210
public function getPersonFunction(ConnectionInterface $con = null)
    {
        if ($this->aPersonFunction === null && ($this->id !== null)) {
            $this->aPersonFunction = ChildPersonFunctionQuery::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->aPersonFunction->addPersonFunctionI18ns($this);
             */
        }

        return $this->aPersonFunction;
    }
1173083
public function countDealerContentVersions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerContentVersionsPartial && !$this->isNew();
        if (null === $this->collDealerContentVersions || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerContentVersions) {
                return 0;
            }

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

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

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

        return count($this->collDealerContentVersions);
    }
877792
public function createVersionInfoForContent(Content $content, $versionNo, $userId)
    {
        $versionInfo = new VersionInfo();

        $versionInfo->contentInfo = $content->versionInfo->contentInfo;
        $versionInfo->versionNo = $versionNo;
        $versionInfo->creatorId = $userId;
        $versionInfo->status = VersionInfo::STATUS_DRAFT;
        $versionInfo->initialLanguageCode = $content->versionInfo->initialLanguageCode;
        $versionInfo->creationDate = time();
        $versionInfo->modificationDate = $versionInfo->creationDate;
        $versionInfo->names = is_object($content->versionInfo) ? $content->versionInfo->names : array();
        $versionInfo->languageCodes = $content->versionInfo->languageCodes;

        return $versionInfo;
    }
1170564
public function addVersion($con = null)
    {
        $this->enforceVersion = false;

        $version = new ChildDealerShedulesVersion();
        $version->setId($this->getId());
        $version->setDealerId($this->getDealerId());
        $version->setDay($this->getDay());
        $version->setBegin($this->getBegin());
        $version->setEnd($this->getEnd());
        $version->setClosed($this->getClosed());
        $version->setPeriodBegin($this->getPeriodBegin());
        $version->setPeriodEnd($this->getPeriodEnd());
        $version->setCreatedAt($this->getCreatedAt());
        $version->setUpdatedAt($this->getUpdatedAt());
        $version->setVersion($this->getVersion());
        $version->setVersionCreatedAt($this->getVersionCreatedAt());
        $version->setVersionCreatedBy($this->getVersionCreatedBy());
        $version->setDealerShedules($this);
        if (($related = $this->getDealer($con)) && $related->getVersion()) {
            $version->setDealerIdVersion($related->getVersion());
        }
        $version->save($con);

        return $version;
    }
772424
public function getKstruktur(ConnectionInterface $con = null)
    {

        if ($this->singleKstruktur === null && !$this->isNew()) {
            $this->singleKstruktur = ChildKstrukturQuery::create()->findPk($this->getPrimaryKey(), $con);
        }

        return $this->singleKstruktur;
    }
1232678
public function countDealerFolderVersions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
    {
        $partial = $this->collDealerFolderVersionsPartial && !$this->isNew();
        if (null === $this->collDealerFolderVersions || null !== $criteria || $partial) {
            if ($this->isNew() && null === $this->collDealerFolderVersions) {
                return 0;
            }

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

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

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

        return count($this->collDealerFolderVersions);
    }
314462
public function getIndexEngineIndex(ConnectionInterface $con = null)
    {
        if ($this->aIndexEngineIndex === null && ($this->id !== null)) {
            $this->aIndexEngineIndex = ChildIndexEngineIndexQuery::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->aIndexEngineIndex->addIndexEngineIndexVersions($this);
             */
        }

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

        return new NoContent();
    }
1328182
public function rollbackToVersion($versionNumber): Template
    {
        $versionNumber = $versionNumber instanceof VersionNumber
            ? $versionNumber
            : VersionNumber::fromValue($versionNumber);

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

        return Template::fromResponse($response);
    }
92431
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;


         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(PersonFunctionVersionTableMap::ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::CODE)) {
            $modifiedColumns[':p' . $index++]  = 'CODE';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'CREATED_AT';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'UPDATED_AT';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::VERSION)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::VERSION_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION_CREATED_AT';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::VERSION_CREATED_BY)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION_CREATED_BY';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::PERSON_FUNCTION_LINK_IDS)) {
            $modifiedColumns[':p' . $index++]  = 'PERSON_FUNCTION_LINK_IDS';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::PERSON_FUNCTION_LINK_VERSIONS)) {
            $modifiedColumns[':p' . $index++]  = 'PERSON_FUNCTION_LINK_VERSIONS';
        }

        $sql = sprintf(
            'INSERT INTO person_function_version (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'ID':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case 'CODE':
                        $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR);
                        break;
                    case 'CREATED_AT':
                        $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'UPDATED_AT':
                        $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'VERSION':
                        $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT);
                        break;
                    case 'VERSION_CREATED_AT':
                        $stmt->bindValue($identifier, $this->version_created_at ? $this->version_created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'VERSION_CREATED_BY':
                        $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR);
                        break;
                    case 'PERSON_FUNCTION_LINK_IDS':
                        $stmt->bindValue($identifier, $this->person_function_link_ids, PDO::PARAM_STR);
                        break;
                    case 'PERSON_FUNCTION_LINK_VERSIONS':
                        $stmt->bindValue($identifier, $this->person_function_link_versions, PDO::PARAM_STR);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
        }

        $this->setNew(false);
    }
1187081
public function addVersion($con = null)
    {
        $this->enforceVersion = false;

        $version = new ChildDealerContentVersion();
        $version->setId($this->getId());
        $version->setDealerId($this->getDealerId());
        $version->setContentId($this->getContentId());
        $version->setCreatedAt($this->getCreatedAt());
        $version->setUpdatedAt($this->getUpdatedAt());
        $version->setVersion($this->getVersion());
        $version->setVersionCreatedAt($this->getVersionCreatedAt());
        $version->setVersionCreatedBy($this->getVersionCreatedBy());
        $version->setDealerContent($this);
        if (($related = $this->getDealer($con)) && $related->getVersion()) {
            $version->setDealerIdVersion($related->getVersion());
        }
        if (($related = $this->getContent($con)) && $related->getVersion()) {
            $version->setContentIdVersion($related->getVersion());
        }
        $version->save($con);

        return $version;
    }
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);
    }
276275
public function getFunctionPhase(ConnectionInterface $con = null)
    {

        if ($this->singleFunctionPhase === null && !$this->isNew()) {
            $this->singleFunctionPhase = ChildFunctionPhaseQuery::create()->findPk($this->getPrimaryKey(), $con);
        }

        return $this->singleFunctionPhase;
    }
45848
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildDealerProductVersionQuery::create()
            ->filterByDealerProduct($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
956468
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildDealerContactInfoVersionQuery::create()
            ->filterByDealerContactInfo($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
696512
public function getAllVersions($con = null)
    {
        $criteria = new Criteria();
        $criteria->addAscendingOrderByColumn(DealerContactVersionTableMap::VERSION);

        return $this->getDealerContactVersions($criteria, $con);
    }