function getLatestDocuments() { $result = $this->selectLatestStmt->execute(); if (!$result) { throw new \Exception("Ошибка базы данных. Запрос на выборку последних документов не прошел"); } $collection = parent::getCollection($this->selectLatestStmt); return $collection; }
function __construct(\PDO $pdo) { parent::__construct($pdo); $this->select = $this->pdo->prepare("SELECT *, DATE_FORMAT(`date`, '%d.%m.%Y в %H:%i') AS date FROM documents WHERE committee = ?"); }