Changed cacheing of attributes to be useful
This commit is contained in:
parent
7bf2386851
commit
dec4bb5165
@ -33,13 +33,13 @@ abstract class AbstractCommonClubsModelFactory
|
||||
* - optional: boolean, if true, the field can be NULL
|
||||
* - ref: (only with type='ref') The name of the class that is referenced
|
||||
*/
|
||||
public abstract function getAttributes();
|
||||
protected abstract function fetchAttributes();
|
||||
|
||||
private $attributes = null;
|
||||
private function fetchAttributes($force = False)
|
||||
public function getAttributes($force = False)
|
||||
{
|
||||
if($this->attributes === null || $force)
|
||||
$this->attributes = $this->getAttributes();
|
||||
$this->attributes = $this->fetchAttributes();
|
||||
|
||||
return $this->attributes;
|
||||
}
|
||||
@ -128,7 +128,7 @@ abstract class AbstractCommonClubsModelFactory
|
||||
|
||||
$attribs = array_map(function($v){
|
||||
return Null;
|
||||
}, $this->fetchAttributes());
|
||||
}, $this->getAttributes());
|
||||
$obj->setValues($attribs);
|
||||
|
||||
$obj->fillDefaultValues();
|
||||
|
@ -5,7 +5,7 @@ defined('_JEXEC') or die;
|
||||
|
||||
class CommonClubsModelFactoryClub extends AbstractCommonClubsModelFactory
|
||||
{
|
||||
public function getAttributes()
|
||||
public function fetchAttributes()
|
||||
{
|
||||
return array(
|
||||
'name'=>array(),
|
||||
|
@ -5,7 +5,7 @@ defined('_JEXEC') or die;
|
||||
|
||||
class CommonClubsModelFactoryPlace extends AbstractCommonClubsModelFactory
|
||||
{
|
||||
public function getAttributes()
|
||||
public function fetchAttributes()
|
||||
{
|
||||
return array(
|
||||
'name'=>array(),
|
||||
|
@ -5,7 +5,7 @@ defined('_JEXEC') or die;
|
||||
|
||||
class CommonClubsModelFactoryUser extends AbstractCommonClubsModelFactory
|
||||
{
|
||||
public function getAttributes()
|
||||
public function fetchAttributes()
|
||||
{
|
||||
return array(
|
||||
'user'=>array(),
|
||||
|
Loading…
Reference in New Issue
Block a user