/** * @param Analyse $analysis * @return ArrayObject */ public function getCommentsOfAnAnalysis(Analyse $analysis) { $statement = "SELECT comment.*, users.name AS nameUser FROM comment \r\n LEFT OUTER JOIN users ON comment.username = users.username\r\n WHERE analysis_id = :id ORDER BY datetime DESC"; $query = $this->session->prepare($statement); $query->bindParam(":id", $analysis->id()); $query->execute(); return $this->buildArrayComments($query->fetchAll(PDO::FETCH_ASSOC)); }
public function getAnalysisId() { return $this->analysis->id(); }