Made definition of columns based on objects
This commit is contained in:
@@ -36,6 +36,10 @@ abstract class AbstractCommonClubsModelFactory
|
||||
protected abstract function fetchAttributes();
|
||||
|
||||
private $attributes = null;
|
||||
/**
|
||||
* @param boolean $force
|
||||
* @return AbstractCommonClubsModelColumn[]
|
||||
*/
|
||||
public function getAttributes($force = False)
|
||||
{
|
||||
if($this->attributes === null || $force)
|
||||
@@ -164,10 +168,15 @@ abstract class AbstractCommonClubsModelFactory
|
||||
$obj = $this->generatePlainObject('new');
|
||||
$obj->markAsNew(true);
|
||||
|
||||
$attribs = array_map(function($v){
|
||||
return Null;
|
||||
}, $this->getAttributes());
|
||||
$obj->setValues($attribs);
|
||||
$values = array();
|
||||
foreach($this->getAttributes() as $a)
|
||||
{
|
||||
$values[$a->getAlias()] = null;
|
||||
}
|
||||
// $attribs = array_map(function($v){
|
||||
// return Null;
|
||||
// }, $this->getAttributes());
|
||||
$obj->setValues($values);
|
||||
|
||||
$obj->fillDefaultValues();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user