MetaModels\DcGeneral\Data\Driver::save PHP Method

save() public method

If the item does not have an Id yet, the save operation will add it as a new row to the database and populate the Id of the model accordingly.
public save ( ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $objItem ) : ContaoCommunityAlliance\DcGeneral\Data\ModelInterface
$objItem ContaoCommunityAlliance\DcGeneral\Data\ModelInterface The model to save back.
return ContaoCommunityAlliance\DcGeneral\Data\ModelInterface The passed model.
    public function save(ModelInterface $objItem)
    {
        if ($objItem instanceof Model) {
            $backupLanguage = $this->setLanguage($this->getCurrentLanguage());
            $objItem->getItem()->save();
            $this->setLanguage($backupLanguage);
            return $objItem;
        }
        throw new \RuntimeException('ERROR: incompatible object passed to GeneralDataMetaModel::save()');
    }