update
This commit is contained in:
193
core/model/News.class.php
Normal file
193
core/model/News.class.php
Normal file
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
/**
|
||||
* Model dla klasy News
|
||||
*
|
||||
* @author ModGen
|
||||
*/
|
||||
|
||||
class News extends DataObject{
|
||||
|
||||
|
||||
/**
|
||||
* nazwa tabeli
|
||||
*/
|
||||
static $tableName = 'news';
|
||||
|
||||
/**
|
||||
* nazwa klucza tabeli
|
||||
*/
|
||||
static $classTablePK = 'id_news';
|
||||
|
||||
/**
|
||||
* nazwa klasy
|
||||
*/
|
||||
static $className = __CLASS__;
|
||||
|
||||
/**
|
||||
* tablica mapująca pola klasy
|
||||
*/
|
||||
static $fields = array(
|
||||
'id_news' => 'id',
|
||||
'title' => 'title',
|
||||
'description' => 'description',
|
||||
'text' => 'text',
|
||||
'date_add' => 'dateAdd',
|
||||
'id_news_type' => 'idNewsType',
|
||||
'id_language' => 'idLanguage',
|
||||
'id_news_main' => 'idNewsMain',
|
||||
'description_main' => 'descriptionMain'
|
||||
);
|
||||
|
||||
|
||||
protected $id;
|
||||
private $title;
|
||||
private $description;
|
||||
private $text;
|
||||
private $dateAdd;
|
||||
private $idNewsType;
|
||||
private $idLanguage;
|
||||
private $idNewsMain;
|
||||
private $descriptionMain;
|
||||
|
||||
|
||||
|
||||
// -- Konstruktor --
|
||||
|
||||
|
||||
function __construct( $id = -1 , $title = null, $description = null, $text = null, $dateAdd = null, $idNewsType = null, $idLanguage = null, $idNewsMain = null, $descriptionMain = null){
|
||||
$this->id = $id;
|
||||
$this->title = $title;
|
||||
$this->description = $description;
|
||||
$this->text = $text;
|
||||
$this->dateAdd = $dateAdd;
|
||||
$this->idNewsType = $idNewsType;
|
||||
$this->idLanguage = $idLanguage;
|
||||
$this->idNewsMain = $idNewsMain;
|
||||
$this->descriptionMain = $descriptionMain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -- Get-y i Set-y --
|
||||
|
||||
public function getId(){
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId($id){
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
|
||||
public function getTitle(){
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setTitle($title){
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
public function getDescription(){
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription($description){
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
|
||||
public function getText(){
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
public function setText($text){
|
||||
$this->text = $text;
|
||||
}
|
||||
|
||||
|
||||
public function getDateAdd(){
|
||||
return $this->dateAdd;
|
||||
}
|
||||
|
||||
public function setDateAdd($dateAdd){
|
||||
$this->dateAdd = $dateAdd;
|
||||
}
|
||||
|
||||
|
||||
public function getIdNewsType(){
|
||||
return $this->idNewsType;
|
||||
}
|
||||
|
||||
public function setIdNewsType($idNewsType){
|
||||
$this->idNewsType = $idNewsType;
|
||||
}
|
||||
|
||||
|
||||
public function getIdLanguage(){
|
||||
return $this->idLanguage;
|
||||
}
|
||||
|
||||
public function setIdLanguage($idLanguage){
|
||||
$this->idLanguage = $idLanguage;
|
||||
}
|
||||
|
||||
|
||||
public function getIdNewsMain(){
|
||||
return $this->idNewsMain;
|
||||
}
|
||||
|
||||
public function setIdNewsMain($idNewsMain){
|
||||
$this->idNewsMain = $idNewsMain;
|
||||
}
|
||||
|
||||
|
||||
public function getDescriptionMain(){
|
||||
return $this->descriptionMain;
|
||||
}
|
||||
|
||||
public function setDescriptionMain($descriptionMain){
|
||||
$this->descriptionMain = $descriptionMain;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Pobiera nazwę tabeli reprezentującej obiekt w SQL
|
||||
* @return string
|
||||
*/
|
||||
public function GetTableName(){
|
||||
return self::$tableName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobiera nazwę klucza głównego tabeli
|
||||
* @return string
|
||||
*/
|
||||
public function GetClassTablePK() {
|
||||
return self::$classTablePK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobiera tablice mapującą pola klasy na pola tabeli
|
||||
* @return array
|
||||
*/
|
||||
public function GetFields(){
|
||||
return self::$fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobiera nazwę klasy
|
||||
* @return string
|
||||
*/
|
||||
public function GetClassName(){
|
||||
return self::$className;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user