Merge branch 'master' of https://github.com/thelia/thelia into coupon
# By Manuel Raynaud (22) and others # Via Manuel Raynaud (7) and others * 'master' of https://github.com/thelia/thelia: (32 commits) refactor name for updating actions choose UPDATE word for name actions add update address action and create tests 404 not found management Working Fix unset namespace modify travis script test rewriting exception Fixed minor bug in Currencies Finished currency edition Added route methods address action implementation hot fix rewriting add address create controller and event Added AdminUtilities Smarty plugin, optimized templates update customer model createOrUpdate method update address model fix redirect process in viewListener refactor reset_install script refactor install process, database management in dedicated class ... Conflicts: local/config/schema.xml reset_install.sh
This commit is contained in:
@@ -2,8 +2,21 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Thelia\Model\Base\Address as BaseAddress;
|
||||
|
||||
class Address extends BaseAddress {
|
||||
|
||||
protected $dispatcher;
|
||||
|
||||
public function setDispatcher(EventDispatcherInterface $dispatcher)
|
||||
{
|
||||
$this->dispatcher = $dispatcher;
|
||||
}
|
||||
|
||||
public function getDispatcher()
|
||||
{
|
||||
return $this->dispatcher;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -70,10 +70,10 @@ abstract class Address implements ActiveRecordInterface
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* The value for the name field.
|
||||
* The value for the label field.
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* The value for the customer_id field.
|
||||
@@ -498,14 +498,14 @@ abstract class Address implements ActiveRecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [name] column value.
|
||||
* Get the [label] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
public function getLabel()
|
||||
{
|
||||
|
||||
return $this->name;
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -724,25 +724,25 @@ abstract class Address implements ActiveRecordInterface
|
||||
} // setId()
|
||||
|
||||
/**
|
||||
* Set the value of [name] column.
|
||||
* Set the value of [label] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\Address The current object (for fluent API support)
|
||||
*/
|
||||
public function setName($v)
|
||||
public function setLabel($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->name !== $v) {
|
||||
$this->name = $v;
|
||||
$this->modifiedColumns[] = AddressTableMap::NAME;
|
||||
if ($this->label !== $v) {
|
||||
$this->label = $v;
|
||||
$this->modifiedColumns[] = AddressTableMap::LABEL;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setName()
|
||||
} // setLabel()
|
||||
|
||||
/**
|
||||
* Set the value of [customer_id] column.
|
||||
@@ -1136,8 +1136,8 @@ abstract class Address implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : AddressTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->id = (null !== $col) ? (int) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AddressTableMap::translateFieldName('Name', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->name = (null !== $col) ? (string) $col : null;
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AddressTableMap::translateFieldName('Label', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->label = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AddressTableMap::translateFieldName('CustomerId', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->customer_id = (null !== $col) ? (int) $col : null;
|
||||
@@ -1501,8 +1501,8 @@ abstract class Address implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(AddressTableMap::ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'ID';
|
||||
}
|
||||
if ($this->isColumnModified(AddressTableMap::NAME)) {
|
||||
$modifiedColumns[':p' . $index++] = 'NAME';
|
||||
if ($this->isColumnModified(AddressTableMap::LABEL)) {
|
||||
$modifiedColumns[':p' . $index++] = 'LABEL';
|
||||
}
|
||||
if ($this->isColumnModified(AddressTableMap::CUSTOMER_ID)) {
|
||||
$modifiedColumns[':p' . $index++] = 'CUSTOMER_ID';
|
||||
@@ -1566,8 +1566,8 @@ abstract class Address implements ActiveRecordInterface
|
||||
case 'ID':
|
||||
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
|
||||
break;
|
||||
case 'NAME':
|
||||
$stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
|
||||
case 'LABEL':
|
||||
$stmt->bindValue($identifier, $this->label, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'CUSTOMER_ID':
|
||||
$stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT);
|
||||
@@ -1683,7 +1683,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
return $this->getId();
|
||||
break;
|
||||
case 1:
|
||||
return $this->getName();
|
||||
return $this->getLabel();
|
||||
break;
|
||||
case 2:
|
||||
return $this->getCustomerId();
|
||||
@@ -1763,7 +1763,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
$keys = AddressTableMap::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getId(),
|
||||
$keys[1] => $this->getName(),
|
||||
$keys[1] => $this->getLabel(),
|
||||
$keys[2] => $this->getCustomerId(),
|
||||
$keys[3] => $this->getTitleId(),
|
||||
$keys[4] => $this->getCompany(),
|
||||
@@ -1841,7 +1841,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
$this->setId($value);
|
||||
break;
|
||||
case 1:
|
||||
$this->setName($value);
|
||||
$this->setLabel($value);
|
||||
break;
|
||||
case 2:
|
||||
$this->setCustomerId($value);
|
||||
@@ -1916,7 +1916,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
$keys = AddressTableMap::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setLabel($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setCustomerId($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setTitleId($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setCompany($arr[$keys[4]]);
|
||||
@@ -1945,7 +1945,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
$criteria = new Criteria(AddressTableMap::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(AddressTableMap::ID)) $criteria->add(AddressTableMap::ID, $this->id);
|
||||
if ($this->isColumnModified(AddressTableMap::NAME)) $criteria->add(AddressTableMap::NAME, $this->name);
|
||||
if ($this->isColumnModified(AddressTableMap::LABEL)) $criteria->add(AddressTableMap::LABEL, $this->label);
|
||||
if ($this->isColumnModified(AddressTableMap::CUSTOMER_ID)) $criteria->add(AddressTableMap::CUSTOMER_ID, $this->customer_id);
|
||||
if ($this->isColumnModified(AddressTableMap::TITLE_ID)) $criteria->add(AddressTableMap::TITLE_ID, $this->title_id);
|
||||
if ($this->isColumnModified(AddressTableMap::COMPANY)) $criteria->add(AddressTableMap::COMPANY, $this->company);
|
||||
@@ -2025,7 +2025,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
*/
|
||||
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
|
||||
{
|
||||
$copyObj->setName($this->getName());
|
||||
$copyObj->setLabel($this->getLabel());
|
||||
$copyObj->setCustomerId($this->getCustomerId());
|
||||
$copyObj->setTitleId($this->getTitleId());
|
||||
$copyObj->setCompany($this->getCompany());
|
||||
@@ -2804,7 +2804,7 @@ abstract class Address implements ActiveRecordInterface
|
||||
public function clear()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->name = null;
|
||||
$this->label = null;
|
||||
$this->customer_id = null;
|
||||
$this->title_id = null;
|
||||
$this->company = null;
|
||||
|
||||
@@ -22,7 +22,7 @@ use Thelia\Model\Map\AddressTableMap;
|
||||
*
|
||||
*
|
||||
* @method ChildAddressQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildAddressQuery orderByName($order = Criteria::ASC) Order by the name column
|
||||
* @method ChildAddressQuery orderByLabel($order = Criteria::ASC) Order by the label column
|
||||
* @method ChildAddressQuery orderByCustomerId($order = Criteria::ASC) Order by the customer_id column
|
||||
* @method ChildAddressQuery orderByTitleId($order = Criteria::ASC) Order by the title_id column
|
||||
* @method ChildAddressQuery orderByCompany($order = Criteria::ASC) Order by the company column
|
||||
@@ -41,7 +41,7 @@ use Thelia\Model\Map\AddressTableMap;
|
||||
* @method ChildAddressQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
*
|
||||
* @method ChildAddressQuery groupById() Group by the id column
|
||||
* @method ChildAddressQuery groupByName() Group by the name column
|
||||
* @method ChildAddressQuery groupByLabel() Group by the label column
|
||||
* @method ChildAddressQuery groupByCustomerId() Group by the customer_id column
|
||||
* @method ChildAddressQuery groupByTitleId() Group by the title_id column
|
||||
* @method ChildAddressQuery groupByCompany() Group by the company column
|
||||
@@ -87,7 +87,7 @@ use Thelia\Model\Map\AddressTableMap;
|
||||
* @method ChildAddress findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAddress matching the query, or a new ChildAddress object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildAddress findOneById(int $id) Return the first ChildAddress filtered by the id column
|
||||
* @method ChildAddress findOneByName(string $name) Return the first ChildAddress filtered by the name column
|
||||
* @method ChildAddress findOneByLabel(string $label) Return the first ChildAddress filtered by the label column
|
||||
* @method ChildAddress findOneByCustomerId(int $customer_id) Return the first ChildAddress filtered by the customer_id column
|
||||
* @method ChildAddress findOneByTitleId(int $title_id) Return the first ChildAddress filtered by the title_id column
|
||||
* @method ChildAddress findOneByCompany(string $company) Return the first ChildAddress filtered by the company column
|
||||
@@ -106,7 +106,7 @@ use Thelia\Model\Map\AddressTableMap;
|
||||
* @method ChildAddress findOneByUpdatedAt(string $updated_at) Return the first ChildAddress filtered by the updated_at column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildAddress objects filtered by the id column
|
||||
* @method array findByName(string $name) Return ChildAddress objects filtered by the name column
|
||||
* @method array findByLabel(string $label) Return ChildAddress objects filtered by the label column
|
||||
* @method array findByCustomerId(int $customer_id) Return ChildAddress objects filtered by the customer_id column
|
||||
* @method array findByTitleId(int $title_id) Return ChildAddress objects filtered by the title_id column
|
||||
* @method array findByCompany(string $company) Return ChildAddress objects filtered by the company column
|
||||
@@ -211,7 +211,7 @@ abstract class AddressQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, NAME, CUSTOMER_ID, TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, PHONE, CELLPHONE, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM address WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, LABEL, CUSTOMER_ID, TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, PHONE, CELLPHONE, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM address WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -342,32 +342,32 @@ abstract class AddressQuery extends ModelCriteria
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the name column
|
||||
* Filter the query on the label column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByName('fooValue'); // WHERE name = 'fooValue'
|
||||
* $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
|
||||
* $query->filterByLabel('fooValue'); // WHERE label = 'fooValue'
|
||||
* $query->filterByLabel('%fooValue%'); // WHERE label LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $name The value to use as filter.
|
||||
* @param string $label 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 ChildAddressQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByName($name = null, $comparison = null)
|
||||
public function filterByLabel($label = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($name)) {
|
||||
if (is_array($label)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $name)) {
|
||||
$name = str_replace('*', '%', $name);
|
||||
} elseif (preg_match('/[\%\*]/', $label)) {
|
||||
$label = str_replace('*', '%', $label);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AddressTableMap::NAME, $name, $comparison);
|
||||
return $this->addUsingAlias(AddressTableMap::LABEL, $label, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ class CartItem extends BaseCartItem
|
||||
if ($this->dispatcher) {
|
||||
$cartEvent = new CartEvent($this->getCart());
|
||||
|
||||
$this->dispatcher->dispatch(TheliaEvents::AFTER_CARTCHANGEITEM, $cartEvent);
|
||||
$this->dispatcher->dispatch(TheliaEvents::AFTER_CARTUPDATEITEM, $cartEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class Category extends BaseCategory
|
||||
|
||||
public function getUrl($locale)
|
||||
{
|
||||
return URL::retrieve('category', $this->getId(), $locale);
|
||||
return URL::init()->retrieve('category', $this->getId(), $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,14 +95,14 @@ class Category extends BaseCategory
|
||||
|
||||
public function preUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_CHANGECATEGORY, new CategoryEvent($this));
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_UPDATECATEGORY, new CategoryEvent($this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_CHANGECATEGORY, new CategoryEvent($this));
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_UPDATECATEGORY, new CategoryEvent($this));
|
||||
}
|
||||
|
||||
public function preDelete(ConnectionInterface $con = null)
|
||||
|
||||
@@ -55,7 +55,7 @@ class Config extends BaseConfig {
|
||||
*/
|
||||
public function preUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_CHANGECONFIG, new ConfigEvent($this));
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_UPDATECONFIG, new ConfigEvent($this));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ class Config extends BaseConfig {
|
||||
*/
|
||||
public function postUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_CHANGECONFIG, new ConfigEvent($this));
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_UPDATECONFIG, new ConfigEvent($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,4 +32,14 @@ class ConfigQuery extends BaseConfigQuery {
|
||||
{
|
||||
return self::read("rewriting_enable") == 1;
|
||||
}
|
||||
|
||||
public static function getPageNotFoundView()
|
||||
{
|
||||
return self::read("page_not_found_view", '404.html');
|
||||
}
|
||||
|
||||
public static function getActiveTemplate()
|
||||
{
|
||||
return self::read('active-template', 'default');
|
||||
}
|
||||
} // ConfigQuery
|
||||
|
||||
@@ -9,6 +9,6 @@ class Content extends BaseContent
|
||||
{
|
||||
public function getUrl($locale)
|
||||
{
|
||||
return URL::retrieve('content', $this->getId(), $locale);
|
||||
return URL::init()->retrieve('content', $this->getId(), $locale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Propel\Runtime\Propel;
|
||||
use Thelia\Coupon\CouponRuleCollection;
|
||||
use Thelia\Model\Base\Coupon as BaseCoupon;
|
||||
use Thelia\Model\Map\CouponTableMap;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
@@ -41,6 +43,58 @@ use Thelia\Model\Base\Coupon as BaseCoupon;
|
||||
*/
|
||||
class Coupon extends BaseCoupon
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $code Coupon Code
|
||||
* @param string $title Coupon title
|
||||
* @param float $amount Amount removed from the Total Checkout
|
||||
* @param string $effect Coupon effect
|
||||
* @param string $shortDescription Coupon short description
|
||||
* @param string $description Coupon description
|
||||
* @param boolean $isEnabled Enable/Disable
|
||||
* @param \DateTime $expirationDate Coupon expiration date
|
||||
* @param boolean $isAvailableOnSpecialOffers Is available on special offers
|
||||
* @param boolean $isCumulative Is cumulative
|
||||
* @param boolean $isRemovingPostage Is removing Postage
|
||||
* @param int $maxUsage Coupon quantity
|
||||
* @param CouponRuleCollection $rules CouponRuleInterface to add
|
||||
* @param string $lang Coupon Language code ISO (ex: fr_FR)
|
||||
*/
|
||||
function createOrUpdate($code, $title, $amount, $effect, $shortDescription, $description, $isEnabled, $expirationDate, $isAvailableOnSpecialOffers, $isCumulative, $maxUsage, $rules, $lang = null)
|
||||
{
|
||||
$this->setCode($code)
|
||||
->setTitle($title)
|
||||
->setShortDescription($shortDescription)
|
||||
->setDescription($description)
|
||||
->setType($effect)
|
||||
->setAmount($amount)
|
||||
->setType($amount)
|
||||
->setIsEnabled($isEnabled)
|
||||
->setExpirationDate($expirationDate)
|
||||
->setIsAvailableOnSpecialOffers($isAvailableOnSpecialOffers)
|
||||
->setIsCumulative($isCumulative)
|
||||
->setMaxUsage($maxUsage)
|
||||
->setRules($rules);
|
||||
|
||||
// Set object language (i18n)
|
||||
if (!is_null($lang)) {
|
||||
$this->setLang($lang);
|
||||
}
|
||||
|
||||
$con = Propel::getWriteConnection(CouponTableMap::DATABASE_NAME);
|
||||
$con->beginTransaction();
|
||||
try {
|
||||
$this->save($con);
|
||||
$con->commit();
|
||||
|
||||
} catch(\Exception $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [serialized_rules] column.
|
||||
*
|
||||
@@ -50,19 +104,19 @@ class Coupon extends BaseCoupon
|
||||
*/
|
||||
public function setRules(CouponRuleCollection $rules)
|
||||
{
|
||||
$serializedRules = null;
|
||||
if ($rules !== null) {
|
||||
|
||||
$v = (string) base64_encode(serialize($rules));
|
||||
$serializedRules = (string) base64_encode(serialize($rules));
|
||||
}
|
||||
|
||||
if ($this->serialized_rules !== $v) {
|
||||
$this->serialized_rules = $v;
|
||||
if ($this->serialized_rules !== $serializedRules) {
|
||||
$this->serialized_rules = $serializedRules;
|
||||
$this->modifiedColumns[] = CouponTableMap::SERIALIZED_RULES;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setSerializedRules()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ class Currency extends BaseCurrency {
|
||||
*/
|
||||
public function preUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_CHANGECURRENCY, new CurrencyEvent($this));
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_UPDATECURRENCY, new CurrencyEvent($this));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ class Currency extends BaseCurrency {
|
||||
*/
|
||||
public function postUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_CHANGECURRENCY, new CurrencyEvent($this));
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_UPDATECURRENCY, new CurrencyEvent($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\Base\Customer as BaseCustomer;
|
||||
|
||||
use Thelia\Model\Exception\InvalidArgumentException;
|
||||
@@ -74,28 +75,46 @@ class Customer extends BaseCustomer implements UserInterface
|
||||
$con = Propel::getWriteConnection(CustomerTableMap::DATABASE_NAME);
|
||||
$con->beginTransaction();
|
||||
try {
|
||||
if ($this->isNew()) {
|
||||
$address = new Address();
|
||||
|
||||
$address
|
||||
->setTitleId($titleId)
|
||||
->setFirstname($firstname)
|
||||
->setLastname($lastname)
|
||||
->setAddress1($address1)
|
||||
->setAddress2($address2)
|
||||
->setAddress3($address3)
|
||||
->setPhone($phone)
|
||||
->setCellphone($cellphone)
|
||||
->setZipcode($zipcode)
|
||||
->setCountryId($countryId)
|
||||
->setIsDefault(1)
|
||||
;
|
||||
|
||||
$this->addAddress($address);
|
||||
|
||||
} else {
|
||||
$address = $this->getDefaultAddress();
|
||||
|
||||
$address
|
||||
->setTitleId($titleId)
|
||||
->setFirstname($firstname)
|
||||
->setLastname($lastname)
|
||||
->setAddress1($address1)
|
||||
->setAddress2($address2)
|
||||
->setAddress3($address3)
|
||||
->setPhone($phone)
|
||||
->setCellphone($cellphone)
|
||||
->setZipcode($zipcode)
|
||||
->setCountryId($countryId)
|
||||
->save($con)
|
||||
;
|
||||
}
|
||||
$this->save($con);
|
||||
|
||||
$address = new Address();
|
||||
|
||||
$address
|
||||
->setTitleId($titleId)
|
||||
->setFirstname($firstname)
|
||||
->setLastname($lastname)
|
||||
->setAddress1($address1)
|
||||
->setAddress2($address2)
|
||||
->setAddress3($address3)
|
||||
->setPhone($phone)
|
||||
->setCellphone($cellphone)
|
||||
->setZipcode($zipcode)
|
||||
->setCountryId($countryId)
|
||||
->setIsDefault(1)
|
||||
->setCustomer($this)
|
||||
->save($con);
|
||||
|
||||
$con->commit();
|
||||
|
||||
|
||||
} catch(Exception $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
@@ -107,12 +126,23 @@ class Customer extends BaseCustomer implements UserInterface
|
||||
return uniqid(substr($this->getLastname(), 0, (strlen($this->getLastname()) >= 3) ? 3 : strlen($this->getLastname())), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Address
|
||||
*/
|
||||
public function getDefaultAddress()
|
||||
{
|
||||
return AddressQuery::create()
|
||||
->filterByCustomer($this)
|
||||
->filterByIsDefault(1)
|
||||
->findOne();
|
||||
}
|
||||
|
||||
/**
|
||||
* create hash for plain password and set it in Customer object
|
||||
*
|
||||
* @param string $password plain password before hashing
|
||||
* @throws Exception\InvalidArgumentException
|
||||
* @return $this|Customer
|
||||
* @throws \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ class Folder extends BaseFolder
|
||||
|
||||
public function getUrl($locale)
|
||||
{
|
||||
return URL::retrieve('folder', $this->getId(), $locale);
|
||||
return URL::init()->retrieve('folder', $this->getId(), $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,9 +75,9 @@ class AddressTableMap extends TableMap
|
||||
const ID = 'address.ID';
|
||||
|
||||
/**
|
||||
* the column name for the NAME field
|
||||
* the column name for the LABEL field
|
||||
*/
|
||||
const NAME = 'address.NAME';
|
||||
const LABEL = 'address.LABEL';
|
||||
|
||||
/**
|
||||
* the column name for the CUSTOMER_ID field
|
||||
@@ -171,11 +171,11 @@ class AddressTableMap extends TableMap
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Name', 'CustomerId', 'TitleId', 'Company', 'Firstname', 'Lastname', 'Address1', 'Address2', 'Address3', 'Zipcode', 'City', 'CountryId', 'Phone', 'Cellphone', 'IsDefault', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'name', 'customerId', 'titleId', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'countryId', 'phone', 'cellphone', 'isDefault', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(AddressTableMap::ID, AddressTableMap::NAME, AddressTableMap::CUSTOMER_ID, AddressTableMap::TITLE_ID, AddressTableMap::COMPANY, AddressTableMap::FIRSTNAME, AddressTableMap::LASTNAME, AddressTableMap::ADDRESS1, AddressTableMap::ADDRESS2, AddressTableMap::ADDRESS3, AddressTableMap::ZIPCODE, AddressTableMap::CITY, AddressTableMap::COUNTRY_ID, AddressTableMap::PHONE, AddressTableMap::CELLPHONE, AddressTableMap::IS_DEFAULT, AddressTableMap::CREATED_AT, AddressTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'NAME', 'CUSTOMER_ID', 'TITLE_ID', 'COMPANY', 'FIRSTNAME', 'LASTNAME', 'ADDRESS1', 'ADDRESS2', 'ADDRESS3', 'ZIPCODE', 'CITY', 'COUNTRY_ID', 'PHONE', 'CELLPHONE', 'IS_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'name', 'customer_id', 'title_id', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'country_id', 'phone', 'cellphone', 'is_default', 'created_at', 'updated_at', ),
|
||||
self::TYPE_PHPNAME => array('Id', 'Label', 'CustomerId', 'TitleId', 'Company', 'Firstname', 'Lastname', 'Address1', 'Address2', 'Address3', 'Zipcode', 'City', 'CountryId', 'Phone', 'Cellphone', 'IsDefault', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'label', 'customerId', 'titleId', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'countryId', 'phone', 'cellphone', 'isDefault', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(AddressTableMap::ID, AddressTableMap::LABEL, AddressTableMap::CUSTOMER_ID, AddressTableMap::TITLE_ID, AddressTableMap::COMPANY, AddressTableMap::FIRSTNAME, AddressTableMap::LASTNAME, AddressTableMap::ADDRESS1, AddressTableMap::ADDRESS2, AddressTableMap::ADDRESS3, AddressTableMap::ZIPCODE, AddressTableMap::CITY, AddressTableMap::COUNTRY_ID, AddressTableMap::PHONE, AddressTableMap::CELLPHONE, AddressTableMap::IS_DEFAULT, AddressTableMap::CREATED_AT, AddressTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'LABEL', 'CUSTOMER_ID', 'TITLE_ID', 'COMPANY', 'FIRSTNAME', 'LASTNAME', 'ADDRESS1', 'ADDRESS2', 'ADDRESS3', 'ZIPCODE', 'CITY', 'COUNTRY_ID', 'PHONE', 'CELLPHONE', 'IS_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'label', 'customer_id', 'title_id', 'company', 'firstname', 'lastname', 'address1', 'address2', 'address3', 'zipcode', 'city', 'country_id', 'phone', 'cellphone', 'is_default', '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, )
|
||||
);
|
||||
|
||||
@@ -186,11 +186,11 @@ class AddressTableMap extends TableMap
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'CustomerId' => 2, 'TitleId' => 3, 'Company' => 4, 'Firstname' => 5, 'Lastname' => 6, 'Address1' => 7, 'Address2' => 8, 'Address3' => 9, 'Zipcode' => 10, 'City' => 11, 'CountryId' => 12, 'Phone' => 13, 'Cellphone' => 14, 'IsDefault' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'name' => 1, 'customerId' => 2, 'titleId' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'countryId' => 12, 'phone' => 13, 'cellphone' => 14, 'isDefault' => 15, 'createdAt' => 16, 'updatedAt' => 17, ),
|
||||
self::TYPE_COLNAME => array(AddressTableMap::ID => 0, AddressTableMap::NAME => 1, AddressTableMap::CUSTOMER_ID => 2, AddressTableMap::TITLE_ID => 3, AddressTableMap::COMPANY => 4, AddressTableMap::FIRSTNAME => 5, AddressTableMap::LASTNAME => 6, AddressTableMap::ADDRESS1 => 7, AddressTableMap::ADDRESS2 => 8, AddressTableMap::ADDRESS3 => 9, AddressTableMap::ZIPCODE => 10, AddressTableMap::CITY => 11, AddressTableMap::COUNTRY_ID => 12, AddressTableMap::PHONE => 13, AddressTableMap::CELLPHONE => 14, AddressTableMap::IS_DEFAULT => 15, AddressTableMap::CREATED_AT => 16, AddressTableMap::UPDATED_AT => 17, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'NAME' => 1, 'CUSTOMER_ID' => 2, 'TITLE_ID' => 3, 'COMPANY' => 4, 'FIRSTNAME' => 5, 'LASTNAME' => 6, 'ADDRESS1' => 7, 'ADDRESS2' => 8, 'ADDRESS3' => 9, 'ZIPCODE' => 10, 'CITY' => 11, 'COUNTRY_ID' => 12, 'PHONE' => 13, 'CELLPHONE' => 14, 'IS_DEFAULT' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'customer_id' => 2, 'title_id' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'country_id' => 12, 'phone' => 13, 'cellphone' => 14, 'is_default' => 15, 'created_at' => 16, 'updated_at' => 17, ),
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Label' => 1, 'CustomerId' => 2, 'TitleId' => 3, 'Company' => 4, 'Firstname' => 5, 'Lastname' => 6, 'Address1' => 7, 'Address2' => 8, 'Address3' => 9, 'Zipcode' => 10, 'City' => 11, 'CountryId' => 12, 'Phone' => 13, 'Cellphone' => 14, 'IsDefault' => 15, 'CreatedAt' => 16, 'UpdatedAt' => 17, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'label' => 1, 'customerId' => 2, 'titleId' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'countryId' => 12, 'phone' => 13, 'cellphone' => 14, 'isDefault' => 15, 'createdAt' => 16, 'updatedAt' => 17, ),
|
||||
self::TYPE_COLNAME => array(AddressTableMap::ID => 0, AddressTableMap::LABEL => 1, AddressTableMap::CUSTOMER_ID => 2, AddressTableMap::TITLE_ID => 3, AddressTableMap::COMPANY => 4, AddressTableMap::FIRSTNAME => 5, AddressTableMap::LASTNAME => 6, AddressTableMap::ADDRESS1 => 7, AddressTableMap::ADDRESS2 => 8, AddressTableMap::ADDRESS3 => 9, AddressTableMap::ZIPCODE => 10, AddressTableMap::CITY => 11, AddressTableMap::COUNTRY_ID => 12, AddressTableMap::PHONE => 13, AddressTableMap::CELLPHONE => 14, AddressTableMap::IS_DEFAULT => 15, AddressTableMap::CREATED_AT => 16, AddressTableMap::UPDATED_AT => 17, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LABEL' => 1, 'CUSTOMER_ID' => 2, 'TITLE_ID' => 3, 'COMPANY' => 4, 'FIRSTNAME' => 5, 'LASTNAME' => 6, 'ADDRESS1' => 7, 'ADDRESS2' => 8, 'ADDRESS3' => 9, 'ZIPCODE' => 10, 'CITY' => 11, 'COUNTRY_ID' => 12, 'PHONE' => 13, 'CELLPHONE' => 14, 'IS_DEFAULT' => 15, 'CREATED_AT' => 16, 'UPDATED_AT' => 17, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'label' => 1, 'customer_id' => 2, 'title_id' => 3, 'company' => 4, 'firstname' => 5, 'lastname' => 6, 'address1' => 7, 'address2' => 8, 'address3' => 9, 'zipcode' => 10, 'city' => 11, 'country_id' => 12, 'phone' => 13, 'cellphone' => 14, 'is_default' => 15, 'created_at' => 16, 'updated_at' => 17, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
|
||||
);
|
||||
|
||||
@@ -211,7 +211,7 @@ class AddressTableMap extends TableMap
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addColumn('NAME', 'Name', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('LABEL', 'Label', 'VARCHAR', false, 255, null);
|
||||
$this->addForeignKey('CUSTOMER_ID', 'CustomerId', 'INTEGER', 'customer', 'ID', true, null, null);
|
||||
$this->addForeignKey('TITLE_ID', 'TitleId', 'INTEGER', 'customer_title', 'ID', true, null, null);
|
||||
$this->addColumn('COMPANY', 'Company', 'VARCHAR', false, 255, null);
|
||||
@@ -394,7 +394,7 @@ class AddressTableMap extends TableMap
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(AddressTableMap::ID);
|
||||
$criteria->addSelectColumn(AddressTableMap::NAME);
|
||||
$criteria->addSelectColumn(AddressTableMap::LABEL);
|
||||
$criteria->addSelectColumn(AddressTableMap::CUSTOMER_ID);
|
||||
$criteria->addSelectColumn(AddressTableMap::TITLE_ID);
|
||||
$criteria->addSelectColumn(AddressTableMap::COMPANY);
|
||||
@@ -413,7 +413,7 @@ class AddressTableMap extends TableMap
|
||||
$criteria->addSelectColumn(AddressTableMap::UPDATED_AT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.NAME');
|
||||
$criteria->addSelectColumn($alias . '.LABEL');
|
||||
$criteria->addSelectColumn($alias . '.CUSTOMER_ID');
|
||||
$criteria->addSelectColumn($alias . '.TITLE_ID');
|
||||
$criteria->addSelectColumn($alias . '.COMPANY');
|
||||
|
||||
@@ -34,7 +34,7 @@ class Message extends BaseMessage {
|
||||
*/
|
||||
public function preUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_CHANGEMESSAGE, new MessageEvent($this));
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_UPDATEMESSAGE, new MessageEvent($this));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ class Message extends BaseMessage {
|
||||
*/
|
||||
public function postUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_CHANGEMESSAGE, new MessageEvent($this));
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_UPDATEMESSAGE, new MessageEvent($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,6 @@ class Product extends BaseProduct
|
||||
{
|
||||
public function getUrl($locale)
|
||||
{
|
||||
return URL::retrieve('product', $this->getId(), $locale);
|
||||
return URL::init()->retrieve('product', $this->getId(), $locale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\Join;
|
||||
use Thelia\Model\Base\RewritingUrlQuery as BaseRewritingUrlQuery;
|
||||
|
||||
use Thelia\Model\Map\RewritingUrlTableMap;
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'rewriting_url' table.
|
||||
@@ -15,6 +17,96 @@ use Thelia\Model\Base\RewritingUrlQuery as BaseRewritingUrlQuery;
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class RewritingUrlQuery extends BaseRewritingUrlQuery {
|
||||
class RewritingUrlQuery extends BaseRewritingUrlQuery
|
||||
{
|
||||
/**
|
||||
* @param $rewrittenUrl
|
||||
*
|
||||
* @return array|mixed|\Propel\Runtime\Collection\ObjectCollection
|
||||
*/
|
||||
public function getResolverSearch($rewrittenUrl)
|
||||
{
|
||||
$redirectedJoin = new Join();
|
||||
$redirectedJoin->addExplicitCondition(RewritingUrlTableMap::TABLE_NAME, 'REDIRECTED', 'ru', RewritingUrlTableMap::TABLE_NAME, 'ID', 'is_redirected');
|
||||
$redirectedJoin->setJoinType(Criteria::LEFT_JOIN);
|
||||
|
||||
$search = RewritingArgumentQuery::create()
|
||||
->joinRewritingUrl('ru', Criteria::RIGHT_JOIN)
|
||||
->addJoinObject($redirectedJoin)
|
||||
->where('`ru`.URL = ?', $rewrittenUrl, \PDO::PARAM_STR)
|
||||
->withColumn('`ru`.URL', 'ru_url')
|
||||
->withColumn('`ru`.VIEW', 'ru_view')
|
||||
->withColumn('`ru`.VIEW_LOCALE', 'ru_locale')
|
||||
->withColumn('`ru`.VIEW_ID', 'ru_viewId')
|
||||
->withColumn('`is_redirected`.URL', 'ru_redirected_to_url')
|
||||
->find();
|
||||
|
||||
return $search;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $view
|
||||
* @param $viewId
|
||||
* @param $viewLocale
|
||||
*
|
||||
* @return null|RewritingUrl
|
||||
*/
|
||||
public function getViewUrlQuery($view, $viewLocale, $viewId)
|
||||
{
|
||||
return RewritingUrlQuery::create()
|
||||
->joinRewritingArgument('ra', Criteria::LEFT_JOIN)
|
||||
->where('ISNULL(`ra`.REWRITING_URL_ID)')
|
||||
->filterByView($view)
|
||||
->filterByViewLocale($viewLocale)
|
||||
->filterByViewId($viewId)
|
||||
->filterByRedirected(null)
|
||||
->orderByUpdatedAt(Criteria::DESC)
|
||||
->findOne();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $view
|
||||
* @param $viewLocale
|
||||
* @param $viewId
|
||||
* @param $viewOtherParameters
|
||||
*
|
||||
* @return null|RewritingUrl
|
||||
*/
|
||||
public function getSpecificUrlQuery($view, $viewLocale, $viewId, $viewOtherParameters)
|
||||
{
|
||||
$urlQuery = RewritingUrlQuery::create()
|
||||
->joinRewritingArgument('ra', Criteria::LEFT_JOIN)
|
||||
->withColumn('`ra`.REWRITING_URL_ID', 'ra_REWRITING_URL_ID')
|
||||
->filterByView($view)
|
||||
->filterByViewLocale($viewLocale)
|
||||
->filterByViewId($viewId)
|
||||
->filterByRedirected(null)
|
||||
->orderByUpdatedAt(Criteria::DESC);
|
||||
|
||||
$otherParametersCount = count($viewOtherParameters);
|
||||
if($otherParametersCount > 0) {
|
||||
$parameterConditions = array();
|
||||
|
||||
foreach($viewOtherParameters as $parameter => $value) {
|
||||
$conditionName = 'other_parameter_condition_' . count($parameterConditions);
|
||||
$urlQuery->condition('parameter_condition', '`ra`.PARAMETER= ?', $parameter, \PDO::PARAM_STR)
|
||||
->condition('value_condition', '`ra`.VALUE = ?', $value, \PDO::PARAM_STR)
|
||||
->combine(array('parameter_condition', 'value_condition'), Criteria::LOGICAL_AND, $conditionName);
|
||||
$parameterConditions[] = $conditionName;
|
||||
}
|
||||
|
||||
$urlQuery->where($parameterConditions, Criteria::LOGICAL_OR);
|
||||
|
||||
$urlQuery->groupBy(RewritingUrlTableMap::ID);
|
||||
|
||||
$urlQuery->condition('count_condition_1', 'COUNT(' . RewritingUrlTableMap::ID . ') = ?', $otherParametersCount, \PDO::PARAM_INT) // ensure we got all the asked parameters (provided by the query)
|
||||
->condition('count_condition_2', 'COUNT(' . RewritingUrlTableMap::ID . ') = (SELECT COUNT(*) FROM rewriting_argument WHERE rewriting_argument.REWRITING_URL_ID = ra_REWRITING_URL_ID)'); // ensure we don't miss any parameters (needed to match the rewritten url)
|
||||
|
||||
$urlQuery->having(array('count_condition_1', 'count_condition_2'), Criteria::LOGICAL_AND);
|
||||
} else {
|
||||
$urlQuery->where('ISNULL(`ra`.REWRITING_URL_ID)');
|
||||
}
|
||||
|
||||
return $urlQuery->findOne();
|
||||
}
|
||||
} // RewritingUrlQuery
|
||||
|
||||
Reference in New Issue
Block a user