Split import export management in two
modifié: core/lib/Thelia/Config/Resources/config.xml modifié: core/lib/Thelia/Config/Resources/loop.xml modifié: core/lib/Thelia/Config/Resources/routing/admin.xml nouveau fichier: core/lib/Thelia/Controller/Admin/ImportExportController.php nouveau fichier: core/lib/Thelia/Core/Template/Loop/Export.php nouveau fichier: core/lib/Thelia/Core/Template/Loop/ExportCategory.php nouveau fichier: core/lib/Thelia/Core/Template/Loop/Import.php nouveau fichier: core/lib/Thelia/Core/Template/Loop/ImportCategory.php modifié: core/lib/Thelia/Core/Template/Loop/ImportExportCategory.php modifié: core/lib/Thelia/Core/Template/Loop/ImportExportType.php nouveau fichier: core/lib/Thelia/Model/Base/Export.php nouveau fichier: core/lib/Thelia/Model/Base/ExportCategory.php nouveau fichier: core/lib/Thelia/Model/Base/ExportCategoryI18n.php nouveau fichier: core/lib/Thelia/Model/Base/ExportCategoryI18nQuery.php nouveau fichier: core/lib/Thelia/Model/Base/ExportCategoryQuery.php nouveau fichier: core/lib/Thelia/Model/Base/ExportI18n.php nouveau fichier: core/lib/Thelia/Model/Base/ExportI18nQuery.php nouveau fichier: core/lib/Thelia/Model/Base/ExportQuery.php renommé: core/lib/Thelia/Model/Base/ImportExportType.php -> core/lib/Thelia/Model/Base/Import.php renommé: core/lib/Thelia/Model/Base/ImportExportCategory.php -> core/lib/Thelia/Model/Base/ImportCategory.php renommé: core/lib/Thelia/Model/Base/ImportExportCategoryI18n.php -> core/lib/Thelia/Model/Base/ImportCategoryI18n.php renommé: core/lib/Thelia/Model/Base/ImportExportCategoryI18nQuery.php -> core/lib/Thelia/Model/Base/ImportCategoryI18nQuery.php renommé: core/lib/Thelia/Model/Base/ImportExportCategoryQuery.php -> core/lib/Thelia/Model/Base/ImportCategoryQuery.php renommé: core/lib/Thelia/Model/Base/ImportExportTypeI18n.php -> core/lib/Thelia/Model/Base/ImportI18n.php renommé: core/lib/Thelia/Model/Base/ImportExportTypeI18nQuery.php -> core/lib/Thelia/Model/Base/ImportI18nQuery.php renommé: core/lib/Thelia/Model/Base/ImportExportTypeQuery.php -> core/lib/Thelia/Model/Base/ImportQuery.php nouveau fichier: core/lib/Thelia/Model/Export.php nouveau fichier: core/lib/Thelia/Model/ExportCategory.php nouveau fichier: core/lib/Thelia/Model/ExportCategoryI18n.php renommé: core/lib/Thelia/Model/ImportExportCategoryQuery.php -> core/lib/Thelia/Model/ExportCategoryI18nQuery.php renommé: core/lib/Thelia/Model/ImportExportTypeQuery.php -> core/lib/Thelia/Model/ExportCategoryQuery.php nouveau fichier: core/lib/Thelia/Model/ExportI18n.php renommé: core/lib/Thelia/Model/ImportExportTypeI18nQuery.php -> core/lib/Thelia/Model/ExportI18nQuery.php renommé: core/lib/Thelia/Model/ImportExportCategoryI18nQuery.php -> core/lib/Thelia/Model/ExportQuery.php nouveau fichier: core/lib/Thelia/Model/Import.php nouveau fichier: core/lib/Thelia/Model/ImportCategory.php nouveau fichier: core/lib/Thelia/Model/ImportCategoryI18n.php nouveau fichier: core/lib/Thelia/Model/ImportCategoryI18nQuery.php nouveau fichier: core/lib/Thelia/Model/ImportCategoryQuery.php supprimé: core/lib/Thelia/Model/ImportExportCategory.php supprimé: core/lib/Thelia/Model/ImportExportCategoryI18n.php supprimé: core/lib/Thelia/Model/ImportExportType.php supprimé: core/lib/Thelia/Model/ImportExportTypeI18n.php nouveau fichier: core/lib/Thelia/Model/ImportI18n.php nouveau fichier: core/lib/Thelia/Model/ImportI18nQuery.php nouveau fichier: core/lib/Thelia/Model/ImportQuery.php nouveau fichier: core/lib/Thelia/Model/Map/ExportCategoryI18nTableMap.php nouveau fichier: core/lib/Thelia/Model/Map/ExportCategoryTableMap.php nouveau fichier: core/lib/Thelia/Model/Map/ExportI18nTableMap.php nouveau fichier: core/lib/Thelia/Model/Map/ExportTableMap.php renommé: core/lib/Thelia/Model/Map/ImportExportCategoryI18nTableMap.php -> core/lib/Thelia/Model/Map/ImportCategoryI18nTableMap.php renommé: core/lib/Thelia/Model/Map/ImportExportCategoryTableMap.php -> core/lib/Thelia/Model/Map/ImportCategoryTableMap.php renommé: core/lib/Thelia/Model/Map/ImportExportTypeI18nTableMap.php -> core/lib/Thelia/Model/Map/ImportI18nTableMap.php renommé: core/lib/Thelia/Model/Map/ImportExportTypeTableMap.php -> core/lib/Thelia/Model/Map/ImportTableMap.php modifié: local/config/schema.xml modifié: setup/thelia.sql modifié: templates/backOffice/default/export.html
This commit is contained in:
474
core/lib/Thelia/Model/Map/ExportCategoryI18nTableMap.php
Normal file
474
core/lib/Thelia/Model/Map/ExportCategoryI18nTableMap.php
Normal file
@@ -0,0 +1,474 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\DataFetcher\DataFetcherInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ExportCategoryI18n;
|
||||
use Thelia\Model\ExportCategoryI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'export_category_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ExportCategoryI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ExportCategoryI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'export_category_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ExportCategoryI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ExportCategoryI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 3;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 3;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'export_category_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'export_category_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'export_category_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', ),
|
||||
self::TYPE_COLNAME => array(ExportCategoryI18nTableMap::ID, ExportCategoryI18nTableMap::LOCALE, ExportCategoryI18nTableMap::TITLE, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, ),
|
||||
self::TYPE_COLNAME => array(ExportCategoryI18nTableMap::ID => 0, ExportCategoryI18nTableMap::LOCALE => 1, ExportCategoryI18nTableMap::TITLE => 2, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('export_category_i18n');
|
||||
$this->setPhpName('ExportCategoryI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ExportCategoryI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'export_category', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', true, 255, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ExportCategory', '\\Thelia\\Model\\ExportCategory', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\ExportCategoryI18n $obj A \Thelia\Model\ExportCategoryI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (null === $key) {
|
||||
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\ExportCategoryI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ExportCategoryI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
// assume we've been passed a primary key";
|
||||
$key = serialize(array((string) $value[0], (string) $value[1]));
|
||||
} elseif ($value instanceof Criteria) {
|
||||
self::$instances = [];
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ExportCategoryI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ExportCategoryI18nTableMap::CLASS_DEFAULT : ExportCategoryI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ExportCategoryI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ExportCategoryI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ExportCategoryI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ExportCategoryI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ExportCategoryI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ExportCategoryI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ExportCategoryI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ExportCategoryI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ExportCategoryI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ExportCategoryI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ExportCategoryI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ExportCategoryI18nTableMap::TITLE);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ExportCategoryI18nTableMap::DATABASE_NAME)->getTable(ExportCategoryI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ExportCategoryI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ExportCategoryI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ExportCategoryI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ExportCategoryI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ExportCategoryI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ExportCategoryI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ExportCategoryI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ExportCategoryI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(ExportCategoryI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ExportCategoryI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = ExportCategoryI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ExportCategoryI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ExportCategoryI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the export_category_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ExportCategoryI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ExportCategoryI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ExportCategoryI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ExportCategoryI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ExportCategoryI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ExportCategoryI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ExportCategoryI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ExportCategoryI18nTableMap::buildTableMap();
|
||||
461
core/lib/Thelia/Model/Map/ExportCategoryTableMap.php
Normal file
461
core/lib/Thelia/Model/Map/ExportCategoryTableMap.php
Normal file
@@ -0,0 +1,461 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\DataFetcher\DataFetcherInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ExportCategory;
|
||||
use Thelia\Model\ExportCategoryQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'export_category' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ExportCategoryTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ExportCategoryTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'export_category';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ExportCategory';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ExportCategory';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 4;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 4;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'export_category.ID';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'export_category.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'export_category.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'export_category.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* The default locale to use for translations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_LOCALE = 'en_US';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ExportCategoryTableMap::ID, ExportCategoryTableMap::POSITION, ExportCategoryTableMap::CREATED_AT, ExportCategoryTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Position' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'position' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
|
||||
self::TYPE_COLNAME => array(ExportCategoryTableMap::ID => 0, ExportCategoryTableMap::POSITION => 1, ExportCategoryTableMap::CREATED_AT => 2, ExportCategoryTableMap::UPDATED_AT => 3, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'POSITION' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'position' => 1, 'created_at' => 2, 'updated_at' => 3, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('export_category');
|
||||
$this->setPhpName('ExportCategory');
|
||||
$this->setClassName('\\Thelia\\Model\\ExportCategory');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Export', '\\Thelia\\Model\\Export', RelationMap::ONE_TO_MANY, array('id' => 'export_category_id', ), 'CASCADE', 'RESTRICT', 'Exports');
|
||||
$this->addRelation('ExportCategoryI18n', '\\Thelia\\Model\\ExportCategoryI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ExportCategoryI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
|
||||
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to export_category * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ExportTableMap::clearInstancePool();
|
||||
ExportCategoryI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ExportCategoryTableMap::CLASS_DEFAULT : ExportCategoryTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ExportCategory object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ExportCategoryTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ExportCategoryTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ExportCategoryTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ExportCategoryTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ExportCategoryTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ExportCategoryTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ExportCategoryTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ExportCategoryTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ExportCategoryTableMap::ID);
|
||||
$criteria->addSelectColumn(ExportCategoryTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ExportCategoryTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ExportCategoryTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ExportCategoryTableMap::DATABASE_NAME)->getTable(ExportCategoryTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ExportCategoryTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ExportCategoryTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ExportCategoryTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ExportCategory or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ExportCategory object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ExportCategoryTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ExportCategory) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ExportCategoryTableMap::DATABASE_NAME);
|
||||
$criteria->add(ExportCategoryTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ExportCategoryQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ExportCategoryTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ExportCategoryTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the export_category table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ExportCategoryQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ExportCategory or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ExportCategory object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ExportCategoryTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ExportCategory object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ExportCategoryTableMap::ID) && $criteria->keyContainsValue(ExportCategoryTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ExportCategoryTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ExportCategoryQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ExportCategoryTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ExportCategoryTableMap::buildTableMap();
|
||||
482
core/lib/Thelia/Model/Map/ExportI18nTableMap.php
Normal file
482
core/lib/Thelia/Model/Map/ExportI18nTableMap.php
Normal file
@@ -0,0 +1,482 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\DataFetcher\DataFetcherInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ExportI18n;
|
||||
use Thelia\Model\ExportI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'export_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ExportI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ExportI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'export_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ExportI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ExportI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 4;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 4;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'export_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'export_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'export_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'export_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', ),
|
||||
self::TYPE_COLNAME => array(ExportI18nTableMap::ID, ExportI18nTableMap::LOCALE, ExportI18nTableMap::TITLE, ExportI18nTableMap::DESCRIPTION, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, ),
|
||||
self::TYPE_COLNAME => array(ExportI18nTableMap::ID => 0, ExportI18nTableMap::LOCALE => 1, ExportI18nTableMap::TITLE => 2, ExportI18nTableMap::DESCRIPTION => 3, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('export_i18n');
|
||||
$this->setPhpName('ExportI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ExportI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'export', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Export', '\\Thelia\\Model\\Export', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\ExportI18n $obj A \Thelia\Model\ExportI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (null === $key) {
|
||||
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\ExportI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ExportI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
// assume we've been passed a primary key";
|
||||
$key = serialize(array((string) $value[0], (string) $value[1]));
|
||||
} elseif ($value instanceof Criteria) {
|
||||
self::$instances = [];
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ExportI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ExportI18nTableMap::CLASS_DEFAULT : ExportI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ExportI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ExportI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ExportI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ExportI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ExportI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ExportI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ExportI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ExportI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ExportI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ExportI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ExportI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ExportI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ExportI18nTableMap::DESCRIPTION);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ExportI18nTableMap::DATABASE_NAME)->getTable(ExportI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ExportI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ExportI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ExportI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ExportI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ExportI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ExportI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ExportI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ExportI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(ExportI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ExportI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = ExportI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ExportI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ExportI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the export_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ExportI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ExportI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ExportI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ExportI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ExportI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ExportI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ExportI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ExportI18nTableMap::buildTableMap();
|
||||
468
core/lib/Thelia/Model/Map/ExportTableMap.php
Normal file
468
core/lib/Thelia/Model/Map/ExportTableMap.php
Normal file
@@ -0,0 +1,468 @@
|
||||
<?php
|
||||
|
||||
namespace Thelia\Model\Map;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\DataFetcher\DataFetcherInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\Export;
|
||||
use Thelia\Model\ExportQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'export' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ExportTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ExportTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'export';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\Export';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.Export';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 5;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 5;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'export.ID';
|
||||
|
||||
/**
|
||||
* the column name for the EXPORT_CATEGORY_ID field
|
||||
*/
|
||||
const EXPORT_CATEGORY_ID = 'export.EXPORT_CATEGORY_ID';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'export.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'export.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'export.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
// i18n behavior
|
||||
|
||||
/**
|
||||
* The default locale to use for translations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_LOCALE = 'en_US';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'ExportCategoryId', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'exportCategoryId', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ExportTableMap::ID, ExportTableMap::EXPORT_CATEGORY_ID, ExportTableMap::POSITION, ExportTableMap::CREATED_AT, ExportTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'EXPORT_CATEGORY_ID', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'export_category_id', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'ExportCategoryId' => 1, 'Position' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'exportCategoryId' => 1, 'position' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
|
||||
self::TYPE_COLNAME => array(ExportTableMap::ID => 0, ExportTableMap::EXPORT_CATEGORY_ID => 1, ExportTableMap::POSITION => 2, ExportTableMap::CREATED_AT => 3, ExportTableMap::UPDATED_AT => 4, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'EXPORT_CATEGORY_ID' => 1, 'POSITION' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'export_category_id' => 1, 'position' => 2, 'created_at' => 3, 'updated_at' => 4, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('export');
|
||||
$this->setPhpName('Export');
|
||||
$this->setClassName('\\Thelia\\Model\\Export');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('EXPORT_CATEGORY_ID', 'ExportCategoryId', 'INTEGER', 'export_category', 'ID', true, null, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ExportCategory', '\\Thelia\\Model\\ExportCategory', RelationMap::MANY_TO_ONE, array('export_category_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('ExportI18n', '\\Thelia\\Model\\ExportI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ExportI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
|
||||
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to export * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ExportI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ExportTableMap::CLASS_DEFAULT : ExportTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (Export object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ExportTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ExportTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ExportTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ExportTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ExportTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ExportTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ExportTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ExportTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ExportTableMap::ID);
|
||||
$criteria->addSelectColumn(ExportTableMap::EXPORT_CATEGORY_ID);
|
||||
$criteria->addSelectColumn(ExportTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ExportTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ExportTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.EXPORT_CATEGORY_ID');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ExportTableMap::DATABASE_NAME)->getTable(ExportTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ExportTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ExportTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ExportTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a Export or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or Export object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ExportTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\Export) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ExportTableMap::DATABASE_NAME);
|
||||
$criteria->add(ExportTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ExportQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ExportTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ExportTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the export table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ExportQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a Export or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or Export object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ExportTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from Export object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ExportTableMap::ID) && $criteria->keyContainsValue(ExportTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ExportTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ExportQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ExportTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ExportTableMap::buildTableMap();
|
||||
@@ -11,12 +11,12 @@ use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ImportExportCategoryI18n;
|
||||
use Thelia\Model\ImportExportCategoryI18nQuery;
|
||||
use Thelia\Model\ImportCategoryI18n;
|
||||
use Thelia\Model\ImportCategoryI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'import_export_category_i18n' table.
|
||||
* This class defines the structure of the 'import_category_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -26,14 +26,14 @@ use Thelia\Model\ImportExportCategoryI18nQuery;
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ImportExportCategoryI18nTableMap extends TableMap
|
||||
class ImportCategoryI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImportExportCategoryI18nTableMap';
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImportCategoryI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
@@ -43,17 +43,17 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'import_export_category_i18n';
|
||||
const TABLE_NAME = 'import_category_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ImportExportCategoryI18n';
|
||||
const OM_CLASS = '\\Thelia\\Model\\ImportCategoryI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ImportExportCategoryI18n';
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ImportCategoryI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
@@ -73,17 +73,17 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'import_export_category_i18n.ID';
|
||||
const ID = 'import_category_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'import_export_category_i18n.LOCALE';
|
||||
const LOCALE = 'import_category_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'import_export_category_i18n.TITLE';
|
||||
const TITLE = 'import_category_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
@@ -99,7 +99,7 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', ),
|
||||
self::TYPE_COLNAME => array(ImportExportCategoryI18nTableMap::ID, ImportExportCategoryI18nTableMap::LOCALE, ImportExportCategoryI18nTableMap::TITLE, ),
|
||||
self::TYPE_COLNAME => array(ImportCategoryI18nTableMap::ID, ImportCategoryI18nTableMap::LOCALE, ImportCategoryI18nTableMap::TITLE, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, )
|
||||
@@ -114,7 +114,7 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, ),
|
||||
self::TYPE_COLNAME => array(ImportExportCategoryI18nTableMap::ID => 0, ImportExportCategoryI18nTableMap::LOCALE => 1, ImportExportCategoryI18nTableMap::TITLE => 2, ),
|
||||
self::TYPE_COLNAME => array(ImportCategoryI18nTableMap::ID => 0, ImportCategoryI18nTableMap::LOCALE => 1, ImportCategoryI18nTableMap::TITLE => 2, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, )
|
||||
@@ -130,13 +130,13 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('import_export_category_i18n');
|
||||
$this->setPhpName('ImportExportCategoryI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ImportExportCategoryI18n');
|
||||
$this->setName('import_category_i18n');
|
||||
$this->setPhpName('ImportCategoryI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ImportCategoryI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'import_export_category', 'ID', true, null, null);
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'import_category', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', true, 255, null);
|
||||
} // initialize()
|
||||
@@ -146,7 +146,7 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ImportExportCategory', '\\Thelia\\Model\\ImportExportCategory', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('ImportCategory', '\\Thelia\\Model\\ImportCategory', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
@@ -157,7 +157,7 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\ImportExportCategoryI18n $obj A \Thelia\Model\ImportExportCategoryI18n object.
|
||||
* @param \Thelia\Model\ImportCategoryI18n $obj A \Thelia\Model\ImportCategoryI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
@@ -178,12 +178,12 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\ImportExportCategoryI18n object or a primary key value.
|
||||
* @param mixed $value A \Thelia\Model\ImportCategoryI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ImportExportCategoryI18n) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ImportCategoryI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
@@ -194,7 +194,7 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ImportExportCategoryI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ImportCategoryI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ImportExportCategoryI18nTableMap::CLASS_DEFAULT : ImportExportCategoryI18nTableMap::OM_CLASS;
|
||||
return $withPrefix ? ImportCategoryI18nTableMap::CLASS_DEFAULT : ImportCategoryI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,21 +268,21 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ImportExportCategoryI18n object, last column rank)
|
||||
* @return array (ImportCategoryI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ImportExportCategoryI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImportExportCategoryI18nTableMap::getInstanceFromPool($key))) {
|
||||
$key = ImportCategoryI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImportCategoryI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ImportExportCategoryI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
$col = $offset + ImportCategoryI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ImportExportCategoryI18nTableMap::OM_CLASS;
|
||||
$cls = ImportCategoryI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ImportExportCategoryI18nTableMap::addInstanceToPool($obj, $key);
|
||||
ImportCategoryI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
@@ -305,8 +305,8 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ImportExportCategoryI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImportExportCategoryI18nTableMap::getInstanceFromPool($key))) {
|
||||
$key = ImportCategoryI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImportCategoryI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
@@ -315,7 +315,7 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ImportExportCategoryI18nTableMap::addInstanceToPool($obj, $key);
|
||||
ImportCategoryI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
@@ -336,9 +336,9 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ImportExportCategoryI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ImportExportCategoryI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ImportExportCategoryI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ImportCategoryI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ImportCategoryI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ImportCategoryI18nTableMap::TITLE);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
@@ -355,7 +355,7 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImportExportCategoryI18nTableMap::DATABASE_NAME)->getTable(ImportExportCategoryI18nTableMap::TABLE_NAME);
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImportCategoryI18nTableMap::DATABASE_NAME)->getTable(ImportCategoryI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -363,16 +363,16 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImportExportCategoryI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImportExportCategoryI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImportExportCategoryI18nTableMap());
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImportCategoryI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImportCategoryI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImportCategoryI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ImportExportCategoryI18n or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ImportCategoryI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ImportExportCategoryI18n object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ImportCategoryI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
@@ -383,17 +383,17 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportExportCategoryI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportCategoryI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ImportExportCategoryI18n) { // it's a model object
|
||||
} elseif ($values instanceof \Thelia\Model\ImportCategoryI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ImportExportCategoryI18nTableMap::DATABASE_NAME);
|
||||
$criteria = new Criteria(ImportCategoryI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
@@ -401,17 +401,17 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(ImportExportCategoryI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ImportExportCategoryI18nTableMap::LOCALE, $value[1]));
|
||||
$criterion = $criteria->getNewCriterion(ImportCategoryI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ImportCategoryI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = ImportExportCategoryI18nQuery::create()->mergeWith($criteria);
|
||||
$query = ImportCategoryI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ImportExportCategoryI18nTableMap::clearInstancePool();
|
||||
if ($values instanceof Criteria) { ImportCategoryI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ImportExportCategoryI18nTableMap::removeInstanceFromPool($singleval);
|
||||
foreach ((array) $values as $singleval) { ImportCategoryI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,20 +419,20 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the import_export_category_i18n table.
|
||||
* Deletes all rows from the import_category_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ImportExportCategoryI18nQuery::create()->doDeleteAll($con);
|
||||
return ImportCategoryI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ImportExportCategoryI18n or Criteria object.
|
||||
* Performs an INSERT on the database, given a ImportCategoryI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ImportExportCategoryI18n object containing data that is used to create the INSERT statement.
|
||||
* @param mixed $criteria Criteria or ImportCategoryI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
@@ -441,18 +441,18 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportExportCategoryI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportCategoryI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ImportExportCategoryI18n object
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ImportCategoryI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ImportExportCategoryI18nQuery::create()->mergeWith($criteria);
|
||||
$query = ImportCategoryI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
@@ -468,7 +468,7 @@ class ImportExportCategoryI18nTableMap extends TableMap
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ImportExportCategoryI18nTableMap
|
||||
} // ImportCategoryI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ImportExportCategoryI18nTableMap::buildTableMap();
|
||||
ImportCategoryI18nTableMap::buildTableMap();
|
||||
@@ -11,12 +11,12 @@ use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ImportExportCategory;
|
||||
use Thelia\Model\ImportExportCategoryQuery;
|
||||
use Thelia\Model\ImportCategory;
|
||||
use Thelia\Model\ImportCategoryQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'import_export_category' table.
|
||||
* This class defines the structure of the 'import_category' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -26,14 +26,14 @@ use Thelia\Model\ImportExportCategoryQuery;
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ImportExportCategoryTableMap extends TableMap
|
||||
class ImportCategoryTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImportExportCategoryTableMap';
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImportCategoryTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
@@ -43,17 +43,17 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'import_export_category';
|
||||
const TABLE_NAME = 'import_category';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ImportExportCategory';
|
||||
const OM_CLASS = '\\Thelia\\Model\\ImportCategory';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ImportExportCategory';
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ImportCategory';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
@@ -73,22 +73,22 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'import_export_category.ID';
|
||||
const ID = 'import_category.ID';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'import_export_category.POSITION';
|
||||
const POSITION = 'import_category.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'import_export_category.CREATED_AT';
|
||||
const CREATED_AT = 'import_category.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'import_export_category.UPDATED_AT';
|
||||
const UPDATED_AT = 'import_category.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
@@ -113,7 +113,7 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ImportExportCategoryTableMap::ID, ImportExportCategoryTableMap::POSITION, ImportExportCategoryTableMap::CREATED_AT, ImportExportCategoryTableMap::UPDATED_AT, ),
|
||||
self::TYPE_COLNAME => array(ImportCategoryTableMap::ID, ImportCategoryTableMap::POSITION, ImportCategoryTableMap::CREATED_AT, ImportCategoryTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
@@ -128,7 +128,7 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Position' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'position' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
|
||||
self::TYPE_COLNAME => array(ImportExportCategoryTableMap::ID => 0, ImportExportCategoryTableMap::POSITION => 1, ImportExportCategoryTableMap::CREATED_AT => 2, ImportExportCategoryTableMap::UPDATED_AT => 3, ),
|
||||
self::TYPE_COLNAME => array(ImportCategoryTableMap::ID => 0, ImportCategoryTableMap::POSITION => 1, ImportCategoryTableMap::CREATED_AT => 2, ImportCategoryTableMap::UPDATED_AT => 3, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'POSITION' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'position' => 1, 'created_at' => 2, 'updated_at' => 3, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
@@ -144,9 +144,9 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('import_export_category');
|
||||
$this->setPhpName('ImportExportCategory');
|
||||
$this->setClassName('\\Thelia\\Model\\ImportExportCategory');
|
||||
$this->setName('import_category');
|
||||
$this->setPhpName('ImportCategory');
|
||||
$this->setClassName('\\Thelia\\Model\\ImportCategory');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
@@ -161,8 +161,8 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ImportExportType', '\\Thelia\\Model\\ImportExportType', RelationMap::ONE_TO_MANY, array('id' => 'import_export_category_id', ), 'CASCADE', 'RESTRICT', 'ImportExportTypes');
|
||||
$this->addRelation('ImportExportCategoryI18n', '\\Thelia\\Model\\ImportExportCategoryI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ImportExportCategoryI18ns');
|
||||
$this->addRelation('Import', '\\Thelia\\Model\\Import', RelationMap::ONE_TO_MANY, array('id' => 'import_category_id', ), 'CASCADE', 'RESTRICT', 'Imports');
|
||||
$this->addRelation('ImportCategoryI18n', '\\Thelia\\Model\\ImportCategoryI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ImportCategoryI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
@@ -179,14 +179,14 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to import_export_category * by a foreign key with ON DELETE CASCADE
|
||||
* Method to invalidate the instance pool of all tables related to import_category * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ImportExportTypeTableMap::clearInstancePool();
|
||||
ImportExportCategoryI18nTableMap::clearInstancePool();
|
||||
ImportTableMap::clearInstancePool();
|
||||
ImportCategoryI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -245,7 +245,7 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ImportExportCategoryTableMap::CLASS_DEFAULT : ImportExportCategoryTableMap::OM_CLASS;
|
||||
return $withPrefix ? ImportCategoryTableMap::CLASS_DEFAULT : ImportCategoryTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,21 +259,21 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ImportExportCategory object, last column rank)
|
||||
* @return array (ImportCategory object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ImportExportCategoryTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImportExportCategoryTableMap::getInstanceFromPool($key))) {
|
||||
$key = ImportCategoryTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImportCategoryTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ImportExportCategoryTableMap::NUM_HYDRATE_COLUMNS;
|
||||
$col = $offset + ImportCategoryTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ImportExportCategoryTableMap::OM_CLASS;
|
||||
$cls = ImportCategoryTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ImportExportCategoryTableMap::addInstanceToPool($obj, $key);
|
||||
ImportCategoryTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
@@ -296,8 +296,8 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ImportExportCategoryTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImportExportCategoryTableMap::getInstanceFromPool($key))) {
|
||||
$key = ImportCategoryTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImportCategoryTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
@@ -306,7 +306,7 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ImportExportCategoryTableMap::addInstanceToPool($obj, $key);
|
||||
ImportCategoryTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
@@ -327,10 +327,10 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ImportExportCategoryTableMap::ID);
|
||||
$criteria->addSelectColumn(ImportExportCategoryTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ImportExportCategoryTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ImportExportCategoryTableMap::UPDATED_AT);
|
||||
$criteria->addSelectColumn(ImportCategoryTableMap::ID);
|
||||
$criteria->addSelectColumn(ImportCategoryTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ImportCategoryTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ImportCategoryTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
@@ -348,7 +348,7 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImportExportCategoryTableMap::DATABASE_NAME)->getTable(ImportExportCategoryTableMap::TABLE_NAME);
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImportCategoryTableMap::DATABASE_NAME)->getTable(ImportCategoryTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -356,16 +356,16 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImportExportCategoryTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImportExportCategoryTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImportExportCategoryTableMap());
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImportCategoryTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImportCategoryTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImportCategoryTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ImportExportCategory or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ImportCategory or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ImportExportCategory object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ImportCategory object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
@@ -376,25 +376,25 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportExportCategoryTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportCategoryTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ImportExportCategory) { // it's a model object
|
||||
} elseif ($values instanceof \Thelia\Model\ImportCategory) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ImportExportCategoryTableMap::DATABASE_NAME);
|
||||
$criteria->add(ImportExportCategoryTableMap::ID, (array) $values, Criteria::IN);
|
||||
$criteria = new Criteria(ImportCategoryTableMap::DATABASE_NAME);
|
||||
$criteria->add(ImportCategoryTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ImportExportCategoryQuery::create()->mergeWith($criteria);
|
||||
$query = ImportCategoryQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ImportExportCategoryTableMap::clearInstancePool();
|
||||
if ($values instanceof Criteria) { ImportCategoryTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ImportExportCategoryTableMap::removeInstanceFromPool($singleval);
|
||||
foreach ((array) $values as $singleval) { ImportCategoryTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,20 +402,20 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the import_export_category table.
|
||||
* Deletes all rows from the import_category table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ImportExportCategoryQuery::create()->doDeleteAll($con);
|
||||
return ImportCategoryQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ImportExportCategory or Criteria object.
|
||||
* Performs an INSERT on the database, given a ImportCategory or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ImportExportCategory object containing data that is used to create the INSERT statement.
|
||||
* @param mixed $criteria Criteria or ImportCategory object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
@@ -424,22 +424,22 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportExportCategoryTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportCategoryTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ImportExportCategory object
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ImportCategory object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ImportExportCategoryTableMap::ID) && $criteria->keyContainsValue(ImportExportCategoryTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ImportExportCategoryTableMap::ID.')');
|
||||
if ($criteria->containsKey(ImportCategoryTableMap::ID) && $criteria->keyContainsValue(ImportCategoryTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ImportCategoryTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ImportExportCategoryQuery::create()->mergeWith($criteria);
|
||||
$query = ImportCategoryQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
@@ -455,7 +455,7 @@ class ImportExportCategoryTableMap extends TableMap
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ImportExportCategoryTableMap
|
||||
} // ImportCategoryTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ImportExportCategoryTableMap::buildTableMap();
|
||||
ImportCategoryTableMap::buildTableMap();
|
||||
@@ -11,12 +11,12 @@ use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ImportExportTypeI18n;
|
||||
use Thelia\Model\ImportExportTypeI18nQuery;
|
||||
use Thelia\Model\ImportI18n;
|
||||
use Thelia\Model\ImportI18nQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'import_export_type_i18n' table.
|
||||
* This class defines the structure of the 'import_i18n' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -26,14 +26,14 @@ use Thelia\Model\ImportExportTypeI18nQuery;
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ImportExportTypeI18nTableMap extends TableMap
|
||||
class ImportI18nTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImportExportTypeI18nTableMap';
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImportI18nTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
@@ -43,17 +43,17 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'import_export_type_i18n';
|
||||
const TABLE_NAME = 'import_i18n';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ImportExportTypeI18n';
|
||||
const OM_CLASS = '\\Thelia\\Model\\ImportI18n';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ImportExportTypeI18n';
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ImportI18n';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
@@ -73,22 +73,22 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'import_export_type_i18n.ID';
|
||||
const ID = 'import_i18n.ID';
|
||||
|
||||
/**
|
||||
* the column name for the LOCALE field
|
||||
*/
|
||||
const LOCALE = 'import_export_type_i18n.LOCALE';
|
||||
const LOCALE = 'import_i18n.LOCALE';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'import_export_type_i18n.TITLE';
|
||||
const TITLE = 'import_i18n.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the DESCRIPTION field
|
||||
*/
|
||||
const DESCRIPTION = 'import_export_type_i18n.DESCRIPTION';
|
||||
const DESCRIPTION = 'import_i18n.DESCRIPTION';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
@@ -104,7 +104,7 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', ),
|
||||
self::TYPE_COLNAME => array(ImportExportTypeI18nTableMap::ID, ImportExportTypeI18nTableMap::LOCALE, ImportExportTypeI18nTableMap::TITLE, ImportExportTypeI18nTableMap::DESCRIPTION, ),
|
||||
self::TYPE_COLNAME => array(ImportI18nTableMap::ID, ImportI18nTableMap::LOCALE, ImportI18nTableMap::TITLE, ImportI18nTableMap::DESCRIPTION, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
@@ -119,7 +119,7 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, ),
|
||||
self::TYPE_COLNAME => array(ImportExportTypeI18nTableMap::ID => 0, ImportExportTypeI18nTableMap::LOCALE => 1, ImportExportTypeI18nTableMap::TITLE => 2, ImportExportTypeI18nTableMap::DESCRIPTION => 3, ),
|
||||
self::TYPE_COLNAME => array(ImportI18nTableMap::ID => 0, ImportI18nTableMap::LOCALE => 1, ImportI18nTableMap::TITLE => 2, ImportI18nTableMap::DESCRIPTION => 3, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
@@ -135,13 +135,13 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('import_export_type_i18n');
|
||||
$this->setPhpName('ImportExportTypeI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ImportExportTypeI18n');
|
||||
$this->setName('import_i18n');
|
||||
$this->setPhpName('ImportI18n');
|
||||
$this->setClassName('\\Thelia\\Model\\ImportI18n');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'import_export_type', 'ID', true, null, null);
|
||||
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'import', 'ID', true, null, null);
|
||||
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
|
||||
@@ -152,7 +152,7 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ImportExportType', '\\Thelia\\Model\\ImportExportType', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('Import', '\\Thelia\\Model\\Import', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
@@ -163,7 +163,7 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
* to the cache in order to ensure that the same objects are always returned by find*()
|
||||
* and findPk*() calls.
|
||||
*
|
||||
* @param \Thelia\Model\ImportExportTypeI18n $obj A \Thelia\Model\ImportExportTypeI18n object.
|
||||
* @param \Thelia\Model\ImportI18n $obj A \Thelia\Model\ImportI18n object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool($obj, $key = null)
|
||||
@@ -184,12 +184,12 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A \Thelia\Model\ImportExportTypeI18n object or a primary key value.
|
||||
* @param mixed $value A \Thelia\Model\ImportI18n object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && null !== $value) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ImportExportTypeI18n) {
|
||||
if (is_object($value) && $value instanceof \Thelia\Model\ImportI18n) {
|
||||
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
|
||||
|
||||
} elseif (is_array($value) && count($value) === 2) {
|
||||
@@ -200,7 +200,7 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
|
||||
return;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ImportExportTypeI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ImportI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ImportExportTypeI18nTableMap::CLASS_DEFAULT : ImportExportTypeI18nTableMap::OM_CLASS;
|
||||
return $withPrefix ? ImportI18nTableMap::CLASS_DEFAULT : ImportI18nTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -274,21 +274,21 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ImportExportTypeI18n object, last column rank)
|
||||
* @return array (ImportI18n object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ImportExportTypeI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImportExportTypeI18nTableMap::getInstanceFromPool($key))) {
|
||||
$key = ImportI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImportI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ImportExportTypeI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
$col = $offset + ImportI18nTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ImportExportTypeI18nTableMap::OM_CLASS;
|
||||
$cls = ImportI18nTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ImportExportTypeI18nTableMap::addInstanceToPool($obj, $key);
|
||||
ImportI18nTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
@@ -311,8 +311,8 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ImportExportTypeI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImportExportTypeI18nTableMap::getInstanceFromPool($key))) {
|
||||
$key = ImportI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImportI18nTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
@@ -321,7 +321,7 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ImportExportTypeI18nTableMap::addInstanceToPool($obj, $key);
|
||||
ImportI18nTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
@@ -342,10 +342,10 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ImportExportTypeI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ImportExportTypeI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ImportExportTypeI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ImportExportTypeI18nTableMap::DESCRIPTION);
|
||||
$criteria->addSelectColumn(ImportI18nTableMap::ID);
|
||||
$criteria->addSelectColumn(ImportI18nTableMap::LOCALE);
|
||||
$criteria->addSelectColumn(ImportI18nTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ImportI18nTableMap::DESCRIPTION);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE');
|
||||
@@ -363,7 +363,7 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImportExportTypeI18nTableMap::DATABASE_NAME)->getTable(ImportExportTypeI18nTableMap::TABLE_NAME);
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImportI18nTableMap::DATABASE_NAME)->getTable(ImportI18nTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -371,16 +371,16 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImportExportTypeI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImportExportTypeI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImportExportTypeI18nTableMap());
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImportI18nTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImportI18nTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImportI18nTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ImportExportTypeI18n or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a ImportI18n or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ImportExportTypeI18n object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or ImportI18n object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
@@ -391,17 +391,17 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportExportTypeI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ImportExportTypeI18n) { // it's a model object
|
||||
} elseif ($values instanceof \Thelia\Model\ImportI18n) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ImportExportTypeI18nTableMap::DATABASE_NAME);
|
||||
$criteria = new Criteria(ImportI18nTableMap::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
@@ -409,17 +409,17 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
$values = array($values);
|
||||
}
|
||||
foreach ($values as $value) {
|
||||
$criterion = $criteria->getNewCriterion(ImportExportTypeI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ImportExportTypeI18nTableMap::LOCALE, $value[1]));
|
||||
$criterion = $criteria->getNewCriterion(ImportI18nTableMap::ID, $value[0]);
|
||||
$criterion->addAnd($criteria->getNewCriterion(ImportI18nTableMap::LOCALE, $value[1]));
|
||||
$criteria->addOr($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
$query = ImportExportTypeI18nQuery::create()->mergeWith($criteria);
|
||||
$query = ImportI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ImportExportTypeI18nTableMap::clearInstancePool();
|
||||
if ($values instanceof Criteria) { ImportI18nTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ImportExportTypeI18nTableMap::removeInstanceFromPool($singleval);
|
||||
foreach ((array) $values as $singleval) { ImportI18nTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,20 +427,20 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the import_export_type_i18n table.
|
||||
* Deletes all rows from the import_i18n table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ImportExportTypeI18nQuery::create()->doDeleteAll($con);
|
||||
return ImportI18nQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ImportExportTypeI18n or Criteria object.
|
||||
* Performs an INSERT on the database, given a ImportI18n or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ImportExportTypeI18n object containing data that is used to create the INSERT statement.
|
||||
* @param mixed $criteria Criteria or ImportI18n object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
@@ -449,18 +449,18 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportExportTypeI18nTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportI18nTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ImportExportTypeI18n object
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ImportI18n object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ImportExportTypeI18nQuery::create()->mergeWith($criteria);
|
||||
$query = ImportI18nQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
@@ -476,7 +476,7 @@ class ImportExportTypeI18nTableMap extends TableMap
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ImportExportTypeI18nTableMap
|
||||
} // ImportI18nTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ImportExportTypeI18nTableMap::buildTableMap();
|
||||
ImportI18nTableMap::buildTableMap();
|
||||
@@ -11,12 +11,12 @@ use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
use Thelia\Model\ImportExportType;
|
||||
use Thelia\Model\ImportExportTypeQuery;
|
||||
use Thelia\Model\Import;
|
||||
use Thelia\Model\ImportQuery;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'import_export_type' table.
|
||||
* This class defines the structure of the 'import' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -26,14 +26,14 @@ use Thelia\Model\ImportExportTypeQuery;
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ImportExportTypeTableMap extends TableMap
|
||||
class ImportTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImportExportTypeTableMap';
|
||||
const CLASS_NAME = 'Thelia.Model.Map.ImportTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
@@ -43,22 +43,22 @@ class ImportExportTypeTableMap extends TableMap
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'import_export_type';
|
||||
const TABLE_NAME = 'import';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\Thelia\\Model\\ImportExportType';
|
||||
const OM_CLASS = '\\Thelia\\Model\\Import';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'Thelia.Model.ImportExportType';
|
||||
const CLASS_DEFAULT = 'Thelia.Model.Import';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
const NUM_COLUMNS = 5;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
@@ -68,37 +68,32 @@ class ImportExportTypeTableMap extends TableMap
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
const NUM_HYDRATE_COLUMNS = 5;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'import_export_type.ID';
|
||||
const ID = 'import.ID';
|
||||
|
||||
/**
|
||||
* the column name for the URL_ACTION field
|
||||
* the column name for the IMPORT_CATEGORY_ID field
|
||||
*/
|
||||
const URL_ACTION = 'import_export_type.URL_ACTION';
|
||||
|
||||
/**
|
||||
* the column name for the IMPORT_EXPORT_CATEGORY_ID field
|
||||
*/
|
||||
const IMPORT_EXPORT_CATEGORY_ID = 'import_export_type.IMPORT_EXPORT_CATEGORY_ID';
|
||||
const IMPORT_CATEGORY_ID = 'import.IMPORT_CATEGORY_ID';
|
||||
|
||||
/**
|
||||
* the column name for the POSITION field
|
||||
*/
|
||||
const POSITION = 'import_export_type.POSITION';
|
||||
const POSITION = 'import.POSITION';
|
||||
|
||||
/**
|
||||
* the column name for the CREATED_AT field
|
||||
*/
|
||||
const CREATED_AT = 'import_export_type.CREATED_AT';
|
||||
const CREATED_AT = 'import.CREATED_AT';
|
||||
|
||||
/**
|
||||
* the column name for the UPDATED_AT field
|
||||
*/
|
||||
const UPDATED_AT = 'import_export_type.UPDATED_AT';
|
||||
const UPDATED_AT = 'import.UPDATED_AT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
@@ -121,12 +116,12 @@ class ImportExportTypeTableMap extends TableMap
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'UrlAction', 'ImportExportCategoryId', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'urlAction', 'importExportCategoryId', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ImportExportTypeTableMap::ID, ImportExportTypeTableMap::URL_ACTION, ImportExportTypeTableMap::IMPORT_EXPORT_CATEGORY_ID, ImportExportTypeTableMap::POSITION, ImportExportTypeTableMap::CREATED_AT, ImportExportTypeTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'URL_ACTION', 'IMPORT_EXPORT_CATEGORY_ID', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'url_action', 'import_export_category_id', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
self::TYPE_PHPNAME => array('Id', 'ImportCategoryId', 'Position', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'importCategoryId', 'position', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(ImportTableMap::ID, ImportTableMap::IMPORT_CATEGORY_ID, ImportTableMap::POSITION, ImportTableMap::CREATED_AT, ImportTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'IMPORT_CATEGORY_ID', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'import_category_id', 'position', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -136,12 +131,12 @@ class ImportExportTypeTableMap extends TableMap
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'UrlAction' => 1, 'ImportExportCategoryId' => 2, 'Position' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'urlAction' => 1, 'importExportCategoryId' => 2, 'position' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
|
||||
self::TYPE_COLNAME => array(ImportExportTypeTableMap::ID => 0, ImportExportTypeTableMap::URL_ACTION => 1, ImportExportTypeTableMap::IMPORT_EXPORT_CATEGORY_ID => 2, ImportExportTypeTableMap::POSITION => 3, ImportExportTypeTableMap::CREATED_AT => 4, ImportExportTypeTableMap::UPDATED_AT => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'URL_ACTION' => 1, 'IMPORT_EXPORT_CATEGORY_ID' => 2, 'POSITION' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'url_action' => 1, 'import_export_category_id' => 2, 'position' => 3, 'created_at' => 4, 'updated_at' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'ImportCategoryId' => 1, 'Position' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'importCategoryId' => 1, 'position' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
|
||||
self::TYPE_COLNAME => array(ImportTableMap::ID => 0, ImportTableMap::IMPORT_CATEGORY_ID => 1, ImportTableMap::POSITION => 2, ImportTableMap::CREATED_AT => 3, ImportTableMap::UPDATED_AT => 4, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'IMPORT_CATEGORY_ID' => 1, 'POSITION' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'import_category_id' => 1, 'position' => 2, 'created_at' => 3, 'updated_at' => 4, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -154,15 +149,14 @@ class ImportExportTypeTableMap extends TableMap
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('import_export_type');
|
||||
$this->setPhpName('ImportExportType');
|
||||
$this->setClassName('\\Thelia\\Model\\ImportExportType');
|
||||
$this->setName('import');
|
||||
$this->setPhpName('Import');
|
||||
$this->setClassName('\\Thelia\\Model\\Import');
|
||||
$this->setPackage('Thelia.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addColumn('URL_ACTION', 'UrlAction', 'VARCHAR', true, 255, null);
|
||||
$this->addForeignKey('IMPORT_EXPORT_CATEGORY_ID', 'ImportExportCategoryId', 'INTEGER', 'import_export_category', 'ID', true, null, null);
|
||||
$this->addForeignKey('IMPORT_CATEGORY_ID', 'ImportCategoryId', 'INTEGER', 'import_category', 'ID', true, null, null);
|
||||
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
@@ -173,8 +167,8 @@ class ImportExportTypeTableMap extends TableMap
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ImportExportCategory', '\\Thelia\\Model\\ImportExportCategory', RelationMap::MANY_TO_ONE, array('import_export_category_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('ImportExportTypeI18n', '\\Thelia\\Model\\ImportExportTypeI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ImportExportTypeI18ns');
|
||||
$this->addRelation('ImportCategory', '\\Thelia\\Model\\ImportCategory', RelationMap::MANY_TO_ONE, array('import_category_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
$this->addRelation('ImportI18n', '\\Thelia\\Model\\ImportI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ImportI18ns');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
@@ -191,13 +185,13 @@ class ImportExportTypeTableMap extends TableMap
|
||||
);
|
||||
} // getBehaviors()
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to import_export_type * by a foreign key with ON DELETE CASCADE
|
||||
* Method to invalidate the instance pool of all tables related to import * by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
ImportExportTypeI18nTableMap::clearInstancePool();
|
||||
ImportI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +250,7 @@ class ImportExportTypeTableMap extends TableMap
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ImportExportTypeTableMap::CLASS_DEFAULT : ImportExportTypeTableMap::OM_CLASS;
|
||||
return $withPrefix ? ImportTableMap::CLASS_DEFAULT : ImportTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,21 +264,21 @@ class ImportExportTypeTableMap extends TableMap
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ImportExportType object, last column rank)
|
||||
* @return array (Import object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ImportExportTypeTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImportExportTypeTableMap::getInstanceFromPool($key))) {
|
||||
$key = ImportTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ImportTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ImportExportTypeTableMap::NUM_HYDRATE_COLUMNS;
|
||||
$col = $offset + ImportTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ImportExportTypeTableMap::OM_CLASS;
|
||||
$cls = ImportTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ImportExportTypeTableMap::addInstanceToPool($obj, $key);
|
||||
ImportTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
@@ -307,8 +301,8 @@ class ImportExportTypeTableMap extends TableMap
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ImportExportTypeTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImportExportTypeTableMap::getInstanceFromPool($key))) {
|
||||
$key = ImportTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ImportTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
@@ -317,7 +311,7 @@ class ImportExportTypeTableMap extends TableMap
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ImportExportTypeTableMap::addInstanceToPool($obj, $key);
|
||||
ImportTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
@@ -338,16 +332,14 @@ class ImportExportTypeTableMap extends TableMap
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ImportExportTypeTableMap::ID);
|
||||
$criteria->addSelectColumn(ImportExportTypeTableMap::URL_ACTION);
|
||||
$criteria->addSelectColumn(ImportExportTypeTableMap::IMPORT_EXPORT_CATEGORY_ID);
|
||||
$criteria->addSelectColumn(ImportExportTypeTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ImportExportTypeTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ImportExportTypeTableMap::UPDATED_AT);
|
||||
$criteria->addSelectColumn(ImportTableMap::ID);
|
||||
$criteria->addSelectColumn(ImportTableMap::IMPORT_CATEGORY_ID);
|
||||
$criteria->addSelectColumn(ImportTableMap::POSITION);
|
||||
$criteria->addSelectColumn(ImportTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(ImportTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.URL_ACTION');
|
||||
$criteria->addSelectColumn($alias . '.IMPORT_EXPORT_CATEGORY_ID');
|
||||
$criteria->addSelectColumn($alias . '.IMPORT_CATEGORY_ID');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
@@ -363,7 +355,7 @@ class ImportExportTypeTableMap extends TableMap
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImportExportTypeTableMap::DATABASE_NAME)->getTable(ImportExportTypeTableMap::TABLE_NAME);
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ImportTableMap::DATABASE_NAME)->getTable(ImportTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -371,16 +363,16 @@ class ImportExportTypeTableMap extends TableMap
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImportExportTypeTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImportExportTypeTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImportExportTypeTableMap());
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ImportTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ImportTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ImportTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ImportExportType or Criteria object OR a primary key value.
|
||||
* Performs a DELETE on the database, given a Import or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ImportExportType object or primary key or array of primary keys
|
||||
* @param mixed $values Criteria or Import object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
@@ -391,25 +383,25 @@ class ImportExportTypeTableMap extends TableMap
|
||||
public static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportExportTypeTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \Thelia\Model\ImportExportType) { // it's a model object
|
||||
} elseif ($values instanceof \Thelia\Model\Import) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ImportExportTypeTableMap::DATABASE_NAME);
|
||||
$criteria->add(ImportExportTypeTableMap::ID, (array) $values, Criteria::IN);
|
||||
$criteria = new Criteria(ImportTableMap::DATABASE_NAME);
|
||||
$criteria->add(ImportTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ImportExportTypeQuery::create()->mergeWith($criteria);
|
||||
$query = ImportQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ImportExportTypeTableMap::clearInstancePool();
|
||||
if ($values instanceof Criteria) { ImportTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ImportExportTypeTableMap::removeInstanceFromPool($singleval);
|
||||
foreach ((array) $values as $singleval) { ImportTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,20 +409,20 @@ class ImportExportTypeTableMap extends TableMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the import_export_type table.
|
||||
* Deletes all rows from the import table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ImportExportTypeQuery::create()->doDeleteAll($con);
|
||||
return ImportQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ImportExportType or Criteria object.
|
||||
* Performs an INSERT on the database, given a Import or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ImportExportType object containing data that is used to create the INSERT statement.
|
||||
* @param mixed $criteria Criteria or Import object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
@@ -439,22 +431,22 @@ class ImportExportTypeTableMap extends TableMap
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportExportTypeTableMap::DATABASE_NAME);
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ImportTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ImportExportType object
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from Import object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ImportExportTypeTableMap::ID) && $criteria->keyContainsValue(ImportExportTypeTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ImportExportTypeTableMap::ID.')');
|
||||
if ($criteria->containsKey(ImportTableMap::ID) && $criteria->keyContainsValue(ImportTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ImportTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ImportExportTypeQuery::create()->mergeWith($criteria);
|
||||
$query = ImportQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
@@ -470,7 +462,7 @@ class ImportExportTypeTableMap extends TableMap
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ImportExportTypeTableMap
|
||||
} // ImportTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ImportExportTypeTableMap::buildTableMap();
|
||||
ImportTableMap::buildTableMap();
|
||||
Reference in New Issue
Block a user