| Conditions | 5 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | public function setCategoriesArticle($categories, $id_article) { |
||
| 47 | $dbc = App::getDb(); |
||
| 48 | |||
| 49 | $count = count($categories); |
||
| 50 | if ((is_array($categories)) && ($count > 0)) { |
||
| 51 | for ($i=0 ; $i<$count ; $i++) { |
||
| 52 | if ($this->getTestCategoryExist($categories[$i]) != false) { |
||
|
|
|||
| 53 | $dbc->insert("ID_category", $this->getTestCategoryExist($categories[$i]))->insert("ID_article", $id_article)->into("_blog_article_category")->set(); |
||
| 54 | } |
||
| 55 | } |
||
| 56 | } |
||
| 57 | } |
||
| 58 | //-------------------------- END SETTER ----------------------------------------------------------------------------// |
||
| 59 | } |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.