Added code to simplify setting values
This commit is contained in:
@@ -45,6 +45,14 @@ abstract class AbstractCommonClubsModel
|
||||
$this->values = $values;
|
||||
}
|
||||
|
||||
protected function setValue($key, $value)
|
||||
{
|
||||
if(is_null($this->values))
|
||||
$this->loadDataFromDatabase();
|
||||
|
||||
$this->values[$key] = $value;
|
||||
}
|
||||
|
||||
public function markAsNew($new)
|
||||
{
|
||||
$this->new = $new;
|
||||
|
||||
@@ -20,4 +20,18 @@ class CommonClubsModelPlace extends AbstractCommonClubsModel
|
||||
return $this->getValues()['club'];
|
||||
}
|
||||
|
||||
public function getArea()
|
||||
{
|
||||
return $this->getValues()['area'];
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
$this->setValue('name', $name);
|
||||
}
|
||||
|
||||
public function setArea($area)
|
||||
{
|
||||
$this->setValue('area', $area);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user