Finished product multiple categories attachment

This commit is contained in:
franck
2013-09-22 22:14:39 +02:00
parent 72a2cdfd75
commit 22f3f49f79
37 changed files with 1049 additions and 498 deletions

View File

@@ -142,9 +142,7 @@ class Template extends BaseAction implements EventSubscriberInterface
*/
public function updateAttributePosition(UpdatePositionEvent $event)
{
$attributeTemplate = AttributeTemplateQuery::create()->findPk($event->getObjectId());
$this->updatePosition($attributeTemplate, $event);
return $this->genericUpdatePosition(AttributeTemplateQuery::create(), $event);
}
/**
@@ -154,26 +152,7 @@ class Template extends BaseAction implements EventSubscriberInterface
*/
public function updateFeaturePosition(UpdatePositionEvent $event)
{
$featureTemplate = FeatureTemplateQuery::create()->findPk($event->getObjectId());
$this->updatePosition($featureTemplate, $event);
}
protected function updatePosition($object, UpdatePositionEvent $event)
{
if (null !== $object) {
$object->setDispatcher($this->getDispatcher());
$mode = $event->getMode();
if ($mode == UpdatePositionEvent::POSITION_ABSOLUTE)
$object->changeAbsolutePosition($event->getPosition());
else if ($mode == UpdatePositionEvent::POSITION_UP)
$object->movePositionUp();
else if ($mode == UpdatePositionEvent::POSITION_DOWN)
$object->movePositionDown();
}
return $this->genericUpdatePosition(FeatureTemplateQuery::create(), $event);
}
public function deleteAttribute(TemplateDeleteAttributeEvent $event) {