29 lines
615 B
PHP
Executable File
29 lines
615 B
PHP
Executable File
<?php
|
|
|
|
namespace Thelia\Model;
|
|
|
|
use Thelia\Model\Base\FolderImage as BaseFolderImage;
|
|
use Propel\Runtime\Connection\ConnectionInterface;
|
|
|
|
class FolderImage extends BaseFolderImage
|
|
{
|
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
|
|
|
/**
|
|
* Calculate next position relative to our parent
|
|
*/
|
|
protected function addCriteriaToPositionQuery($query) {
|
|
$query->filterByFolder($this->getFolder());
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public function preInsert(ConnectionInterface $con = null)
|
|
{
|
|
$this->setPosition($this->getNextPosition());
|
|
|
|
return true;
|
|
}
|
|
}
|