function loadComments() { if (!$this->comments) { $query = $this->_db->getQuery(true)->select('*')->from($this->_db->quoteName('#__eventgallery_comment'))->where('published=1')->where('file=' . $this->_db->quote($this->file->getFileName()))->where('folder=' . $this->_db->quote($this->file->getFolderName()))->order('date DESC'); $this->comments = $this->_getList($query); if (!$this->comments) { $this->comments = array(); } } }