@@ 27-42 (lines=16) @@ | ||
24 | ||
25 | $query = $dbc->select()->from("_blog_article")->limit(0, $nb_article)->get(); |
|
26 | ||
27 | if ((is_array($query)) && (count($query) > 0)) { |
|
28 | $articles = []; |
|
29 | ||
30 | foreach ($query as $obj) { |
|
31 | $articles[] = [ |
|
32 | "id_article" => $obj->ID_article, |
|
33 | "title" => $obj->title, |
|
34 | "url" => $obj->url, |
|
35 | "article" => $obj->article, |
|
36 | "publication_date" => $obj->publication_date, |
|
37 | "categories" => Blog::getCategory()->getCategoryArticle($obj->url) |
|
38 | ]; |
|
39 | } |
|
40 | ||
41 | Blog::setValues(["articles" => $articles]); |
|
42 | } |
|
43 | } |
|
44 | ||
45 | /** |
|
@@ 85-100 (lines=16) @@ | ||
82 | ->where("_blog_article_category.ID_category", "=", "_blog_category.ID_category", "", true) |
|
83 | ->get(); |
|
84 | ||
85 | if ((is_array($query)) && (count($query) > 0)) { |
|
86 | $articles = []; |
|
87 | ||
88 | foreach ($query as $obj) { |
|
89 | $articles[] = [ |
|
90 | "id_article" => $obj->ID_article, |
|
91 | "title" => $obj->title, |
|
92 | "url" => $obj->url, |
|
93 | "article" => $obj->article, |
|
94 | "publication_date" => $obj->publication_date, |
|
95 | "categories" => Blog::getCategory()->getCategoryArticle($obj->url) |
|
96 | ]; |
|
97 | } |
|
98 | ||
99 | Blog::setValues(["articles" => $articles]); |
|
100 | } |
|
101 | } |
|
102 | //-------------------------- END GETTER ----------------------------------------------------------------------------// |
|
103 |