Ejemplo n.º 1
0
 private static function checkCommentaireParent(&$id_commentaire_parent, $id_technote)
 {
     if (!empty($id_commentaire_parent)) {
         $commentaireDAO = new CommentaireDAO(BDD::getInstancePDO());
         if (($res = $commentaireDAO->getOne($id_commentaire_parent)) !== false) {
             if ($res->id_technote == $id_technote) {
                 return true;
             } else {
                 return 'Le commentaire parent n\'appartient pas à la même technote';
             }
         } else {
             return 'Le commentaire parent n\'existe pas ou plus';
         }
     }
     $id_commentaire_parent = NULL;
     return true;
 }