first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

39
class/Query/XMLFeed.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
namespace Query;
class XMLFeed
{
public static function categorizedProducts()
{
return function (QueryBuilder $qb) {
return $qb->expr()->isNotNull('ps.id_section');
};
}
public static function productsInFeed()
{
return function (QueryBuilder $qb) {
return $qb->expr()->eq('p.show_in_feed', '1');
};
}
public static function showInStore($in_store_only)
{
return function (QueryBuilder $qb) use ($in_store_only) {
if ($in_store_only && !findModule(\Modules::PRODUCTS_SUPPLIERS)) {
$qb->expr()->gt('COALESCE(pv.in_store, p.in_store)', 0);
}
};
}
public static function limit($count, $offset = null)
{
return function (QueryBuilder $qb) use ($count, $offset) {
if (isset($offset)) {
$qb->setFirstResult($offset);
}
$qb->setMaxResults($count);
};
}
}