保存改动

@access public
@return array
768931
public function save() {

		$aUpdate =& self::$_lPoolDataChange[$this->_sConfig][$this->_mID];
		$aOrig   =& self::$_lPoolData[$this->_sConfig][$this->_mID];

		if ($aUpdate === $aOrig) {
			return FALSE;
		}

		$aOP = ($aOrig === FALSE) ? $aUpdate : self::_getDiff($aOrig, $aUpdate);

		$aOrig = $aUpdate;

		return $this->_coll()->update(
			[static::$_mKey => $this->_mID],
			$aOP,
			['upsert' => TRUE]
		);
	}
294526
public function actionSave()
    {
        $rule_id = \Yii::$app->request->post('rule_id');
        $url_id = \Yii::$app->request->post('url_id');
        $param_name = \Yii::$app->request->post('param_name');
        $rule = \Yii::$app->request->post('rule');
        $note = \Yii::$app->request->post('note');
        $status = \Yii::$app->request->post('status');

        if (!DpAdminMenuUrl::getByUrlId($url_id)) {
            return $this->renderError('菜单URL不存在！');
        }
        $saveData = [
            'url_id' => $url_id,
            'param_name' => $param_name,
            'rule' => $rule,
            'note' => $note,
            'status' => $status,
        ];
        if ($rule_id) {
            $obj = DpAdminMenuUrlRule::find()
                ->findByRuleId($rule_id)
                ->one();
            if (!$obj) {
                return $this->renderError('保存失败，记录不存在！');
            }
        } else {
            $obj = new DpAdminMenuUrlRule();
        }
        $obj->setAttributes($saveData);
        if (!$obj->save()) {
            foreach ($obj->getErrors() as $error) {
                foreach ($error as $message) {
                    return [
                        'success' => false,
                        'msg' => $message,
                    ];
                }
            }
        }

        return $this->renderSuccess('保存成功');
    }
159057
protected function _save()
    {
        $postdata = $this->_post('postdata');
        if (!$postdata)
        {
            self::error('No data to save!');
        }

        $postdata = $this->check_postdata($postdata, $this->primary_val);


        if ($this->inner_value !== false) // is nested
        {
            $field = reset($this->inner_where);
            if (!isset($postdata[$field])) // nested table connection field MUST be defined
            {
                $fdata = $this->_parse_field_names($field, 'build_select_details');
                $this->hidden_fields = array_merge($this->hidden_fields, $fdata);
                //$this->hidden_fields[$field] = $fdata[0];
                $postdata[$field] = $this->inner_value;
            }
        }
        $this->validate_postdata($postdata);
        if ($this->exception)
        {
            return $this->call_exception($postdata);
        }
        if (!$this->primary_val)
        {
            if (!$this->is_create || $this->table_ro)
                return self::error('Forbidden');
            if (isset($this->pass_var['create']))
            {
                foreach ($this->pass_var['create'] as $field => $param)
                {
                    if ($param['eval'])
                    {
                        $param['value'] = eval($param['value']);
                    }
                    $postdata[$field] = $this->replace_text_variables($param['value'], $postdata);
                    $this->hidden_fields[$field] = array('table' => $param['table'], 'field' => $param['field']);
                }
            }


            $pd = new Fruit_postdata($postdata, $this);

            if ($this->alert_create)
            {
                foreach ($this->alert_create as $alert)
                {
                    if ($alert['field'] && $pd->get($alert['field']) != $alert['value'])
                        continue;

                    $send_to = $pd->get($alert['column']) ? $pd->get($alert['column']) : $alert['column'];
                    if (!$send_to or !preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $send_to))
                        continue;
                    $alert['message'] = $this->replace_text_variables($alert['message'], $postdata);
                    if (Fruit_config::$email_enable_html)
                        $message = $alert['message'] . '<br /><br />' . "\r\n" . ($alert['link'] ? '<a href="' . $alert['link'] .
                            '" target="_blank">' . $alert['link'] . '</a>' : '');
                    else
                        $message = $alert['message'] . "\r\n\r\n" . ($alert['link'] ? $alert['link'] : '');
                    $this->send_email($send_to, $alert['subject'], $message, $alert['cc'], Fruit_config::$email_enable_html);
                }
            }
            if ($this->mass_alert_create)
            {
                foreach ($this->mass_alert_create as $alert)
                {
                    if ($alert['field'] && isset($postdata[$alert['field']]) && $postdata[$alert['field']] != $alert['value'])
                        continue;
                    $alert['message'] = $this->replace_text_variables($alert['message'], $postdata);
                    $alert['where'] = $this->replace_text_variables($alert['where'], $postdata);
                    if (Fruit_config::$email_enable_html)
                        $message = $alert['message'] . '<br /><br />' . "\r\n" . ($alert['link'] ? '<a href="' . $alert['link'] .
                            '" target="_blank">' . $alert['link'] . '</a>' : '');
                    else
                        $message = $alert['message'] . "\r\n\r\n" . ($alert['link'] ? $alert['link'] : '');
                    $db = Fruit_db::get_instance($this->connection);
                    $db->query("SELECT `{$alert['email_column']}` FROM `{$alert['email_table']}`" . ($alert['where'] ? ' WHERE ' . $alert['where'] :
                        ''));
                    foreach ($db->result() as $row)
                    {
                        $this->send_email($row[$alert['email_column']], $alert['subject'], $message, array(), Fruit_config::$email_enable_html);
                    }
                }
            }

            if ($this->before_insert)
            {
                $path = $this->check_file($this->before_insert['path'], 'before_insert');
                include_once ($path);
                if (is_callable($this->before_insert['callable']))
                {
                    call_user_func_array($this->before_insert['callable'], array($pd, $this));
                    $postdata = $pd->to_array();
                    if ($this->exception)
                    {
                        return $this->call_exception($postdata);
                    }
                }
            }

            $this->make_upload_process($pd);

            if ($this->replace_insert)
            {
                $path = $this->check_file($this->replace_insert['path'], 'replace_insert');
                include_once ($path);
                if (is_callable($this->replace_insert['callable']))
                {
                    $this->primary_val = call_user_func_array($this->replace_insert['callable'], array($pd, $this));
                    $postdata = $pd->to_array();
                    if ($this->exception)
                    {
                        return $this->call_exception($postdata);
                    }
                }
            }
            else
            {
                $this->primary_val = $this->_insert($postdata);
            }
            if ($this->after_insert)
            {
                $path = $this->check_file($this->after_insert['path'], 'after_insert');
                include_once ($path);
                if (is_callable($this->after_insert['callable']))
                {
                    call_user_func_array($this->after_insert['callable'], array(
                        $pd,
                        $this->primary_val,
                        $this));
                    $postdata = $pd->to_array();
                    if ($this->exception)
                    {
                        return $this->call_exception($postdata);
                    }
                }
            }

            $this->make_upload_process($pd);

            if ($this->send_external_create)
            {
                if (!$this->send_external_create['where_field'] or $postdata[$this->send_external_create['where_field']] == $this->
                    send_external_create['where_val'])
                {
                    foreach ($this->send_external_create['data'] as $key => $value)
                    {
                        $this->send_external_create['data'][$key] = $this->replace_text_variables($value, $postdata + array($this->table . '.' .
                                $this->primary_key => $this->primary_val));
                    }
                    switch ($this->send_external_create['method'])
                    {
                        case 'include':
                            $path = $this->check_file($this->send_external_create['path'], 'send_external_create');
                            ob_start();
                            extract($this->send_external_create['data']);
                            include ($path);
                            ob_end_clean();
                            break;
                        case 'get':
                        case 'post':
                            $this->send_http_request($this->send_external_create['path'], $this->send_external_create['data'], $this->
                                send_external_create['method'], false);
                            break;
                    }
                }
            }
        }
        else
        {
            if ($this->table_ro)
                return self::error('Forbidden');
            $fields = array();
            $row = array();
            $this->find_details_text_variables();
            if ($this->direct_select_tags)
            {
                foreach ($this->direct_select_tags as $key => $dsf)
                {
                    $fields[$key] = "`{$dsf['table']}`.`{$dsf['field']}` AS `{$key}`";
                }
            }
            if ($fields)
            {
                $db = Fruit_db::get_instance($this->connection);
                if (!$this->join)
                {
                    $db->query('SELECT ' . implode(',', $fields) . " FROM `{$this->table}` WHERE `{$this->primary_key}` = " . $db->escape($this->
                        primary_val) . " LIMIT 1");
                    $row = $db->row();

                }
                else
                {
                    $tables = array('`' . $this->table . '`');
                    $joins = array();
                    foreach ($this->join as $alias => $param)
                    {
                        $tables[] = '`' . $alias . '`';
                        $joins[] = "INNER JOIN `{$param['join_table']}` AS `{$alias}` 
                    ON `{$param['table']}`.`{$param['field']}` = `{$alias}`.`{$param['join_field']}`";
                    }
                    $db->query('SELECT ' . implode(',', $fields) . " FROM `{$this->table}` AS `{$this->table}` " . implode(' ', $joins) .
                        " WHERE `{$this->table}`.`{$this->primary_key}` = " . $db->escape($this->primary_val));
                    $row = $db->row();
                }
            }

            if (!$this->is_edit($row))
                return self::error('Forbidden');

            if (isset($this->pass_var['edit']))
            {
                foreach ($this->pass_var['edit'] as $field => $param)
                {
                    if (isset($param['tmp_value']))
                    {
                        $param['value'] = $param['tmp_value'];
                        unset($this->pass_var['edit'][$field]['tmp_value']);
                    }
                    if ($param['eval'])
                    {
                        $param['value'] = eval($param['value']);
                    }
                    $postdata[$field] = $this->replace_text_variables($param['value'], $postdata);
                    $postdata[$field] = $this->replace_text_variables($param['value'], $row);
                    $this->hidden_fields[$field] = array('table' => $param['table'], 'field' => $param['field']);
                }
            }

            $pd = new Fruit_postdata($postdata, $this);

            if ($this->alert_edit)
            {
                foreach ($this->alert_edit as $alert)
                {
                    if ($alert['field'] && $pd->get($alert['field']) != $alert['value'])
                        continue;
                    $send_to = $pd->get($alert['column']) ? $pd->get($alert['column']) : $alert['column'];
                    if (!$send_to or !preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $send_to))
                        continue;
                    $alert['message'] = $this->replace_text_variables($alert['message'], $postdata);
                    if (Fruit_config::$email_enable_html)
                        $message = $alert['message'] . '<br /><br />' . "\r\n" . ($alert['link'] ? '<a href="' . $alert['link'] .
                            '" target="_blank">' . $alert['link'] . '</a>' : '');
                    else
                        $message = $alert['message'] . "\r\n\r\n" . ($alert['link'] ? $alert['link'] : '');
                    $this->send_email($send_to, $alert['subject'], $message, $alert['cc'], Fruit_config::$email_enable_html);
                }
            }
            if ($this->mass_alert_edit)
            {
                foreach ($this->mass_alert_edit as $alert)
                {
                    if ($alert['field'] && isset($postdata[$alert['field']]) && $postdata[$alert['field']] != $alert['value'])
                        continue;
                    $alert['message'] = $this->replace_text_variables($alert['message'], $postdata);
                    $alert['where'] = $this->replace_text_variables($alert['where'], $postdata);
                    if (Fruit_config::$email_enable_html)
                        $message = $alert['message'] . '<br /><br />' . "\r\n" . ($alert['link'] ? '<a href="' . $alert['link'] .
                            '" target="_blank">' . $alert['link'] . '</a>' : '');
                    else
                        $message = $alert['message'] . "\r\n\r\n" . ($alert['link'] ? $alert['link'] : '');
                    $db = Fruit_db::get_instance($this->connection);
                    $db->query("SELECT `{$alert['email_column']}` FROM `{$alert['email_table']}`" . ($alert['where'] ? ' WHERE ' . $alert['where'] :
                        ''));
                    foreach ($db->result() as $row)
                    {
                        $this->send_email($row[$alert['email_column']], $alert['subject'], $message, array(), Fruit_config::$email_enable_html);
                    }
                }
            }

            if ($this->before_update)
            {
                $path = $this->check_file($this->before_update['path'], 'before_update');
                include_once ($path);
                if (is_callable($this->before_update['callable']))
                {
                    call_user_func_array($this->before_update['callable'], array(
                        $pd,
                        $this->primary_val,
                        $this));
                    $postdata = $pd->to_array();

                    if ($this->exception)
                    {
                        return $this->call_exception($postdata);
                    }
                }
            }
            if ($this->replace_update)
            {
                $path = $this->check_file($this->replace_update['path'], 'replace_update');
                include_once ($path);
                if (is_callable($this->replace_update['callable']))
                {
                    $this->primary_val = call_user_func_array($this->replace_update['callable'], array(
                        $pd,
                        $this->primary_val,
                        $this));
                    $postdata = $pd->to_array();
                    if ($this->exception)
                    {
                        return $this->call_exception($postdata);
                    }
                }
            }
            else
                $this->primary_val = $this->_update($postdata, $this->primary_val);
            if ($this->after_update)
            {
                $path = $this->check_file($this->after_update['path'], 'after_update');
                include_once ($path);
                if (is_callable($this->after_update['callable']))
                {
                    call_user_func_array($this->after_update['callable'], array(
                        $pd,
                        $this->primary_val,
                        $this));
                    $postdata = $pd->to_array();
                    if ($this->exception)
                    {
                        return $this->call_exception($postdata);
                    }
                }
            }
            if ($this->send_external_edit)
            {
                if (!$this->send_external_edit['where_field'] or $postdata[$this->send_external_edit['where_field']] == $this->
                    send_external_edit['where_val'])
                {
                    foreach ($this->send_external_edit['data'] as $key => $value)
                    {
                        $this->send_external_edit['data'][$key] = $this->replace_text_variables($value, $postdata);
                    }
                    switch ($this->send_external_edit['method'])
                    {
                        case 'include':
                            $path = $this->check_file($this->send_external_edit['path'], 'send_external_edit');
                            ob_start();
                            extract($this->send_external_edit['data']);
                            include ($path);
                            ob_end_clean();
                            break;
                        case 'get':
                        case 'post':
                            $this->send_http_request($this->send_external_edit['path'], $this->send_external_edit['data'], $this->
                                send_external_edit['method'], false);
                            break;
                    }
                }
            }
        }
        unset($postdata);
        $this->task = $this->after;
        $this->after = null;
        return $this->_run_task();
    }
198788
public function actionSave()
    {
        $user_id = \Yii::$app->request->post('user_id');
        $menu_ids = \Yii::$app->request->post('menu_ids');
        $username = \Yii::$app->request->post('username');
        $nickname = \Yii::$app->request->post('nickname');
        $source_password = \Yii::$app->request->post('source_password');
        $group_ids = (array)\Yii::$app->request->post('group_ids');
        $is_group_access = \Yii::$app->request->post('is_group_access');
        $is_user_access = \Yii::$app->request->post('is_user_access');
        $is_system = \Yii::$app->request->post('is_system');
        $note = \Yii::$app->request->post('note');
        $status = \Yii::$app->request->post('status');

        $groupIdsStr = '';
        if ($group_ids) {
            $groupIdsStr = join(',', array_filter($group_ids, function ($groupId) {
                return DpAdminGroup::getByGroupId($groupId);
            }));
        }

        $saveData = [
            'username' => $username,
            'nickname' => $nickname,
            'source_password' => $source_password,
            'group_ids' => $groupIdsStr,
            'is_group_access' => $is_group_access,
            'is_user_access' => $is_user_access,
            'is_system' => $is_system,
            'note' => $note,
            'status' => $status,
        ];
        if ($user_id) {
            $obj = DpAdminUser::find()
                ->where([
                    'user_id' => $user_id
                ])
                ->one();
            if (!$obj) {
                return $this->renderError('保存失败，记录不存在！');
            }
        } else {
            $obj = new DpAdminUser();
        }
        $obj->setAttributes($saveData);
        if (!$obj->save()) {
            foreach ($obj->getErrors() as $error) {
                foreach ($error as $message) {
                    return [
                        'success' => false,
                        'msg' => $message,
                    ];
                }
            }
        }
        // 用户关联的菜单权限更新
        DpAdminUserMenuRelation::deleteByUserId($obj->user_id);
        if ($menu_ids) {
            $menuIdArr = array_filter(StringHelper::explode($menu_ids, ',', true, true), function ($menuId) {
                return DpAdminMenu::getByMenuId($menuId);
            });
            if ($menuIdArr) {
                foreach ($menuIdArr as $menuId) {
                    $linkObj = new DpAdminUserMenuRelation();
                    $linkObj->setAttributes([
                        'user_id' => $obj->user_id,
                        'menu_id' => $menuId,
                    ]);
                    $linkObj->save();
                }
            }
        }

        return $this->renderSuccess('保存成功');
    }
105108
public function save()
    {
        try {
            if (isset($this->data['_id'])) {
                $this->data = array_merge($this->data, $this->chill->put($this->_id, $this->data));
            } else {
                $this->data = array_merge($this->data, $this->chill->post($this->data));
            }

            return true;
        } catch (Chill\Exception $ex) {
            return false;
        }
    }
709007
public function _saveArray()
	{
		$value = $this->getModel()->getAttribute($this->getArrayFieldName());;
		$value = $this->_postgresqlArrayEncode($value);
		if($value === null && $this->onEmptySaveNull == false){
			$value = '{}';
		}
		$this->getModel()->setAttribute($this->getArrayFieldName(), $value);

		return $this;
	}
20882
function save()
    {
        $this->_save = false;
        if ($this->_change == 0 or $this->_change == 1)
        {
            if ($this->db->insert($this->_data, $this->table) === false)
            {
                return false;
            }
            //改变状态
            $this->_change = 1;
            $this->_current_id = $this->db->lastInsertId();
        }
        elseif ($this->_change == 2)
        {
            $update = $this->_update;
            unset($update[$this->primary]);
            if ($this->db->update($this->_current_id, $update, $this->table, $this->primary) === false)
            {
                return false;
            }
        }
        $this->notify();
        return true;
    }
1336337
public function save()
    {
        $builder = static::query();

        /**
         * Get the current primary key value
         */
        $primary_key_value = $this->getKeyValue();

        /**
         * If primary key value is null, we are going to start the creation of new
         * row
         */
        if ($primary_key_value == null) {
            /**
             * Insert information in the database
             */
            $r = $builder->insert($this->attributes);

            /**
             * We get a last insertion id value
             */
            $primary_key_value = $builder->getLastInsertId();

            /**
             * Transtype value to the define primary key type
             */
            if ($this->primary_key_type == 'int') {
                $primary_key_value = (int) $primary_key_value;
            } elseif ($this->primary_key_type == 'float') {
                $primary_key_value = (float) $primary_key_value;
            } elseif ($this->primary_key_type == 'double') {
                $primary_key_value = (double) $primary_key_value;
            } else {
                $primary_key_value = (string) $primary_key_value;
            }

            /**
             * Set the primary key value
             */
            $this->attributes[$this->primary_key] = $primary_key_value;

            $this->original = $this->attributes;

            if ($r == 1) {
                $this->fireEvent('oncreated');
            }

            return $r;
        }

        if (!$builder->exists($this->primary_key, $primary_key_value)) {
            return 0;
        }

        $this->original[$this->primary_key] = $primary_key_value;

        $update_data = [];

        foreach ($this->attributes as $key => $value) {
            if (!isset($this->original[$key])
                || $this->original[$key] != $value) {
                $update_data[$key] = $value;
            }
        }

        $r = $builder
            ->where($this->primary_key, $primary_key_value)
            ->update($update_data);

        if ($r == 1) {
            $this->fireEvent('onupdate');
        }

        return $r;
    }
1051928
public function persist()
    {

        $blob = $this->serializer->serialize($this->_attributes, $this->serializeOptions);

        $result = (bool)$this->filesystem->write($this->url, $blob, $this->getOption('file_locking'));

        if (!$hashMethod = $this->getOption('checksum_method')) {
            return $result;
        }

        $checksum = $this->createChecksum($hashMethod, $blob);

        $savedBlob = $this->filesystem->read($this->url);

        $this->checkData($hashMethod, $savedBlob, $checksum);

        return $result;
    }
906972
public function save()
    {
        if(file_exists($this->_config_file_path)){

            chmod($this->_config_file_path, 0644);

            $content = "<?php\nclass AnSiteConfig{\n";

            foreach($this->_attributes as $key=>$value) {
              if(!is_array($value)){
                $content .= "    var \$$key = '$value';\n";
              }
            }

            $content .= "}\n";

            try {
              file_put_contents($this->_config_file_path, $content);
            } catch (Exception $e) {
                throw new \RuntimeException($e->getMessage());
            }

            chmod($this->_config_file_path, 0444);

            $this->_clearCache();
        }

        return $this;
    }
634087
function save()
    {
        $dirty_props = $this->_dirty; 

        if ($this->_vars)
        {   
            $dirty_vars = $this->_vars->getDirtyVariables();
            if ($dirty_vars)
            {
                $dirty_props['vars'] = $dirty_vars;
            }
        }
        
        $this->_api->doRequest('POST', $this->getBaseApiPath(), $dirty_props);        
        $this->_dirty = array();
        
        if ($this->_vars)
        {
            $this->_vars->clearDirtyVariables();
        }
    }
1326516
public function actionSave()
    {
        $group_id = \Yii::$app->request->post('group_id');
        $menu_ids = \Yii::$app->request->post('menu_ids');
        $name = \Yii::$app->request->post('name');
        $is_system = \Yii::$app->request->post('is_system');
        $note = \Yii::$app->request->post('note');
        $status = \Yii::$app->request->post('status');

        $saveData = [
            'name' => $name,
            'is_system' => $is_system,
            'note' => $note,
            'status' => $status,
        ];
        if ($group_id) {
            $obj = DpAdminGroup::find()
                ->findByGroupId($group_id)
                ->one();
            if (!$obj) {
                return $this->renderError('保存失败，记录不存在！');
            }
        } else {
            $obj = new DpAdminGroup();
        }
        $obj->setAttributes($saveData);
        if (!$obj->save()) {
            foreach ($obj->getErrors() as $error) {
                foreach ($error as $message) {
                    return [
                        'success' => false,
                        'msg' => $message,
                    ];
                }
            }
        }
        // 用户组关联的菜单权限更新
        DpAdminGroupMenuRelation::deleteByGroupId($obj->group_id);
        if ($menu_ids) {
            $menuIdArr = array_filter(StringHelper::explode($menu_ids, ',', true, true), function ($menuId) {
                return DpAdminMenu::getByMenuId($menuId);
            });
            if ($menuIdArr) {
                foreach ($menuIdArr as $menuId) {
                    $linkObj = new DpAdminGroupMenuRelation();
                    $linkObj->setAttributes([
                        'group_id' => $obj->group_id,
                        'menu_id' => $menuId,
                    ]);
                    $linkObj->save();
                }
            }
        }

        return $this->renderSuccess('保存成功');
    }
54956
public function save()
    {
        $json = [];
        foreach ($this as $cookie) {
            /** @var SetCookie $cookie */
            if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
                $json[] = $cookie->toArray();
            }
        }

        $_SESSION[$this->sessionKey] = json_encode($json);
    }
830807
private function store()
    {
        $settings = [];
        foreach ($this->settings as $key => $value) {
            $settings[$key] = serialize($value);
        }
        file_put_contents($this->cacheFile, json_encode($settings));
    }
1300786
public function save()
	{
		$result = $this->getClient()->save();
		$prodIds = array_unique( $this->getView()->param( 'product/catalog.lists.refid', [] ) );

		if( !empty( $prodIds ) )
		{
			$context = $this->getContext();
			$manager = \Aimeos\MShop::create( $context, 'product' );
			$domains = ['attribute', 'price', 'product', 'supplier', 'text'];

			$search = $manager->createSearch( true )->setSlice( count( $prodIds ) );
			$search->setConditions( $search->compare( '==', 'product.id', $prodIds ) );

			$items = $manager->searchItems( $search, $domains );
			\Aimeos\MShop::create( $context, 'index' )->rebuildIndex( $items );
		}

		return $result;
	}
722904
public function save()
    {

        $ok = $this->getDataConnector()->saveResourceLink($this);
        if ($ok) {
            $this->settingsChanged = false;
        }

        return $ok;

    }
248660
public function save()
    {
        $result = true;

        if (!empty($this->changedData)) {
            foreach ($this->changedData as $scope => $rowData) {
                foreach ($rowData as $layoutName => $layoutData) {
                    if (empty($scope) || empty($layoutName)) {
                        continue;
                    }
                    $layoutPath = $this->getLayoutPath($scope, true);
                    $data = Json::encode($layoutData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);

                    $result &= $this->getFileManager()->putContents(array($layoutPath, $layoutName.'.json'), $data);
                }
            }
        }

        if ($result == true) {
            $this->clearChanges();
        }

        return (bool) $result;
    }