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

217 lines
3.5 KiB
PHP

<?php
/**
* Model dla klasy MfProductMain
*
* @author ModGen
*/
class MfProductMain extends DataObject{
/**
* nazwa tabeli
*/
static $tableName = 'mf_product_main';
/**
* nazwa klucza tabeli
*/
static $classTablePK = 'id_mf_product_main';
/**
* nazwa klasy
*/
static $className = __CLASS__;
/**
* tablica mapująca pola klasy
*/
static $fields = array(
'id_mf_product_main' => 'id',
'sort' => 'sort',
'title' => 'title',
'publication' => 'publication',
'lang' => 'lang',
'type' => 'type',
'id_category' => 'idCategory',
'id_mf_image_group' => 'idMfImageGroup',
'image' => 'imageName'
);
protected $id;
private $sort;
private $title;
private $publication;
private $lang;
private $type;
private $idCategory;
private $idMfImageGroup;
private $imageName;
public $objCategory;
// -- Konstruktor --
function __construct( $id = -1 , $sort = null, $title = null, $publication = null, $lang = null, $type = null, $idCategory = null, $idMfImageGroup = null){
$this->id = $id;
$this->sort = $sort;
$this->title = $title;
$this->publication = $publication;
$this->lang = $lang;
$this->type = $type;
$this->idCategory = $idCategory;
$this->idMfImageGroup = $idMfImageGroup;
}
// -- Get-y i Set-y --
public function getId(){
return $this->id;
}
public function setId($id){
$this->id = $id;
}
public function getSort(){
return $this->sort;
}
public function setSort($sort){
$this->sort = $sort;
}
public function getTitle(){
return $this->title;
}
public function setTitle($title){
$this->title = $title;
}
public function getPublication(){
return $this->publication;
}
public function setPublication($publication){
$this->publication = $publication;
}
public function getLang(){
return $this->lang;
}
public function setLang($lang){
$this->lang = $lang;
}
public function getType(){
return $this->type;
}
public function setType($type){
$this->type = $type;
}
public function getIdCategory(){
return $this->idCategory;
}
public function setIdCategory($idCategory){
$this->idCategory = $idCategory;
}
public function getIdMfImageGroup(){
return $this->idMfImageGroup;
}
public function setIdMfImageGroup($idMfImageGroup){
$this->idMfImageGroup = $idMfImageGroup;
}
public function getImageName(){
return $this->imageName;
}
public function setImageName($imageName){
$this->imageName = $imageName ;
}
public function GetFullPath() {
return PATH_STATIC . "/upload/ProductMain/" . $this->imageName;
}
public function GetFullUrl() {
return URL_STATIC_CONTENT . "/upload/ProductMain/" . $this->imageName;
}
public function setObjCategory($obj) {
$this->objCategory = $obj;
}
public function getObjCategory() {
if ($this->idCategory > 0 && !is_object($this->objCategory)) {
$this->objCategory = MfProductCategoryDAL::GetById($this->getIdCategory());
}
return $this->objCategory;
}
/**
* 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;
}
}
?>