38 lines
777 B
PHP

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