Made user controller working mostly. Not everything is tested but seems good
This commit is contained in:
@@ -59,9 +59,9 @@ abstract class AbstractClubsController extends BaseController
|
||||
try
|
||||
{
|
||||
// Fetch the posted data
|
||||
$values = $this->loadData();
|
||||
$values = $this->loadData($this->additionalData());
|
||||
|
||||
$this->filterRawCheck($values);
|
||||
$this->filterRaw($values);
|
||||
|
||||
// Check the input data
|
||||
if( ! $this->requiredDataIsAvailable($values) )
|
||||
@@ -70,7 +70,9 @@ abstract class AbstractClubsController extends BaseController
|
||||
if( ! $this->rawDataIsValid($values) )
|
||||
throw new DataParsingException();
|
||||
|
||||
$obj->setValues($values, true);
|
||||
$obj->applyAndMergeValues($values, true);
|
||||
|
||||
$this->filterObject($obj, $values);
|
||||
|
||||
// Do some additional tests by the controller
|
||||
if( ! $this->objectValid($obj) )
|
||||
@@ -103,7 +105,12 @@ abstract class AbstractClubsController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
protected function loadData()
|
||||
protected function additionalData()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function loadData($additionalData)
|
||||
{
|
||||
$values = array();
|
||||
$factory = $this->getFactory();
|
||||
@@ -114,10 +121,17 @@ abstract class AbstractClubsController extends BaseController
|
||||
$values[$column->getAlias()] = $column->getFilter()->getFilteredValue($input, $column->getAlias());
|
||||
}
|
||||
|
||||
foreach($additionalData as $k => $v)
|
||||
{
|
||||
$values[$k] = $v->getFilteredValue($input, $k);
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
protected function filterRawCheck(&$values){}
|
||||
protected function filterRaw(&$values){}
|
||||
|
||||
protected function filterObject($obj){}
|
||||
|
||||
protected function objectValid($obj)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user