Initial commit

This commit is contained in:
2020-01-27 08:56:08 +01:00
commit b7525048d6
27129 changed files with 3409855 additions and 0 deletions

View File

@@ -0,0 +1,469 @@
<?php
namespace PayPal\Model\Map;
use PayPal\Model\PaypalCart;
use PayPal\Model\PaypalCartQuery;
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 'paypal_cart' 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 PaypalCartTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'PayPal.Model.Map.PaypalCartTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'paypal_cart';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\PayPal\\Model\\PaypalCart';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'PayPal.Model.PaypalCart';
/**
* The total number of columns
*/
const NUM_COLUMNS = 8;
/**
* 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 = 8;
/**
* the column name for the ID field
*/
const ID = 'paypal_cart.ID';
/**
* the column name for the CREDIT_CARD_ID field
*/
const CREDIT_CARD_ID = 'paypal_cart.CREDIT_CARD_ID';
/**
* the column name for the PLANIFIED_PAYMENT_ID field
*/
const PLANIFIED_PAYMENT_ID = 'paypal_cart.PLANIFIED_PAYMENT_ID';
/**
* the column name for the EXPRESS_PAYMENT_ID field
*/
const EXPRESS_PAYMENT_ID = 'paypal_cart.EXPRESS_PAYMENT_ID';
/**
* the column name for the EXPRESS_PAYER_ID field
*/
const EXPRESS_PAYER_ID = 'paypal_cart.EXPRESS_PAYER_ID';
/**
* the column name for the EXPRESS_TOKEN field
*/
const EXPRESS_TOKEN = 'paypal_cart.EXPRESS_TOKEN';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'paypal_cart.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'paypal_cart.UPDATED_AT';
/**
* 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', 'CreditCardId', 'PlanifiedPaymentId', 'ExpressPaymentId', 'ExpressPayerId', 'ExpressToken', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'creditCardId', 'planifiedPaymentId', 'expressPaymentId', 'expressPayerId', 'expressToken', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(PaypalCartTableMap::ID, PaypalCartTableMap::CREDIT_CARD_ID, PaypalCartTableMap::PLANIFIED_PAYMENT_ID, PaypalCartTableMap::EXPRESS_PAYMENT_ID, PaypalCartTableMap::EXPRESS_PAYER_ID, PaypalCartTableMap::EXPRESS_TOKEN, PaypalCartTableMap::CREATED_AT, PaypalCartTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'CREDIT_CARD_ID', 'PLANIFIED_PAYMENT_ID', 'EXPRESS_PAYMENT_ID', 'EXPRESS_PAYER_ID', 'EXPRESS_TOKEN', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'credit_card_id', 'planified_payment_id', 'express_payment_id', 'express_payer_id', 'express_token', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
* 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, 'CreditCardId' => 1, 'PlanifiedPaymentId' => 2, 'ExpressPaymentId' => 3, 'ExpressPayerId' => 4, 'ExpressToken' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'creditCardId' => 1, 'planifiedPaymentId' => 2, 'expressPaymentId' => 3, 'expressPayerId' => 4, 'expressToken' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
self::TYPE_COLNAME => array(PaypalCartTableMap::ID => 0, PaypalCartTableMap::CREDIT_CARD_ID => 1, PaypalCartTableMap::PLANIFIED_PAYMENT_ID => 2, PaypalCartTableMap::EXPRESS_PAYMENT_ID => 3, PaypalCartTableMap::EXPRESS_PAYER_ID => 4, PaypalCartTableMap::EXPRESS_TOKEN => 5, PaypalCartTableMap::CREATED_AT => 6, PaypalCartTableMap::UPDATED_AT => 7, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CREDIT_CARD_ID' => 1, 'PLANIFIED_PAYMENT_ID' => 2, 'EXPRESS_PAYMENT_ID' => 3, 'EXPRESS_PAYER_ID' => 4, 'EXPRESS_TOKEN' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
self::TYPE_FIELDNAME => array('id' => 0, 'credit_card_id' => 1, 'planified_payment_id' => 2, 'express_payment_id' => 3, 'express_payer_id' => 4, 'express_token' => 5, 'created_at' => 6, 'updated_at' => 7, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
* 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('paypal_cart');
$this->setPhpName('PaypalCart');
$this->setClassName('\\PayPal\\Model\\PaypalCart');
$this->setPackage('PayPal.Model');
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'cart', 'ID', true, null, null);
$this->addColumn('CREDIT_CARD_ID', 'CreditCardId', 'VARCHAR', false, 40, null);
$this->addForeignKey('PLANIFIED_PAYMENT_ID', 'PlanifiedPaymentId', 'INTEGER', 'paypal_planified_payment', 'ID', false, null, null);
$this->addColumn('EXPRESS_PAYMENT_ID', 'ExpressPaymentId', 'VARCHAR', false, 255, null);
$this->addColumn('EXPRESS_PAYER_ID', 'ExpressPayerId', 'VARCHAR', false, 255, null);
$this->addColumn('EXPRESS_TOKEN', 'ExpressToken', 'VARCHAR', false, 255, 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('Cart', '\\Thelia\\Model\\Cart', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('PaypalPlanifiedPayment', '\\PayPal\\Model\\PaypalPlanifiedPayment', RelationMap::MANY_TO_ONE, array('planified_payment_id' => 'id', ), 'CASCADE', 'RESTRICT');
} // buildRelations()
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
/**
* 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 ? PaypalCartTableMap::CLASS_DEFAULT : PaypalCartTableMap::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 (PaypalCart object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = PaypalCartTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = PaypalCartTableMap::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 + PaypalCartTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = PaypalCartTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
PaypalCartTableMap::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 = PaypalCartTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = PaypalCartTableMap::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;
PaypalCartTableMap::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(PaypalCartTableMap::ID);
$criteria->addSelectColumn(PaypalCartTableMap::CREDIT_CARD_ID);
$criteria->addSelectColumn(PaypalCartTableMap::PLANIFIED_PAYMENT_ID);
$criteria->addSelectColumn(PaypalCartTableMap::EXPRESS_PAYMENT_ID);
$criteria->addSelectColumn(PaypalCartTableMap::EXPRESS_PAYER_ID);
$criteria->addSelectColumn(PaypalCartTableMap::EXPRESS_TOKEN);
$criteria->addSelectColumn(PaypalCartTableMap::CREATED_AT);
$criteria->addSelectColumn(PaypalCartTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.CREDIT_CARD_ID');
$criteria->addSelectColumn($alias . '.PLANIFIED_PAYMENT_ID');
$criteria->addSelectColumn($alias . '.EXPRESS_PAYMENT_ID');
$criteria->addSelectColumn($alias . '.EXPRESS_PAYER_ID');
$criteria->addSelectColumn($alias . '.EXPRESS_TOKEN');
$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(PaypalCartTableMap::DATABASE_NAME)->getTable(PaypalCartTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(PaypalCartTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(PaypalCartTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new PaypalCartTableMap());
}
}
/**
* Performs a DELETE on the database, given a PaypalCart or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or PaypalCart 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(PaypalCartTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \PayPal\Model\PaypalCart) { // 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(PaypalCartTableMap::DATABASE_NAME);
$criteria->add(PaypalCartTableMap::ID, (array) $values, Criteria::IN);
}
$query = PaypalCartQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { PaypalCartTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { PaypalCartTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the paypal_cart 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 PaypalCartQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a PaypalCart or Criteria object.
*
* @param mixed $criteria Criteria or PaypalCart 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(PaypalCartTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from PaypalCart object
}
// Set the correct dbName
$query = PaypalCartQuery::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;
}
} // PaypalCartTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
PaypalCartTableMap::buildTableMap();

View File

@@ -0,0 +1,679 @@
<?php
namespace PayPal\Model\Map;
use PayPal\Model\PaypalCustomer;
use PayPal\Model\PaypalCustomerQuery;
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 'paypal_customer' 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 PaypalCustomerTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'PayPal.Model.Map.PaypalCustomerTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'paypal_customer';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\PayPal\\Model\\PaypalCustomer';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'PayPal.Model.PaypalCustomer';
/**
* The total number of columns
*/
const NUM_COLUMNS = 27;
/**
* 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 = 27;
/**
* the column name for the ID field
*/
const ID = 'paypal_customer.ID';
/**
* the column name for the PAYPAL_USER_ID field
*/
const PAYPAL_USER_ID = 'paypal_customer.PAYPAL_USER_ID';
/**
* the column name for the CREDIT_CARD_ID field
*/
const CREDIT_CARD_ID = 'paypal_customer.CREDIT_CARD_ID';
/**
* the column name for the NAME field
*/
const NAME = 'paypal_customer.NAME';
/**
* the column name for the GIVEN_NAME field
*/
const GIVEN_NAME = 'paypal_customer.GIVEN_NAME';
/**
* the column name for the FAMILY_NAME field
*/
const FAMILY_NAME = 'paypal_customer.FAMILY_NAME';
/**
* the column name for the MIDDLE_NAME field
*/
const MIDDLE_NAME = 'paypal_customer.MIDDLE_NAME';
/**
* the column name for the PICTURE field
*/
const PICTURE = 'paypal_customer.PICTURE';
/**
* the column name for the EMAIL_VERIFIED field
*/
const EMAIL_VERIFIED = 'paypal_customer.EMAIL_VERIFIED';
/**
* the column name for the GENDER field
*/
const GENDER = 'paypal_customer.GENDER';
/**
* the column name for the BIRTHDAY field
*/
const BIRTHDAY = 'paypal_customer.BIRTHDAY';
/**
* the column name for the ZONEINFO field
*/
const ZONEINFO = 'paypal_customer.ZONEINFO';
/**
* the column name for the LOCALE field
*/
const LOCALE = 'paypal_customer.LOCALE';
/**
* the column name for the LANGUAGE field
*/
const LANGUAGE = 'paypal_customer.LANGUAGE';
/**
* the column name for the VERIFIED field
*/
const VERIFIED = 'paypal_customer.VERIFIED';
/**
* the column name for the PHONE_NUMBER field
*/
const PHONE_NUMBER = 'paypal_customer.PHONE_NUMBER';
/**
* the column name for the VERIFIED_ACCOUNT field
*/
const VERIFIED_ACCOUNT = 'paypal_customer.VERIFIED_ACCOUNT';
/**
* the column name for the ACCOUNT_TYPE field
*/
const ACCOUNT_TYPE = 'paypal_customer.ACCOUNT_TYPE';
/**
* the column name for the AGE_RANGE field
*/
const AGE_RANGE = 'paypal_customer.AGE_RANGE';
/**
* the column name for the PAYER_ID field
*/
const PAYER_ID = 'paypal_customer.PAYER_ID';
/**
* the column name for the POSTAL_CODE field
*/
const POSTAL_CODE = 'paypal_customer.POSTAL_CODE';
/**
* the column name for the LOCALITY field
*/
const LOCALITY = 'paypal_customer.LOCALITY';
/**
* the column name for the REGION field
*/
const REGION = 'paypal_customer.REGION';
/**
* the column name for the COUNTRY field
*/
const COUNTRY = 'paypal_customer.COUNTRY';
/**
* the column name for the STREET_ADDRESS field
*/
const STREET_ADDRESS = 'paypal_customer.STREET_ADDRESS';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'paypal_customer.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'paypal_customer.UPDATED_AT';
/**
* 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', 'PaypalUserId', 'CreditCardId', 'Name', 'GivenName', 'FamilyName', 'MiddleName', 'Picture', 'EmailVerified', 'Gender', 'Birthday', 'Zoneinfo', 'Locale', 'Language', 'Verified', 'PhoneNumber', 'VerifiedAccount', 'AccountType', 'AgeRange', 'PayerId', 'PostalCode', 'Locality', 'Region', 'Country', 'StreetAddress', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'paypalUserId', 'creditCardId', 'name', 'givenName', 'familyName', 'middleName', 'picture', 'emailVerified', 'gender', 'birthday', 'zoneinfo', 'locale', 'language', 'verified', 'phoneNumber', 'verifiedAccount', 'accountType', 'ageRange', 'payerId', 'postalCode', 'locality', 'region', 'country', 'streetAddress', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(PaypalCustomerTableMap::ID, PaypalCustomerTableMap::PAYPAL_USER_ID, PaypalCustomerTableMap::CREDIT_CARD_ID, PaypalCustomerTableMap::NAME, PaypalCustomerTableMap::GIVEN_NAME, PaypalCustomerTableMap::FAMILY_NAME, PaypalCustomerTableMap::MIDDLE_NAME, PaypalCustomerTableMap::PICTURE, PaypalCustomerTableMap::EMAIL_VERIFIED, PaypalCustomerTableMap::GENDER, PaypalCustomerTableMap::BIRTHDAY, PaypalCustomerTableMap::ZONEINFO, PaypalCustomerTableMap::LOCALE, PaypalCustomerTableMap::LANGUAGE, PaypalCustomerTableMap::VERIFIED, PaypalCustomerTableMap::PHONE_NUMBER, PaypalCustomerTableMap::VERIFIED_ACCOUNT, PaypalCustomerTableMap::ACCOUNT_TYPE, PaypalCustomerTableMap::AGE_RANGE, PaypalCustomerTableMap::PAYER_ID, PaypalCustomerTableMap::POSTAL_CODE, PaypalCustomerTableMap::LOCALITY, PaypalCustomerTableMap::REGION, PaypalCustomerTableMap::COUNTRY, PaypalCustomerTableMap::STREET_ADDRESS, PaypalCustomerTableMap::CREATED_AT, PaypalCustomerTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PAYPAL_USER_ID', 'CREDIT_CARD_ID', 'NAME', 'GIVEN_NAME', 'FAMILY_NAME', 'MIDDLE_NAME', 'PICTURE', 'EMAIL_VERIFIED', 'GENDER', 'BIRTHDAY', 'ZONEINFO', 'LOCALE', 'LANGUAGE', 'VERIFIED', 'PHONE_NUMBER', 'VERIFIED_ACCOUNT', 'ACCOUNT_TYPE', 'AGE_RANGE', 'PAYER_ID', 'POSTAL_CODE', 'LOCALITY', 'REGION', 'COUNTRY', 'STREET_ADDRESS', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'paypal_user_id', 'credit_card_id', 'name', 'given_name', 'family_name', 'middle_name', 'picture', 'email_verified', 'gender', 'birthday', 'zoneinfo', 'locale', 'language', 'verified', 'phone_number', 'verified_account', 'account_type', 'age_range', 'payer_id', 'postal_code', 'locality', 'region', 'country', 'street_address', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, )
);
/**
* 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, 'PaypalUserId' => 1, 'CreditCardId' => 2, 'Name' => 3, 'GivenName' => 4, 'FamilyName' => 5, 'MiddleName' => 6, 'Picture' => 7, 'EmailVerified' => 8, 'Gender' => 9, 'Birthday' => 10, 'Zoneinfo' => 11, 'Locale' => 12, 'Language' => 13, 'Verified' => 14, 'PhoneNumber' => 15, 'VerifiedAccount' => 16, 'AccountType' => 17, 'AgeRange' => 18, 'PayerId' => 19, 'PostalCode' => 20, 'Locality' => 21, 'Region' => 22, 'Country' => 23, 'StreetAddress' => 24, 'CreatedAt' => 25, 'UpdatedAt' => 26, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'paypalUserId' => 1, 'creditCardId' => 2, 'name' => 3, 'givenName' => 4, 'familyName' => 5, 'middleName' => 6, 'picture' => 7, 'emailVerified' => 8, 'gender' => 9, 'birthday' => 10, 'zoneinfo' => 11, 'locale' => 12, 'language' => 13, 'verified' => 14, 'phoneNumber' => 15, 'verifiedAccount' => 16, 'accountType' => 17, 'ageRange' => 18, 'payerId' => 19, 'postalCode' => 20, 'locality' => 21, 'region' => 22, 'country' => 23, 'streetAddress' => 24, 'createdAt' => 25, 'updatedAt' => 26, ),
self::TYPE_COLNAME => array(PaypalCustomerTableMap::ID => 0, PaypalCustomerTableMap::PAYPAL_USER_ID => 1, PaypalCustomerTableMap::CREDIT_CARD_ID => 2, PaypalCustomerTableMap::NAME => 3, PaypalCustomerTableMap::GIVEN_NAME => 4, PaypalCustomerTableMap::FAMILY_NAME => 5, PaypalCustomerTableMap::MIDDLE_NAME => 6, PaypalCustomerTableMap::PICTURE => 7, PaypalCustomerTableMap::EMAIL_VERIFIED => 8, PaypalCustomerTableMap::GENDER => 9, PaypalCustomerTableMap::BIRTHDAY => 10, PaypalCustomerTableMap::ZONEINFO => 11, PaypalCustomerTableMap::LOCALE => 12, PaypalCustomerTableMap::LANGUAGE => 13, PaypalCustomerTableMap::VERIFIED => 14, PaypalCustomerTableMap::PHONE_NUMBER => 15, PaypalCustomerTableMap::VERIFIED_ACCOUNT => 16, PaypalCustomerTableMap::ACCOUNT_TYPE => 17, PaypalCustomerTableMap::AGE_RANGE => 18, PaypalCustomerTableMap::PAYER_ID => 19, PaypalCustomerTableMap::POSTAL_CODE => 20, PaypalCustomerTableMap::LOCALITY => 21, PaypalCustomerTableMap::REGION => 22, PaypalCustomerTableMap::COUNTRY => 23, PaypalCustomerTableMap::STREET_ADDRESS => 24, PaypalCustomerTableMap::CREATED_AT => 25, PaypalCustomerTableMap::UPDATED_AT => 26, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PAYPAL_USER_ID' => 1, 'CREDIT_CARD_ID' => 2, 'NAME' => 3, 'GIVEN_NAME' => 4, 'FAMILY_NAME' => 5, 'MIDDLE_NAME' => 6, 'PICTURE' => 7, 'EMAIL_VERIFIED' => 8, 'GENDER' => 9, 'BIRTHDAY' => 10, 'ZONEINFO' => 11, 'LOCALE' => 12, 'LANGUAGE' => 13, 'VERIFIED' => 14, 'PHONE_NUMBER' => 15, 'VERIFIED_ACCOUNT' => 16, 'ACCOUNT_TYPE' => 17, 'AGE_RANGE' => 18, 'PAYER_ID' => 19, 'POSTAL_CODE' => 20, 'LOCALITY' => 21, 'REGION' => 22, 'COUNTRY' => 23, 'STREET_ADDRESS' => 24, 'CREATED_AT' => 25, 'UPDATED_AT' => 26, ),
self::TYPE_FIELDNAME => array('id' => 0, 'paypal_user_id' => 1, 'credit_card_id' => 2, 'name' => 3, 'given_name' => 4, 'family_name' => 5, 'middle_name' => 6, 'picture' => 7, 'email_verified' => 8, 'gender' => 9, 'birthday' => 10, 'zoneinfo' => 11, 'locale' => 12, 'language' => 13, 'verified' => 14, 'phone_number' => 15, 'verified_account' => 16, 'account_type' => 17, 'age_range' => 18, 'payer_id' => 19, 'postal_code' => 20, 'locality' => 21, 'region' => 22, 'country' => 23, 'street_address' => 24, 'created_at' => 25, 'updated_at' => 26, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, )
);
/**
* 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('paypal_customer');
$this->setPhpName('PaypalCustomer');
$this->setClassName('\\PayPal\\Model\\PaypalCustomer');
$this->setPackage('PayPal.Model');
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'customer', 'ID', true, null, null);
$this->addPrimaryKey('PAYPAL_USER_ID', 'PaypalUserId', 'INTEGER', true, null, null);
$this->addColumn('CREDIT_CARD_ID', 'CreditCardId', 'VARCHAR', false, 40, null);
$this->addColumn('NAME', 'Name', 'VARCHAR', false, 255, null);
$this->addColumn('GIVEN_NAME', 'GivenName', 'VARCHAR', false, 255, null);
$this->addColumn('FAMILY_NAME', 'FamilyName', 'VARCHAR', false, 255, null);
$this->addColumn('MIDDLE_NAME', 'MiddleName', 'VARCHAR', false, 255, null);
$this->addColumn('PICTURE', 'Picture', 'VARCHAR', false, 255, null);
$this->addColumn('EMAIL_VERIFIED', 'EmailVerified', 'TINYINT', false, null, null);
$this->addColumn('GENDER', 'Gender', 'VARCHAR', false, 255, null);
$this->addColumn('BIRTHDAY', 'Birthday', 'VARCHAR', false, 255, null);
$this->addColumn('ZONEINFO', 'Zoneinfo', 'VARCHAR', false, 255, null);
$this->addColumn('LOCALE', 'Locale', 'VARCHAR', false, 255, null);
$this->addColumn('LANGUAGE', 'Language', 'VARCHAR', false, 255, null);
$this->addColumn('VERIFIED', 'Verified', 'TINYINT', false, null, null);
$this->addColumn('PHONE_NUMBER', 'PhoneNumber', 'VARCHAR', false, 255, null);
$this->addColumn('VERIFIED_ACCOUNT', 'VerifiedAccount', 'VARCHAR', false, 255, null);
$this->addColumn('ACCOUNT_TYPE', 'AccountType', 'VARCHAR', false, 255, null);
$this->addColumn('AGE_RANGE', 'AgeRange', 'VARCHAR', false, 255, null);
$this->addColumn('PAYER_ID', 'PayerId', 'VARCHAR', false, 255, null);
$this->addColumn('POSTAL_CODE', 'PostalCode', 'VARCHAR', false, 255, null);
$this->addColumn('LOCALITY', 'Locality', 'VARCHAR', false, 255, null);
$this->addColumn('REGION', 'Region', 'VARCHAR', false, 255, null);
$this->addColumn('COUNTRY', 'Country', 'VARCHAR', false, 255, null);
$this->addColumn('STREET_ADDRESS', 'StreetAddress', 'VARCHAR', false, 255, 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('Customer', '\\Thelia\\Model\\Customer', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', 'RESTRICT');
} // buildRelations()
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
/**
* 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 \PayPal\Model\PaypalCustomer $obj A \PayPal\Model\PaypalCustomer 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->getPaypalUserId()));
} // 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 \PayPal\Model\PaypalCustomer object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \PayPal\Model\PaypalCustomer) {
$key = serialize(array((string) $value->getId(), (string) $value->getPaypalUserId()));
} 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 \PayPal\Model\PaypalCustomer 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('PaypalUserId', 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('PaypalUserId', 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 ? PaypalCustomerTableMap::CLASS_DEFAULT : PaypalCustomerTableMap::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 (PaypalCustomer object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = PaypalCustomerTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = PaypalCustomerTableMap::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 + PaypalCustomerTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = PaypalCustomerTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
PaypalCustomerTableMap::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 = PaypalCustomerTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = PaypalCustomerTableMap::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;
PaypalCustomerTableMap::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(PaypalCustomerTableMap::ID);
$criteria->addSelectColumn(PaypalCustomerTableMap::PAYPAL_USER_ID);
$criteria->addSelectColumn(PaypalCustomerTableMap::CREDIT_CARD_ID);
$criteria->addSelectColumn(PaypalCustomerTableMap::NAME);
$criteria->addSelectColumn(PaypalCustomerTableMap::GIVEN_NAME);
$criteria->addSelectColumn(PaypalCustomerTableMap::FAMILY_NAME);
$criteria->addSelectColumn(PaypalCustomerTableMap::MIDDLE_NAME);
$criteria->addSelectColumn(PaypalCustomerTableMap::PICTURE);
$criteria->addSelectColumn(PaypalCustomerTableMap::EMAIL_VERIFIED);
$criteria->addSelectColumn(PaypalCustomerTableMap::GENDER);
$criteria->addSelectColumn(PaypalCustomerTableMap::BIRTHDAY);
$criteria->addSelectColumn(PaypalCustomerTableMap::ZONEINFO);
$criteria->addSelectColumn(PaypalCustomerTableMap::LOCALE);
$criteria->addSelectColumn(PaypalCustomerTableMap::LANGUAGE);
$criteria->addSelectColumn(PaypalCustomerTableMap::VERIFIED);
$criteria->addSelectColumn(PaypalCustomerTableMap::PHONE_NUMBER);
$criteria->addSelectColumn(PaypalCustomerTableMap::VERIFIED_ACCOUNT);
$criteria->addSelectColumn(PaypalCustomerTableMap::ACCOUNT_TYPE);
$criteria->addSelectColumn(PaypalCustomerTableMap::AGE_RANGE);
$criteria->addSelectColumn(PaypalCustomerTableMap::PAYER_ID);
$criteria->addSelectColumn(PaypalCustomerTableMap::POSTAL_CODE);
$criteria->addSelectColumn(PaypalCustomerTableMap::LOCALITY);
$criteria->addSelectColumn(PaypalCustomerTableMap::REGION);
$criteria->addSelectColumn(PaypalCustomerTableMap::COUNTRY);
$criteria->addSelectColumn(PaypalCustomerTableMap::STREET_ADDRESS);
$criteria->addSelectColumn(PaypalCustomerTableMap::CREATED_AT);
$criteria->addSelectColumn(PaypalCustomerTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.PAYPAL_USER_ID');
$criteria->addSelectColumn($alias . '.CREDIT_CARD_ID');
$criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.GIVEN_NAME');
$criteria->addSelectColumn($alias . '.FAMILY_NAME');
$criteria->addSelectColumn($alias . '.MIDDLE_NAME');
$criteria->addSelectColumn($alias . '.PICTURE');
$criteria->addSelectColumn($alias . '.EMAIL_VERIFIED');
$criteria->addSelectColumn($alias . '.GENDER');
$criteria->addSelectColumn($alias . '.BIRTHDAY');
$criteria->addSelectColumn($alias . '.ZONEINFO');
$criteria->addSelectColumn($alias . '.LOCALE');
$criteria->addSelectColumn($alias . '.LANGUAGE');
$criteria->addSelectColumn($alias . '.VERIFIED');
$criteria->addSelectColumn($alias . '.PHONE_NUMBER');
$criteria->addSelectColumn($alias . '.VERIFIED_ACCOUNT');
$criteria->addSelectColumn($alias . '.ACCOUNT_TYPE');
$criteria->addSelectColumn($alias . '.AGE_RANGE');
$criteria->addSelectColumn($alias . '.PAYER_ID');
$criteria->addSelectColumn($alias . '.POSTAL_CODE');
$criteria->addSelectColumn($alias . '.LOCALITY');
$criteria->addSelectColumn($alias . '.REGION');
$criteria->addSelectColumn($alias . '.COUNTRY');
$criteria->addSelectColumn($alias . '.STREET_ADDRESS');
$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(PaypalCustomerTableMap::DATABASE_NAME)->getTable(PaypalCustomerTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(PaypalCustomerTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(PaypalCustomerTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new PaypalCustomerTableMap());
}
}
/**
* Performs a DELETE on the database, given a PaypalCustomer or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or PaypalCustomer 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(PaypalCustomerTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \PayPal\Model\PaypalCustomer) { // 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(PaypalCustomerTableMap::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(PaypalCustomerTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(PaypalCustomerTableMap::PAYPAL_USER_ID, $value[1]));
$criteria->addOr($criterion);
}
}
$query = PaypalCustomerQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { PaypalCustomerTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { PaypalCustomerTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the paypal_customer 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 PaypalCustomerQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a PaypalCustomer or Criteria object.
*
* @param mixed $criteria Criteria or PaypalCustomer 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(PaypalCustomerTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from PaypalCustomer object
}
// Set the correct dbName
$query = PaypalCustomerQuery::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;
}
} // PaypalCustomerTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
PaypalCustomerTableMap::buildTableMap();

View File

@@ -0,0 +1,489 @@
<?php
namespace PayPal\Model\Map;
use PayPal\Model\PaypalLog;
use PayPal\Model\PaypalLogQuery;
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 'paypal_log' 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 PaypalLogTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'PayPal.Model.Map.PaypalLogTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'paypal_log';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\PayPal\\Model\\PaypalLog';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'PayPal.Model.PaypalLog';
/**
* The total number of columns
*/
const NUM_COLUMNS = 10;
/**
* 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 = 10;
/**
* the column name for the ID field
*/
const ID = 'paypal_log.ID';
/**
* the column name for the CUSTOMER_ID field
*/
const CUSTOMER_ID = 'paypal_log.CUSTOMER_ID';
/**
* the column name for the ORDER_ID field
*/
const ORDER_ID = 'paypal_log.ORDER_ID';
/**
* the column name for the HOOK field
*/
const HOOK = 'paypal_log.HOOK';
/**
* the column name for the CHANNEL field
*/
const CHANNEL = 'paypal_log.CHANNEL';
/**
* the column name for the LEVEL field
*/
const LEVEL = 'paypal_log.LEVEL';
/**
* the column name for the MESSAGE field
*/
const MESSAGE = 'paypal_log.MESSAGE';
/**
* the column name for the TIME field
*/
const TIME = 'paypal_log.TIME';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'paypal_log.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'paypal_log.UPDATED_AT';
/**
* 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', 'CustomerId', 'OrderId', 'Hook', 'Channel', 'Level', 'Message', 'Time', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'customerId', 'orderId', 'hook', 'channel', 'level', 'message', 'time', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(PaypalLogTableMap::ID, PaypalLogTableMap::CUSTOMER_ID, PaypalLogTableMap::ORDER_ID, PaypalLogTableMap::HOOK, PaypalLogTableMap::CHANNEL, PaypalLogTableMap::LEVEL, PaypalLogTableMap::MESSAGE, PaypalLogTableMap::TIME, PaypalLogTableMap::CREATED_AT, PaypalLogTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'CUSTOMER_ID', 'ORDER_ID', 'HOOK', 'CHANNEL', 'LEVEL', 'MESSAGE', 'TIME', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'customer_id', 'order_id', 'hook', 'channel', 'level', 'message', 'time', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
* 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, 'CustomerId' => 1, 'OrderId' => 2, 'Hook' => 3, 'Channel' => 4, 'Level' => 5, 'Message' => 6, 'Time' => 7, 'CreatedAt' => 8, 'UpdatedAt' => 9, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'customerId' => 1, 'orderId' => 2, 'hook' => 3, 'channel' => 4, 'level' => 5, 'message' => 6, 'time' => 7, 'createdAt' => 8, 'updatedAt' => 9, ),
self::TYPE_COLNAME => array(PaypalLogTableMap::ID => 0, PaypalLogTableMap::CUSTOMER_ID => 1, PaypalLogTableMap::ORDER_ID => 2, PaypalLogTableMap::HOOK => 3, PaypalLogTableMap::CHANNEL => 4, PaypalLogTableMap::LEVEL => 5, PaypalLogTableMap::MESSAGE => 6, PaypalLogTableMap::TIME => 7, PaypalLogTableMap::CREATED_AT => 8, PaypalLogTableMap::UPDATED_AT => 9, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CUSTOMER_ID' => 1, 'ORDER_ID' => 2, 'HOOK' => 3, 'CHANNEL' => 4, 'LEVEL' => 5, 'MESSAGE' => 6, 'TIME' => 7, 'CREATED_AT' => 8, 'UPDATED_AT' => 9, ),
self::TYPE_FIELDNAME => array('id' => 0, 'customer_id' => 1, 'order_id' => 2, 'hook' => 3, 'channel' => 4, 'level' => 5, 'message' => 6, 'time' => 7, 'created_at' => 8, 'updated_at' => 9, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
* 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('paypal_log');
$this->setPhpName('PaypalLog');
$this->setClassName('\\PayPal\\Model\\PaypalLog');
$this->setPackage('PayPal.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('CUSTOMER_ID', 'CustomerId', 'INTEGER', 'customer', 'ID', false, null, null);
$this->addForeignKey('ORDER_ID', 'OrderId', 'INTEGER', 'order', 'ID', false, null, null);
$this->addColumn('HOOK', 'Hook', 'VARCHAR', false, 255, null);
$this->addColumn('CHANNEL', 'Channel', 'VARCHAR', false, 255, null);
$this->addColumn('LEVEL', 'Level', 'INTEGER', false, null, null);
$this->addColumn('MESSAGE', 'Message', 'CLOB', false, null, null);
$this->addColumn('TIME', 'Time', 'INTEGER', false, 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('Customer', '\\Thelia\\Model\\Customer', RelationMap::MANY_TO_ONE, array('customer_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::MANY_TO_ONE, array('order_id' => 'id', ), 'CASCADE', 'RESTRICT');
} // buildRelations()
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
/**
* 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 ? PaypalLogTableMap::CLASS_DEFAULT : PaypalLogTableMap::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 (PaypalLog object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = PaypalLogTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = PaypalLogTableMap::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 + PaypalLogTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = PaypalLogTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
PaypalLogTableMap::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 = PaypalLogTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = PaypalLogTableMap::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;
PaypalLogTableMap::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(PaypalLogTableMap::ID);
$criteria->addSelectColumn(PaypalLogTableMap::CUSTOMER_ID);
$criteria->addSelectColumn(PaypalLogTableMap::ORDER_ID);
$criteria->addSelectColumn(PaypalLogTableMap::HOOK);
$criteria->addSelectColumn(PaypalLogTableMap::CHANNEL);
$criteria->addSelectColumn(PaypalLogTableMap::LEVEL);
$criteria->addSelectColumn(PaypalLogTableMap::MESSAGE);
$criteria->addSelectColumn(PaypalLogTableMap::TIME);
$criteria->addSelectColumn(PaypalLogTableMap::CREATED_AT);
$criteria->addSelectColumn(PaypalLogTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.CUSTOMER_ID');
$criteria->addSelectColumn($alias . '.ORDER_ID');
$criteria->addSelectColumn($alias . '.HOOK');
$criteria->addSelectColumn($alias . '.CHANNEL');
$criteria->addSelectColumn($alias . '.LEVEL');
$criteria->addSelectColumn($alias . '.MESSAGE');
$criteria->addSelectColumn($alias . '.TIME');
$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(PaypalLogTableMap::DATABASE_NAME)->getTable(PaypalLogTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(PaypalLogTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(PaypalLogTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new PaypalLogTableMap());
}
}
/**
* Performs a DELETE on the database, given a PaypalLog or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or PaypalLog 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(PaypalLogTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \PayPal\Model\PaypalLog) { // 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(PaypalLogTableMap::DATABASE_NAME);
$criteria->add(PaypalLogTableMap::ID, (array) $values, Criteria::IN);
}
$query = PaypalLogQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { PaypalLogTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { PaypalLogTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the paypal_log 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 PaypalLogQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a PaypalLog or Criteria object.
*
* @param mixed $criteria Criteria or PaypalLog 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(PaypalLogTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from PaypalLog object
}
if ($criteria->containsKey(PaypalLogTableMap::ID) && $criteria->keyContainsValue(PaypalLogTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.PaypalLogTableMap::ID.')');
}
// Set the correct dbName
$query = PaypalLogQuery::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;
}
} // PaypalLogTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
PaypalLogTableMap::buildTableMap();

View File

@@ -0,0 +1,593 @@
<?php
namespace PayPal\Model\Map;
use PayPal\Model\PaypalOrder;
use PayPal\Model\PaypalOrderQuery;
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 'paypal_order' 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 PaypalOrderTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'PayPal.Model.Map.PaypalOrderTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'paypal_order';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\PayPal\\Model\\PaypalOrder';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'PayPal.Model.PaypalOrder';
/**
* The total number of columns
*/
const NUM_COLUMNS = 22;
/**
* 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 = 22;
/**
* the column name for the ID field
*/
const ID = 'paypal_order.ID';
/**
* the column name for the PAYMENT_ID field
*/
const PAYMENT_ID = 'paypal_order.PAYMENT_ID';
/**
* the column name for the AGREEMENT_ID field
*/
const AGREEMENT_ID = 'paypal_order.AGREEMENT_ID';
/**
* the column name for the CREDIT_CARD_ID field
*/
const CREDIT_CARD_ID = 'paypal_order.CREDIT_CARD_ID';
/**
* the column name for the STATE field
*/
const STATE = 'paypal_order.STATE';
/**
* the column name for the AMOUNT field
*/
const AMOUNT = 'paypal_order.AMOUNT';
/**
* the column name for the DESCRIPTION field
*/
const DESCRIPTION = 'paypal_order.DESCRIPTION';
/**
* the column name for the PAYER_ID field
*/
const PAYER_ID = 'paypal_order.PAYER_ID';
/**
* the column name for the TOKEN field
*/
const TOKEN = 'paypal_order.TOKEN';
/**
* the column name for the PLANIFIED_TITLE field
*/
const PLANIFIED_TITLE = 'paypal_order.PLANIFIED_TITLE';
/**
* the column name for the PLANIFIED_DESCRIPTION field
*/
const PLANIFIED_DESCRIPTION = 'paypal_order.PLANIFIED_DESCRIPTION';
/**
* the column name for the PLANIFIED_FREQUENCY field
*/
const PLANIFIED_FREQUENCY = 'paypal_order.PLANIFIED_FREQUENCY';
/**
* the column name for the PLANIFIED_FREQUENCY_INTERVAL field
*/
const PLANIFIED_FREQUENCY_INTERVAL = 'paypal_order.PLANIFIED_FREQUENCY_INTERVAL';
/**
* the column name for the PLANIFIED_CYCLE field
*/
const PLANIFIED_CYCLE = 'paypal_order.PLANIFIED_CYCLE';
/**
* the column name for the PLANIFIED_ACTUAL_CYCLE field
*/
const PLANIFIED_ACTUAL_CYCLE = 'paypal_order.PLANIFIED_ACTUAL_CYCLE';
/**
* the column name for the PLANIFIED_MIN_AMOUNT field
*/
const PLANIFIED_MIN_AMOUNT = 'paypal_order.PLANIFIED_MIN_AMOUNT';
/**
* the column name for the PLANIFIED_MAX_AMOUNT field
*/
const PLANIFIED_MAX_AMOUNT = 'paypal_order.PLANIFIED_MAX_AMOUNT';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'paypal_order.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'paypal_order.UPDATED_AT';
/**
* the column name for the VERSION field
*/
const VERSION = 'paypal_order.VERSION';
/**
* the column name for the VERSION_CREATED_AT field
*/
const VERSION_CREATED_AT = 'paypal_order.VERSION_CREATED_AT';
/**
* the column name for the VERSION_CREATED_BY field
*/
const VERSION_CREATED_BY = 'paypal_order.VERSION_CREATED_BY';
/**
* 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', 'PaymentId', 'AgreementId', 'CreditCardId', 'State', 'Amount', 'Description', 'PayerId', 'Token', 'PlanifiedTitle', 'PlanifiedDescription', 'PlanifiedFrequency', 'PlanifiedFrequencyInterval', 'PlanifiedCycle', 'PlanifiedActualCycle', 'PlanifiedMinAmount', 'PlanifiedMaxAmount', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ),
self::TYPE_STUDLYPHPNAME => array('id', 'paymentId', 'agreementId', 'creditCardId', 'state', 'amount', 'description', 'payerId', 'token', 'planifiedTitle', 'planifiedDescription', 'planifiedFrequency', 'planifiedFrequencyInterval', 'planifiedCycle', 'planifiedActualCycle', 'planifiedMinAmount', 'planifiedMaxAmount', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ),
self::TYPE_COLNAME => array(PaypalOrderTableMap::ID, PaypalOrderTableMap::PAYMENT_ID, PaypalOrderTableMap::AGREEMENT_ID, PaypalOrderTableMap::CREDIT_CARD_ID, PaypalOrderTableMap::STATE, PaypalOrderTableMap::AMOUNT, PaypalOrderTableMap::DESCRIPTION, PaypalOrderTableMap::PAYER_ID, PaypalOrderTableMap::TOKEN, PaypalOrderTableMap::PLANIFIED_TITLE, PaypalOrderTableMap::PLANIFIED_DESCRIPTION, PaypalOrderTableMap::PLANIFIED_FREQUENCY, PaypalOrderTableMap::PLANIFIED_FREQUENCY_INTERVAL, PaypalOrderTableMap::PLANIFIED_CYCLE, PaypalOrderTableMap::PLANIFIED_ACTUAL_CYCLE, PaypalOrderTableMap::PLANIFIED_MIN_AMOUNT, PaypalOrderTableMap::PLANIFIED_MAX_AMOUNT, PaypalOrderTableMap::CREATED_AT, PaypalOrderTableMap::UPDATED_AT, PaypalOrderTableMap::VERSION, PaypalOrderTableMap::VERSION_CREATED_AT, PaypalOrderTableMap::VERSION_CREATED_BY, ),
self::TYPE_RAW_COLNAME => array('ID', 'PAYMENT_ID', 'AGREEMENT_ID', 'CREDIT_CARD_ID', 'STATE', 'AMOUNT', 'DESCRIPTION', 'PAYER_ID', 'TOKEN', 'PLANIFIED_TITLE', 'PLANIFIED_DESCRIPTION', 'PLANIFIED_FREQUENCY', 'PLANIFIED_FREQUENCY_INTERVAL', 'PLANIFIED_CYCLE', 'PLANIFIED_ACTUAL_CYCLE', 'PLANIFIED_MIN_AMOUNT', 'PLANIFIED_MAX_AMOUNT', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ),
self::TYPE_FIELDNAME => array('id', 'payment_id', 'agreement_id', 'credit_card_id', 'state', 'amount', 'description', 'payer_id', 'token', 'planified_title', 'planified_description', 'planified_frequency', 'planified_frequency_interval', 'planified_cycle', 'planified_actual_cycle', 'planified_min_amount', 'planified_max_amount', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, )
);
/**
* 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, 'PaymentId' => 1, 'AgreementId' => 2, 'CreditCardId' => 3, 'State' => 4, 'Amount' => 5, 'Description' => 6, 'PayerId' => 7, 'Token' => 8, 'PlanifiedTitle' => 9, 'PlanifiedDescription' => 10, 'PlanifiedFrequency' => 11, 'PlanifiedFrequencyInterval' => 12, 'PlanifiedCycle' => 13, 'PlanifiedActualCycle' => 14, 'PlanifiedMinAmount' => 15, 'PlanifiedMaxAmount' => 16, 'CreatedAt' => 17, 'UpdatedAt' => 18, 'Version' => 19, 'VersionCreatedAt' => 20, 'VersionCreatedBy' => 21, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'paymentId' => 1, 'agreementId' => 2, 'creditCardId' => 3, 'state' => 4, 'amount' => 5, 'description' => 6, 'payerId' => 7, 'token' => 8, 'planifiedTitle' => 9, 'planifiedDescription' => 10, 'planifiedFrequency' => 11, 'planifiedFrequencyInterval' => 12, 'planifiedCycle' => 13, 'planifiedActualCycle' => 14, 'planifiedMinAmount' => 15, 'planifiedMaxAmount' => 16, 'createdAt' => 17, 'updatedAt' => 18, 'version' => 19, 'versionCreatedAt' => 20, 'versionCreatedBy' => 21, ),
self::TYPE_COLNAME => array(PaypalOrderTableMap::ID => 0, PaypalOrderTableMap::PAYMENT_ID => 1, PaypalOrderTableMap::AGREEMENT_ID => 2, PaypalOrderTableMap::CREDIT_CARD_ID => 3, PaypalOrderTableMap::STATE => 4, PaypalOrderTableMap::AMOUNT => 5, PaypalOrderTableMap::DESCRIPTION => 6, PaypalOrderTableMap::PAYER_ID => 7, PaypalOrderTableMap::TOKEN => 8, PaypalOrderTableMap::PLANIFIED_TITLE => 9, PaypalOrderTableMap::PLANIFIED_DESCRIPTION => 10, PaypalOrderTableMap::PLANIFIED_FREQUENCY => 11, PaypalOrderTableMap::PLANIFIED_FREQUENCY_INTERVAL => 12, PaypalOrderTableMap::PLANIFIED_CYCLE => 13, PaypalOrderTableMap::PLANIFIED_ACTUAL_CYCLE => 14, PaypalOrderTableMap::PLANIFIED_MIN_AMOUNT => 15, PaypalOrderTableMap::PLANIFIED_MAX_AMOUNT => 16, PaypalOrderTableMap::CREATED_AT => 17, PaypalOrderTableMap::UPDATED_AT => 18, PaypalOrderTableMap::VERSION => 19, PaypalOrderTableMap::VERSION_CREATED_AT => 20, PaypalOrderTableMap::VERSION_CREATED_BY => 21, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PAYMENT_ID' => 1, 'AGREEMENT_ID' => 2, 'CREDIT_CARD_ID' => 3, 'STATE' => 4, 'AMOUNT' => 5, 'DESCRIPTION' => 6, 'PAYER_ID' => 7, 'TOKEN' => 8, 'PLANIFIED_TITLE' => 9, 'PLANIFIED_DESCRIPTION' => 10, 'PLANIFIED_FREQUENCY' => 11, 'PLANIFIED_FREQUENCY_INTERVAL' => 12, 'PLANIFIED_CYCLE' => 13, 'PLANIFIED_ACTUAL_CYCLE' => 14, 'PLANIFIED_MIN_AMOUNT' => 15, 'PLANIFIED_MAX_AMOUNT' => 16, 'CREATED_AT' => 17, 'UPDATED_AT' => 18, 'VERSION' => 19, 'VERSION_CREATED_AT' => 20, 'VERSION_CREATED_BY' => 21, ),
self::TYPE_FIELDNAME => array('id' => 0, 'payment_id' => 1, 'agreement_id' => 2, 'credit_card_id' => 3, 'state' => 4, 'amount' => 5, 'description' => 6, 'payer_id' => 7, 'token' => 8, 'planified_title' => 9, 'planified_description' => 10, 'planified_frequency' => 11, 'planified_frequency_interval' => 12, 'planified_cycle' => 13, 'planified_actual_cycle' => 14, 'planified_min_amount' => 15, 'planified_max_amount' => 16, 'created_at' => 17, 'updated_at' => 18, 'version' => 19, 'version_created_at' => 20, 'version_created_by' => 21, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, )
);
/**
* 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('paypal_order');
$this->setPhpName('PaypalOrder');
$this->setClassName('\\PayPal\\Model\\PaypalOrder');
$this->setPackage('PayPal.Model');
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'order', 'ID', true, null, null);
$this->addColumn('PAYMENT_ID', 'PaymentId', 'VARCHAR', false, 50, null);
$this->addColumn('AGREEMENT_ID', 'AgreementId', 'VARCHAR', false, 255, null);
$this->addColumn('CREDIT_CARD_ID', 'CreditCardId', 'VARCHAR', false, 40, null);
$this->addColumn('STATE', 'State', 'VARCHAR', false, 20, null);
$this->addColumn('AMOUNT', 'Amount', 'DECIMAL', false, 16, 0);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('PAYER_ID', 'PayerId', 'VARCHAR', false, 255, null);
$this->addColumn('TOKEN', 'Token', 'VARCHAR', false, 255, null);
$this->addColumn('PLANIFIED_TITLE', 'PlanifiedTitle', 'VARCHAR', true, 255, null);
$this->addColumn('PLANIFIED_DESCRIPTION', 'PlanifiedDescription', 'CLOB', false, null, null);
$this->addColumn('PLANIFIED_FREQUENCY', 'PlanifiedFrequency', 'VARCHAR', true, 255, null);
$this->addColumn('PLANIFIED_FREQUENCY_INTERVAL', 'PlanifiedFrequencyInterval', 'INTEGER', true, null, null);
$this->addColumn('PLANIFIED_CYCLE', 'PlanifiedCycle', 'INTEGER', true, null, null);
$this->addColumn('PLANIFIED_ACTUAL_CYCLE', 'PlanifiedActualCycle', 'INTEGER', true, null, 0);
$this->addColumn('PLANIFIED_MIN_AMOUNT', 'PlanifiedMinAmount', 'DECIMAL', false, 16, 0);
$this->addColumn('PLANIFIED_MAX_AMOUNT', 'PlanifiedMaxAmount', 'DECIMAL', false, 16, 0);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('VERSION', 'Version', 'INTEGER', false, null, 0);
$this->addColumn('VERSION_CREATED_AT', 'VersionCreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('VERSION_CREATED_BY', 'VersionCreatedBy', 'VARCHAR', false, 100, null);
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('PaypalPlan', '\\PayPal\\Model\\PaypalPlan', RelationMap::ONE_TO_MANY, array('id' => 'paypal_order_id', ), 'CASCADE', 'RESTRICT', 'PaypalPlans');
$this->addRelation('PaypalOrderVersion', '\\PayPal\\Model\\PaypalOrderVersion', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'PaypalOrderVersions');
} // buildRelations()
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
'versionable' => array('version_column' => 'version', 'version_table' => '', 'log_created_at' => 'true', 'log_created_by' => 'true', 'log_comment' => 'false', 'version_created_at_column' => 'version_created_at', 'version_created_by_column' => 'version_created_by', 'version_comment_column' => 'version_comment', ),
);
} // getBehaviors()
/**
* Method to invalidate the instance pool of all tables related to paypal_order * 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.
PaypalPlanTableMap::clearInstancePool();
PaypalOrderVersionTableMap::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 ? PaypalOrderTableMap::CLASS_DEFAULT : PaypalOrderTableMap::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 (PaypalOrder object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = PaypalOrderTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = PaypalOrderTableMap::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 + PaypalOrderTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = PaypalOrderTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
PaypalOrderTableMap::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 = PaypalOrderTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = PaypalOrderTableMap::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;
PaypalOrderTableMap::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(PaypalOrderTableMap::ID);
$criteria->addSelectColumn(PaypalOrderTableMap::PAYMENT_ID);
$criteria->addSelectColumn(PaypalOrderTableMap::AGREEMENT_ID);
$criteria->addSelectColumn(PaypalOrderTableMap::CREDIT_CARD_ID);
$criteria->addSelectColumn(PaypalOrderTableMap::STATE);
$criteria->addSelectColumn(PaypalOrderTableMap::AMOUNT);
$criteria->addSelectColumn(PaypalOrderTableMap::DESCRIPTION);
$criteria->addSelectColumn(PaypalOrderTableMap::PAYER_ID);
$criteria->addSelectColumn(PaypalOrderTableMap::TOKEN);
$criteria->addSelectColumn(PaypalOrderTableMap::PLANIFIED_TITLE);
$criteria->addSelectColumn(PaypalOrderTableMap::PLANIFIED_DESCRIPTION);
$criteria->addSelectColumn(PaypalOrderTableMap::PLANIFIED_FREQUENCY);
$criteria->addSelectColumn(PaypalOrderTableMap::PLANIFIED_FREQUENCY_INTERVAL);
$criteria->addSelectColumn(PaypalOrderTableMap::PLANIFIED_CYCLE);
$criteria->addSelectColumn(PaypalOrderTableMap::PLANIFIED_ACTUAL_CYCLE);
$criteria->addSelectColumn(PaypalOrderTableMap::PLANIFIED_MIN_AMOUNT);
$criteria->addSelectColumn(PaypalOrderTableMap::PLANIFIED_MAX_AMOUNT);
$criteria->addSelectColumn(PaypalOrderTableMap::CREATED_AT);
$criteria->addSelectColumn(PaypalOrderTableMap::UPDATED_AT);
$criteria->addSelectColumn(PaypalOrderTableMap::VERSION);
$criteria->addSelectColumn(PaypalOrderTableMap::VERSION_CREATED_AT);
$criteria->addSelectColumn(PaypalOrderTableMap::VERSION_CREATED_BY);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.PAYMENT_ID');
$criteria->addSelectColumn($alias . '.AGREEMENT_ID');
$criteria->addSelectColumn($alias . '.CREDIT_CARD_ID');
$criteria->addSelectColumn($alias . '.STATE');
$criteria->addSelectColumn($alias . '.AMOUNT');
$criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.PAYER_ID');
$criteria->addSelectColumn($alias . '.TOKEN');
$criteria->addSelectColumn($alias . '.PLANIFIED_TITLE');
$criteria->addSelectColumn($alias . '.PLANIFIED_DESCRIPTION');
$criteria->addSelectColumn($alias . '.PLANIFIED_FREQUENCY');
$criteria->addSelectColumn($alias . '.PLANIFIED_FREQUENCY_INTERVAL');
$criteria->addSelectColumn($alias . '.PLANIFIED_CYCLE');
$criteria->addSelectColumn($alias . '.PLANIFIED_ACTUAL_CYCLE');
$criteria->addSelectColumn($alias . '.PLANIFIED_MIN_AMOUNT');
$criteria->addSelectColumn($alias . '.PLANIFIED_MAX_AMOUNT');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
$criteria->addSelectColumn($alias . '.VERSION');
$criteria->addSelectColumn($alias . '.VERSION_CREATED_AT');
$criteria->addSelectColumn($alias . '.VERSION_CREATED_BY');
}
}
/**
* 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(PaypalOrderTableMap::DATABASE_NAME)->getTable(PaypalOrderTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(PaypalOrderTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(PaypalOrderTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new PaypalOrderTableMap());
}
}
/**
* Performs a DELETE on the database, given a PaypalOrder or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or PaypalOrder 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(PaypalOrderTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \PayPal\Model\PaypalOrder) { // 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(PaypalOrderTableMap::DATABASE_NAME);
$criteria->add(PaypalOrderTableMap::ID, (array) $values, Criteria::IN);
}
$query = PaypalOrderQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { PaypalOrderTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { PaypalOrderTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the paypal_order 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 PaypalOrderQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a PaypalOrder or Criteria object.
*
* @param mixed $criteria Criteria or PaypalOrder 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(PaypalOrderTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from PaypalOrder object
}
// Set the correct dbName
$query = PaypalOrderQuery::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;
}
} // PaypalOrderTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
PaypalOrderTableMap::buildTableMap();

View File

@@ -0,0 +1,634 @@
<?php
namespace PayPal\Model\Map;
use PayPal\Model\PaypalOrderVersion;
use PayPal\Model\PaypalOrderVersionQuery;
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 'paypal_order_version' 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 PaypalOrderVersionTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'PayPal.Model.Map.PaypalOrderVersionTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'paypal_order_version';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\PayPal\\Model\\PaypalOrderVersion';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'PayPal.Model.PaypalOrderVersion';
/**
* The total number of columns
*/
const NUM_COLUMNS = 23;
/**
* 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 = 23;
/**
* the column name for the ID field
*/
const ID = 'paypal_order_version.ID';
/**
* the column name for the PAYMENT_ID field
*/
const PAYMENT_ID = 'paypal_order_version.PAYMENT_ID';
/**
* the column name for the AGREEMENT_ID field
*/
const AGREEMENT_ID = 'paypal_order_version.AGREEMENT_ID';
/**
* the column name for the CREDIT_CARD_ID field
*/
const CREDIT_CARD_ID = 'paypal_order_version.CREDIT_CARD_ID';
/**
* the column name for the STATE field
*/
const STATE = 'paypal_order_version.STATE';
/**
* the column name for the AMOUNT field
*/
const AMOUNT = 'paypal_order_version.AMOUNT';
/**
* the column name for the DESCRIPTION field
*/
const DESCRIPTION = 'paypal_order_version.DESCRIPTION';
/**
* the column name for the PAYER_ID field
*/
const PAYER_ID = 'paypal_order_version.PAYER_ID';
/**
* the column name for the TOKEN field
*/
const TOKEN = 'paypal_order_version.TOKEN';
/**
* the column name for the PLANIFIED_TITLE field
*/
const PLANIFIED_TITLE = 'paypal_order_version.PLANIFIED_TITLE';
/**
* the column name for the PLANIFIED_DESCRIPTION field
*/
const PLANIFIED_DESCRIPTION = 'paypal_order_version.PLANIFIED_DESCRIPTION';
/**
* the column name for the PLANIFIED_FREQUENCY field
*/
const PLANIFIED_FREQUENCY = 'paypal_order_version.PLANIFIED_FREQUENCY';
/**
* the column name for the PLANIFIED_FREQUENCY_INTERVAL field
*/
const PLANIFIED_FREQUENCY_INTERVAL = 'paypal_order_version.PLANIFIED_FREQUENCY_INTERVAL';
/**
* the column name for the PLANIFIED_CYCLE field
*/
const PLANIFIED_CYCLE = 'paypal_order_version.PLANIFIED_CYCLE';
/**
* the column name for the PLANIFIED_ACTUAL_CYCLE field
*/
const PLANIFIED_ACTUAL_CYCLE = 'paypal_order_version.PLANIFIED_ACTUAL_CYCLE';
/**
* the column name for the PLANIFIED_MIN_AMOUNT field
*/
const PLANIFIED_MIN_AMOUNT = 'paypal_order_version.PLANIFIED_MIN_AMOUNT';
/**
* the column name for the PLANIFIED_MAX_AMOUNT field
*/
const PLANIFIED_MAX_AMOUNT = 'paypal_order_version.PLANIFIED_MAX_AMOUNT';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'paypal_order_version.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'paypal_order_version.UPDATED_AT';
/**
* the column name for the VERSION field
*/
const VERSION = 'paypal_order_version.VERSION';
/**
* the column name for the VERSION_CREATED_AT field
*/
const VERSION_CREATED_AT = 'paypal_order_version.VERSION_CREATED_AT';
/**
* the column name for the VERSION_CREATED_BY field
*/
const VERSION_CREATED_BY = 'paypal_order_version.VERSION_CREATED_BY';
/**
* the column name for the ID_VERSION field
*/
const ID_VERSION = 'paypal_order_version.ID_VERSION';
/**
* 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', 'PaymentId', 'AgreementId', 'CreditCardId', 'State', 'Amount', 'Description', 'PayerId', 'Token', 'PlanifiedTitle', 'PlanifiedDescription', 'PlanifiedFrequency', 'PlanifiedFrequencyInterval', 'PlanifiedCycle', 'PlanifiedActualCycle', 'PlanifiedMinAmount', 'PlanifiedMaxAmount', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', 'IdVersion', ),
self::TYPE_STUDLYPHPNAME => array('id', 'paymentId', 'agreementId', 'creditCardId', 'state', 'amount', 'description', 'payerId', 'token', 'planifiedTitle', 'planifiedDescription', 'planifiedFrequency', 'planifiedFrequencyInterval', 'planifiedCycle', 'planifiedActualCycle', 'planifiedMinAmount', 'planifiedMaxAmount', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', 'idVersion', ),
self::TYPE_COLNAME => array(PaypalOrderVersionTableMap::ID, PaypalOrderVersionTableMap::PAYMENT_ID, PaypalOrderVersionTableMap::AGREEMENT_ID, PaypalOrderVersionTableMap::CREDIT_CARD_ID, PaypalOrderVersionTableMap::STATE, PaypalOrderVersionTableMap::AMOUNT, PaypalOrderVersionTableMap::DESCRIPTION, PaypalOrderVersionTableMap::PAYER_ID, PaypalOrderVersionTableMap::TOKEN, PaypalOrderVersionTableMap::PLANIFIED_TITLE, PaypalOrderVersionTableMap::PLANIFIED_DESCRIPTION, PaypalOrderVersionTableMap::PLANIFIED_FREQUENCY, PaypalOrderVersionTableMap::PLANIFIED_FREQUENCY_INTERVAL, PaypalOrderVersionTableMap::PLANIFIED_CYCLE, PaypalOrderVersionTableMap::PLANIFIED_ACTUAL_CYCLE, PaypalOrderVersionTableMap::PLANIFIED_MIN_AMOUNT, PaypalOrderVersionTableMap::PLANIFIED_MAX_AMOUNT, PaypalOrderVersionTableMap::CREATED_AT, PaypalOrderVersionTableMap::UPDATED_AT, PaypalOrderVersionTableMap::VERSION, PaypalOrderVersionTableMap::VERSION_CREATED_AT, PaypalOrderVersionTableMap::VERSION_CREATED_BY, PaypalOrderVersionTableMap::ID_VERSION, ),
self::TYPE_RAW_COLNAME => array('ID', 'PAYMENT_ID', 'AGREEMENT_ID', 'CREDIT_CARD_ID', 'STATE', 'AMOUNT', 'DESCRIPTION', 'PAYER_ID', 'TOKEN', 'PLANIFIED_TITLE', 'PLANIFIED_DESCRIPTION', 'PLANIFIED_FREQUENCY', 'PLANIFIED_FREQUENCY_INTERVAL', 'PLANIFIED_CYCLE', 'PLANIFIED_ACTUAL_CYCLE', 'PLANIFIED_MIN_AMOUNT', 'PLANIFIED_MAX_AMOUNT', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', 'ID_VERSION', ),
self::TYPE_FIELDNAME => array('id', 'payment_id', 'agreement_id', 'credit_card_id', 'state', 'amount', 'description', 'payer_id', 'token', 'planified_title', 'planified_description', 'planified_frequency', 'planified_frequency_interval', 'planified_cycle', 'planified_actual_cycle', 'planified_min_amount', 'planified_max_amount', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', 'id_version', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, )
);
/**
* 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, 'PaymentId' => 1, 'AgreementId' => 2, 'CreditCardId' => 3, 'State' => 4, 'Amount' => 5, 'Description' => 6, 'PayerId' => 7, 'Token' => 8, 'PlanifiedTitle' => 9, 'PlanifiedDescription' => 10, 'PlanifiedFrequency' => 11, 'PlanifiedFrequencyInterval' => 12, 'PlanifiedCycle' => 13, 'PlanifiedActualCycle' => 14, 'PlanifiedMinAmount' => 15, 'PlanifiedMaxAmount' => 16, 'CreatedAt' => 17, 'UpdatedAt' => 18, 'Version' => 19, 'VersionCreatedAt' => 20, 'VersionCreatedBy' => 21, 'IdVersion' => 22, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'paymentId' => 1, 'agreementId' => 2, 'creditCardId' => 3, 'state' => 4, 'amount' => 5, 'description' => 6, 'payerId' => 7, 'token' => 8, 'planifiedTitle' => 9, 'planifiedDescription' => 10, 'planifiedFrequency' => 11, 'planifiedFrequencyInterval' => 12, 'planifiedCycle' => 13, 'planifiedActualCycle' => 14, 'planifiedMinAmount' => 15, 'planifiedMaxAmount' => 16, 'createdAt' => 17, 'updatedAt' => 18, 'version' => 19, 'versionCreatedAt' => 20, 'versionCreatedBy' => 21, 'idVersion' => 22, ),
self::TYPE_COLNAME => array(PaypalOrderVersionTableMap::ID => 0, PaypalOrderVersionTableMap::PAYMENT_ID => 1, PaypalOrderVersionTableMap::AGREEMENT_ID => 2, PaypalOrderVersionTableMap::CREDIT_CARD_ID => 3, PaypalOrderVersionTableMap::STATE => 4, PaypalOrderVersionTableMap::AMOUNT => 5, PaypalOrderVersionTableMap::DESCRIPTION => 6, PaypalOrderVersionTableMap::PAYER_ID => 7, PaypalOrderVersionTableMap::TOKEN => 8, PaypalOrderVersionTableMap::PLANIFIED_TITLE => 9, PaypalOrderVersionTableMap::PLANIFIED_DESCRIPTION => 10, PaypalOrderVersionTableMap::PLANIFIED_FREQUENCY => 11, PaypalOrderVersionTableMap::PLANIFIED_FREQUENCY_INTERVAL => 12, PaypalOrderVersionTableMap::PLANIFIED_CYCLE => 13, PaypalOrderVersionTableMap::PLANIFIED_ACTUAL_CYCLE => 14, PaypalOrderVersionTableMap::PLANIFIED_MIN_AMOUNT => 15, PaypalOrderVersionTableMap::PLANIFIED_MAX_AMOUNT => 16, PaypalOrderVersionTableMap::CREATED_AT => 17, PaypalOrderVersionTableMap::UPDATED_AT => 18, PaypalOrderVersionTableMap::VERSION => 19, PaypalOrderVersionTableMap::VERSION_CREATED_AT => 20, PaypalOrderVersionTableMap::VERSION_CREATED_BY => 21, PaypalOrderVersionTableMap::ID_VERSION => 22, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PAYMENT_ID' => 1, 'AGREEMENT_ID' => 2, 'CREDIT_CARD_ID' => 3, 'STATE' => 4, 'AMOUNT' => 5, 'DESCRIPTION' => 6, 'PAYER_ID' => 7, 'TOKEN' => 8, 'PLANIFIED_TITLE' => 9, 'PLANIFIED_DESCRIPTION' => 10, 'PLANIFIED_FREQUENCY' => 11, 'PLANIFIED_FREQUENCY_INTERVAL' => 12, 'PLANIFIED_CYCLE' => 13, 'PLANIFIED_ACTUAL_CYCLE' => 14, 'PLANIFIED_MIN_AMOUNT' => 15, 'PLANIFIED_MAX_AMOUNT' => 16, 'CREATED_AT' => 17, 'UPDATED_AT' => 18, 'VERSION' => 19, 'VERSION_CREATED_AT' => 20, 'VERSION_CREATED_BY' => 21, 'ID_VERSION' => 22, ),
self::TYPE_FIELDNAME => array('id' => 0, 'payment_id' => 1, 'agreement_id' => 2, 'credit_card_id' => 3, 'state' => 4, 'amount' => 5, 'description' => 6, 'payer_id' => 7, 'token' => 8, 'planified_title' => 9, 'planified_description' => 10, 'planified_frequency' => 11, 'planified_frequency_interval' => 12, 'planified_cycle' => 13, 'planified_actual_cycle' => 14, 'planified_min_amount' => 15, 'planified_max_amount' => 16, 'created_at' => 17, 'updated_at' => 18, 'version' => 19, 'version_created_at' => 20, 'version_created_by' => 21, 'id_version' => 22, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, )
);
/**
* 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('paypal_order_version');
$this->setPhpName('PaypalOrderVersion');
$this->setClassName('\\PayPal\\Model\\PaypalOrderVersion');
$this->setPackage('PayPal.Model');
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'paypal_order', 'ID', true, null, null);
$this->addColumn('PAYMENT_ID', 'PaymentId', 'VARCHAR', false, 50, null);
$this->addColumn('AGREEMENT_ID', 'AgreementId', 'VARCHAR', false, 255, null);
$this->addColumn('CREDIT_CARD_ID', 'CreditCardId', 'VARCHAR', false, 40, null);
$this->addColumn('STATE', 'State', 'VARCHAR', false, 20, null);
$this->addColumn('AMOUNT', 'Amount', 'DECIMAL', false, 16, 0);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('PAYER_ID', 'PayerId', 'VARCHAR', false, 255, null);
$this->addColumn('TOKEN', 'Token', 'VARCHAR', false, 255, null);
$this->addColumn('PLANIFIED_TITLE', 'PlanifiedTitle', 'VARCHAR', true, 255, null);
$this->addColumn('PLANIFIED_DESCRIPTION', 'PlanifiedDescription', 'CLOB', false, null, null);
$this->addColumn('PLANIFIED_FREQUENCY', 'PlanifiedFrequency', 'VARCHAR', true, 255, null);
$this->addColumn('PLANIFIED_FREQUENCY_INTERVAL', 'PlanifiedFrequencyInterval', 'INTEGER', true, null, null);
$this->addColumn('PLANIFIED_CYCLE', 'PlanifiedCycle', 'INTEGER', true, null, null);
$this->addColumn('PLANIFIED_ACTUAL_CYCLE', 'PlanifiedActualCycle', 'INTEGER', true, null, 0);
$this->addColumn('PLANIFIED_MIN_AMOUNT', 'PlanifiedMinAmount', 'DECIMAL', false, 16, 0);
$this->addColumn('PLANIFIED_MAX_AMOUNT', 'PlanifiedMaxAmount', 'DECIMAL', false, 16, 0);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
$this->addPrimaryKey('VERSION', 'Version', 'INTEGER', true, null, 0);
$this->addColumn('VERSION_CREATED_AT', 'VersionCreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('VERSION_CREATED_BY', 'VersionCreatedBy', 'VARCHAR', false, 100, null);
$this->addColumn('ID_VERSION', 'IdVersion', 'INTEGER', false, null, 0);
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('PaypalOrder', '\\PayPal\\Model\\PaypalOrder', 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 \PayPal\Model\PaypalOrderVersion $obj A \PayPal\Model\PaypalOrderVersion 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->getVersion()));
} // 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 \PayPal\Model\PaypalOrderVersion object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \PayPal\Model\PaypalOrderVersion) {
$key = serialize(array((string) $value->getId(), (string) $value->getVersion()));
} 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 \PayPal\Model\PaypalOrderVersion 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 ? 19 + $offset : static::translateFieldName('Version', 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 ? 19 + $offset : static::translateFieldName('Version', 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 ? PaypalOrderVersionTableMap::CLASS_DEFAULT : PaypalOrderVersionTableMap::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 (PaypalOrderVersion object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = PaypalOrderVersionTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = PaypalOrderVersionTableMap::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 + PaypalOrderVersionTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = PaypalOrderVersionTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
PaypalOrderVersionTableMap::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 = PaypalOrderVersionTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = PaypalOrderVersionTableMap::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;
PaypalOrderVersionTableMap::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(PaypalOrderVersionTableMap::ID);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PAYMENT_ID);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::AGREEMENT_ID);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::CREDIT_CARD_ID);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::STATE);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::AMOUNT);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::DESCRIPTION);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PAYER_ID);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::TOKEN);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PLANIFIED_TITLE);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PLANIFIED_DESCRIPTION);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PLANIFIED_FREQUENCY);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PLANIFIED_FREQUENCY_INTERVAL);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PLANIFIED_CYCLE);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PLANIFIED_ACTUAL_CYCLE);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PLANIFIED_MIN_AMOUNT);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::PLANIFIED_MAX_AMOUNT);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::CREATED_AT);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::UPDATED_AT);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::VERSION);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::VERSION_CREATED_AT);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::VERSION_CREATED_BY);
$criteria->addSelectColumn(PaypalOrderVersionTableMap::ID_VERSION);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.PAYMENT_ID');
$criteria->addSelectColumn($alias . '.AGREEMENT_ID');
$criteria->addSelectColumn($alias . '.CREDIT_CARD_ID');
$criteria->addSelectColumn($alias . '.STATE');
$criteria->addSelectColumn($alias . '.AMOUNT');
$criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.PAYER_ID');
$criteria->addSelectColumn($alias . '.TOKEN');
$criteria->addSelectColumn($alias . '.PLANIFIED_TITLE');
$criteria->addSelectColumn($alias . '.PLANIFIED_DESCRIPTION');
$criteria->addSelectColumn($alias . '.PLANIFIED_FREQUENCY');
$criteria->addSelectColumn($alias . '.PLANIFIED_FREQUENCY_INTERVAL');
$criteria->addSelectColumn($alias . '.PLANIFIED_CYCLE');
$criteria->addSelectColumn($alias . '.PLANIFIED_ACTUAL_CYCLE');
$criteria->addSelectColumn($alias . '.PLANIFIED_MIN_AMOUNT');
$criteria->addSelectColumn($alias . '.PLANIFIED_MAX_AMOUNT');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
$criteria->addSelectColumn($alias . '.VERSION');
$criteria->addSelectColumn($alias . '.VERSION_CREATED_AT');
$criteria->addSelectColumn($alias . '.VERSION_CREATED_BY');
$criteria->addSelectColumn($alias . '.ID_VERSION');
}
}
/**
* 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(PaypalOrderVersionTableMap::DATABASE_NAME)->getTable(PaypalOrderVersionTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(PaypalOrderVersionTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(PaypalOrderVersionTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new PaypalOrderVersionTableMap());
}
}
/**
* Performs a DELETE on the database, given a PaypalOrderVersion or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or PaypalOrderVersion 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(PaypalOrderVersionTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \PayPal\Model\PaypalOrderVersion) { // 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(PaypalOrderVersionTableMap::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(PaypalOrderVersionTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(PaypalOrderVersionTableMap::VERSION, $value[1]));
$criteria->addOr($criterion);
}
}
$query = PaypalOrderVersionQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { PaypalOrderVersionTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { PaypalOrderVersionTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the paypal_order_version 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 PaypalOrderVersionQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a PaypalOrderVersion or Criteria object.
*
* @param mixed $criteria Criteria or PaypalOrderVersion 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(PaypalOrderVersionTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from PaypalOrderVersion object
}
// Set the correct dbName
$query = PaypalOrderVersionQuery::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;
}
} // PaypalOrderVersionTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
PaypalOrderVersionTableMap::buildTableMap();

View File

@@ -0,0 +1,456 @@
<?php
namespace PayPal\Model\Map;
use PayPal\Model\PaypalPlan;
use PayPal\Model\PaypalPlanQuery;
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 'paypal_plan' 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 PaypalPlanTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'PayPal.Model.Map.PaypalPlanTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'paypal_plan';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\PayPal\\Model\\PaypalPlan';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'PayPal.Model.PaypalPlan';
/**
* The total number of columns
*/
const NUM_COLUMNS = 6;
/**
* 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 = 6;
/**
* the column name for the ID field
*/
const ID = 'paypal_plan.ID';
/**
* the column name for the PAYPAL_ORDER_ID field
*/
const PAYPAL_ORDER_ID = 'paypal_plan.PAYPAL_ORDER_ID';
/**
* the column name for the PLAN_ID field
*/
const PLAN_ID = 'paypal_plan.PLAN_ID';
/**
* the column name for the STATE field
*/
const STATE = 'paypal_plan.STATE';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'paypal_plan.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'paypal_plan.UPDATED_AT';
/**
* 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', 'PaypalOrderId', 'PlanId', 'State', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'paypalOrderId', 'planId', 'state', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(PaypalPlanTableMap::ID, PaypalPlanTableMap::PAYPAL_ORDER_ID, PaypalPlanTableMap::PLAN_ID, PaypalPlanTableMap::STATE, PaypalPlanTableMap::CREATED_AT, PaypalPlanTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PAYPAL_ORDER_ID', 'PLAN_ID', 'STATE', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'paypal_order_id', 'plan_id', 'state', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
);
/**
* 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, 'PaypalOrderId' => 1, 'PlanId' => 2, 'State' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'paypalOrderId' => 1, 'planId' => 2, 'state' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
self::TYPE_COLNAME => array(PaypalPlanTableMap::ID => 0, PaypalPlanTableMap::PAYPAL_ORDER_ID => 1, PaypalPlanTableMap::PLAN_ID => 2, PaypalPlanTableMap::STATE => 3, PaypalPlanTableMap::CREATED_AT => 4, PaypalPlanTableMap::UPDATED_AT => 5, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PAYPAL_ORDER_ID' => 1, 'PLAN_ID' => 2, 'STATE' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
self::TYPE_FIELDNAME => array('id' => 0, 'paypal_order_id' => 1, 'plan_id' => 2, 'state' => 3, 'created_at' => 4, 'updated_at' => 5, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
);
/**
* 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('paypal_plan');
$this->setPhpName('PaypalPlan');
$this->setClassName('\\PayPal\\Model\\PaypalPlan');
$this->setPackage('PayPal.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('PAYPAL_ORDER_ID', 'PaypalOrderId', 'INTEGER', 'paypal_order', 'ID', true, null, null);
$this->addColumn('PLAN_ID', 'PlanId', 'VARCHAR', false, 255, null);
$this->addColumn('STATE', 'State', 'VARCHAR', false, 255, 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('PaypalOrder', '\\PayPal\\Model\\PaypalOrder', RelationMap::MANY_TO_ONE, array('paypal_order_id' => 'id', ), 'CASCADE', 'RESTRICT');
} // buildRelations()
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
/**
* 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 ? PaypalPlanTableMap::CLASS_DEFAULT : PaypalPlanTableMap::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 (PaypalPlan object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = PaypalPlanTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = PaypalPlanTableMap::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 + PaypalPlanTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = PaypalPlanTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
PaypalPlanTableMap::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 = PaypalPlanTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = PaypalPlanTableMap::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;
PaypalPlanTableMap::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(PaypalPlanTableMap::ID);
$criteria->addSelectColumn(PaypalPlanTableMap::PAYPAL_ORDER_ID);
$criteria->addSelectColumn(PaypalPlanTableMap::PLAN_ID);
$criteria->addSelectColumn(PaypalPlanTableMap::STATE);
$criteria->addSelectColumn(PaypalPlanTableMap::CREATED_AT);
$criteria->addSelectColumn(PaypalPlanTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.PAYPAL_ORDER_ID');
$criteria->addSelectColumn($alias . '.PLAN_ID');
$criteria->addSelectColumn($alias . '.STATE');
$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(PaypalPlanTableMap::DATABASE_NAME)->getTable(PaypalPlanTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(PaypalPlanTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(PaypalPlanTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new PaypalPlanTableMap());
}
}
/**
* Performs a DELETE on the database, given a PaypalPlan or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or PaypalPlan 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(PaypalPlanTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \PayPal\Model\PaypalPlan) { // 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(PaypalPlanTableMap::DATABASE_NAME);
$criteria->add(PaypalPlanTableMap::ID, (array) $values, Criteria::IN);
}
$query = PaypalPlanQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { PaypalPlanTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { PaypalPlanTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the paypal_plan 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 PaypalPlanQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a PaypalPlan or Criteria object.
*
* @param mixed $criteria Criteria or PaypalPlan 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(PaypalPlanTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from PaypalPlan object
}
if ($criteria->containsKey(PaypalPlanTableMap::ID) && $criteria->keyContainsValue(PaypalPlanTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.PaypalPlanTableMap::ID.')');
}
// Set the correct dbName
$query = PaypalPlanQuery::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;
}
} // PaypalPlanTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
PaypalPlanTableMap::buildTableMap();

View File

@@ -0,0 +1,482 @@
<?php
namespace PayPal\Model\Map;
use PayPal\Model\PaypalPlanifiedPaymentI18n;
use PayPal\Model\PaypalPlanifiedPaymentI18nQuery;
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 'paypal_planified_payment_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 PaypalPlanifiedPaymentI18nTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'PayPal.Model.Map.PaypalPlanifiedPaymentI18nTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'paypal_planified_payment_i18n';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\PayPal\\Model\\PaypalPlanifiedPaymentI18n';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'PayPal.Model.PaypalPlanifiedPaymentI18n';
/**
* 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 = 'paypal_planified_payment_i18n.ID';
/**
* the column name for the LOCALE field
*/
const LOCALE = 'paypal_planified_payment_i18n.LOCALE';
/**
* the column name for the TITLE field
*/
const TITLE = 'paypal_planified_payment_i18n.TITLE';
/**
* the column name for the DESCRIPTION field
*/
const DESCRIPTION = 'paypal_planified_payment_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(PaypalPlanifiedPaymentI18nTableMap::ID, PaypalPlanifiedPaymentI18nTableMap::LOCALE, PaypalPlanifiedPaymentI18nTableMap::TITLE, PaypalPlanifiedPaymentI18nTableMap::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(PaypalPlanifiedPaymentI18nTableMap::ID => 0, PaypalPlanifiedPaymentI18nTableMap::LOCALE => 1, PaypalPlanifiedPaymentI18nTableMap::TITLE => 2, PaypalPlanifiedPaymentI18nTableMap::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('paypal_planified_payment_i18n');
$this->setPhpName('PaypalPlanifiedPaymentI18n');
$this->setClassName('\\PayPal\\Model\\PaypalPlanifiedPaymentI18n');
$this->setPackage('PayPal.Model');
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'paypal_planified_payment', '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('PaypalPlanifiedPayment', '\\PayPal\\Model\\PaypalPlanifiedPayment', 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 \PayPal\Model\PaypalPlanifiedPaymentI18n $obj A \PayPal\Model\PaypalPlanifiedPaymentI18n 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 \PayPal\Model\PaypalPlanifiedPaymentI18n object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \PayPal\Model\PaypalPlanifiedPaymentI18n) {
$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 \PayPal\Model\PaypalPlanifiedPaymentI18n 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 ? PaypalPlanifiedPaymentI18nTableMap::CLASS_DEFAULT : PaypalPlanifiedPaymentI18nTableMap::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 (PaypalPlanifiedPaymentI18n object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = PaypalPlanifiedPaymentI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = PaypalPlanifiedPaymentI18nTableMap::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 + PaypalPlanifiedPaymentI18nTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = PaypalPlanifiedPaymentI18nTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
PaypalPlanifiedPaymentI18nTableMap::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 = PaypalPlanifiedPaymentI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = PaypalPlanifiedPaymentI18nTableMap::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;
PaypalPlanifiedPaymentI18nTableMap::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(PaypalPlanifiedPaymentI18nTableMap::ID);
$criteria->addSelectColumn(PaypalPlanifiedPaymentI18nTableMap::LOCALE);
$criteria->addSelectColumn(PaypalPlanifiedPaymentI18nTableMap::TITLE);
$criteria->addSelectColumn(PaypalPlanifiedPaymentI18nTableMap::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(PaypalPlanifiedPaymentI18nTableMap::DATABASE_NAME)->getTable(PaypalPlanifiedPaymentI18nTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(PaypalPlanifiedPaymentI18nTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(PaypalPlanifiedPaymentI18nTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new PaypalPlanifiedPaymentI18nTableMap());
}
}
/**
* Performs a DELETE on the database, given a PaypalPlanifiedPaymentI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or PaypalPlanifiedPaymentI18n 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(PaypalPlanifiedPaymentI18nTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \PayPal\Model\PaypalPlanifiedPaymentI18n) { // 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(PaypalPlanifiedPaymentI18nTableMap::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(PaypalPlanifiedPaymentI18nTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(PaypalPlanifiedPaymentI18nTableMap::LOCALE, $value[1]));
$criteria->addOr($criterion);
}
}
$query = PaypalPlanifiedPaymentI18nQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { PaypalPlanifiedPaymentI18nTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { PaypalPlanifiedPaymentI18nTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the paypal_planified_payment_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 PaypalPlanifiedPaymentI18nQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a PaypalPlanifiedPaymentI18n or Criteria object.
*
* @param mixed $criteria Criteria or PaypalPlanifiedPaymentI18n 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(PaypalPlanifiedPaymentI18nTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from PaypalPlanifiedPaymentI18n object
}
// Set the correct dbName
$query = PaypalPlanifiedPaymentI18nQuery::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;
}
} // PaypalPlanifiedPaymentI18nTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
PaypalPlanifiedPaymentI18nTableMap::buildTableMap();

View File

@@ -0,0 +1,501 @@
<?php
namespace PayPal\Model\Map;
use PayPal\Model\PaypalPlanifiedPayment;
use PayPal\Model\PaypalPlanifiedPaymentQuery;
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 'paypal_planified_payment' 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 PaypalPlanifiedPaymentTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'PayPal.Model.Map.PaypalPlanifiedPaymentTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'paypal_planified_payment';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\PayPal\\Model\\PaypalPlanifiedPayment';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'PayPal.Model.PaypalPlanifiedPayment';
/**
* The total number of columns
*/
const NUM_COLUMNS = 9;
/**
* 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 = 9;
/**
* the column name for the ID field
*/
const ID = 'paypal_planified_payment.ID';
/**
* the column name for the FREQUENCY field
*/
const FREQUENCY = 'paypal_planified_payment.FREQUENCY';
/**
* the column name for the FREQUENCY_INTERVAL field
*/
const FREQUENCY_INTERVAL = 'paypal_planified_payment.FREQUENCY_INTERVAL';
/**
* the column name for the CYCLE field
*/
const CYCLE = 'paypal_planified_payment.CYCLE';
/**
* the column name for the MIN_AMOUNT field
*/
const MIN_AMOUNT = 'paypal_planified_payment.MIN_AMOUNT';
/**
* the column name for the MAX_AMOUNT field
*/
const MAX_AMOUNT = 'paypal_planified_payment.MAX_AMOUNT';
/**
* the column name for the POSITION field
*/
const POSITION = 'paypal_planified_payment.POSITION';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'paypal_planified_payment.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'paypal_planified_payment.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', 'Frequency', 'FrequencyInterval', 'Cycle', 'MinAmount', 'MaxAmount', 'Position', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'frequency', 'frequencyInterval', 'cycle', 'minAmount', 'maxAmount', 'position', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(PaypalPlanifiedPaymentTableMap::ID, PaypalPlanifiedPaymentTableMap::FREQUENCY, PaypalPlanifiedPaymentTableMap::FREQUENCY_INTERVAL, PaypalPlanifiedPaymentTableMap::CYCLE, PaypalPlanifiedPaymentTableMap::MIN_AMOUNT, PaypalPlanifiedPaymentTableMap::MAX_AMOUNT, PaypalPlanifiedPaymentTableMap::POSITION, PaypalPlanifiedPaymentTableMap::CREATED_AT, PaypalPlanifiedPaymentTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'FREQUENCY', 'FREQUENCY_INTERVAL', 'CYCLE', 'MIN_AMOUNT', 'MAX_AMOUNT', 'POSITION', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'frequency', 'frequency_interval', 'cycle', 'min_amount', 'max_amount', 'position', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
* 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, 'Frequency' => 1, 'FrequencyInterval' => 2, 'Cycle' => 3, 'MinAmount' => 4, 'MaxAmount' => 5, 'Position' => 6, 'CreatedAt' => 7, 'UpdatedAt' => 8, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'frequency' => 1, 'frequencyInterval' => 2, 'cycle' => 3, 'minAmount' => 4, 'maxAmount' => 5, 'position' => 6, 'createdAt' => 7, 'updatedAt' => 8, ),
self::TYPE_COLNAME => array(PaypalPlanifiedPaymentTableMap::ID => 0, PaypalPlanifiedPaymentTableMap::FREQUENCY => 1, PaypalPlanifiedPaymentTableMap::FREQUENCY_INTERVAL => 2, PaypalPlanifiedPaymentTableMap::CYCLE => 3, PaypalPlanifiedPaymentTableMap::MIN_AMOUNT => 4, PaypalPlanifiedPaymentTableMap::MAX_AMOUNT => 5, PaypalPlanifiedPaymentTableMap::POSITION => 6, PaypalPlanifiedPaymentTableMap::CREATED_AT => 7, PaypalPlanifiedPaymentTableMap::UPDATED_AT => 8, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'FREQUENCY' => 1, 'FREQUENCY_INTERVAL' => 2, 'CYCLE' => 3, 'MIN_AMOUNT' => 4, 'MAX_AMOUNT' => 5, 'POSITION' => 6, 'CREATED_AT' => 7, 'UPDATED_AT' => 8, ),
self::TYPE_FIELDNAME => array('id' => 0, 'frequency' => 1, 'frequency_interval' => 2, 'cycle' => 3, 'min_amount' => 4, 'max_amount' => 5, 'position' => 6, 'created_at' => 7, 'updated_at' => 8, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
);
/**
* 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('paypal_planified_payment');
$this->setPhpName('PaypalPlanifiedPayment');
$this->setClassName('\\PayPal\\Model\\PaypalPlanifiedPayment');
$this->setPackage('PayPal.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('FREQUENCY', 'Frequency', 'VARCHAR', true, 255, null);
$this->addColumn('FREQUENCY_INTERVAL', 'FrequencyInterval', 'INTEGER', true, null, null);
$this->addColumn('CYCLE', 'Cycle', 'INTEGER', true, null, null);
$this->addColumn('MIN_AMOUNT', 'MinAmount', 'DECIMAL', false, 16, 0);
$this->addColumn('MAX_AMOUNT', 'MaxAmount', 'DECIMAL', false, 16, 0);
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, 0);
$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('PaypalCart', '\\PayPal\\Model\\PaypalCart', RelationMap::ONE_TO_MANY, array('id' => 'planified_payment_id', ), 'CASCADE', 'RESTRICT', 'PaypalCarts');
$this->addRelation('PaypalPlanifiedPaymentI18n', '\\PayPal\\Model\\PaypalPlanifiedPaymentI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'PaypalPlanifiedPaymentI18ns');
} // 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 paypal_planified_payment * 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.
PaypalCartTableMap::clearInstancePool();
PaypalPlanifiedPaymentI18nTableMap::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 ? PaypalPlanifiedPaymentTableMap::CLASS_DEFAULT : PaypalPlanifiedPaymentTableMap::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 (PaypalPlanifiedPayment object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = PaypalPlanifiedPaymentTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = PaypalPlanifiedPaymentTableMap::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 + PaypalPlanifiedPaymentTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = PaypalPlanifiedPaymentTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
PaypalPlanifiedPaymentTableMap::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 = PaypalPlanifiedPaymentTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = PaypalPlanifiedPaymentTableMap::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;
PaypalPlanifiedPaymentTableMap::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(PaypalPlanifiedPaymentTableMap::ID);
$criteria->addSelectColumn(PaypalPlanifiedPaymentTableMap::FREQUENCY);
$criteria->addSelectColumn(PaypalPlanifiedPaymentTableMap::FREQUENCY_INTERVAL);
$criteria->addSelectColumn(PaypalPlanifiedPaymentTableMap::CYCLE);
$criteria->addSelectColumn(PaypalPlanifiedPaymentTableMap::MIN_AMOUNT);
$criteria->addSelectColumn(PaypalPlanifiedPaymentTableMap::MAX_AMOUNT);
$criteria->addSelectColumn(PaypalPlanifiedPaymentTableMap::POSITION);
$criteria->addSelectColumn(PaypalPlanifiedPaymentTableMap::CREATED_AT);
$criteria->addSelectColumn(PaypalPlanifiedPaymentTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.FREQUENCY');
$criteria->addSelectColumn($alias . '.FREQUENCY_INTERVAL');
$criteria->addSelectColumn($alias . '.CYCLE');
$criteria->addSelectColumn($alias . '.MIN_AMOUNT');
$criteria->addSelectColumn($alias . '.MAX_AMOUNT');
$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(PaypalPlanifiedPaymentTableMap::DATABASE_NAME)->getTable(PaypalPlanifiedPaymentTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(PaypalPlanifiedPaymentTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(PaypalPlanifiedPaymentTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new PaypalPlanifiedPaymentTableMap());
}
}
/**
* Performs a DELETE on the database, given a PaypalPlanifiedPayment or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or PaypalPlanifiedPayment 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(PaypalPlanifiedPaymentTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \PayPal\Model\PaypalPlanifiedPayment) { // 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(PaypalPlanifiedPaymentTableMap::DATABASE_NAME);
$criteria->add(PaypalPlanifiedPaymentTableMap::ID, (array) $values, Criteria::IN);
}
$query = PaypalPlanifiedPaymentQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { PaypalPlanifiedPaymentTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { PaypalPlanifiedPaymentTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the paypal_planified_payment 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 PaypalPlanifiedPaymentQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a PaypalPlanifiedPayment or Criteria object.
*
* @param mixed $criteria Criteria or PaypalPlanifiedPayment 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(PaypalPlanifiedPaymentTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from PaypalPlanifiedPayment object
}
if ($criteria->containsKey(PaypalPlanifiedPaymentTableMap::ID) && $criteria->keyContainsValue(PaypalPlanifiedPaymentTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.PaypalPlanifiedPaymentTableMap::ID.')');
}
// Set the correct dbName
$query = PaypalPlanifiedPaymentQuery::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;
}
} // PaypalPlanifiedPaymentTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
PaypalPlanifiedPaymentTableMap::buildTableMap();

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="PaypalCartTableMap.php" server="51.254.220.106//web/" local="131359545000000000" remote="131390167800000000" />
<file name="PaypalCustomerTableMap.php" server="51.254.220.106//web/" local="131359545000000000" remote="131390167800000000" />
<file name="PaypalLogTableMap.php" server="51.254.220.106//web/" local="131359545000000000" remote="131390167800000000" />
<file name="PaypalOrderTableMap.php" server="51.254.220.106//web/" local="131359545000000000" remote="131390167800000000" />
<file name="PaypalOrderVersionTableMap.php" server="51.254.220.106//web/" local="131359545000000000" remote="131390167800000000" />
<file name="PaypalPlanTableMap.php" server="51.254.220.106//web/" local="131359545000000000" remote="131390167800000000" />
<file name="PaypalPlanifiedPaymentI18nTableMap.php" server="51.254.220.106//web/" local="131359545000000000" remote="131390167800000000" />
<file name="PaypalPlanifiedPaymentTableMap.php" server="51.254.220.106//web/" local="131359545000000000" remote="131390167800000000" />
</dwsync>