Created models for all database objects

This commit is contained in:
2019-05-31 14:18:34 +02:00
parent 4fa01d4cc0
commit 4ce8fd274d
14 changed files with 634 additions and 11 deletions

View 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();
}
}