Event harmonization with MRA

This commit is contained in:
franck
2013-09-04 15:45:46 +02:00
parent ecf6326820
commit 02a1b5c655
30 changed files with 271 additions and 261 deletions

View File

@@ -13,6 +13,8 @@ class Category extends BaseCategory
{
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
use \Thelia\Model\Tools\PositionManagementTrait;
/**
* @return int number of child for the current category
*/
@@ -46,18 +48,6 @@ class Category extends BaseCategory
$this->save();
}
public function getNextPosition($parent) {
$last = CategoryQuery::create()
->filterByParent($parent)
->orderByPosition(Criteria::DESC)
->limit(1)
->findOne()
;
return $last != null ? $last->getPosition() + 1 : 1;
}
/**
*
* count all products for current category and sub categories

View File

@@ -11,6 +11,8 @@ class Currency extends BaseCurrency {
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
use \Thelia\Model\Tools\PositionManagementTrait;
/**
* {@inheritDoc}
*/