Skip to content
Snippets Groups Projects
Commit 9403c188 authored by lbrun's avatar lbrun
Browse files

dev#37281 : fix tests

parent eef42384
5 merge requests!1587Master,!1553Master,!1539Master,!1533Dev#37281 nouvelle sitotheque dans une boite bibliotheque numerique pouvoir choisir d afficher les ressources les plus recentes,!1520Dev#37281 nouvelle sitotheque dans une boite bibliotheque numerique pouvoir choisir d afficher les ressources les plus recentes
...@@ -32,9 +32,8 @@ class Admin_BibnumController extends ZendAfi_Controller_Action { ...@@ -32,9 +32,8 @@ class Admin_BibnumController extends ZendAfi_Controller_Action {
->setAlbums(Class_Album::findAllBy(['cat_id' => 0])); ->setAlbums(Class_Album::findAllBy(['cat_id' => 0]));
$albums = []; $albums = [];
foreach ($categories as $category) { foreach ($categories as $category)
$albums[] = $category->toArray(); $albums[] = $category->getInfosForTree();
}
$bib = Class_Bib::getPortail(); $bib = Class_Bib::getPortail();
......
...@@ -244,22 +244,22 @@ class Class_AlbumCategorie extends Storm_Model_Abstract { ...@@ -244,22 +244,22 @@ class Class_AlbumCategorie extends Storm_Model_Abstract {
} }
public function albumsToArray($albums) { public function getAlbumsInfosForTree($albums) {
$albums_array = []; $albums_array = [];
foreach ($albums as $album) { foreach ($albums as $album) {
$albums_array []= $album->toArray(); $albums_array []= $album->getInfosForTree();
} }
return $albums_array; return $albums_array;
} }
public function toArray() { public function getInfoForTree() {
return return
['id' => $this->getId(), ['id' => $this->getId(),
'label' => htmlspecialchars($this->getLibelle()), 'label' => htmlspecialchars($this->getLibelle()),
'categories' => $this->albumsToArray($this->getSousCategories()), 'categories' => $this->getAlbumsInfosForTree($this->getSousCategories()),
'items' => []]; 'items' => []];
} }
} }
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment