79 lines
1.5 KiB
PHP
79 lines
1.5 KiB
PHP
<?php
|
|
|
|
// No direct access.
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
class ClubsOffer extends AbstractClubsModel
|
|
{
|
|
protected $name;
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* @param string $name
|
|
*/
|
|
public function setName($name)
|
|
{
|
|
$this->name = $name;
|
|
}
|
|
|
|
protected function __construct()
|
|
{}
|
|
|
|
private const tableName = '#__club_offers';
|
|
private const className = 'ClubsOffer';
|
|
|
|
public static function getFactory()
|
|
{
|
|
return new class extends AbstractClubsModelFactory {
|
|
public function __construct()
|
|
{
|
|
parent::__construct($this->tableName, $this->className);
|
|
}
|
|
|
|
protected function getJoins($dbo)
|
|
{
|
|
$ret = array();
|
|
return $ret;
|
|
}
|
|
|
|
};
|
|
}
|
|
|
|
public static function loadOffers()
|
|
{
|
|
return self::loadElements(self::tableName, self::className);
|
|
}
|
|
|
|
|
|
public static function loadOffer(int $id)
|
|
{
|
|
return self::loadElement($id, self::tableName, self::className);
|
|
}
|
|
|
|
public static function createOffer()
|
|
{
|
|
$offer = new ClubsOffer();
|
|
$offer->id = 'new';
|
|
return $offer;
|
|
}
|
|
|
|
protected function getDataMappings()
|
|
{
|
|
return array('name');
|
|
}
|
|
|
|
protected function getTableName()
|
|
{
|
|
return self::tableName;
|
|
}
|
|
|
|
}
|