Files
webprogrammierung/php/model/Article.php
T
2026-05-26 18:55:42 +02:00

91 lines
1.7 KiB
PHP

<?php
/*
* Klasse: Artikel
* Diese Klasse stellt alle Daten eines Artikels (Beitrag) bereit
*
* @author Niklas Ortmann
*/
class Article
{
private $id;
private $title;
private $content;
private $author;
private $date;
/**
* @param $id integer ID des Beitrages
* @param $title
* @param $content
* @param $author
* @param $date
*/
public function __construct($id, $title, $content, $author, $date)
{
$this->id = $id;
$this->title = $title;
$this->content = $content;
$this->author = $author;
$this->date = $date;
}
/**
* Gibt die ID eines Artikels zurück.
*/
public function getId()
{
return $this->id;
}
/**
* Gibt den Titel eines Artikels zurück.
*/
public function getTitle()
{
return $this->title;
}
/**
* Setzt den Titel eines Artikels.
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* Gibt den Content eines Artikels zurück.
* TODO: Content muss noch definiert werden.
*/
public function getContent()
{
return $this->content;
}
/**
* Setzt den Content eines Artikels.
* TODO: Content muss noch definiert werden.
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* Gibt den Autor eines Artikels zurück.
*/
public function getAuthor()
{
return $this->author;
}
/**
* Gibt das Veröffentlichungsdatum des Artikels zurück.
*/
public function getDate()
{
return $this->date;
}
}
?>