public createVariant ( ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface $objConfig ) : null | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface | ||
$objConfig | ContaoCommunityAlliance\DcGeneral\Data\ConfigInterface | The config holding the id of the base model. |
Результат | null | ContaoCommunityAlliance\DcGeneral\Data\ModelInterface |
public function createVariant(ConfigInterface $objConfig)
{
$objItem = $this->getMetaModel()->findById($objConfig->getId())->varCopy();
if (!$objItem) {
return null;
}
$model = new Model($objItem);
$model->setMeta($model::IS_CHANGED, true);
return $model;
}