From 3204b0f2f47dc38d2e2f15edaa7259ce47aefca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ANDRE=20s=C3=A9bastien?= <sandre@afi-sa.fr> Date: Fri, 19 Aug 2022 09:12:26 +0200 Subject: [PATCH] explo new storm with more volatile --- .../classes/NanookRecordsIntegrationTest.php | 5 +- .../classes/NoticeIntegrationSubjectTest.php | 2 +- .../php/classes/NoticeIntegrationTest.php | 6 +- .../php/classes/RepairCodifAuthorTest.php | 188 +++++++++--------- library/Class/Catalogue/Loader.php | 4 +- library/Class/CodifAuteur.php | 13 +- library/Class/CodifThesaurus/Loader.php | 19 +- library/Class/Exemplaire/Shelf.php | 31 ++- library/Class/FileManager/Model.php | 7 +- library/Class/Matiere.php | 4 +- library/Class/Notice/Loader.php | 4 +- .../DynamicFacet/Domain.php | 4 +- .../DynamicFacet/Unimarc.php | 4 +- library/storm | 2 +- .../Intonation/Library/Widget/Search/View.php | 10 +- 15 files changed, 157 insertions(+), 146 deletions(-) diff --git a/cosmogramme/tests/php/classes/NanookRecordsIntegrationTest.php b/cosmogramme/tests/php/classes/NanookRecordsIntegrationTest.php index 3a820fed977..59fd4b04dce 100644 --- a/cosmogramme/tests/php/classes/NanookRecordsIntegrationTest.php +++ b/cosmogramme/tests/php/classes/NanookRecordsIntegrationTest.php @@ -439,7 +439,8 @@ class NanookRecordsIntegrationOblivionTest extends NanookRecordsIntegrationTestC /** @test */ public function facettesShouldContainsF2andF24() { - $this->assertEquals('T4 A1 F24 F25 Lfre G96', $this->_notice->getFacettes()); + $this->assertEquals('T4 A1 A2 A3 F24 F25 Lfre G96', + $this->_notice->getFacettes()); } } @@ -803,7 +804,7 @@ class NanookRecordsIntegrationModifLabelOnDynamicFacetTest extends NanookRecords /** @test */ public function firstRecordFacetsShouldContainsHNIVE0001() { - $this->assertEquals('T3 HNIVE0001 A1', Class_Notice::find(1)->getFacettes()); + $this->assertEquals('T3 HNIVE0001 A1 A2', Class_Notice::find(1)->getFacettes()); } diff --git a/cosmogramme/tests/php/classes/NoticeIntegrationSubjectTest.php b/cosmogramme/tests/php/classes/NoticeIntegrationSubjectTest.php index 4dcf875cf8c..b2a14bb17c6 100644 --- a/cosmogramme/tests/php/classes/NoticeIntegrationSubjectTest.php +++ b/cosmogramme/tests/php/classes/NoticeIntegrationSubjectTest.php @@ -56,7 +56,7 @@ class NoticeIntegrationSubjectTest extends NoticeIntegrationTestCase { /** @test */ public function noticeFacettesShouldContainsFacetsSubjectM1M2M3M4M5() { - $this->assertContains('T1 D94438 A1 M1 M2 M3 M4 M5 Lfre', + $this->assertContains('T1 D94438 A1 A2 M1 M2 M3 M4 M5 Lfre', Class_Notice::find(1)->getFacettes()); } diff --git a/cosmogramme/tests/php/classes/NoticeIntegrationTest.php b/cosmogramme/tests/php/classes/NoticeIntegrationTest.php index 710a18b3190..6889c8373c9 100644 --- a/cosmogramme/tests/php/classes/NoticeIntegrationTest.php +++ b/cosmogramme/tests/php/classes/NoticeIntegrationTest.php @@ -1274,14 +1274,14 @@ class NoticeIntegrationArchivesAlsaceTest extends NoticeIntegrationTestCase { /** @test */ public function facettesShouldContainsM1AndM2AndD1() { - $this->assertEquals('T1 D94438 A1 M1 M2 Lfre', + $this->assertEquals('T1 D94438 A1 A2 M1 M2 Lfre', Class_Notice::find(1)->getFacettes()); } /** @test */ public function facettesWithExemplairesShouldContainsM1AndM2AndD1() { - $this->assertEquals('D94438 A1 M1 M2 Lfre T1 B1 YBibliothèque des Dominicains HNRNR0001', + $this->assertEquals('D94438 A1 A2 M1 M2 Lfre T1 B1 YBibliothèque des Dominicains HNRNR0001', Class_Notice::find(1)->updateFacetsFromExemplaires()->getFacettes()); } } @@ -1550,4 +1550,4 @@ class NoticeIntegrationItemsUpdateDateTest extends NoticeIntegrationTestCase { public function itemsShouldHaveShelfKeyUpdateDateSetTo20220620() { $this->assertEquals(8, Class_Exemplaire::countBy(['shelf_key_update_date' => '2022-06-20 16:53:17'])); } -} \ No newline at end of file +} diff --git a/cosmogramme/tests/php/classes/RepairCodifAuthorTest.php b/cosmogramme/tests/php/classes/RepairCodifAuthorTest.php index b12d81f211c..f318abf5611 100644 --- a/cosmogramme/tests/php/classes/RepairCodifAuthorTest.php +++ b/cosmogramme/tests/php/classes/RepairCodifAuthorTest.php @@ -21,140 +21,138 @@ require_once 'ModelTestCase.php'; - - abstract class RepairCodifAuthorTestCase extends ModelTestCase { - protected $_guitton_pierre, - $_lebas_patrick, - $_x, - $_book, - $count; - - public function setUp() { - parent::setUp(); - $this->_x = $this->fixture('Class_CodifAuteur', - ['id' => 3, - 'libelle' => 'x', - 'formes' => 'x']); - - $this->_lebas_patrick = $this->fixture('Class_CodifAuteur', - ['id' => 2, - 'Libelle' => 'Patrickx', - 'formes' => 'PATRICKX']); - - $this->_guitton_pierre = $this->fixture('Class_CodifAuteur', - ['id' => 1, - 'libelle' => 'GUITTONxxPIERRE', - 'formes' => 'GUITTONxxPIERRE']); - - $this->_book = $this->fixture('Class_Notice', - ['id_notice' => 1, - 'unimarc' => "01410cam0 22002651i 450 001000700000005004100007010003200048102000400080200019400084205001600278210003800294215004400332300004000376330036700416607005700783702002800840702003000868702003200898702002400930702002600954702002700980702002501007702002301032996008901055411463131022s2014 FR bgr|||| 0|| 0|fre|d01a978-2-7424-3490-9 (Broché)0101aBourgogne /fIsabelle Bonnevie, Jean-Louis Despesse, Pierre Guitton, Patrick Lebas ; ont également collaboré à cet ouvrage Serge Lewuillon, Caroline Musquet, Fanny Philippe, Daniel Russo01a2e édition01aParis :cGallimard loisirs,d201401a1 vol. (559 p.) :ccartes ;d19 x 12 cm01aBibliogr. Filmogr. Glossaire. Index01aCe guide propose des itinéraires à la carte pour découvrir la région, des sélections thématiques, plus de 2.000 sites et adresses pour voyager au gré de ses envies à Dijon, Vézelay, Cluny, Guédelon, sur le canal de Bourgogne, etc. Il est agrémenté d'un chapitre consacré aux vins et vignobles de Bourgogne. Contient un dossier spécial sur les vins.01aBourgogne (France)xGuides touristiques et de visite01aBonnevie, Isabelle4aut01aDespesse, Jean-Louis4aut01aGuitton, Pierred1955-4aut01aLebas, Patrick4aut01aLewuillon, Serge4con01aMusquet, Caroline4con01aPhilippe, Fanny4con01aRusso, Daniel4con01a914.44 BOUwDEWEYc1i00695969l09ADOCmLBpE14.90rYsYt1IMPu19/3/2014xLDOCzADU"]); - } + + protected + $_guitton_pierre, + $_lebas_patrick, + $_x, + $_book, + $count; + + public function setUp() { + parent::setUp(); + + $this->_x = $this->fixture(Class_CodifAuteur::class, + ['id' => 3, + 'libelle' => 'x', + 'formes' => 'x']); + + $this->_lebas_patrick = $this->fixture(Class_CodifAuteur::class, + ['id' => 2, + 'Libelle' => 'Patrickx', + 'formes' => 'PATRICKX']); + + $this->_guitton_pierre = $this->fixture(Class_CodifAuteur::class, + ['id' => 1, + 'libelle' => 'GUITTONxxPIERRE', + 'formes' => 'GUITTONxxPIERRE']); + + $this->_book = $this->fixture(Class_Notice::class, + ['id_notice' => 1, + 'unimarc' => "01410cam0 22002651i 450 001000700000005004100007010003200048102000400080200019400084205001600278210003800294215004400332300004000376330036700416607005700783702002800840702003000868702003200898702002400930702002600954702002700980702002501007702002301032996008901055411463131022s2014 FR bgr|||| 0|| 0|fre|d01a978-2-7424-3490-9 (Broché)0101aBourgogne /fIsabelle Bonnevie, Jean-Louis Despesse, Pierre Guitton, Patrick Lebas ; ont également collaboré à cet ouvrage Serge Lewuillon, Caroline Musquet, Fanny Philippe, Daniel Russo01a2e édition01aParis :cGallimard loisirs,d201401a1 vol. (559 p.) :ccartes ;d19 x 12 cm01aBibliogr. Filmogr. Glossaire. Index01aCe guide propose des itinéraires à la carte pour découvrir la région, des sélections thématiques, plus de 2.000 sites et adresses pour voyager au gré de ses envies à Dijon, Vézelay, Cluny, Guédelon, sur le canal de Bourgogne, etc. Il est agrémenté d'un chapitre consacré aux vins et vignobles de Bourgogne. Contient un dossier spécial sur les vins.01aBourgogne (France)xGuides touristiques et de visite01aBonnevie, Isabelle4aut01aDespesse, Jean-Louis4aut01aGuitton, Pierred1955-4aut01aLebas, Patrick4aut01aLewuillon, Serge4con01aMusquet, Caroline4con01aPhilippe, Fanny4con01aRusso, Daniel4con01a914.44 BOUwDEWEYc1i00695969l09ADOCmLBpE14.90rYsYt1IMPu19/3/2014xLDOCzADU"]); + } } class RepairCodifAuthorUpdateTest extends RepairCodifAuthorTestCase { - public function setUp() { - parent::setUp(); - - - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_CodifAuteur') - ->whenCalled('findAllBy') - ->willDo( - function() { - $this->count++; - return $this->count > 1 ? [] : [$this->_guitton_pierre];}); - + public function setUp() { + parent::setUp(); + Storm_Test_ObjectWrapper::onLoaderOfModel(Class_CodifAuteur::class) + ->whenCalled('findAllBy') + ->willDo( + function() { + $this->count++; + return $this->count > 1 ? [] : [$this->_guitton_pierre];}); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Notice') - ->whenCalled('findFirstBy') - ->answers($this->_book); + $this->_book->setFacettes('A1')->assertSave(); - Class_CodifAuteur::repairAllWithWrongLibelle(); - } + Class_CodifAuteur::repairAllWithWrongLibelle(); + } - /** @test */ - public function libelleShouldBeRepaired() { - $this->assertEquals('Guitton, Pierre', Class_CodifAuteur::find(1)->getlibelle()); - } + /** @test */ + public function libelleShouldBeRepaired() { + $this->assertEquals('Guitton, Pierre', Class_CodifAuteur::find(1)->getlibelle()); + } } + class RepairCodifAuthorDeleteTest extends RepairCodifAuthorTestCase { - public function setUp() { - parent::setUp(); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_CodifAuteur') - ->whenCalled('findAllBy') - ->willDo( - function() { - $this->count++; - return $this->count > 1 ? [] : [$this->_guitton_pierre];}); + public function setUp() { + parent::setUp(); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Notice') - ->whenCalled('findFirstBy') - ->answers([]); + Storm_Test_ObjectWrapper::onLoaderOfModel(Class_CodifAuteur::class) + ->whenCalled('findAllBy') + ->willDo( + function() { + $this->count++; + return $this->count > 1 ? [] : [$this->_guitton_pierre];}); - Class_CodifAuteur::repairAllWithWrongLibelle(); - } + Class_CodifAuteur::repairAllWithWrongLibelle(); + } - /** @test */ - public function libelleShouldBeRepaired() { - $this->assertEquals(null, Class_CodifAuteur::find(1)); - } + /** @test */ + public function libelleShouldBeRepaired() { + $this->assertEquals(null, Class_CodifAuteur::find(1)); + } } + class RepairCodifAuthorNoUpdateTest extends RepairCodifAuthorTestCase { - public function setUp() { - parent::setUp(); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_CodifAuteur') - ->whenCalled('findAllBy') - ->willDo( - function() { - $this->count++; - return $this->count > 1 ? [] : [$this->_lebas_patrick];}); + public function setUp() { + parent::setUp(); + + Storm_Test_ObjectWrapper::onLoaderOfModel(Class_CodifAuteur::class) + ->whenCalled('findAllBy') + ->willDo(function() { + $this->count++; + return $this->count > 1 ? [] : [$this->_lebas_patrick];}); - Class_CodifAuteur::repairAllWithWrongLibelle(); - } + $this->_book->setFacettes('A2')->assertSave(); + Class_CodifAuteur::repairAllWithWrongLibelle(); + } - /** @test */ - public function libelleShouldBeRepaired() { - $this->assertEquals('Patrickx', Class_CodifAuteur::find(2)->getLibelle()); - } + + /** @test */ + public function libelleShouldBeRepaired() { + $this->assertEquals('Patrickx', Class_CodifAuteur::find(2)->getLibelle()); + } } + class RepairCodifAuthorRemoveXTest extends RepairCodifAuthorTestCase { - public function setUp() { - parent::setUp(); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_CodifAuteur') - ->whenCalled('findAllBy') - ->willDo( - function() { - $this->count++; - return $this->count > 1 ? [] : [$this->_x];}); + public function setUp() { + parent::setUp(); + + Storm_Test_ObjectWrapper::onLoaderOfModel(Class_CodifAuteur::class) + ->whenCalled('findAllBy') + ->willDo( + function() { + $this->count++; + return $this->count > 1 ? [] : [$this->_x];}); - Class_CodifAuteur::repairAllWithWrongLibelle(); - } + Class_CodifAuteur::repairAllWithWrongLibelle(); + } - /** @test */ - public function libelleShouldBeRepaired() { - $this->assertEquals(null, Class_CodifAuteur::find(3)); - } + /** @test */ + public function libelleShouldBeRepaired() { + $this->assertEquals(null, Class_CodifAuteur::find(3)); + } } -?> \ No newline at end of file diff --git a/library/Class/Catalogue/Loader.php b/library/Class/Catalogue/Loader.php index aa947e2171a..5ef6112c0cd 100644 --- a/library/Class/Catalogue/Loader.php +++ b/library/Class/Catalogue/Loader.php @@ -102,7 +102,7 @@ class Class_Catalogue_Loader extends Storm_Model_Loader { Class_CodifThesaurus::deleteAllWithIdOrigineAndCode($catalogue->getId(), Class_CodifThesaurus::fixedCodeOf('Domain')); $new_thesaurus = $catalogue->getNewThesaurus(); - $new_thesaurus_id = Class_CodifThesaurus::findNextThesaurusChildId('catalogue', + $new_thesaurus_id = Class_CodifThesaurus::findNextThesaurusChildId('Catalogue', $thesaurus_id); $new_thesaurus->setIdThesaurus($new_thesaurus_id); $new_thesaurus->save(); @@ -621,7 +621,7 @@ class Class_Catalogue_Loader extends Storm_Model_Loader { if (!$thesaurus_parent) return null; $new_thesaurus_id=Class_CodifThesaurus::findNextThesaurusChildId( - 'catalogue', + 'Catalogue', $thesaurus_parent->getIdThesaurus()); } else if (strlen($thesaurus->getIdThesaurus())>8) { diff --git a/library/Class/CodifAuteur.php b/library/Class/CodifAuteur.php index 4816039f584..4988f9396af 100644 --- a/library/Class/CodifAuteur.php +++ b/library/Class/CodifAuteur.php @@ -81,8 +81,9 @@ class CodifAuteurLoader extends Storm_Model_Loader { if (isset($this->_by_alpha_cache[$code_alpha])) return $this->_by_alpha_cache[$code_alpha]; - return $this->_by_alpha_cache[$code_alpha] = - Class_CodifAuteur::findFirstBy(['where' => "MATCH(formes) AGAINST('" . $code_alpha . "' IN BOOLEAN MODE)"]); + return $this->_by_alpha_cache[$code_alpha] = Storm_Query::from($this) + ->match('formes', Storm_Query::terms($code_alpha)) + ->fetchFirst(); } @@ -101,14 +102,16 @@ class CodifAuteurLoader extends Storm_Model_Loader { protected function repairAuthor($author) { - if(($author->getLibelle() === 'x') && ($author->getFormes() === 'x')){ + if (($author->getLibelle() === 'x') && ($author->getFormes() === 'x')){ $author->delete(); return; } - $notice = Class_Notice::findFirstBy(['where' => 'MATCH(facettes) AGAINST(\'A'.$author->getId().'\' IN BOOLEAN MODE)']); + $notice = Storm_Query::from(Class_Notice::getLoader()) + ->match('facettes', Storm_Query::terms('A' . $author->getId())) + ->fetchFirst(); - if(!$notice) { + if (!$notice) { $author->delete(); return; } diff --git a/library/Class/CodifThesaurus/Loader.php b/library/Class/CodifThesaurus/Loader.php index ded53c1985a..47190d85a3d 100644 --- a/library/Class/CodifThesaurus/Loader.php +++ b/library/Class/CodifThesaurus/Loader.php @@ -243,9 +243,12 @@ class Class_CodifThesaurus_Loader extends Storm_Model_Loader { /** @return string */ public function findNextThesaurusChildId($code, $parentid_thesaurus) { Class_CodifThesaurus::clearCache(); - $last_thesaurus = Class_CodifThesaurus::findFirstBy(['code' => $code, - Class_CodifThesaurus::clauseStart('id_thesaurus', $parentid_thesaurus), - 'order' => 'id_thesaurus desc']); + $last_thesaurus = Storm_Query::from($this) + ->eq('code', $code) + ->start('id_thesaurus', $parentid_thesaurus) + ->order_desc('id_thesaurus') + ->fetchFirst(); + if (!$last_thesaurus) return $parentid_thesaurus.'0001'; @@ -285,8 +288,7 @@ class Class_CodifThesaurus_Loader extends Storm_Model_Loader { public function deleteAllFrom($thesaurus) { if ($thesaurus && '' != $thesaurus->getIdThesaurus()) - $this->basicDeleteBy([Class_CodifThesaurus::clauseStart('id_thesaurus', - $thesaurus->getIdThesaurus())]); + $this->basicDeleteBy(['id_thesaurus like' => $thesaurus->getIdThesaurus() . '%']); } @@ -413,9 +415,10 @@ class Class_CodifThesaurus_Loader extends Storm_Model_Loader { public function findDomainFacets() : array { - return Class_CodifThesaurus::findAllBy(['code' => Class_CodifThesaurusFixed::CODE_DOMAIN_FACET, - Class_CodifThesaurus::clauseGreater('rules', - '')]); + return Storm_Query::from(Class_CodifThesaurus::getLoader()) + ->eq('code', Class_CodifThesaurusFixed::CODE_DOMAIN_FACET) + ->gt('rules', '') + ->fetchAll(); } diff --git a/library/Class/Exemplaire/Shelf.php b/library/Class/Exemplaire/Shelf.php index 80811344e68..7bae9c7aaa9 100644 --- a/library/Class/Exemplaire/Shelf.php +++ b/library/Class/Exemplaire/Shelf.php @@ -42,28 +42,27 @@ class Class_Exemplaire_Shelf { protected function _findBeforeItems() : array { - return array_reverse($this->_findItems(Class_Exemplaire::clauseLesser('shelf_key', - $this->_item->getShelfKey()), - 'shelf_key desc')); + return array_reverse($this + ->_findItems(Storm_Query::lt('shelf_key', + $this->_item->getShelfKey()) + ->order_desc('shelf_key'))); } protected function _findAfterItems() : array { - return $this->_findItems(Class_Exemplaire::clauseGreater('shelf_key', - $this->_item->getShelfKey()), - 'shelf_key'); + return $this->_findItems(Storm_Query::gt('shelf_key', $this->_item->getShelfKey()) + ->order('shelf_key')); } - protected function _findItems(Storm_Model_PersistenceStrategy_Clause $clause, - string $order) : array { - return Class_Exemplaire::findAllBy([$clause, - 'order' => $order, - 'id_bib' => $this->_item->getIdBib(), - 'section' => $this->_item->getSection(), - 'emplacement' => $this->_item->getEmplacement(), - 'id_notice not' => $this->_item->getIdNotice(), - 'limit' => 12, - 'group_by' => 'id_notice']); + protected function _findItems(Storm_Query $query) : array { + return $query->from(Class_Exemplaire::getLoader()) + ->eq('id_bib', $this->_item->getIdBib()) + ->eq('section', $this->_item->getSection()) + ->eq('emplacement', $this->_item->getEmplacement()) + ->eq_not('id_notice', $this->_item->getIdNotice()) + ->limit(12) + ->group('id_notice') + ->fetchAll(); } } diff --git a/library/Class/FileManager/Model.php b/library/Class/FileManager/Model.php index 80d4e2c646b..873422f5b16 100644 --- a/library/Class/FileManager/Model.php +++ b/library/Class/FileManager/Model.php @@ -189,8 +189,9 @@ class Class_FileManager_ModelRelationWidget { public function findAll(string $path) : array { $widgets = []; - foreach(Class_Profil::findAllBy([Class_Profil::clauseNotEqual('template', 'null'), - Class_Profil::clauseNotEqual('template', '')]) as $profile) + foreach (Storm_Query::from(Class_Profil::getLoader()) + ->is_not('template') + ->fetchAll() as $profile) $widgets = $this->_getWidgetsWithImage($path, $profile, $widgets); return $widgets; @@ -249,4 +250,4 @@ class Class_FileManager_ModelRelationWidget { }, $this->findAll($path)); } -} \ No newline at end of file +} diff --git a/library/Class/Matiere.php b/library/Class/Matiere.php index ac7ba123327..6aee42de789 100644 --- a/library/Class/Matiere.php +++ b/library/Class/Matiere.php @@ -38,7 +38,9 @@ class Class_Matiere extends Storm_Model_Abstract { public function getSousVedettes() { $vedette = $this->getLibelle(); - $children = $this->getLoader()->findAllBy([Storm_Model_PersistenceStrategy_Clause::clauseStart('libelle', $vedette . ' : ')]); + $children = Storm_Query::from($this->getLoader()) + ->start('libelle', $vedette . ' : ') + ->fetchAll(); if (0 == count($children)) return ''; diff --git a/library/Class/Notice/Loader.php b/library/Class/Notice/Loader.php index 84831c8a39e..b980201bbcf 100644 --- a/library/Class/Notice/Loader.php +++ b/library/Class/Notice/Loader.php @@ -220,6 +220,8 @@ class Class_Notice_Loader extends Storm_Model_Loader { public function findAllByClefAlphaStartingWith(string $value) : array { - return Class_Notice::findAllBy([Class_Notice::clauseStart('clef_alpha', $value)]); + return Storm_Query::from($this) + ->start('clef_alpha', $value) + ->fetchAll(); } } diff --git a/library/ZendAfi/Controller/Plugin/ResourceDefinition/DynamicFacet/Domain.php b/library/ZendAfi/Controller/Plugin/ResourceDefinition/DynamicFacet/Domain.php index 16750cd6ebc..df590613fc2 100644 --- a/library/ZendAfi/Controller/Plugin/ResourceDefinition/DynamicFacet/Domain.php +++ b/library/ZendAfi/Controller/Plugin/ResourceDefinition/DynamicFacet/Domain.php @@ -25,8 +25,8 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_DynamicFacet_Domain public function getDefinitions() { $definitions = parent::getDefinitions(); - $definitions['model']['filter'] = [Class_CodifThesaurus::clauseGreater('rules', ''), - Class_CodifThesaurus::clauseEqual('code', Class_CodifThesaurusFixed::CODE_DOMAIN_FACET)]; + $definitions['model']['filter'] = [Class_CodifThesaurus::greater('rules', ''), + 'code' => Class_CodifThesaurusFixed::CODE_DOMAIN_FACET]; $definitions['actions']['index']['title'] = $this->_('Facettes dynamiques sur domaines'); $definitions['actions']['edit']['title'] = $this->_('Modifier la facette sur domaines : %s'); $definitions['actions']['add']['title'] = $this->_('Ajouter une facette dynamique pour des domaines'); diff --git a/library/ZendAfi/Controller/Plugin/ResourceDefinition/DynamicFacet/Unimarc.php b/library/ZendAfi/Controller/Plugin/ResourceDefinition/DynamicFacet/Unimarc.php index 2535826d2d9..6adf14360bc 100644 --- a/library/ZendAfi/Controller/Plugin/ResourceDefinition/DynamicFacet/Unimarc.php +++ b/library/ZendAfi/Controller/Plugin/ResourceDefinition/DynamicFacet/Unimarc.php @@ -27,8 +27,8 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_DynamicFacet_Unimarc return ['model' => ['class' => Class_CodifThesaurus::class, 'name' => 'thesauri', - 'filter' => [Class_CodifThesaurus::clauseGreater('rules', ''), - Class_CodifThesaurus::clauseEqual('code', Class_CodifThesaurusFixed::CODE_UNIMARC_FACET)], + 'filter' => [Class_CodifThesaurus::greater('rules', ''), + 'code' => Class_CodifThesaurusFixed::CODE_UNIMARC_FACET], 'order' => 'libelle'], 'messages' => ['successful_save' => $this->_('Facette dynamique "%s" sauvegardée'), diff --git a/library/storm b/library/storm index 55dd4c19b54..8f1ab0b2702 160000 --- a/library/storm +++ b/library/storm @@ -1 +1 @@ -Subproject commit 55dd4c19b54eead3f8a06871cbca07d582973427 +Subproject commit 8f1ab0b2702bd2785d48b28f70932a22f31f54cb diff --git a/library/templates/Intonation/Library/Widget/Search/View.php b/library/templates/Intonation/Library/Widget/Search/View.php index 76219df02d7..a59cca6a36d 100644 --- a/library/templates/Intonation/Library/Widget/Search/View.php +++ b/library/templates/Intonation/Library/Widget/Search/View.php @@ -348,10 +348,12 @@ abstract class IntonationSearchRenderAbstract { protected function _createDomainSelectorByFacetCode(ZendAfi_Form $form, string $facet_code) : ?Zend_Form_Element { $facet_thesaurus_id = substr($facet_code, 1); - if ((!$facets = Class_CodifThesaurus::findAllBy([Class_CodifThesaurus::clauseStart('id_thesaurus', $facet_thesaurus_id), - Class_CodifThesaurus::clauseNotIs('id_origine'), - 'code' => Class_CodifThesaurusFixed::CODE_DOMAIN_FACET, - 'order' => 'libelle_facette']))) + if ((!$facets = Storm_Query::from(Class_CodifThesaurus::getLoader()) + ->start('id_thesaurus', $facet_thesaurus_id) + ->is_not('id_origine') + ->eq('code', Class_CodifThesaurusFixed::CODE_DOMAIN_FACET) + ->order('libelle_facette') + ->fetchAll())) return null; $parent_facet = Class_CodifThesaurus::findFirstBy(['id_thesaurus' => $facet_thesaurus_id]); -- GitLab