Backend\Core\Engine\Model::updateExtraData PHP Méthode

updateExtraData() public static méthode

Update extra data
public static updateExtraData ( integer $id, string $key, string $value )
$id integer The id for the extra.
$key string The key in the data you want to update.
$value string The new value.
    public static function updateExtraData($id, $key, $value)
    {
        $db = self::getContainer()->get('database');
        $data = (string) $db->getVar('SELECT i.data
             FROM modules_extras AS i
             WHERE i.id = ?', array((int) $id));
        $data = unserialize($data);
        $data[(string) $key] = (string) $value;
        $db->update('modules_extras', array('data' => serialize($data)), 'id = ?', array((int) $id));
    }