Created models for all database objects
This commit is contained in:
37
src/admin/common/models/offer.php
Normal file
37
src/admin/common/models/offer.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class CommonClubsModelOffer extends AbstractCommonClubsModel
|
||||
{
|
||||
protected function getFactory()
|
||||
{
|
||||
return new CommonClubsModelFactoryOffer();
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->getValues()['name'];
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
$this->setValue('name', $name);
|
||||
}
|
||||
|
||||
/*public function getClubs()
|
||||
{
|
||||
return $this->fetchAssociatedElements(new CommonClubsModelFactoryClub(), '');
|
||||
}*/
|
||||
|
||||
protected function prepareDelete($db)
|
||||
{
|
||||
$q = $db->getQuery(true);
|
||||
$q->delete('#__club_offer_assocs');
|
||||
$q->where("offerid = {$this->getId()}");
|
||||
$db->setQuery($q);
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user