Merge branch 'master' of github.com:thelia/thelia into cleanmaster

This commit is contained in:
Etienne Roudeix
2013-12-09 10:29:49 +01:00
9 changed files with 737 additions and 376 deletions

View File

@@ -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
*