MetaModels\Attribute\BaseSimple::setDataFor PHP Метод

setDataFor() публичный Метод

This method is called to store the data for certain items to the database.
public setDataFor ( mixed $arrValues ) : void
$arrValues mixed The values to be stored into database. Mapping is item id=>value.
Результат void
    public function setDataFor($arrValues)
    {
        $strTable = $this->getMetaModel()->getTableName();
        $strColName = $this->getColName();
        foreach ($arrValues as $intId => $varData) {
            if (is_array($varData)) {
                $varData = serialize($varData);
            }
            $this->getMetaModel()->getServiceContainer()->getDatabase()->prepare(sprintf('UPDATE %s SET %s=? WHERE id=%s', $strTable, $strColName, $intId))->execute($varData);
        }
    }