Gets all the versions of this object, in incremental order

@param   ConnectionInterface $con the connection to use

@return  ObjectCollection A list of ChildDealerProductVersion objects
340087
public function getAllVersions($con = null)
    {
        $criteria = new Criteria();
        $criteria->addAscendingOrderByColumn(DealerProductVersionTableMap::VERSION);

        return $this->getDealerProductVersions($criteria, $con);
    }
957534
public function getLastVersionNumber($con = null)
    {
        $v = ChildDealerShedulesVersionQuery::create()
            ->filterByDealerShedules($this)
            ->orderByVersion('desc')
            ->findOne($con);
        if (!$v) {
            return 0;
        }

        return $v->getVersion();
    }
646498
public function getObject(ConnectionInterface $con = null)
    {
        if ($this->aObject === null && ($this->object_id !== null)) {
            $this->aObject = ChildObjectQuery::create()->findPk($this->object_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->aObject->addSkills($this);
             */
        }

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

        $version = new ChildDealerProductVersion();
        $version->setId($this->getId());
        $version->setDealerId($this->getDealerId());
        $version->setProductId($this->getProductId());
        $version->setCreatedAt($this->getCreatedAt());
        $version->setUpdatedAt($this->getUpdatedAt());
        $version->setVersion($this->getVersion());
        $version->setVersionCreatedAt($this->getVersionCreatedAt());
        $version->setVersionCreatedBy($this->getVersionCreatedBy());
        $version->setDealerProduct($this);
        if (($related = $this->getDealer($con)) && $related->getVersion()) {
            $version->setDealerIdVersion($related->getVersion());
        }
        if (($related = $this->getProduct($con)) && $related->getVersion()) {
            $version->setProductIdVersion($related->getVersion());
        }
        $version->save($con);

        return $version;
    }
682922
public function getLastVersionNumber($con = null)
    {
        $v = ChildSkillVersionQuery::create()
            ->filterBySkill($this)
            ->orderByVersion('desc')
            ->findOne($con);
        if (!$v) {
            return 0;
        }

        return $v->getVersion();
    }
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;
    }
787574
public function getDealerBrand(ConnectionInterface $con = null)
    {
        if ($this->aDealerBrand === null && ($this->id !== null)) {
            $this->aDealerBrand = ChildDealerBrandQuery::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->aDealerBrand->addDealerBrandVersions($this);
             */
        }

        return $this->aDealerBrand;
    }
1183467
public function getProduct(ConnectionInterface $con = null)
    {
        if ($this->aProduct === null && ($this->product_id !== null)) {
            $this->aProduct = ProductQuery::create()->findPk($this->product_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->aProduct->addDealerProducts($this);
             */
        }

        return $this->aProduct;
    }
1179412
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildDealerFolderVersionQuery::create()
            ->filterByDealerFolder($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
217873
public function getCustomer(ConnectionInterface $con = null)
    {
        if ($this->aCustomer === null && ($this->customer_id !== null)) {
            $this->aCustomer = CustomerQuery::create()->findPk($this->customer_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->aCustomer->addCustomerCustomerGroups($this);
             */
        }

        return $this->aCustomer;
    }
91195
public function getSmartyFilter(ConnectionInterface $con = null)
    {
        if ($this->aSmartyFilter === null && ($this->id !== null)) {
            $this->aSmartyFilter = ChildSmartyFilterQuery::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->aSmartyFilter->addSmartyFilterI18ns($this);
             */
        }

        return $this->aSmartyFilter;
    }
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);
    }
1325122
public function getDealerShedules(ConnectionInterface $con = null)
    {
        if ($this->aDealerShedules === null && ($this->id !== null)) {
            $this->aDealerShedules = ChildDealerShedulesQuery::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->aDealerShedules->addDealerShedulesVersions($this);
             */
        }

        return $this->aDealerShedules;
    }
821382
protected function doUpdate(ConnectionInterface $con)
    {
        $selectCriteria = $this->buildPkeyCriteria();
        $valuesCriteria = $this->buildCriteria();

        return $selectCriteria->doUpdate($valuesCriteria, $con);
    }
1063795
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;


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

        $sql = sprintf(
            'INSERT INTO dealer_admin_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 'DEALER_ID':
                        $stmt->bindValue($identifier, $this->dealer_id, PDO::PARAM_INT);
                        break;
                    case 'ADMIN_ID':
                        $stmt->bindValue($identifier, $this->admin_id, PDO::PARAM_INT);
                        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 'DEALER_ID_VERSION':
                        $stmt->bindValue($identifier, $this->dealer_id_version, PDO::PARAM_INT);
                        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);
    }
696512
public function getAllVersions($con = null)
    {
        $criteria = new Criteria();
        $criteria->addAscendingOrderByColumn(DealerContactVersionTableMap::VERSION);

        return $this->getDealerContactVersions($criteria, $con);
    }
32440
public function getDealerAdmin(ConnectionInterface $con = null)
    {
        if ($this->aDealerAdmin === null && ($this->id !== null)) {
            $this->aDealerAdmin = ChildDealerAdminQuery::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->aDealerAdmin->addDealerAdminVersions($this);
             */
        }

        return $this->aDealerAdmin;
    }