Initial commit

This commit is contained in:
2019-05-26 15:57:49 +02:00
commit 9f74ec1089
34290 changed files with 5059123 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,847 @@
<?php
namespace PayPal\Model\Base;
use \Exception;
use \PDO;
use PayPal\Model\PaypalCart as ChildPaypalCart;
use PayPal\Model\PaypalCartQuery as ChildPaypalCartQuery;
use PayPal\Model\Map\PaypalCartTableMap;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Cart;
/**
* Base class that represents a query for the 'paypal_cart' table.
*
*
*
* @method ChildPaypalCartQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildPaypalCartQuery orderByCreditCardId($order = Criteria::ASC) Order by the credit_card_id column
* @method ChildPaypalCartQuery orderByPlanifiedPaymentId($order = Criteria::ASC) Order by the planified_payment_id column
* @method ChildPaypalCartQuery orderByExpressPaymentId($order = Criteria::ASC) Order by the express_payment_id column
* @method ChildPaypalCartQuery orderByExpressPayerId($order = Criteria::ASC) Order by the express_payer_id column
* @method ChildPaypalCartQuery orderByExpressToken($order = Criteria::ASC) Order by the express_token column
* @method ChildPaypalCartQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildPaypalCartQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildPaypalCartQuery groupById() Group by the id column
* @method ChildPaypalCartQuery groupByCreditCardId() Group by the credit_card_id column
* @method ChildPaypalCartQuery groupByPlanifiedPaymentId() Group by the planified_payment_id column
* @method ChildPaypalCartQuery groupByExpressPaymentId() Group by the express_payment_id column
* @method ChildPaypalCartQuery groupByExpressPayerId() Group by the express_payer_id column
* @method ChildPaypalCartQuery groupByExpressToken() Group by the express_token column
* @method ChildPaypalCartQuery groupByCreatedAt() Group by the created_at column
* @method ChildPaypalCartQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildPaypalCartQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildPaypalCartQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildPaypalCartQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildPaypalCartQuery leftJoinCart($relationAlias = null) Adds a LEFT JOIN clause to the query using the Cart relation
* @method ChildPaypalCartQuery rightJoinCart($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Cart relation
* @method ChildPaypalCartQuery innerJoinCart($relationAlias = null) Adds a INNER JOIN clause to the query using the Cart relation
*
* @method ChildPaypalCartQuery leftJoinPaypalPlanifiedPayment($relationAlias = null) Adds a LEFT JOIN clause to the query using the PaypalPlanifiedPayment relation
* @method ChildPaypalCartQuery rightJoinPaypalPlanifiedPayment($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PaypalPlanifiedPayment relation
* @method ChildPaypalCartQuery innerJoinPaypalPlanifiedPayment($relationAlias = null) Adds a INNER JOIN clause to the query using the PaypalPlanifiedPayment relation
*
* @method ChildPaypalCart findOne(ConnectionInterface $con = null) Return the first ChildPaypalCart matching the query
* @method ChildPaypalCart findOneOrCreate(ConnectionInterface $con = null) Return the first ChildPaypalCart matching the query, or a new ChildPaypalCart object populated from the query conditions when no match is found
*
* @method ChildPaypalCart findOneById(int $id) Return the first ChildPaypalCart filtered by the id column
* @method ChildPaypalCart findOneByCreditCardId(string $credit_card_id) Return the first ChildPaypalCart filtered by the credit_card_id column
* @method ChildPaypalCart findOneByPlanifiedPaymentId(int $planified_payment_id) Return the first ChildPaypalCart filtered by the planified_payment_id column
* @method ChildPaypalCart findOneByExpressPaymentId(string $express_payment_id) Return the first ChildPaypalCart filtered by the express_payment_id column
* @method ChildPaypalCart findOneByExpressPayerId(string $express_payer_id) Return the first ChildPaypalCart filtered by the express_payer_id column
* @method ChildPaypalCart findOneByExpressToken(string $express_token) Return the first ChildPaypalCart filtered by the express_token column
* @method ChildPaypalCart findOneByCreatedAt(string $created_at) Return the first ChildPaypalCart filtered by the created_at column
* @method ChildPaypalCart findOneByUpdatedAt(string $updated_at) Return the first ChildPaypalCart filtered by the updated_at column
*
* @method array findById(int $id) Return ChildPaypalCart objects filtered by the id column
* @method array findByCreditCardId(string $credit_card_id) Return ChildPaypalCart objects filtered by the credit_card_id column
* @method array findByPlanifiedPaymentId(int $planified_payment_id) Return ChildPaypalCart objects filtered by the planified_payment_id column
* @method array findByExpressPaymentId(string $express_payment_id) Return ChildPaypalCart objects filtered by the express_payment_id column
* @method array findByExpressPayerId(string $express_payer_id) Return ChildPaypalCart objects filtered by the express_payer_id column
* @method array findByExpressToken(string $express_token) Return ChildPaypalCart objects filtered by the express_token column
* @method array findByCreatedAt(string $created_at) Return ChildPaypalCart objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildPaypalCart objects filtered by the updated_at column
*
*/
abstract class PaypalCartQuery extends ModelCriteria
{
/**
* Initializes internal state of \PayPal\Model\Base\PaypalCartQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\PayPal\\Model\\PaypalCart', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildPaypalCartQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildPaypalCartQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \PayPal\Model\PaypalCartQuery) {
return $criteria;
}
$query = new \PayPal\Model\PaypalCartQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
return $query;
}
/**
* Find object by primary key.
* Propel uses the instance pool to skip the database if the object exists.
* Go fast if the query is untouched.
*
* <code>
* $obj = $c->findPk(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildPaypalCart|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = PaypalCartTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(PaypalCartTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|| $this->map || $this->having || $this->joins) {
return $this->findPkComplex($key, $con);
} else {
return $this->findPkSimple($key, $con);
}
}
/**
* Find object by primary key using raw SQL to go fast.
* Bypass doSelect() and the object formatter by using generated code.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalCart A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CREDIT_CARD_ID, PLANIFIED_PAYMENT_ID, EXPRESS_PAYMENT_ID, EXPRESS_PAYER_ID, EXPRESS_TOKEN, CREATED_AT, UPDATED_AT FROM paypal_cart WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildPaypalCart();
$obj->hydrate($row);
PaypalCartTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
return $obj;
}
/**
* Find object by primary key.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalCart|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
// As the query uses a PK condition, no limit(1) is necessary.
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKey($key)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
}
/**
* Find objects by primary key
* <code>
* $objs = $c->findPks(array(12, 56, 832), $con);
* </code>
* @param array $keys Primary keys to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
*/
public function findPks($keys, $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKeys($keys)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
}
/**
* Filter the query by primary key
*
* @param mixed $key Primary key to use for the query
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(PaypalCartTableMap::ID, $key, Criteria::EQUAL);
}
/**
* Filter the query by a list of primary keys
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(PaypalCartTableMap::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @see filterByCart()
*
* @param mixed $id The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
$this->addUsingAlias(PaypalCartTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(PaypalCartTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalCartTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the credit_card_id column
*
* Example usage:
* <code>
* $query->filterByCreditCardId('fooValue'); // WHERE credit_card_id = 'fooValue'
* $query->filterByCreditCardId('%fooValue%'); // WHERE credit_card_id LIKE '%fooValue%'
* </code>
*
* @param string $creditCardId The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByCreditCardId($creditCardId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($creditCardId)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $creditCardId)) {
$creditCardId = str_replace('*', '%', $creditCardId);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalCartTableMap::CREDIT_CARD_ID, $creditCardId, $comparison);
}
/**
* Filter the query on the planified_payment_id column
*
* Example usage:
* <code>
* $query->filterByPlanifiedPaymentId(1234); // WHERE planified_payment_id = 1234
* $query->filterByPlanifiedPaymentId(array(12, 34)); // WHERE planified_payment_id IN (12, 34)
* $query->filterByPlanifiedPaymentId(array('min' => 12)); // WHERE planified_payment_id > 12
* </code>
*
* @see filterByPaypalPlanifiedPayment()
*
* @param mixed $planifiedPaymentId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByPlanifiedPaymentId($planifiedPaymentId = null, $comparison = null)
{
if (is_array($planifiedPaymentId)) {
$useMinMax = false;
if (isset($planifiedPaymentId['min'])) {
$this->addUsingAlias(PaypalCartTableMap::PLANIFIED_PAYMENT_ID, $planifiedPaymentId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($planifiedPaymentId['max'])) {
$this->addUsingAlias(PaypalCartTableMap::PLANIFIED_PAYMENT_ID, $planifiedPaymentId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalCartTableMap::PLANIFIED_PAYMENT_ID, $planifiedPaymentId, $comparison);
}
/**
* Filter the query on the express_payment_id column
*
* Example usage:
* <code>
* $query->filterByExpressPaymentId('fooValue'); // WHERE express_payment_id = 'fooValue'
* $query->filterByExpressPaymentId('%fooValue%'); // WHERE express_payment_id LIKE '%fooValue%'
* </code>
*
* @param string $expressPaymentId The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByExpressPaymentId($expressPaymentId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($expressPaymentId)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $expressPaymentId)) {
$expressPaymentId = str_replace('*', '%', $expressPaymentId);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalCartTableMap::EXPRESS_PAYMENT_ID, $expressPaymentId, $comparison);
}
/**
* Filter the query on the express_payer_id column
*
* Example usage:
* <code>
* $query->filterByExpressPayerId('fooValue'); // WHERE express_payer_id = 'fooValue'
* $query->filterByExpressPayerId('%fooValue%'); // WHERE express_payer_id LIKE '%fooValue%'
* </code>
*
* @param string $expressPayerId The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByExpressPayerId($expressPayerId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($expressPayerId)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $expressPayerId)) {
$expressPayerId = str_replace('*', '%', $expressPayerId);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalCartTableMap::EXPRESS_PAYER_ID, $expressPayerId, $comparison);
}
/**
* Filter the query on the express_token column
*
* Example usage:
* <code>
* $query->filterByExpressToken('fooValue'); // WHERE express_token = 'fooValue'
* $query->filterByExpressToken('%fooValue%'); // WHERE express_token LIKE '%fooValue%'
* </code>
*
* @param string $expressToken The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByExpressToken($expressToken = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($expressToken)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $expressToken)) {
$expressToken = str_replace('*', '%', $expressToken);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalCartTableMap::EXPRESS_TOKEN, $expressToken, $comparison);
}
/**
* Filter the query on the created_at column
*
* Example usage:
* <code>
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
* </code>
*
* @param mixed $createdAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByCreatedAt($createdAt = null, $comparison = null)
{
if (is_array($createdAt)) {
$useMinMax = false;
if (isset($createdAt['min'])) {
$this->addUsingAlias(PaypalCartTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(PaypalCartTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalCartTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
* Filter the query on the updated_at column
*
* Example usage:
* <code>
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
* </code>
*
* @param mixed $updatedAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
{
if (is_array($updatedAt)) {
$useMinMax = false;
if (isset($updatedAt['min'])) {
$this->addUsingAlias(PaypalCartTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(PaypalCartTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalCartTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Cart object
*
* @param \Thelia\Model\Cart|ObjectCollection $cart The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByCart($cart, $comparison = null)
{
if ($cart instanceof \Thelia\Model\Cart) {
return $this
->addUsingAlias(PaypalCartTableMap::ID, $cart->getId(), $comparison);
} elseif ($cart instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(PaypalCartTableMap::ID, $cart->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCart() only accepts arguments of type \Thelia\Model\Cart or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Cart relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function joinCart($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Cart');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Cart');
}
return $this;
}
/**
* Use the Cart relation Cart object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\CartQuery A secondary query class using the current class as primary query
*/
public function useCartQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCart($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Cart', '\Thelia\Model\CartQuery');
}
/**
* Filter the query by a related \PayPal\Model\PaypalPlanifiedPayment object
*
* @param \PayPal\Model\PaypalPlanifiedPayment|ObjectCollection $paypalPlanifiedPayment The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function filterByPaypalPlanifiedPayment($paypalPlanifiedPayment, $comparison = null)
{
if ($paypalPlanifiedPayment instanceof \PayPal\Model\PaypalPlanifiedPayment) {
return $this
->addUsingAlias(PaypalCartTableMap::PLANIFIED_PAYMENT_ID, $paypalPlanifiedPayment->getId(), $comparison);
} elseif ($paypalPlanifiedPayment instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(PaypalCartTableMap::PLANIFIED_PAYMENT_ID, $paypalPlanifiedPayment->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByPaypalPlanifiedPayment() only accepts arguments of type \PayPal\Model\PaypalPlanifiedPayment or Collection');
}
}
/**
* Adds a JOIN clause to the query using the PaypalPlanifiedPayment relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function joinPaypalPlanifiedPayment($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('PaypalPlanifiedPayment');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'PaypalPlanifiedPayment');
}
return $this;
}
/**
* Use the PaypalPlanifiedPayment relation PaypalPlanifiedPayment object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \PayPal\Model\PaypalPlanifiedPaymentQuery A secondary query class using the current class as primary query
*/
public function usePaypalPlanifiedPaymentQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinPaypalPlanifiedPayment($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'PaypalPlanifiedPayment', '\PayPal\Model\PaypalPlanifiedPaymentQuery');
}
/**
* Exclude object from result
*
* @param ChildPaypalCart $paypalCart Object to remove from the list of results
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function prune($paypalCart = null)
{
if ($paypalCart) {
$this->addUsingAlias(PaypalCartTableMap::ID, $paypalCart->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* 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 function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalCartTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
$affectedRows += parent::doDeleteAll($con);
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
PaypalCartTableMap::clearInstancePool();
PaypalCartTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildPaypalCart or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildPaypalCart 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 function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalCartTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(PaypalCartTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
PaypalCartTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
PaypalCartTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
// timestampable behavior
/**
* Filter by the latest updated
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(PaypalCartTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(PaypalCartTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(PaypalCartTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(PaypalCartTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(PaypalCartTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildPaypalCartQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(PaypalCartTableMap::CREATED_AT);
}
} // PaypalCartQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,950 @@
<?php
namespace PayPal\Model\Base;
use \Exception;
use \PDO;
use PayPal\Model\PaypalLog as ChildPaypalLog;
use PayPal\Model\PaypalLogQuery as ChildPaypalLogQuery;
use PayPal\Model\Map\PaypalLogTableMap;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Customer;
use Thelia\Model\Order;
/**
* Base class that represents a query for the 'paypal_log' table.
*
*
*
* @method ChildPaypalLogQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildPaypalLogQuery orderByCustomerId($order = Criteria::ASC) Order by the customer_id column
* @method ChildPaypalLogQuery orderByOrderId($order = Criteria::ASC) Order by the order_id column
* @method ChildPaypalLogQuery orderByHook($order = Criteria::ASC) Order by the hook column
* @method ChildPaypalLogQuery orderByChannel($order = Criteria::ASC) Order by the channel column
* @method ChildPaypalLogQuery orderByLevel($order = Criteria::ASC) Order by the level column
* @method ChildPaypalLogQuery orderByMessage($order = Criteria::ASC) Order by the message column
* @method ChildPaypalLogQuery orderByTime($order = Criteria::ASC) Order by the time column
* @method ChildPaypalLogQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildPaypalLogQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildPaypalLogQuery groupById() Group by the id column
* @method ChildPaypalLogQuery groupByCustomerId() Group by the customer_id column
* @method ChildPaypalLogQuery groupByOrderId() Group by the order_id column
* @method ChildPaypalLogQuery groupByHook() Group by the hook column
* @method ChildPaypalLogQuery groupByChannel() Group by the channel column
* @method ChildPaypalLogQuery groupByLevel() Group by the level column
* @method ChildPaypalLogQuery groupByMessage() Group by the message column
* @method ChildPaypalLogQuery groupByTime() Group by the time column
* @method ChildPaypalLogQuery groupByCreatedAt() Group by the created_at column
* @method ChildPaypalLogQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildPaypalLogQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildPaypalLogQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildPaypalLogQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildPaypalLogQuery leftJoinCustomer($relationAlias = null) Adds a LEFT JOIN clause to the query using the Customer relation
* @method ChildPaypalLogQuery rightJoinCustomer($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Customer relation
* @method ChildPaypalLogQuery innerJoinCustomer($relationAlias = null) Adds a INNER JOIN clause to the query using the Customer relation
*
* @method ChildPaypalLogQuery leftJoinOrder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Order relation
* @method ChildPaypalLogQuery rightJoinOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Order relation
* @method ChildPaypalLogQuery innerJoinOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the Order relation
*
* @method ChildPaypalLog findOne(ConnectionInterface $con = null) Return the first ChildPaypalLog matching the query
* @method ChildPaypalLog findOneOrCreate(ConnectionInterface $con = null) Return the first ChildPaypalLog matching the query, or a new ChildPaypalLog object populated from the query conditions when no match is found
*
* @method ChildPaypalLog findOneById(int $id) Return the first ChildPaypalLog filtered by the id column
* @method ChildPaypalLog findOneByCustomerId(int $customer_id) Return the first ChildPaypalLog filtered by the customer_id column
* @method ChildPaypalLog findOneByOrderId(int $order_id) Return the first ChildPaypalLog filtered by the order_id column
* @method ChildPaypalLog findOneByHook(string $hook) Return the first ChildPaypalLog filtered by the hook column
* @method ChildPaypalLog findOneByChannel(string $channel) Return the first ChildPaypalLog filtered by the channel column
* @method ChildPaypalLog findOneByLevel(int $level) Return the first ChildPaypalLog filtered by the level column
* @method ChildPaypalLog findOneByMessage(string $message) Return the first ChildPaypalLog filtered by the message column
* @method ChildPaypalLog findOneByTime(int $time) Return the first ChildPaypalLog filtered by the time column
* @method ChildPaypalLog findOneByCreatedAt(string $created_at) Return the first ChildPaypalLog filtered by the created_at column
* @method ChildPaypalLog findOneByUpdatedAt(string $updated_at) Return the first ChildPaypalLog filtered by the updated_at column
*
* @method array findById(int $id) Return ChildPaypalLog objects filtered by the id column
* @method array findByCustomerId(int $customer_id) Return ChildPaypalLog objects filtered by the customer_id column
* @method array findByOrderId(int $order_id) Return ChildPaypalLog objects filtered by the order_id column
* @method array findByHook(string $hook) Return ChildPaypalLog objects filtered by the hook column
* @method array findByChannel(string $channel) Return ChildPaypalLog objects filtered by the channel column
* @method array findByLevel(int $level) Return ChildPaypalLog objects filtered by the level column
* @method array findByMessage(string $message) Return ChildPaypalLog objects filtered by the message column
* @method array findByTime(int $time) Return ChildPaypalLog objects filtered by the time column
* @method array findByCreatedAt(string $created_at) Return ChildPaypalLog objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildPaypalLog objects filtered by the updated_at column
*
*/
abstract class PaypalLogQuery extends ModelCriteria
{
/**
* Initializes internal state of \PayPal\Model\Base\PaypalLogQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\PayPal\\Model\\PaypalLog', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildPaypalLogQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildPaypalLogQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \PayPal\Model\PaypalLogQuery) {
return $criteria;
}
$query = new \PayPal\Model\PaypalLogQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
return $query;
}
/**
* Find object by primary key.
* Propel uses the instance pool to skip the database if the object exists.
* Go fast if the query is untouched.
*
* <code>
* $obj = $c->findPk(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildPaypalLog|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = PaypalLogTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(PaypalLogTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|| $this->map || $this->having || $this->joins) {
return $this->findPkComplex($key, $con);
} else {
return $this->findPkSimple($key, $con);
}
}
/**
* Find object by primary key using raw SQL to go fast.
* Bypass doSelect() and the object formatter by using generated code.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalLog A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CUSTOMER_ID, ORDER_ID, HOOK, CHANNEL, LEVEL, MESSAGE, TIME, CREATED_AT, UPDATED_AT FROM paypal_log WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildPaypalLog();
$obj->hydrate($row);
PaypalLogTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
return $obj;
}
/**
* Find object by primary key.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalLog|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
// As the query uses a PK condition, no limit(1) is necessary.
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKey($key)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
}
/**
* Find objects by primary key
* <code>
* $objs = $c->findPks(array(12, 56, 832), $con);
* </code>
* @param array $keys Primary keys to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
*/
public function findPks($keys, $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKeys($keys)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
}
/**
* Filter the query by primary key
*
* @param mixed $key Primary key to use for the query
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(PaypalLogTableMap::ID, $key, Criteria::EQUAL);
}
/**
* Filter the query by a list of primary keys
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(PaypalLogTableMap::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @param mixed $id The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
$this->addUsingAlias(PaypalLogTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(PaypalLogTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalLogTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the customer_id column
*
* Example usage:
* <code>
* $query->filterByCustomerId(1234); // WHERE customer_id = 1234
* $query->filterByCustomerId(array(12, 34)); // WHERE customer_id IN (12, 34)
* $query->filterByCustomerId(array('min' => 12)); // WHERE customer_id > 12
* </code>
*
* @see filterByCustomer()
*
* @param mixed $customerId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByCustomerId($customerId = null, $comparison = null)
{
if (is_array($customerId)) {
$useMinMax = false;
if (isset($customerId['min'])) {
$this->addUsingAlias(PaypalLogTableMap::CUSTOMER_ID, $customerId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($customerId['max'])) {
$this->addUsingAlias(PaypalLogTableMap::CUSTOMER_ID, $customerId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalLogTableMap::CUSTOMER_ID, $customerId, $comparison);
}
/**
* Filter the query on the order_id column
*
* Example usage:
* <code>
* $query->filterByOrderId(1234); // WHERE order_id = 1234
* $query->filterByOrderId(array(12, 34)); // WHERE order_id IN (12, 34)
* $query->filterByOrderId(array('min' => 12)); // WHERE order_id > 12
* </code>
*
* @see filterByOrder()
*
* @param mixed $orderId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByOrderId($orderId = null, $comparison = null)
{
if (is_array($orderId)) {
$useMinMax = false;
if (isset($orderId['min'])) {
$this->addUsingAlias(PaypalLogTableMap::ORDER_ID, $orderId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($orderId['max'])) {
$this->addUsingAlias(PaypalLogTableMap::ORDER_ID, $orderId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalLogTableMap::ORDER_ID, $orderId, $comparison);
}
/**
* Filter the query on the hook column
*
* Example usage:
* <code>
* $query->filterByHook('fooValue'); // WHERE hook = 'fooValue'
* $query->filterByHook('%fooValue%'); // WHERE hook LIKE '%fooValue%'
* </code>
*
* @param string $hook The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByHook($hook = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($hook)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $hook)) {
$hook = str_replace('*', '%', $hook);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalLogTableMap::HOOK, $hook, $comparison);
}
/**
* Filter the query on the channel column
*
* Example usage:
* <code>
* $query->filterByChannel('fooValue'); // WHERE channel = 'fooValue'
* $query->filterByChannel('%fooValue%'); // WHERE channel LIKE '%fooValue%'
* </code>
*
* @param string $channel The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByChannel($channel = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($channel)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $channel)) {
$channel = str_replace('*', '%', $channel);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalLogTableMap::CHANNEL, $channel, $comparison);
}
/**
* Filter the query on the level column
*
* Example usage:
* <code>
* $query->filterByLevel(1234); // WHERE level = 1234
* $query->filterByLevel(array(12, 34)); // WHERE level IN (12, 34)
* $query->filterByLevel(array('min' => 12)); // WHERE level > 12
* </code>
*
* @param mixed $level The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByLevel($level = null, $comparison = null)
{
if (is_array($level)) {
$useMinMax = false;
if (isset($level['min'])) {
$this->addUsingAlias(PaypalLogTableMap::LEVEL, $level['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($level['max'])) {
$this->addUsingAlias(PaypalLogTableMap::LEVEL, $level['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalLogTableMap::LEVEL, $level, $comparison);
}
/**
* Filter the query on the message column
*
* Example usage:
* <code>
* $query->filterByMessage('fooValue'); // WHERE message = 'fooValue'
* $query->filterByMessage('%fooValue%'); // WHERE message LIKE '%fooValue%'
* </code>
*
* @param string $message The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByMessage($message = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($message)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $message)) {
$message = str_replace('*', '%', $message);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalLogTableMap::MESSAGE, $message, $comparison);
}
/**
* Filter the query on the time column
*
* Example usage:
* <code>
* $query->filterByTime(1234); // WHERE time = 1234
* $query->filterByTime(array(12, 34)); // WHERE time IN (12, 34)
* $query->filterByTime(array('min' => 12)); // WHERE time > 12
* </code>
*
* @param mixed $time The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByTime($time = null, $comparison = null)
{
if (is_array($time)) {
$useMinMax = false;
if (isset($time['min'])) {
$this->addUsingAlias(PaypalLogTableMap::TIME, $time['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($time['max'])) {
$this->addUsingAlias(PaypalLogTableMap::TIME, $time['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalLogTableMap::TIME, $time, $comparison);
}
/**
* Filter the query on the created_at column
*
* Example usage:
* <code>
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
* </code>
*
* @param mixed $createdAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByCreatedAt($createdAt = null, $comparison = null)
{
if (is_array($createdAt)) {
$useMinMax = false;
if (isset($createdAt['min'])) {
$this->addUsingAlias(PaypalLogTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(PaypalLogTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalLogTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
* Filter the query on the updated_at column
*
* Example usage:
* <code>
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
* </code>
*
* @param mixed $updatedAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
{
if (is_array($updatedAt)) {
$useMinMax = false;
if (isset($updatedAt['min'])) {
$this->addUsingAlias(PaypalLogTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(PaypalLogTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalLogTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Customer object
*
* @param \Thelia\Model\Customer|ObjectCollection $customer The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByCustomer($customer, $comparison = null)
{
if ($customer instanceof \Thelia\Model\Customer) {
return $this
->addUsingAlias(PaypalLogTableMap::CUSTOMER_ID, $customer->getId(), $comparison);
} elseif ($customer instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(PaypalLogTableMap::CUSTOMER_ID, $customer->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCustomer() only accepts arguments of type \Thelia\Model\Customer or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Customer relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function joinCustomer($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Customer');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Customer');
}
return $this;
}
/**
* Use the Customer relation Customer object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\CustomerQuery A secondary query class using the current class as primary query
*/
public function useCustomerQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCustomer($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Customer', '\Thelia\Model\CustomerQuery');
}
/**
* Filter the query by a related \Thelia\Model\Order object
*
* @param \Thelia\Model\Order|ObjectCollection $order The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function filterByOrder($order, $comparison = null)
{
if ($order instanceof \Thelia\Model\Order) {
return $this
->addUsingAlias(PaypalLogTableMap::ORDER_ID, $order->getId(), $comparison);
} elseif ($order instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(PaypalLogTableMap::ORDER_ID, $order->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByOrder() only accepts arguments of type \Thelia\Model\Order or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Order relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function joinOrder($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Order');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Order');
}
return $this;
}
/**
* Use the Order relation Order object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\OrderQuery A secondary query class using the current class as primary query
*/
public function useOrderQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinOrder($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Order', '\Thelia\Model\OrderQuery');
}
/**
* Exclude object from result
*
* @param ChildPaypalLog $paypalLog Object to remove from the list of results
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function prune($paypalLog = null)
{
if ($paypalLog) {
$this->addUsingAlias(PaypalLogTableMap::ID, $paypalLog->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* 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 function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalLogTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
$affectedRows += parent::doDeleteAll($con);
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
PaypalLogTableMap::clearInstancePool();
PaypalLogTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildPaypalLog or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildPaypalLog 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 function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalLogTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(PaypalLogTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
PaypalLogTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
PaypalLogTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
// timestampable behavior
/**
* Filter by the latest updated
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(PaypalLogTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(PaypalLogTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(PaypalLogTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(PaypalLogTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(PaypalLogTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildPaypalLogQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(PaypalLogTableMap::CREATED_AT);
}
} // PaypalLogQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,699 @@
<?php
namespace PayPal\Model\Base;
use \Exception;
use \PDO;
use PayPal\Model\PaypalPlan as ChildPaypalPlan;
use PayPal\Model\PaypalPlanQuery as ChildPaypalPlanQuery;
use PayPal\Model\Map\PaypalPlanTableMap;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
/**
* Base class that represents a query for the 'paypal_plan' table.
*
*
*
* @method ChildPaypalPlanQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildPaypalPlanQuery orderByPaypalOrderId($order = Criteria::ASC) Order by the paypal_order_id column
* @method ChildPaypalPlanQuery orderByPlanId($order = Criteria::ASC) Order by the plan_id column
* @method ChildPaypalPlanQuery orderByState($order = Criteria::ASC) Order by the state column
* @method ChildPaypalPlanQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildPaypalPlanQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildPaypalPlanQuery groupById() Group by the id column
* @method ChildPaypalPlanQuery groupByPaypalOrderId() Group by the paypal_order_id column
* @method ChildPaypalPlanQuery groupByPlanId() Group by the plan_id column
* @method ChildPaypalPlanQuery groupByState() Group by the state column
* @method ChildPaypalPlanQuery groupByCreatedAt() Group by the created_at column
* @method ChildPaypalPlanQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildPaypalPlanQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildPaypalPlanQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildPaypalPlanQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildPaypalPlanQuery leftJoinPaypalOrder($relationAlias = null) Adds a LEFT JOIN clause to the query using the PaypalOrder relation
* @method ChildPaypalPlanQuery rightJoinPaypalOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PaypalOrder relation
* @method ChildPaypalPlanQuery innerJoinPaypalOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the PaypalOrder relation
*
* @method ChildPaypalPlan findOne(ConnectionInterface $con = null) Return the first ChildPaypalPlan matching the query
* @method ChildPaypalPlan findOneOrCreate(ConnectionInterface $con = null) Return the first ChildPaypalPlan matching the query, or a new ChildPaypalPlan object populated from the query conditions when no match is found
*
* @method ChildPaypalPlan findOneById(int $id) Return the first ChildPaypalPlan filtered by the id column
* @method ChildPaypalPlan findOneByPaypalOrderId(int $paypal_order_id) Return the first ChildPaypalPlan filtered by the paypal_order_id column
* @method ChildPaypalPlan findOneByPlanId(string $plan_id) Return the first ChildPaypalPlan filtered by the plan_id column
* @method ChildPaypalPlan findOneByState(string $state) Return the first ChildPaypalPlan filtered by the state column
* @method ChildPaypalPlan findOneByCreatedAt(string $created_at) Return the first ChildPaypalPlan filtered by the created_at column
* @method ChildPaypalPlan findOneByUpdatedAt(string $updated_at) Return the first ChildPaypalPlan filtered by the updated_at column
*
* @method array findById(int $id) Return ChildPaypalPlan objects filtered by the id column
* @method array findByPaypalOrderId(int $paypal_order_id) Return ChildPaypalPlan objects filtered by the paypal_order_id column
* @method array findByPlanId(string $plan_id) Return ChildPaypalPlan objects filtered by the plan_id column
* @method array findByState(string $state) Return ChildPaypalPlan objects filtered by the state column
* @method array findByCreatedAt(string $created_at) Return ChildPaypalPlan objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildPaypalPlan objects filtered by the updated_at column
*
*/
abstract class PaypalPlanQuery extends ModelCriteria
{
/**
* Initializes internal state of \PayPal\Model\Base\PaypalPlanQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\PayPal\\Model\\PaypalPlan', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildPaypalPlanQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildPaypalPlanQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \PayPal\Model\PaypalPlanQuery) {
return $criteria;
}
$query = new \PayPal\Model\PaypalPlanQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
return $query;
}
/**
* Find object by primary key.
* Propel uses the instance pool to skip the database if the object exists.
* Go fast if the query is untouched.
*
* <code>
* $obj = $c->findPk(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildPaypalPlan|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = PaypalPlanTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(PaypalPlanTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|| $this->map || $this->having || $this->joins) {
return $this->findPkComplex($key, $con);
} else {
return $this->findPkSimple($key, $con);
}
}
/**
* Find object by primary key using raw SQL to go fast.
* Bypass doSelect() and the object formatter by using generated code.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalPlan A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, PAYPAL_ORDER_ID, PLAN_ID, STATE, CREATED_AT, UPDATED_AT FROM paypal_plan WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildPaypalPlan();
$obj->hydrate($row);
PaypalPlanTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
return $obj;
}
/**
* Find object by primary key.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalPlan|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
// As the query uses a PK condition, no limit(1) is necessary.
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKey($key)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
}
/**
* Find objects by primary key
* <code>
* $objs = $c->findPks(array(12, 56, 832), $con);
* </code>
* @param array $keys Primary keys to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
*/
public function findPks($keys, $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKeys($keys)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
}
/**
* Filter the query by primary key
*
* @param mixed $key Primary key to use for the query
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(PaypalPlanTableMap::ID, $key, Criteria::EQUAL);
}
/**
* Filter the query by a list of primary keys
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(PaypalPlanTableMap::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @param mixed $id The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
$this->addUsingAlias(PaypalPlanTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(PaypalPlanTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the paypal_order_id column
*
* Example usage:
* <code>
* $query->filterByPaypalOrderId(1234); // WHERE paypal_order_id = 1234
* $query->filterByPaypalOrderId(array(12, 34)); // WHERE paypal_order_id IN (12, 34)
* $query->filterByPaypalOrderId(array('min' => 12)); // WHERE paypal_order_id > 12
* </code>
*
* @see filterByPaypalOrder()
*
* @param mixed $paypalOrderId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function filterByPaypalOrderId($paypalOrderId = null, $comparison = null)
{
if (is_array($paypalOrderId)) {
$useMinMax = false;
if (isset($paypalOrderId['min'])) {
$this->addUsingAlias(PaypalPlanTableMap::PAYPAL_ORDER_ID, $paypalOrderId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($paypalOrderId['max'])) {
$this->addUsingAlias(PaypalPlanTableMap::PAYPAL_ORDER_ID, $paypalOrderId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanTableMap::PAYPAL_ORDER_ID, $paypalOrderId, $comparison);
}
/**
* Filter the query on the plan_id column
*
* Example usage:
* <code>
* $query->filterByPlanId('fooValue'); // WHERE plan_id = 'fooValue'
* $query->filterByPlanId('%fooValue%'); // WHERE plan_id LIKE '%fooValue%'
* </code>
*
* @param string $planId The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function filterByPlanId($planId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($planId)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $planId)) {
$planId = str_replace('*', '%', $planId);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalPlanTableMap::PLAN_ID, $planId, $comparison);
}
/**
* Filter the query on the state column
*
* Example usage:
* <code>
* $query->filterByState('fooValue'); // WHERE state = 'fooValue'
* $query->filterByState('%fooValue%'); // WHERE state LIKE '%fooValue%'
* </code>
*
* @param string $state The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function filterByState($state = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($state)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $state)) {
$state = str_replace('*', '%', $state);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalPlanTableMap::STATE, $state, $comparison);
}
/**
* Filter the query on the created_at column
*
* Example usage:
* <code>
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
* </code>
*
* @param mixed $createdAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function filterByCreatedAt($createdAt = null, $comparison = null)
{
if (is_array($createdAt)) {
$useMinMax = false;
if (isset($createdAt['min'])) {
$this->addUsingAlias(PaypalPlanTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(PaypalPlanTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
* Filter the query on the updated_at column
*
* Example usage:
* <code>
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
* </code>
*
* @param mixed $updatedAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
{
if (is_array($updatedAt)) {
$useMinMax = false;
if (isset($updatedAt['min'])) {
$this->addUsingAlias(PaypalPlanTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(PaypalPlanTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \PayPal\Model\PaypalOrder object
*
* @param \PayPal\Model\PaypalOrder|ObjectCollection $paypalOrder The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function filterByPaypalOrder($paypalOrder, $comparison = null)
{
if ($paypalOrder instanceof \PayPal\Model\PaypalOrder) {
return $this
->addUsingAlias(PaypalPlanTableMap::PAYPAL_ORDER_ID, $paypalOrder->getId(), $comparison);
} elseif ($paypalOrder instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(PaypalPlanTableMap::PAYPAL_ORDER_ID, $paypalOrder->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByPaypalOrder() only accepts arguments of type \PayPal\Model\PaypalOrder or Collection');
}
}
/**
* Adds a JOIN clause to the query using the PaypalOrder relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function joinPaypalOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('PaypalOrder');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'PaypalOrder');
}
return $this;
}
/**
* Use the PaypalOrder relation PaypalOrder object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \PayPal\Model\PaypalOrderQuery A secondary query class using the current class as primary query
*/
public function usePaypalOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinPaypalOrder($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'PaypalOrder', '\PayPal\Model\PaypalOrderQuery');
}
/**
* Exclude object from result
*
* @param ChildPaypalPlan $paypalPlan Object to remove from the list of results
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function prune($paypalPlan = null)
{
if ($paypalPlan) {
$this->addUsingAlias(PaypalPlanTableMap::ID, $paypalPlan->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* 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 function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalPlanTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
$affectedRows += parent::doDeleteAll($con);
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
PaypalPlanTableMap::clearInstancePool();
PaypalPlanTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildPaypalPlan or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildPaypalPlan 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 function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalPlanTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(PaypalPlanTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
PaypalPlanTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
PaypalPlanTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
// timestampable behavior
/**
* Filter by the latest updated
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(PaypalPlanTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(PaypalPlanTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(PaypalPlanTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(PaypalPlanTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(PaypalPlanTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildPaypalPlanQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(PaypalPlanTableMap::CREATED_AT);
}
} // PaypalPlanQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,541 @@
<?php
namespace PayPal\Model\Base;
use \Exception;
use \PDO;
use PayPal\Model\PaypalPlanifiedPaymentI18n as ChildPaypalPlanifiedPaymentI18n;
use PayPal\Model\PaypalPlanifiedPaymentI18nQuery as ChildPaypalPlanifiedPaymentI18nQuery;
use PayPal\Model\Map\PaypalPlanifiedPaymentI18nTableMap;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
/**
* Base class that represents a query for the 'paypal_planified_payment_i18n' table.
*
*
*
* @method ChildPaypalPlanifiedPaymentI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildPaypalPlanifiedPaymentI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildPaypalPlanifiedPaymentI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildPaypalPlanifiedPaymentI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
*
* @method ChildPaypalPlanifiedPaymentI18nQuery groupById() Group by the id column
* @method ChildPaypalPlanifiedPaymentI18nQuery groupByLocale() Group by the locale column
* @method ChildPaypalPlanifiedPaymentI18nQuery groupByTitle() Group by the title column
* @method ChildPaypalPlanifiedPaymentI18nQuery groupByDescription() Group by the description column
*
* @method ChildPaypalPlanifiedPaymentI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildPaypalPlanifiedPaymentI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildPaypalPlanifiedPaymentI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildPaypalPlanifiedPaymentI18nQuery leftJoinPaypalPlanifiedPayment($relationAlias = null) Adds a LEFT JOIN clause to the query using the PaypalPlanifiedPayment relation
* @method ChildPaypalPlanifiedPaymentI18nQuery rightJoinPaypalPlanifiedPayment($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PaypalPlanifiedPayment relation
* @method ChildPaypalPlanifiedPaymentI18nQuery innerJoinPaypalPlanifiedPayment($relationAlias = null) Adds a INNER JOIN clause to the query using the PaypalPlanifiedPayment relation
*
* @method ChildPaypalPlanifiedPaymentI18n findOne(ConnectionInterface $con = null) Return the first ChildPaypalPlanifiedPaymentI18n matching the query
* @method ChildPaypalPlanifiedPaymentI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildPaypalPlanifiedPaymentI18n matching the query, or a new ChildPaypalPlanifiedPaymentI18n object populated from the query conditions when no match is found
*
* @method ChildPaypalPlanifiedPaymentI18n findOneById(int $id) Return the first ChildPaypalPlanifiedPaymentI18n filtered by the id column
* @method ChildPaypalPlanifiedPaymentI18n findOneByLocale(string $locale) Return the first ChildPaypalPlanifiedPaymentI18n filtered by the locale column
* @method ChildPaypalPlanifiedPaymentI18n findOneByTitle(string $title) Return the first ChildPaypalPlanifiedPaymentI18n filtered by the title column
* @method ChildPaypalPlanifiedPaymentI18n findOneByDescription(string $description) Return the first ChildPaypalPlanifiedPaymentI18n filtered by the description column
*
* @method array findById(int $id) Return ChildPaypalPlanifiedPaymentI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildPaypalPlanifiedPaymentI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildPaypalPlanifiedPaymentI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildPaypalPlanifiedPaymentI18n objects filtered by the description column
*
*/
abstract class PaypalPlanifiedPaymentI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \PayPal\Model\Base\PaypalPlanifiedPaymentI18nQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\PayPal\\Model\\PaypalPlanifiedPaymentI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildPaypalPlanifiedPaymentI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildPaypalPlanifiedPaymentI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \PayPal\Model\PaypalPlanifiedPaymentI18nQuery) {
return $criteria;
}
$query = new \PayPal\Model\PaypalPlanifiedPaymentI18nQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
return $query;
}
/**
* Find object by primary key.
* Propel uses the instance pool to skip the database if the object exists.
* Go fast if the query is untouched.
*
* <code>
* $obj = $c->findPk(array(12, 34), $con);
* </code>
*
* @param array[$id, $locale] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildPaypalPlanifiedPaymentI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = PaypalPlanifiedPaymentI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(PaypalPlanifiedPaymentI18nTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|| $this->map || $this->having || $this->joins) {
return $this->findPkComplex($key, $con);
} else {
return $this->findPkSimple($key, $con);
}
}
/**
* Find object by primary key using raw SQL to go fast.
* Bypass doSelect() and the object formatter by using generated code.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalPlanifiedPaymentI18n A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION FROM paypal_planified_payment_i18n WHERE ID = :p0 AND LOCALE = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildPaypalPlanifiedPaymentI18n();
$obj->hydrate($row);
PaypalPlanifiedPaymentI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
}
$stmt->closeCursor();
return $obj;
}
/**
* Find object by primary key.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalPlanifiedPaymentI18n|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
// As the query uses a PK condition, no limit(1) is necessary.
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKey($key)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
}
/**
* Find objects by primary key
* <code>
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
* </code>
* @param array $keys Primary keys to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
*/
public function findPks($keys, $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKeys($keys)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
}
/**
* Filter the query by primary key
*
* @param mixed $key Primary key to use for the query
*
* @return ChildPaypalPlanifiedPaymentI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
return $this;
}
/**
* Filter the query by a list of primary keys
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildPaypalPlanifiedPaymentI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
if (empty($keys)) {
return $this->add(null, '1<>1', Criteria::CUSTOM);
}
foreach ($keys as $key) {
$cton0 = $this->getNewCriterion(PaypalPlanifiedPaymentI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(PaypalPlanifiedPaymentI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$this->addOr($cton0);
}
return $this;
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @see filterByPaypalPlanifiedPayment()
*
* @param mixed $id The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentI18nQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the locale column
*
* Example usage:
* <code>
* $query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
* $query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
* </code>
*
* @param string $locale The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentI18nQuery The current query, for fluid interface
*/
public function filterByLocale($locale = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($locale)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $locale)) {
$locale = str_replace('*', '%', $locale);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::LOCALE, $locale, $comparison);
}
/**
* Filter the query on the title column
*
* Example usage:
* <code>
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
* </code>
*
* @param string $title The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentI18nQuery The current query, for fluid interface
*/
public function filterByTitle($title = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($title)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $title)) {
$title = str_replace('*', '%', $title);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::TITLE, $title, $comparison);
}
/**
* Filter the query on the description column
*
* Example usage:
* <code>
* $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
* $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
* </code>
*
* @param string $description The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentI18nQuery The current query, for fluid interface
*/
public function filterByDescription($description = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($description)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $description)) {
$description = str_replace('*', '%', $description);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::DESCRIPTION, $description, $comparison);
}
/**
* Filter the query by a related \PayPal\Model\PaypalPlanifiedPayment object
*
* @param \PayPal\Model\PaypalPlanifiedPayment|ObjectCollection $paypalPlanifiedPayment The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentI18nQuery The current query, for fluid interface
*/
public function filterByPaypalPlanifiedPayment($paypalPlanifiedPayment, $comparison = null)
{
if ($paypalPlanifiedPayment instanceof \PayPal\Model\PaypalPlanifiedPayment) {
return $this
->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::ID, $paypalPlanifiedPayment->getId(), $comparison);
} elseif ($paypalPlanifiedPayment instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(PaypalPlanifiedPaymentI18nTableMap::ID, $paypalPlanifiedPayment->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByPaypalPlanifiedPayment() only accepts arguments of type \PayPal\Model\PaypalPlanifiedPayment or Collection');
}
}
/**
* Adds a JOIN clause to the query using the PaypalPlanifiedPayment relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildPaypalPlanifiedPaymentI18nQuery The current query, for fluid interface
*/
public function joinPaypalPlanifiedPayment($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('PaypalPlanifiedPayment');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'PaypalPlanifiedPayment');
}
return $this;
}
/**
* Use the PaypalPlanifiedPayment relation PaypalPlanifiedPayment object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \PayPal\Model\PaypalPlanifiedPaymentQuery A secondary query class using the current class as primary query
*/
public function usePaypalPlanifiedPaymentQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinPaypalPlanifiedPayment($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'PaypalPlanifiedPayment', '\PayPal\Model\PaypalPlanifiedPaymentQuery');
}
/**
* Exclude object from result
*
* @param ChildPaypalPlanifiedPaymentI18n $paypalPlanifiedPaymentI18n Object to remove from the list of results
*
* @return ChildPaypalPlanifiedPaymentI18nQuery The current query, for fluid interface
*/
public function prune($paypalPlanifiedPaymentI18n = null)
{
if ($paypalPlanifiedPaymentI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(PaypalPlanifiedPaymentI18nTableMap::ID), $paypalPlanifiedPaymentI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(PaypalPlanifiedPaymentI18nTableMap::LOCALE), $paypalPlanifiedPaymentI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* 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 function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalPlanifiedPaymentI18nTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
$affectedRows += parent::doDeleteAll($con);
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
PaypalPlanifiedPaymentI18nTableMap::clearInstancePool();
PaypalPlanifiedPaymentI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildPaypalPlanifiedPaymentI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildPaypalPlanifiedPaymentI18n 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 function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalPlanifiedPaymentI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(PaypalPlanifiedPaymentI18nTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
PaypalPlanifiedPaymentI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
PaypalPlanifiedPaymentI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // PaypalPlanifiedPaymentI18nQuery

View File

@@ -0,0 +1,977 @@
<?php
namespace PayPal\Model\Base;
use \Exception;
use \PDO;
use PayPal\Model\PaypalPlanifiedPayment as ChildPaypalPlanifiedPayment;
use PayPal\Model\PaypalPlanifiedPaymentI18nQuery as ChildPaypalPlanifiedPaymentI18nQuery;
use PayPal\Model\PaypalPlanifiedPaymentQuery as ChildPaypalPlanifiedPaymentQuery;
use PayPal\Model\Map\PaypalPlanifiedPaymentTableMap;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
/**
* Base class that represents a query for the 'paypal_planified_payment' table.
*
*
*
* @method ChildPaypalPlanifiedPaymentQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildPaypalPlanifiedPaymentQuery orderByFrequency($order = Criteria::ASC) Order by the frequency column
* @method ChildPaypalPlanifiedPaymentQuery orderByFrequencyInterval($order = Criteria::ASC) Order by the frequency_interval column
* @method ChildPaypalPlanifiedPaymentQuery orderByCycle($order = Criteria::ASC) Order by the cycle column
* @method ChildPaypalPlanifiedPaymentQuery orderByMinAmount($order = Criteria::ASC) Order by the min_amount column
* @method ChildPaypalPlanifiedPaymentQuery orderByMaxAmount($order = Criteria::ASC) Order by the max_amount column
* @method ChildPaypalPlanifiedPaymentQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method ChildPaypalPlanifiedPaymentQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildPaypalPlanifiedPaymentQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildPaypalPlanifiedPaymentQuery groupById() Group by the id column
* @method ChildPaypalPlanifiedPaymentQuery groupByFrequency() Group by the frequency column
* @method ChildPaypalPlanifiedPaymentQuery groupByFrequencyInterval() Group by the frequency_interval column
* @method ChildPaypalPlanifiedPaymentQuery groupByCycle() Group by the cycle column
* @method ChildPaypalPlanifiedPaymentQuery groupByMinAmount() Group by the min_amount column
* @method ChildPaypalPlanifiedPaymentQuery groupByMaxAmount() Group by the max_amount column
* @method ChildPaypalPlanifiedPaymentQuery groupByPosition() Group by the position column
* @method ChildPaypalPlanifiedPaymentQuery groupByCreatedAt() Group by the created_at column
* @method ChildPaypalPlanifiedPaymentQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildPaypalPlanifiedPaymentQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildPaypalPlanifiedPaymentQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildPaypalPlanifiedPaymentQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildPaypalPlanifiedPaymentQuery leftJoinPaypalCart($relationAlias = null) Adds a LEFT JOIN clause to the query using the PaypalCart relation
* @method ChildPaypalPlanifiedPaymentQuery rightJoinPaypalCart($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PaypalCart relation
* @method ChildPaypalPlanifiedPaymentQuery innerJoinPaypalCart($relationAlias = null) Adds a INNER JOIN clause to the query using the PaypalCart relation
*
* @method ChildPaypalPlanifiedPaymentQuery leftJoinPaypalPlanifiedPaymentI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the PaypalPlanifiedPaymentI18n relation
* @method ChildPaypalPlanifiedPaymentQuery rightJoinPaypalPlanifiedPaymentI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PaypalPlanifiedPaymentI18n relation
* @method ChildPaypalPlanifiedPaymentQuery innerJoinPaypalPlanifiedPaymentI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the PaypalPlanifiedPaymentI18n relation
*
* @method ChildPaypalPlanifiedPayment findOne(ConnectionInterface $con = null) Return the first ChildPaypalPlanifiedPayment matching the query
* @method ChildPaypalPlanifiedPayment findOneOrCreate(ConnectionInterface $con = null) Return the first ChildPaypalPlanifiedPayment matching the query, or a new ChildPaypalPlanifiedPayment object populated from the query conditions when no match is found
*
* @method ChildPaypalPlanifiedPayment findOneById(int $id) Return the first ChildPaypalPlanifiedPayment filtered by the id column
* @method ChildPaypalPlanifiedPayment findOneByFrequency(string $frequency) Return the first ChildPaypalPlanifiedPayment filtered by the frequency column
* @method ChildPaypalPlanifiedPayment findOneByFrequencyInterval(int $frequency_interval) Return the first ChildPaypalPlanifiedPayment filtered by the frequency_interval column
* @method ChildPaypalPlanifiedPayment findOneByCycle(int $cycle) Return the first ChildPaypalPlanifiedPayment filtered by the cycle column
* @method ChildPaypalPlanifiedPayment findOneByMinAmount(string $min_amount) Return the first ChildPaypalPlanifiedPayment filtered by the min_amount column
* @method ChildPaypalPlanifiedPayment findOneByMaxAmount(string $max_amount) Return the first ChildPaypalPlanifiedPayment filtered by the max_amount column
* @method ChildPaypalPlanifiedPayment findOneByPosition(int $position) Return the first ChildPaypalPlanifiedPayment filtered by the position column
* @method ChildPaypalPlanifiedPayment findOneByCreatedAt(string $created_at) Return the first ChildPaypalPlanifiedPayment filtered by the created_at column
* @method ChildPaypalPlanifiedPayment findOneByUpdatedAt(string $updated_at) Return the first ChildPaypalPlanifiedPayment filtered by the updated_at column
*
* @method array findById(int $id) Return ChildPaypalPlanifiedPayment objects filtered by the id column
* @method array findByFrequency(string $frequency) Return ChildPaypalPlanifiedPayment objects filtered by the frequency column
* @method array findByFrequencyInterval(int $frequency_interval) Return ChildPaypalPlanifiedPayment objects filtered by the frequency_interval column
* @method array findByCycle(int $cycle) Return ChildPaypalPlanifiedPayment objects filtered by the cycle column
* @method array findByMinAmount(string $min_amount) Return ChildPaypalPlanifiedPayment objects filtered by the min_amount column
* @method array findByMaxAmount(string $max_amount) Return ChildPaypalPlanifiedPayment objects filtered by the max_amount column
* @method array findByPosition(int $position) Return ChildPaypalPlanifiedPayment objects filtered by the position column
* @method array findByCreatedAt(string $created_at) Return ChildPaypalPlanifiedPayment objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildPaypalPlanifiedPayment objects filtered by the updated_at column
*
*/
abstract class PaypalPlanifiedPaymentQuery extends ModelCriteria
{
/**
* Initializes internal state of \PayPal\Model\Base\PaypalPlanifiedPaymentQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\PayPal\\Model\\PaypalPlanifiedPayment', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildPaypalPlanifiedPaymentQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildPaypalPlanifiedPaymentQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \PayPal\Model\PaypalPlanifiedPaymentQuery) {
return $criteria;
}
$query = new \PayPal\Model\PaypalPlanifiedPaymentQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
return $query;
}
/**
* Find object by primary key.
* Propel uses the instance pool to skip the database if the object exists.
* Go fast if the query is untouched.
*
* <code>
* $obj = $c->findPk(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildPaypalPlanifiedPayment|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = PaypalPlanifiedPaymentTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(PaypalPlanifiedPaymentTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|| $this->map || $this->having || $this->joins) {
return $this->findPkComplex($key, $con);
} else {
return $this->findPkSimple($key, $con);
}
}
/**
* Find object by primary key using raw SQL to go fast.
* Bypass doSelect() and the object formatter by using generated code.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalPlanifiedPayment A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, FREQUENCY, FREQUENCY_INTERVAL, CYCLE, MIN_AMOUNT, MAX_AMOUNT, POSITION, CREATED_AT, UPDATED_AT FROM paypal_planified_payment WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildPaypalPlanifiedPayment();
$obj->hydrate($row);
PaypalPlanifiedPaymentTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
return $obj;
}
/**
* Find object by primary key.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildPaypalPlanifiedPayment|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
// As the query uses a PK condition, no limit(1) is necessary.
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKey($key)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
}
/**
* Find objects by primary key
* <code>
* $objs = $c->findPks(array(12, 56, 832), $con);
* </code>
* @param array $keys Primary keys to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
*/
public function findPks($keys, $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKeys($keys)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
}
/**
* Filter the query by primary key
*
* @param mixed $key Primary key to use for the query
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::ID, $key, Criteria::EQUAL);
}
/**
* Filter the query by a list of primary keys
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @param mixed $id The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the frequency column
*
* Example usage:
* <code>
* $query->filterByFrequency('fooValue'); // WHERE frequency = 'fooValue'
* $query->filterByFrequency('%fooValue%'); // WHERE frequency LIKE '%fooValue%'
* </code>
*
* @param string $frequency The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByFrequency($frequency = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($frequency)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $frequency)) {
$frequency = str_replace('*', '%', $frequency);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::FREQUENCY, $frequency, $comparison);
}
/**
* Filter the query on the frequency_interval column
*
* Example usage:
* <code>
* $query->filterByFrequencyInterval(1234); // WHERE frequency_interval = 1234
* $query->filterByFrequencyInterval(array(12, 34)); // WHERE frequency_interval IN (12, 34)
* $query->filterByFrequencyInterval(array('min' => 12)); // WHERE frequency_interval > 12
* </code>
*
* @param mixed $frequencyInterval The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByFrequencyInterval($frequencyInterval = null, $comparison = null)
{
if (is_array($frequencyInterval)) {
$useMinMax = false;
if (isset($frequencyInterval['min'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::FREQUENCY_INTERVAL, $frequencyInterval['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($frequencyInterval['max'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::FREQUENCY_INTERVAL, $frequencyInterval['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::FREQUENCY_INTERVAL, $frequencyInterval, $comparison);
}
/**
* Filter the query on the cycle column
*
* Example usage:
* <code>
* $query->filterByCycle(1234); // WHERE cycle = 1234
* $query->filterByCycle(array(12, 34)); // WHERE cycle IN (12, 34)
* $query->filterByCycle(array('min' => 12)); // WHERE cycle > 12
* </code>
*
* @param mixed $cycle The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByCycle($cycle = null, $comparison = null)
{
if (is_array($cycle)) {
$useMinMax = false;
if (isset($cycle['min'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::CYCLE, $cycle['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cycle['max'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::CYCLE, $cycle['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::CYCLE, $cycle, $comparison);
}
/**
* Filter the query on the min_amount column
*
* Example usage:
* <code>
* $query->filterByMinAmount(1234); // WHERE min_amount = 1234
* $query->filterByMinAmount(array(12, 34)); // WHERE min_amount IN (12, 34)
* $query->filterByMinAmount(array('min' => 12)); // WHERE min_amount > 12
* </code>
*
* @param mixed $minAmount The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByMinAmount($minAmount = null, $comparison = null)
{
if (is_array($minAmount)) {
$useMinMax = false;
if (isset($minAmount['min'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::MIN_AMOUNT, $minAmount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($minAmount['max'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::MIN_AMOUNT, $minAmount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::MIN_AMOUNT, $minAmount, $comparison);
}
/**
* Filter the query on the max_amount column
*
* Example usage:
* <code>
* $query->filterByMaxAmount(1234); // WHERE max_amount = 1234
* $query->filterByMaxAmount(array(12, 34)); // WHERE max_amount IN (12, 34)
* $query->filterByMaxAmount(array('min' => 12)); // WHERE max_amount > 12
* </code>
*
* @param mixed $maxAmount The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByMaxAmount($maxAmount = null, $comparison = null)
{
if (is_array($maxAmount)) {
$useMinMax = false;
if (isset($maxAmount['min'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::MAX_AMOUNT, $maxAmount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($maxAmount['max'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::MAX_AMOUNT, $maxAmount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::MAX_AMOUNT, $maxAmount, $comparison);
}
/**
* Filter the query on the position column
*
* Example usage:
* <code>
* $query->filterByPosition(1234); // WHERE position = 1234
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12
* </code>
*
* @param mixed $position The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($position)) {
$useMinMax = false;
if (isset($position['min'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::POSITION, $position, $comparison);
}
/**
* Filter the query on the created_at column
*
* Example usage:
* <code>
* $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
* $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
* $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
* </code>
*
* @param mixed $createdAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByCreatedAt($createdAt = null, $comparison = null)
{
if (is_array($createdAt)) {
$useMinMax = false;
if (isset($createdAt['min'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
* Filter the query on the updated_at column
*
* Example usage:
* <code>
* $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
* $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
* $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
* </code>
*
* @param mixed $updatedAt The value to use as filter.
* Values can be integers (unix timestamps), DateTime objects, or strings.
* Empty strings are treated as NULL.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByUpdatedAt($updatedAt = null, $comparison = null)
{
if (is_array($updatedAt)) {
$useMinMax = false;
if (isset($updatedAt['min'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \PayPal\Model\PaypalCart object
*
* @param \PayPal\Model\PaypalCart|ObjectCollection $paypalCart the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByPaypalCart($paypalCart, $comparison = null)
{
if ($paypalCart instanceof \PayPal\Model\PaypalCart) {
return $this
->addUsingAlias(PaypalPlanifiedPaymentTableMap::ID, $paypalCart->getPlanifiedPaymentId(), $comparison);
} elseif ($paypalCart instanceof ObjectCollection) {
return $this
->usePaypalCartQuery()
->filterByPrimaryKeys($paypalCart->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByPaypalCart() only accepts arguments of type \PayPal\Model\PaypalCart or Collection');
}
}
/**
* Adds a JOIN clause to the query using the PaypalCart relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function joinPaypalCart($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('PaypalCart');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'PaypalCart');
}
return $this;
}
/**
* Use the PaypalCart relation PaypalCart object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \PayPal\Model\PaypalCartQuery A secondary query class using the current class as primary query
*/
public function usePaypalCartQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinPaypalCart($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'PaypalCart', '\PayPal\Model\PaypalCartQuery');
}
/**
* Filter the query by a related \PayPal\Model\PaypalPlanifiedPaymentI18n object
*
* @param \PayPal\Model\PaypalPlanifiedPaymentI18n|ObjectCollection $paypalPlanifiedPaymentI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function filterByPaypalPlanifiedPaymentI18n($paypalPlanifiedPaymentI18n, $comparison = null)
{
if ($paypalPlanifiedPaymentI18n instanceof \PayPal\Model\PaypalPlanifiedPaymentI18n) {
return $this
->addUsingAlias(PaypalPlanifiedPaymentTableMap::ID, $paypalPlanifiedPaymentI18n->getId(), $comparison);
} elseif ($paypalPlanifiedPaymentI18n instanceof ObjectCollection) {
return $this
->usePaypalPlanifiedPaymentI18nQuery()
->filterByPrimaryKeys($paypalPlanifiedPaymentI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByPaypalPlanifiedPaymentI18n() only accepts arguments of type \PayPal\Model\PaypalPlanifiedPaymentI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the PaypalPlanifiedPaymentI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function joinPaypalPlanifiedPaymentI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('PaypalPlanifiedPaymentI18n');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'PaypalPlanifiedPaymentI18n');
}
return $this;
}
/**
* Use the PaypalPlanifiedPaymentI18n relation PaypalPlanifiedPaymentI18n object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \PayPal\Model\PaypalPlanifiedPaymentI18nQuery A secondary query class using the current class as primary query
*/
public function usePaypalPlanifiedPaymentI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinPaypalPlanifiedPaymentI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'PaypalPlanifiedPaymentI18n', '\PayPal\Model\PaypalPlanifiedPaymentI18nQuery');
}
/**
* Exclude object from result
*
* @param ChildPaypalPlanifiedPayment $paypalPlanifiedPayment Object to remove from the list of results
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function prune($paypalPlanifiedPayment = null)
{
if ($paypalPlanifiedPayment) {
$this->addUsingAlias(PaypalPlanifiedPaymentTableMap::ID, $paypalPlanifiedPayment->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* 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 function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalPlanifiedPaymentTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
$affectedRows += parent::doDeleteAll($con);
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
PaypalPlanifiedPaymentTableMap::clearInstancePool();
PaypalPlanifiedPaymentTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildPaypalPlanifiedPayment or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildPaypalPlanifiedPayment 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 function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PaypalPlanifiedPaymentTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(PaypalPlanifiedPaymentTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
PaypalPlanifiedPaymentTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
PaypalPlanifiedPaymentTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
// i18n behavior
/**
* Adds a JOIN clause to the query using the i18n relation
*
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'PaypalPlanifiedPaymentI18n';
return $this
->joinPaypalPlanifiedPaymentI18n($relationAlias, $joinType)
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
}
/**
* Adds a JOIN clause to the query and hydrates the related I18n object.
* Shortcut for $c->joinI18n($locale)->with()
*
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('PaypalPlanifiedPaymentI18n');
$this->with['PaypalPlanifiedPaymentI18n']->setIsWithOneToMany(false);
return $this;
}
/**
* Use the I18n relation query object
*
* @see useQuery()
*
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
*
* @return ChildPaypalPlanifiedPaymentI18nQuery A secondary query class using the current class as primary query
*/
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'PaypalPlanifiedPaymentI18n', '\PayPal\Model\PaypalPlanifiedPaymentI18nQuery');
}
// timestampable behavior
/**
* Filter by the latest updated
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(PaypalPlanifiedPaymentTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(PaypalPlanifiedPaymentTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(PaypalPlanifiedPaymentTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(PaypalPlanifiedPaymentTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildPaypalPlanifiedPaymentQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(PaypalPlanifiedPaymentTableMap::CREATED_AT);
}
} // PaypalPlanifiedPaymentQuery

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,48 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalCart as BasePaypalCart;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Cart;
use Thelia\Model\CartQuery;
class PaypalCart extends BasePaypalCart
{
/**
* Get the associated ChildCart object
*
* @param ConnectionInterface $con Optional Connection object.
* @return Cart The associated ChildCart object.
* @throws PropelException
*/
public function getCart(ConnectionInterface $con = null)
{
if ($this->aCart === null && ($this->id !== null)) {
$this->aCart = CartQuery::create()->findPk($this->id, $con);
}
return $this->aCart;
}
/**
* Declares an association between this object and a ChildCart object.
*
* @param Cart $cart
* @return \PayPal\Model\PaypalCart The current object (for fluent API support)
* @throws PropelException
*/
public function setCart(Cart $cart = null)
{
if ($cart === null) {
$this->setId(NULL);
} else {
$this->setId($cart->getId());
}
$this->aCart = $cart;
return $this;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalCartQuery as BasePaypalCartQuery;
/**
* Skeleton subclass for performing query and update operations on the 'paypal_cart' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class PaypalCartQuery extends BasePaypalCartQuery
{
} // PaypalCartQuery

View File

@@ -0,0 +1,52 @@
<?php
namespace PayPal\Model;
use PayPal\Api\OpenIdUserinfo;
use PayPal\Model\Base\PaypalCustomer as BasePaypalCustomer;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Customer;
use Thelia\Model\CustomerQuery;
class PaypalCustomer extends BasePaypalCustomer
{
/** @var OpenIdUserinfo */
protected $openIdUserinfo;
/**
* Get the associated ChildCustomer object
*
* @param ConnectionInterface $con Optional Connection object.
* @return Customer The associated ChildCustomer object.
* @throws PropelException
*/
public function getCustomer(ConnectionInterface $con = null)
{
if ($this->aCustomer === null && ($this->id !== null)) {
$this->aCustomer = CustomerQuery::create()->findPk($this->id, $con);
}
return $this->aCustomer;
}
/**
* Declares an association between this object and a ChildCustomer object.
*
* @param Customer $customer
* @return \PayPal\Model\PaypalCustomer The current object (for fluent API support)
* @throws PropelException
*/
public function setCustomer(Customer $customer = null)
{
if ($customer === null) {
$this->setId(NULL);
} else {
$this->setId($customer->getId());
}
$this->aCustomer = $customer;
return $this;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalCustomerQuery as BasePaypalCustomerQuery;
/**
* Skeleton subclass for performing query and update operations on the 'paypal_customer' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class PaypalCustomerQuery extends BasePaypalCustomerQuery
{
} // PaypalCustomerQuery

View File

@@ -0,0 +1,10 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalLog as BasePaypalLog;
class PaypalLog extends BasePaypalLog
{
}

View File

@@ -0,0 +1,21 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalLogQuery as BasePaypalLogQuery;
/**
* Skeleton subclass for performing query and update operations on the 'paypal_log' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class PaypalLogQuery extends BasePaypalLogQuery
{
} // PaypalLogQuery

View File

@@ -0,0 +1,48 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalOrder as BasePaypalOrder;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Order;
use Thelia\Model\OrderQuery;
class PaypalOrder extends BasePaypalOrder
{
/**
* Get the associated ChildOrder object
*
* @param ConnectionInterface $con Optional Connection object.
* @return Order The associated ChildOrder object.
* @throws PropelException
*/
public function getOrder(ConnectionInterface $con = null)
{
if ($this->aOrder === null && ($this->id !== null)) {
$this->aOrder = OrderQuery::create()->findPk($this->id, $con);
}
return $this->aOrder;
}
/**
* Declares an association between this object and a ChildOrder object.
*
* @param Order $order
* @return \PayPal\Model\PaypalOrder The current object (for fluent API support)
* @throws PropelException
*/
public function setOrder(Order $order = null)
{
if ($order === null) {
$this->setId(NULL);
} else {
$this->setId($order->getId());
}
$this->aOrder = $order;
return $this;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalOrderQuery as BasePaypalOrderQuery;
/**
* Skeleton subclass for performing query and update operations on the 'paypal_order' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class PaypalOrderQuery extends BasePaypalOrderQuery
{
} // PaypalOrderQuery

View File

@@ -0,0 +1,10 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalOrderVersion as BasePaypalOrderVersion;
class PaypalOrderVersion extends BasePaypalOrderVersion
{
}

View File

@@ -0,0 +1,21 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalOrderVersionQuery as BasePaypalOrderVersionQuery;
/**
* Skeleton subclass for performing query and update operations on the 'paypal_order_version' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class PaypalOrderVersionQuery extends BasePaypalOrderVersionQuery
{
} // PaypalOrderVersionQuery

View File

@@ -0,0 +1,10 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalPlan as BasePaypalPlan;
class PaypalPlan extends BasePaypalPlan
{
}

View File

@@ -0,0 +1,21 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalPlanQuery as BasePaypalPlanQuery;
/**
* Skeleton subclass for performing query and update operations on the 'paypal_plan' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class PaypalPlanQuery extends BasePaypalPlanQuery
{
} // PaypalPlanQuery

View File

@@ -0,0 +1,10 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalPlanifiedPayment as BasePaypalPlanifiedPayment;
class PaypalPlanifiedPayment extends BasePaypalPlanifiedPayment
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalPlanifiedPaymentI18n as BasePaypalPlanifiedPaymentI18n;
class PaypalPlanifiedPaymentI18n extends BasePaypalPlanifiedPaymentI18n
{
}

View File

@@ -0,0 +1,21 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalPlanifiedPaymentI18nQuery as BasePaypalPlanifiedPaymentI18nQuery;
/**
* Skeleton subclass for performing query and update operations on the 'paypal_planified_payment_i18n' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class PaypalPlanifiedPaymentI18nQuery extends BasePaypalPlanifiedPaymentI18nQuery
{
} // PaypalPlanifiedPaymentI18nQuery

View File

@@ -0,0 +1,21 @@
<?php
namespace PayPal\Model;
use PayPal\Model\Base\PaypalPlanifiedPaymentQuery as BasePaypalPlanifiedPaymentQuery;
/**
* Skeleton subclass for performing query and update operations on the 'paypal_planified_payment' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class PaypalPlanifiedPaymentQuery extends BasePaypalPlanifiedPaymentQuery
{
} // PaypalPlanifiedPaymentQuery