Dernières modifs (traductions, mon nom dans le code, ...)

This commit is contained in:
2020-12-07 22:20:05 +01:00
parent 40b78b9a63
commit 92dae7030b
24 changed files with 54 additions and 592 deletions

View File

@@ -11,8 +11,6 @@
</loops> </loops>
<forms> <forms>
<!-- <form name="dhl.freeshipping.form" class="DHL\Form\FreeShipping" />-->
<!-- <form name="dhl.export.form" class="DHL\Form\Export" />-->
<form name="dhl.configuration" class="DHL\Form\Configuration" /> <form name="dhl.configuration" class="DHL\Form\Configuration" />
</forms> </forms>

View File

@@ -0,0 +1,5 @@
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `dhl_delivery_price`;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -14,7 +14,7 @@ use Thelia\Tools\URL;
/** /**
* Class Configuration * Class Configuration
* @package DHL\Controller * @package DHL\Controller
* @author Thomas Arnaud <tarnaud@openstudio.fr> * @author Laurent LE CORRE <laurent@thecoredev.fr>
*/ */
class Configuration extends BaseAdminController class Configuration extends BaseAdminController
{ {

View File

@@ -17,7 +17,7 @@ use Thelia\Tools\URL;
/** /**
* Class EditPrices * Class EditPrices
* @package DHL\Controller * @package DHL\Controller
* @author Thelia <info@thelia.net> * @author Laurent LE CORRE <laurent@thecoredev.fr>
*/ */
class EditPrices extends BaseAdminController class EditPrices extends BaseAdminController
{ {

View File

@@ -15,9 +15,16 @@ use Thelia\Model\AreaQuery;
use Thelia\Model\Country; use Thelia\Model\Country;
use Thelia\Model\CountryArea; use Thelia\Model\CountryArea;
use Thelia\Model\CountryQuery; use Thelia\Model\CountryQuery;
use Thelia\Model\MessageQuery;
use Thelia\Model\ModuleConfigQuery;
use Thelia\Module\AbstractDeliveryModule; use Thelia\Module\AbstractDeliveryModule;
use Thelia\Module\Exception\DeliveryException; use Thelia\Module\Exception\DeliveryException;
/**
* Class DHL
* @package DHL
* @author Laurent LE CORRE <laurent@thecoredev.fr>
*/
class DHL extends AbstractDeliveryModule class DHL extends AbstractDeliveryModule
{ {
protected $request; protected $request;
@@ -29,6 +36,9 @@ class DHL extends AbstractDeliveryModule
const JSON_PRICE_RESOURCE = "/Config/prices.json"; const JSON_PRICE_RESOURCE = "/Config/prices.json";
const WEBSERVICE_URL = 'tracking_url'; const WEBSERVICE_URL = 'tracking_url';
const TRACKING_MESSAGE_NAME = 'mail_dhl';
public static function getPrices($areaId) public static function getPrices($areaId)
{ {
if (null === self::$prices) { if (null === self::$prices) {
@@ -183,4 +193,28 @@ class DHL extends AbstractDeliveryModule
return $postage; return $postage;
} }
/**
* @param ConnectionInterface|null $con
* @param bool $deleteModuleData
* @throws \Propel\Runtime\Exception\PropelException
*/
public function destroy(ConnectionInterface $con = null, $deleteModuleData = false)
{
if ($deleteModuleData) {
// Delete message
MessageQuery::create()->filterByName(self::TRACKING_MESSAGE_NAME)->delete($con);
// Delete module config data
ModuleConfigQuery::create()->filterByModuleId(self::getModuleId())->delete($con);
// Delete module tables.
if (null !== $con) {
$database = new Database($con);
$database->insertSql(null, [__DIR__ . '/Config/drop.sql']);
}
}
parent::destroy($con, $deleteModuleData);
}
} }

View File

@@ -3,8 +3,6 @@
namespace DHL\Form; namespace DHL\Form;
use DHL\DHL; use DHL\DHL;
use DHL\Model\Config\Base\DHLConfigValue;
use Thelia\Core\Translation\Translator;
use Thelia\Form\BaseForm; use Thelia\Form\BaseForm;
/** /**

View File

@@ -8,7 +8,7 @@ use Thelia\Core\Hook\BaseHook;
/** /**
* Class HookManager * Class HookManager
* @package DHL\Hook * @package DHL\Hook
* @author Thomas Arnaud <tarnaud@openstudio.fr> * @author Laurent LE CORRE <laurent@thecoredev.fr>
*/ */
class HookManager extends BaseHook class HookManager extends BaseHook
{ {

View File

@@ -1,25 +0,0 @@
<?php
return [
'*If you choose this option, the exported orders would not be available on this page anymore' => '*Wenn Sie diese Option auswählen, sind die exportierten Bestellungen auf dieser Seite nicht mehr verfügbar',
'Actions' => 'Aktionen',
'An error occured' => 'Ein Fehler ist aufgetreten',
'Area : ' => 'Bereich : ',
'Cancel' => 'Abbrechen',
'Change orders status after export' => 'Status der Bestellung nach dem Export ändern',
'DHL Module allows to send your products all around the world with La Poste.' => 'DHL Modul ermöglicht, Ihre Produkte mit La Poste weltweit zu versenden.',
'Create' => 'Erstellen',
'Date' => 'Datum',
'Delete' => 'Löschen',
'Do not change' => 'Nicht ändern',
'Edit' => 'Ändern',
'Export' => 'Export',
'Please change the access rights' => 'Bitte ändern Sie die Zugriffsrechte',
'Price (€)' => 'Preis (€)',
'Processing' => 'Bearbeitung',
'REF' => 'REF',
'Sent' => 'Gesendet',
'There is currently not orders to export' => 'Es gibt derzeit keine Bestellungen, die exportiert werden können',
'Total taxed amount' => 'Gesamter besteuerter Betrag',
'Weight up to ... (kg)' => 'Gewicht bis zu ... (kg)',
];

View File

@@ -1,7 +1,6 @@
<?php <?php
return array( return array(
'*If you choose this option, the exported orders would not be available on this page anymore' => '*If you choose this option, the exported orders would not be available on this page anymore',
'Actions' => 'Actions', 'Actions' => 'Actions',
'An error occured' => 'An error occured', 'An error occured' => 'An error occured',
'Area : ' => 'Area : ', 'Area : ' => 'Area : ',
@@ -21,7 +20,6 @@ return array(
'Edit a price slice' => 'Edit a price slice', 'Edit a price slice' => 'Edit a price slice',
'Edit this price slice' => 'Edit this price slice', 'Edit this price slice' => 'Edit this price slice',
'Export' => 'Export', 'Export' => 'Export',
'Export expeditor inet file' => 'Export expeditor inet file',
'Please change the access rights' => 'Please change the access rights', 'Please change the access rights' => 'Please change the access rights',
'Price (€)' => 'Price (€)', 'Price (€)' => 'Price (€)',
'Price slices' => 'Price slices', 'Price slices' => 'Price slices',

View File

@@ -1,37 +1,22 @@
<?php <?php
return [ return array(
'*If you choose this option, the exported orders would not be available on this page anymore' => '* Si vous choisissez cette option, les commandes exportées ne seront plus affichée sur cette page.',
'Actions' => 'Actions', 'Actions' => 'Actions',
'An error occured' => 'Une erreur est survenue',
'Area : ' => 'Zone de livraison : ', 'Area : ' => 'Zone de livraison : ',
'Cancel' => 'Annuler', 'Cancel' => 'Annuler',
'Change orders status after export' => 'Modification du statut des commande après l\'export',
'DHL Module allows to send your products all around the world with La Poste.' => 'DHL vous permet dexpédier vos colis dans le monde entier avec La Poste',
'Create' => 'Créer', 'Create' => 'Créer',
'Create a new price slice' => 'Créer une nouvelle tranche de prix', 'Create a new price slice' => 'Créer une nouvelle tranche de prix',
'Create a price slice' => 'Créer une tranche de prix', 'Create a price slice' => 'Créer une tranche de prix',
'Customer' => 'Client', 'DHL Module allows to send your products all around the world.' => 'Les services DHL vous permettent d\'envoyer des colis partout dans le monde.',
'Date' => 'Date',
'Delete' => 'Supprimer', 'Delete' => 'Supprimer',
'Delete a price slice' => 'Supprimer une tranche de prix', 'Delete a price slice' => 'Supprimer une tranche de prix',
'Delete this price slice' => 'Supprimer cette tranche de prix', 'Delete this price slice' => 'Supprimer cette tranche de prix',
'Do not change' => 'Ne pas modifier',
'Do you really want to delete this slice ?' => 'Confirmez-vous la suppression de cette tranche de prix', 'Do you really want to delete this slice ?' => 'Confirmez-vous la suppression de cette tranche de prix',
'Edit' => 'Modifier', 'Edit' => 'Modifier',
'Edit a price slice' => 'Modifier une tranche de prix', 'Edit a price slice' => 'Modifier une tranche de prix',
'Edit this price slice' => 'Modifier cette tranche de prix', 'Edit this price slice' => 'Modifier cette tranche de prix',
'Export' => 'Export',
'Export expeditor inet file' => 'Exporter le fichier Expeditor INET',
'Number of packages' => 'Nombre de colis',
'Packages weight' => 'Poids des colis',
'Please change the access rights' => 'Merci de modifier les droits d\'accès', 'Please change the access rights' => 'Merci de modifier les droits d\'accès',
'Price (€)' => 'Prix (€)', 'Price (€)' => 'Prix (€)',
'Price slices' => 'Prix et poids', 'Save' => 'Sauvegarder',
'Processing' => 'Traitement',
'REF' => 'REF',
'Sent' => 'Envoyée',
'There is currently not orders to export' => 'Il n\'y a pas de commande à exporter pour le moment',
'Total taxed amount' => 'Total TTC',
'Weight up to ... (kg)' => 'Jusqu\'au poids (Kg)', 'Weight up to ... (kg)' => 'Jusqu\'au poids (Kg)',
]; );

View File

@@ -1,13 +0,0 @@
<?php
return [
'Actions' => 'Azioni',
'Cancel' => 'Annulla',
'Create' => 'Creare',
'Date' => 'Data',
'Delete' => 'Cancellare',
'Edit' => 'Modifica',
'Export' => 'Esporta',
'Number of packages' => 'Numero di pacchetti',
'Packages weight' => 'Peso pacchi',
];

View File

@@ -1,34 +0,0 @@
<?php
return [
'*If you choose this option, the exported orders would not be available on this page anymore' => '* Bu seçeneği seçerseniz, ihracat siparişleri artık bu sayfadaki müsait olmaz',
'Actions' => 'Eylemler',
'An error occured' => 'Bir hata meydana geldi',
'Area : ' => 'Alanı: ',
'Cancel' => 'Vazgeç',
'Change orders status after export' => 'İhracat sonra sipariş durumunu değiştir',
'DHL Module allows to send your products all around the world with La Poste.' => 'DHL modülü sağlar ürünlerinizi göndermek için La Poste ile dünyanın her yerinden.',
'Create' => 'Oluştur',
'Create a new price slice' => 'Yeni fiyat dilimi oluşturmak',
'Create a price slice' => 'Bir fiyat dilim oluşturma',
'Date' => 'Tarih',
'Delete' => 'sil',
'Delete a price slice' => 'Bir fiyat dilim silmek',
'Delete this price slice' => 'Bu fiyat dilim silmek',
'Do not change' => 'Değiştirme',
'Do you really want to delete this slice ?' => 'Gerçekten bu dosyayı silmek istiyor musunuz ?',
'Edit' => 'Düzenle',
'Edit a price slice' => 'Bir fiyat dilim Düzenle',
'Edit this price slice' => 'Bu fiyat dilim Düzenle',
'Export' => 'Dışa aktarma',
'Export expeditor inet file' => 'Expeditor inet dosyası dışa aktarma',
'Please change the access rights' => 'Lütfen erişim haklarını Değiştir',
'Price (€)' => 'Fiyat (TL)',
'Price slices' => 'Fiyat dilimleri',
'Processing' => 'İşlem devam ediyor',
'REF' => 'ÜRÜN KODU',
'Sent' => 'Gönder',
'There is currently not orders to export' => 'Şu anda hiçbir emir vermek için',
'Total taxed amount' => 'Toplam Kdvtutarı',
'Weight up to ... (kg)' => 'Fazla kilo... (kg)',
];

View File

@@ -1,14 +0,0 @@
<?php
return [
'Activate free shipping: ' => 'Kostenlose Lieferung aktivieren: ',
'Can\'t read Config directory' => 'Config-Verzeichnis kann nicht gelesen werden',
'Can\'t read file' => 'Datei kann nicht gelesen werden',
'Can\'t write Config directory' => 'Config-Verzeichnis kann nicht beschrieben werden',
'Can\'t write file' => 'Datei kann nicht geschrieben werden',
'DHL delivery unavailable for the delivery country' => 'Eine Lieferung mit DHL ist für das Land nicht verfügbar',
'DHL delivery unavailable for this cart weight (%weight kg)' => 'Eine Lieferung mit DHL ist für Warenkörbe mit diesem Gewicht (%weight kg) nicht verfügbar',
'Modify status export after export' => 'Status der Bestellung nach dem Export ändern',
'dhl expeditor export' => 'DHL expeditor export',
'select a valid status' => 'Wählen Sie einen gültigen Bestellungsstatus aus',
];

View File

@@ -1,14 +1,11 @@
<?php <?php
return array( return array(
'Activate free shipping: ' => 'Activate free shipping: ',
'Can\'t read Config directory' => 'Can\'t read Config directory', 'Can\'t read Config directory' => 'Can\'t read Config directory',
'Can\'t read file' => 'Can\'t read file', 'Can\'t read file' => 'Can\'t read file',
'Can\'t write Config directory' => 'Can\'t write Config directory', 'Can\'t write Config directory' => 'Can\'t write Config directory',
'Can\'t write file' => 'Can\'t write file', 'Can\'t write file' => 'Can\'t write file',
'DHL delivery unavailable for the delivery country' => 'DHL delivery unavailable for the delivery country', 'DHL delivery unavailable for the delivery country' => 'DHL delivery unavailable for the delivery country',
'DHL delivery unavailable for this cart weight (%weight kg)' => 'DHL delivery unavailable for this cart weight (%weight kg)', 'DHL delivery unavailable for this cart weight (%weight kg)' => 'DHL delivery unavailable for this cart weight (%weight kg)',
'Modify status export after export' => 'Change orders status after export',
'dhl expeditor export' => 'DHL Expeditor export',
'select a valid status' => 'Select a valid order status', 'select a valid status' => 'Select a valid order status',
); );

View File

@@ -1,14 +1,12 @@
<?php <?php
return [ return array(
'Activate free shipping: ' => 'Activer la livraison offerte: ',
'Can\'t read Config directory' => 'Le dossier Config ne peut être lu', 'Can\'t read Config directory' => 'Le dossier Config ne peut être lu',
'Can\'t read file' => 'Le fichier suivant ne peut être lu', 'Can\'t read file' => 'Le fichier suivant ne peut être lu',
'Can\'t write Config directory' => 'Le dossier Config ne peut être écrit', 'Can\'t write Config directory' => 'Le dossier Config ne peut être écrit',
'Can\'t write file' => 'Le fichier suivant ne peut être écrit', 'Can\'t write file' => 'Le fichier suivant ne peut être écrit',
'DHL delivery unavailable for the delivery country' => 'La livraison par DHL n\'est pas disponible dans ce pays', 'DHL delivery unavailable for the delivery country' => 'La livraison par DHL n\'est pas disponible dans ce pays',
'DHL delivery unavailable for this cart weight (%weight kg)' => 'La livraison par DHL n\'est pas disponible pour un panier de %weight Kg', 'DHL delivery unavailable for this cart weight (%weight kg)' => 'La livraison par DHL n\'est pas disponible pour un panier de %weight Kg',
'Modify status export after export' => 'Modification du statut des commandes après l\'export', 'DHL tracking URL' => 'URL de suivi DHL',
'dhl expeditor export' => 'Export pour le logiciel Expeditor', 'This is the URL of the DHL tracking service.' => 'Saisissez ici l\'URL du service de suivi DHL',
'select a valid status' => 'Choisissez un statut de commande valide.', );
];

View File

@@ -1,14 +0,0 @@
<?php
return [
'Activate free shipping: ' => 'Ücretsiz nakliye etkinleştirmek için: ',
'Can\'t read Config directory' => 'Yapılandırma dizini okunamıyor',
'Can\'t read file' => 'Dosyayı okuyamıyor',
'Can\'t write Config directory' => 'Dosyayı okuyamıyor',
'Can\'t write file' => 'Dosyaya yazılamıyor',
'DHL delivery unavailable for the delivery country' => 'Bu Teslimat Bu ülke için kullanılamaz DHL teslim',
'DHL delivery unavailable for this cart weight (%weight kg)' => 'DHL teslimat için bu sepeti ağırlık (%weight kg) kullanılamaz',
'Modify status export after export' => 'İhracat sonra sipariş durumunu değiştir',
'dhl expeditor export' => 'DHL Expeditor verme',
'select a valid status' => 'Geçerli sipariş durumunu seçin',
];

View File

@@ -1,14 +1,5 @@
<?php <?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace DHL\Loop; namespace DHL\Loop;
use DHL\DHL; use DHL\DHL;
@@ -21,8 +12,8 @@ use Thelia\Core\Translation\Translator;
/** /**
* Class CheckRightsLoop * Class CheckRightsLoop
* @package DHL\Looop * @package DHL\Loop
* @author Thelia <info@thelia.net> * @author Laurent LE CORRE <laurent@thecoredev.fr>
*/ */
class CheckRightsLoop extends BaseLoop implements ArraySearchLoopInterface class CheckRightsLoop extends BaseLoop implements ArraySearchLoopInterface
{ {

View File

@@ -1,14 +1,4 @@
<?php <?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace DHL\Loop; namespace DHL\Loop;
@@ -21,7 +11,7 @@ use Thelia\Core\Template\Loop\Order;
/** /**
* Class NotSendLoop * Class NotSendLoop
* @package DHL\Loop * @package DHL\Loop
* @author Manuel Raynaud <manu@raynaud.io> * @author Laurent LE CORRE <laurent@thecoredev.fr>
*/ */
class NotSendLoop extends Order class NotSendLoop extends Order
{ {

View File

@@ -10,7 +10,6 @@ use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria; use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveRecord\ActiveRecordInterface; use Propel\Runtime\ActiveRecord\ActiveRecordInterface;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Connection\ConnectionInterface; use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\BadMethodCallException; use Propel\Runtime\Exception\BadMethodCallException;
use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Exception\PropelException;

View File

@@ -11,11 +11,9 @@ use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria; use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin; use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection; use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface; use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Area;
/** /**
* Base class that represents a query for the 'dhl_delivery_price' table. * Base class that represents a query for the 'dhl_delivery_price' table.

View File

@@ -10,7 +10,6 @@ use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria; use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveRecord\ActiveRecordInterface; use Propel\Runtime\ActiveRecord\ActiveRecordInterface;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Connection\ConnectionInterface; use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\BadMethodCallException; use Propel\Runtime\Exception\BadMethodCallException;
use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Exception\PropelException;

View File

@@ -14,7 +14,6 @@ use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\ObjectCollection; use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface; use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Area;
/** /**
* Base class that represents a query for the 'dhl_delivery_price' table. * Base class that represents a query for the 'dhl_delivery_price' table.

View File

@@ -1,426 +0,0 @@
<?php
namespace DHL\Model\Map;
use DHL\Model\DHLDeliveryPriceQuery;
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;
/**
* This class defines the structure of the 'dhl_delivery_price' 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 DHLDeliveryPriceTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'DHL.Model.Map.DHLDeliveryPriceTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'dhl_delivery_price';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\DHL\\Model\\DHLDeliveryPrice';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'DHL.Model.DHLDeliveryPrice';
/**
* 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 = 'dhl_delivery_price.ID';
/**
* the column name for the MAX_WEIGHT field
*/
const MAX_WEIGHT = 'dhl_delivery_price.MAX_WEIGHT';
/**
* the column name for the PRICE_WITH_TAX field
*/
const PRICE_WITH_TAX = 'dhl_delivery_price.PRICE_WITH_TAX';
/**
* the column name for the AREA_ID field
*/
const AREA_ID = 'dhl_delivery_price.AREA_ID';
/**
* 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', 'MaxWeight', 'PriceWithTax', 'AreaId', ),
self::TYPE_STUDLYPHPNAME => array('id', 'maxWeight', 'priceWithTax', 'areaId', ),
self::TYPE_COLNAME => array(DHLDeliveryPriceTableMap::ID, DHLDeliveryPriceTableMap::MAX_WEIGHT, DHLDeliveryPriceTableMap::PRICE_WITH_TAX, DHLDeliveryPriceTableMap::AREA_ID, ),
self::TYPE_RAW_COLNAME => array('ID', 'MAX_WEIGHT', 'PRICE_WITH_TAX', 'AREA_ID', ),
self::TYPE_FIELDNAME => array('id', 'max_weight', 'price_with_tax', 'area_id', ),
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, 'MaxWeight' => 1, 'PriceWithTax' => 2, 'AreaId' => 3, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'maxWeight' => 1, 'priceWithTax' => 2, 'areaId' => 3, ),
self::TYPE_COLNAME => array(DHLDeliveryPriceTableMap::ID => 0, DHLDeliveryPriceTableMap::MAX_WEIGHT => 1, DHLDeliveryPriceTableMap::PRICE_WITH_TAX => 2, DHLDeliveryPriceTableMap::AREA_ID => 3, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'MAX_WEIGHT' => 1, 'PRICE_WITH_TAX' => 2, 'AREA_ID' => 3, ),
self::TYPE_FIELDNAME => array('id' => 0, 'max_weight' => 1, 'price_with_tax' => 2, 'area_id' => 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('dhl_delivery_price');
$this->setPhpName('DHLDeliveryPrice');
$this->setClassName('\\DHL\\Model\\DHLDeliveryPrice');
$this->setPackage('DHL.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('MAX_WEIGHT', 'MaxWeight', 'DECIMAL', true, 16, 0);
$this->addColumn('PRICE_WITH_TAX', 'PriceWithTax', 'DECIMAL', true, 16, 0);
$this->addForeignKey('AREA_ID', 'AreaId', 'INTEGER', 'area', 'ID', true, null, null);
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('Area', '\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'CASCADE', 'RESTRICT');
} // buildRelations()
/**
* 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 ? DHLDeliveryPriceTableMap::CLASS_DEFAULT : DHLDeliveryPriceTableMap::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 (DHLDeliveryPrice object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = DHLDeliveryPriceTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = DHLDeliveryPriceTableMap::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 + DHLDeliveryPriceTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = DHLDeliveryPriceTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
DHLDeliveryPriceTableMap::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 = DHLDeliveryPriceTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = DHLDeliveryPriceTableMap::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;
DHLDeliveryPriceTableMap::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(DHLDeliveryPriceTableMap::ID);
$criteria->addSelectColumn(DHLDeliveryPriceTableMap::MAX_WEIGHT);
$criteria->addSelectColumn(DHLDeliveryPriceTableMap::PRICE_WITH_TAX);
$criteria->addSelectColumn(DHLDeliveryPriceTableMap::AREA_ID);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.MAX_WEIGHT');
$criteria->addSelectColumn($alias . '.PRICE_WITH_TAX');
$criteria->addSelectColumn($alias . '.AREA_ID');
}
}
/**
* 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(DHLDeliveryPriceTableMap::DATABASE_NAME)->getTable(DHLDeliveryPriceTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(DHLDeliveryPriceTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(DHLDeliveryPriceTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new DHLDeliveryPriceTableMap());
}
}
/**
* Performs a DELETE on the database, given a DHLDeliveryPrice or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or DHLDeliveryPrice 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(DHLDeliveryPriceTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \DHL\Model\DHLDeliveryPrice) { // 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(DHLDeliveryPriceTableMap::DATABASE_NAME);
$criteria->add(DHLDeliveryPriceTableMap::ID, (array) $values, Criteria::IN);
}
$query = DHLDeliveryPriceQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { DHLDeliveryPriceTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { DHLDeliveryPriceTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the dhl_delivery_price 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 DHLDeliveryPriceQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a DHLDeliveryPrice or Criteria object.
*
* @param mixed $criteria Criteria or DHLDeliveryPrice 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(DHLDeliveryPriceTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from DHLDeliveryPrice object
}
if ($criteria->containsKey(DHLDeliveryPriceTableMap::ID) && $criteria->keyContainsValue(DHLDeliveryPriceTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.DHLDeliveryPriceTableMap::ID.')');
}
// Set the correct dbName
$query = DHLDeliveryPriceQuery::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;
}
} // DHLDeliveryPriceTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
DHLDeliveryPriceTableMap::buildTableMap();

View File

@@ -4,7 +4,6 @@ namespace DHL\Model;
use DHL\Model\Base\DHLDeliveryPriceQuery as BaseDHLDeliveryPriceQuery; use DHL\Model\Base\DHLDeliveryPriceQuery as BaseDHLDeliveryPriceQuery;
class DHLDeliveryPriceQuery extends BaseDHLDeliveryPriceQuery class DHLDeliveryPriceQuery extends BaseDHLDeliveryPriceQuery
{ {