Skip to content
Snippets Groups Projects

Stable

Compare and
+ 10
7
Preferences
Compare changes
@@ -48,22 +48,25 @@ class PanierNoticeLoader extends Storm_Model_Loader {
public function findAllIdsWithCatalogue() {
return array_filter(
array_unique(
array_map(
function($association) {return $association->getIdPanier();},
Class_PanierNoticeCatalogue::findAll())));
$panier_notice_catalogue = Class_PanierNoticeCatalogue::getLoader()->findAll();
$ids_with_catalogue = array_map(function($association) {return $association->getIdPanier();}, $panier_notice_catalogue);
return array_filter(array_unique($ids_with_catalogue));
}
public function findAllWithCatalogue() {
return Class_PanierNotice::findAllBy(['id' => $this->findAllIdsWithCatalogue()]);
$ids = $this->findAllIdsWithCatalogue();
if(empty($ids))
return [];
return Class_PanierNotice::findAllBy(['id' => $ids]);
}
public function indexAll() {
Class_NoticeDomain::deleteBy(['panier_id not' => 0]);
$cart_to_index = Class_PanierNotice::findAllWithCatalogue();
$cart_to_index = Class_PanierNotice::getLoader()->findAllWithCatalogue();
foreach($cart_to_index as $cart) {
$cart->index();
}