Interface DAO
Código:
Implementacion del DAO<?php
interface NoticeDAO {
public function showAllNotice();
}
Código:
EL uso<?php
require_once "./sql/DBConnection.php";
require_once "./dao/NoticeDAO.php";
require_once "./dto/Notice.php";
class NoticeDAOImplement extends DBConnection implements NoticeDAO {
public function showAllNotice() {
# se realiza la consulta a la base de datos
$mysqli = $this->connect();
$result = $mysqli->query("SELECT * FROM notice");
$notice = new Notice();
while ($row = $result->fetch_assoc()) {
echo $notice->setNoticeId($row['notice_id']);
$notice->setNoticeId($row['notice_title']);
$notice->setNoticeId($row['notice_datetime']);
$notice->setNoticeId($row['notice_content']);
}
return $notice;
}
}
Código:
La pregunta es porque no me esta devolviendo ningún valor <?php include_once './impl/NoticeDAOImplement.php'; $noticeDao = new NoticeDAOImplement(); $notice = $noticeDao->showAllNotice(); echo "<br><br>=========>".$notice->getNoticeTitle(); ?>




