Files
zurawik.pl/core/model/MfHomeSite.class.php
2026-05-15 18:33:51 +02:00

206 lines
3.3 KiB
PHP

<?php
/**
* Klasa prostych artykulow
*
*/
class MfHomeSite extends DataObject {
/**
* nazwa tabeli
*/
static $tableName = 'mf_home_site';
/**
* nazwa klucza tabeli
*/
static $classTablePK = 'id_mf_home_site';
/**
* nazwa klasy
*/
static $className = __CLASS__;
/**
* tabela mapująca pola z bazy SQL na pola klasy.
* `id_mf_home_site`, `lang``description`, `id_source`, `sort`, `photo`
*/
static $fields = array(
'id_mf_home_site' =>'id',
'lang' =>'lang' ,
'name' =>'name',
'title' =>'title',
'description' =>'description',
'id_source' => 'idSource',
'sort' =>'sort',
'photo' =>'photo',
'type' =>'type',
'location' =>'location',
'source_url' =>'sourceUrl'
);
protected $id;
private $lang;
private $name;
private $title;
private $description;
private $idSource;
private $sort;
private $photo;
private $type;
private $sourceUrl;
private $location;
public $objSource;
public function GetId() {
return $this->id;
}
public function SetId($id) {
$this->id = $id;
}
public function GetDescription() {
return $this->description;
}
public function SetDescription($d) {
$this->description = $d;
}
public function GetIdSource() {
return $this->idSource;
}
public function SetIdSource($idSource) {
$this->idSource = $idSource;
}
public function GetSort() {
return $this->sort;
}
public function SetSort($sort) {
$this->sort = $sort;
}
public function GetName() {
return $this->name;
}
public function SetName($name) {
$this->name = $name;
}
public function GetTitle() {
return $this->title;
}
public function SetTitle($title) {
$this->title = $title;
}
public function GetSourceUrl() {
return $this->sourceUrl;
}
public function SetSourceUrl($sourceUrl) {
$this->sourceUrl = $sourceUrl;
}
public function GetType() {
return $this->type;
}
public function SetType($type) {
$this->type = $type;
}
public function GetLocation() {
return $this->location;
}
public function SetLocation($location) {
$this->location = $location;
}
public function GetLang() {
if($this->lang=='') {
$this->SetLang(Router::$curLang);
}
return $this->lang;
}
public function SetLang($lang) {
$this->lang = $lang;
}
public function SetPhoto($photo) {
return $this->photo = $photo;
}
public function GetPhoto() {
return $this->photo;
}
public function GetPhotoUrl() {
if ($this->GetPhoto()) {
return Config::Get('URL_STATIC_CONTENT') . '/upload/home/' . $this->GetPhoto();
} else {
return null;
}
}
public function GetPhotoPath() {
if ($this->GetPhoto()) {
return Config::Get('PATH_STATIC_CONTENT') . '/upload/home/' . $this->GetPhoto();
} else {
return null;
}
}
/**
* Konstruktor klasy
*
* @param integer $id
*/
public function __construct($id = -1) {
$this->SetId($id);
}
/**
* Pobiera nazwę tabeli reprezentującej obiekt w SQL
* @return string
*/
public function GetTableName(){
return self::$tableName;
}
/**
* Pobiera taablice 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;
}
public function GetClassTablePK() {
return self::$classTablePK;
}
}
?>