CodeExplorer getSupplierListQuery example
$limit =
$request->
getParam('limit', 20
);
$offset =
$request->
getParam('start', 0
);
$query =
trim($request->
getParam('query', ''
));
if ($query !== ''
) { $filter[] =
[ 'property' => 'name',
'value' =>
$query,
];
} $query =
$this->
getRepository()->
getSupplierListQuery($filter,
$sort,
$limit,
$offset);
$total =
$this->
get('models'
)->
getQueryCount($query);
$suppliers =
$query->
getArrayResult();
$mediaService =
Shopware()->
Container()->
get(MediaServiceInterface::
class);
foreach ($suppliers as &
$supplier) { $supplier['description'
] =
strip_tags((string) $supplier['description'
]);
$supplier['image'
] =
$mediaService->
getUrl($supplier['image'
]);
} unset($supplier);