Merge branch 'master' of github.com:thelia/thelia into cleanmaster
This commit is contained in:
@@ -107,7 +107,7 @@ final class TheliaEvents
|
||||
/**
|
||||
* sent just before customer removal
|
||||
*/
|
||||
const BEFORE_DELETECUSTOMER = "action.before_updateCustomer";
|
||||
const BEFORE_DELETECUSTOMER = "action.before_deleteCustomer";
|
||||
|
||||
/**
|
||||
* sent just after customer removal
|
||||
@@ -121,7 +121,7 @@ final class TheliaEvents
|
||||
const ADDRESS_CREATE = "action.createAddress";
|
||||
|
||||
/**
|
||||
* sent for address creation
|
||||
* sent for address modification
|
||||
*/
|
||||
const ADDRESS_UPDATE = "action.updateAddress";
|
||||
|
||||
@@ -135,7 +135,14 @@ final class TheliaEvents
|
||||
*/
|
||||
const ADDRESS_DEFAULT = "action.defaultAddress";
|
||||
|
||||
/**
|
||||
* sent once the address creation form has been successfully validated, and before address insertion in the database.
|
||||
*/
|
||||
const BEFORE_CREATEADDRESS = "action.before_createAddress";
|
||||
|
||||
/**
|
||||
* Sent just after a successful insert of a new address in the database.
|
||||
*/
|
||||
const AFTER_CREATEADDRESS = "action.after_createAddress";
|
||||
|
||||
const BEFORE_UPDATEADDRESS = "action.before_updateAddress";
|
||||
|
||||
@@ -115,12 +115,7 @@ class Category extends BaseCategory
|
||||
*/
|
||||
public function postDelete(ConnectionInterface $con = null)
|
||||
{
|
||||
RewritingUrlQuery::create()
|
||||
->filterByView($this->getRewrittenUrlViewName())
|
||||
->filterByViewId($this->getId())
|
||||
->update(array(
|
||||
"View" => ConfigQuery::getObsoleteRewrittenUrlView()
|
||||
));
|
||||
$this->markRewritenUrlObsolete();
|
||||
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_DELETECATEGORY, new CategoryEvent($this));
|
||||
}
|
||||
|
||||
@@ -148,12 +148,7 @@ class Content extends BaseContent
|
||||
|
||||
public function postDelete(ConnectionInterface $con = null)
|
||||
{
|
||||
RewritingUrlQuery::create()
|
||||
->filterByView($this->getRewrittenUrlViewName())
|
||||
->filterByViewId($this->getId())
|
||||
->update(array(
|
||||
"View" => ConfigQuery::getObsoleteRewrittenUrlView()
|
||||
));
|
||||
$this->markRewritenUrlObsolete();
|
||||
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_DELETECONTENT, new ContentEvent($this));
|
||||
}
|
||||
|
||||
@@ -100,12 +100,7 @@ class Folder extends BaseFolder
|
||||
|
||||
public function postDelete(ConnectionInterface $con = null)
|
||||
{
|
||||
RewritingUrlQuery::create()
|
||||
->filterByView($this->getRewrittenUrlViewName())
|
||||
->filterByViewId($this->getId())
|
||||
->update(array(
|
||||
"View" => ConfigQuery::getObsoleteRewrittenUrlView()
|
||||
));
|
||||
$this->markRewritenUrlObsolete();
|
||||
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_DELETEFOLDER, new FolderEvent($this));
|
||||
}
|
||||
|
||||
@@ -263,12 +263,7 @@ class Product extends BaseProduct
|
||||
*/
|
||||
public function postDelete(ConnectionInterface $con = null)
|
||||
{
|
||||
RewritingUrlQuery::create()
|
||||
->filterByView($this->getRewrittenUrlViewName())
|
||||
->filterByViewId($this->getId())
|
||||
->update(array(
|
||||
"View" => ConfigQuery::getObsoleteRewrittenUrlView()
|
||||
));
|
||||
$this->markRewritenUrlObsolete();
|
||||
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_DELETEPRODUCT, new ProductEvent($this));
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ use Thelia\Model\RewritingUrlQuery;
|
||||
use Thelia\Model\RewritingUrl;
|
||||
use Thelia\Rewriting\RewritingResolver;
|
||||
use Thelia\Tools\URL;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
/**
|
||||
* A trait for managing Rewritten URLs from model classes
|
||||
*/
|
||||
@@ -138,6 +139,18 @@ trait UrlRewritingTrait {
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark the current URL as obseolete
|
||||
*/
|
||||
public function markRewritenUrlObsolete() {
|
||||
RewritingUrlQuery::create()
|
||||
->filterByView($this->getRewrittenUrlViewName())
|
||||
->filterByViewId($this->getId())
|
||||
->update(array(
|
||||
"View" => ConfigQuery::getObsoleteRewrittenUrlView()
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the rewritten URL for the given locale
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user