/** * Returns an ArticleData object of the first found article of this type. * If no article was found create an empty one. * * @return object */ public function getPreviewArticleData() { global $g_ado_db; $sql = "SELECT " . $this->m_dbTableName . ".* FROM " . $this->m_dbTableName . ", Articles WHERE " . $this->m_dbTableName . ".NrArticle = Articles.Number AND " . $this->m_dbTableName . ".IdLanguage = Articles.IdLanguage LIMIT 1"; $row = $g_ado_db->GetRow($sql); if (!$row) { $destArticleData = new ArticleData($this->m_name, Article::__generateArticleNumber(), 1); } else { $destArticleData = new ArticleData($this->m_name, $row['NrArticle'], $row['IdLanguage']); } return $destArticleData; }