On continue à adapter le template...
This commit is contained in:
52
local/modules/Selection/Model/SelectionContainerQuery.php
Normal file
52
local/modules/Selection/Model/SelectionContainerQuery.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Selection\Model;
|
||||
|
||||
use Selection\Model\Base\SelectionContainerQuery as BaseSelectionContainerQuery;
|
||||
use Thelia\Log\Tlog;
|
||||
use Thelia\Model\Lang;
|
||||
use Thelia\Model\Tools\ModelCriteriaTools;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'selection_container' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class SelectionContainerQuery extends BaseSelectionContainerQuery
|
||||
{
|
||||
/**
|
||||
* @param $lang Lang
|
||||
* @return SelectionContainer[]
|
||||
*/
|
||||
public static function getAll($lang)
|
||||
{
|
||||
try {
|
||||
$containerQuery = SelectionContainerQuery::create();
|
||||
/* manage translations */
|
||||
ModelCriteriaTools::getI18n(
|
||||
false,
|
||||
$lang->getId(),
|
||||
$containerQuery,
|
||||
$lang->getLocale(),
|
||||
array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM', 'META_TITLE', 'META_DESCRIPTION', 'META_KEYWORDS'),
|
||||
null,
|
||||
'ID',
|
||||
false
|
||||
);
|
||||
$containers = $containerQuery->find();
|
||||
if (empty($containers)) {
|
||||
return [];
|
||||
}
|
||||
return $containers;
|
||||
} catch (\Exception $e) {
|
||||
Tlog::getInstance()->error($e->getMessage());
|
||||
}
|
||||
return [];
|
||||
}
|
||||
} // SelectionContainerQuery
|
||||
Reference in New Issue
Block a user