Esempio n. 1
0
 public function getNbPost($id)
 {
     $postManager = new PostManager($this->db);
     $postList = $postManager->findByIdAuthor($id);
     if ($postList) {
         if (is_string($postList)) {
             $errors[] = $postList;
             return $errors;
         } else {
             $postNb = count($postList);
             if ($postNb == NULL) {
                 $postNb = 0;
                 return $postNb;
             } else {
                 return $postNb;
             }
         }
     } else {
         return "Pas de messages postés";
     }
 }