Execute additional saving tasks.
@return true
359946
protected function additionalSavingTasks( Pg $pg, $simulate = false, array &$ignoreList = array(), $action = self::ACTION_OBJECT )
    {

        // additional saving tasks?
        $repository = $this->recordManager->entityManager->getRepository( $this->object->class );
        $normality = $repository->normality;

        // links
        if( isset( $normality['persist']['links'] ) ) {
            foreach( $normality['persist']['links'] as $link ) {

                $links = $repository->linksGet( $this->object, $link, Repository::CHANGED + Base::INITIAL );

                // save links
                if( $task = $this->recordManager->getTask( $links, Task::PERSIST, false ) ) {
                    $task->execute( $pg, $simulate, $ignoreList, self::ACTION_OBJECT );
                }

            }
        }

        // references
        if( isset( $normality['persist']['references'] ) ) {
            foreach( $normality['persist']['references'] as $reference ) {

                $references = $repository->referencesGet( $this->object, $reference, Repository::CHANGED );

                // save links
                if( $references and $task = $this->recordManager->getTask( $references, Task::PERSIST, false ) ) {
                    $task->execute( $pg, $simulate, $ignoreList, self::ACTION_OBJECT );
                }

            }
        }

        return true;

    }
449285
public function execute() {
        global $CFG;

        if (!empty($CFG->skiplangupgrade)) {
            mtrace('Langpack update skipped. ($CFG->skiplangupgrade set)');

            return;
        }

        $controller = new \tool_langimport\controller();
        if ($controller->update_all_installed_languages()) {
            foreach ($controller->info as $message) {
                mtrace($message);
            }
            return true;
        } else {
            foreach ($controller->errors as $message) {
                mtrace($message);
            }
            return false;
        }

    }
584005
public function perform()
	{
		try {
			Resque_Event::trigger('beforePerform', $this);

			$instance = $this->getInstance();
			if(method_exists($instance, 'setUp')) {
				$instance->setUp();
			}

			$instance->perform();

			if(method_exists($instance, 'tearDown')) {
				$instance->tearDown();
			}

			Resque_Event::trigger('afterPerform', $this);
		}
		// beforePerform/setUp have said don't perform this job. Return.
		catch(Resque_Job_DontPerform $e) {
			return false;
		}

		return true;
	}
1090018
public function canSave()
    {
        if($this->getRequest()->getFormat() == 'html')
        {
            if($this->getModel()->getState()->isUnique())
            {
                if($this->canEdit() && !$this->isLocked()) {
                    return true;
                }
            }
            else
            {
                if($this->canAdd()) {
                    return true;
                }
            }
        }

        return false;
    }
256340
public function save_controller() {
        if ($this->progress >= self::PROGRESS_SAVED) {
            throw new base_ui_exception('backupuialreadysaved');
        }
        $this->progress = self::PROGRESS_SAVED;
        // First enforce dependencies.
        $this->enforce_dependencies();
        // Process UI event after to check any changes are valid.
        $this->controller->process_ui_event();
        // Save the controller.
        $this->controller->save_controller();
        return true;
    }
156485
public function save()
	{
		$result=true;
		foreach($this->files as $file)
		{
			if($this->confirmed($file))
				$result=$file->save() && $result;
		}
		return $result;
	}
616262
public function save()
	{
		// Validate
		if (!$this->validate())
		{
			return false;
		}

		// Handle cases where the primary key might be an empty string
		// For auto-increment in strict-mode DBs, this needs to be NULL
		// instead.
		if ($this->hasAttribute($this->getPrimaryKey())
		 && !$this->get($this->getPrimaryKey()))
		{
			$this->set($this->getPrimaryKey(), null);
		}

		// See if we're creating or updating
		$method = $this->isNew() ? 'create' : 'modify';
		$result = $this->$method();

		// Only perform the following upon success
		if ($result)
		{
			// Purge cache
			$this->purgeCache();

			// If creating, result is our new id, so set that back on the model
			if ($this->isNew())
			{
				$this->set($this->getPrimaryKey(), $result);
				\Event::trigger($this->getTableName() . '_new', ['model' => $this]);
			}

			\Event::trigger('system.onContentSave', array($this->getTableName(), $this));
		}

		return $result;
	}
1035483
protected function doExecute()
    {
        $tmpFile = WINDWALKER_TEMP . '/offline';

        if ($this->offline) {
            File::write($tmpFile, 'off');
        } elseif (is_file($tmpFile)) {
            File::delete($tmpFile);
        }

        $this->out()->out($this->description);

        return true;
    }
1018986
public function show_save() {
        foreach($this->settings as $setting) {
            if (empty($setting->nosave)) {
                return true;
            }
        }
        return false;
    }
845850
public function finish(){
        $this->running = 0;
        $this->success = 1;
        $this->last_execution_time = self::execution_time();
        
        if ($this->save()){
            Console::stdout(Console::ansiFormat("*** finished ".$this->controller."/".$this->action." (time: " . sprintf("%.3f", $this->last_execution_time) . "s)\n\n", [Console::FG_GREEN]));
            return true;
        }else{
            Console::stdout(Console::ansiFormat("*** failed to finish ".$this->controller."/".$this->action." (time: " . sprintf("%.3f", $this->last_execution_time) . "s)\n\n", [Console::FG_RED]));
            return false;
        }
    }
137831
public function push()
    {
        if (! $this->save()) return false;

        foreach ($this->relations as $models) {
            foreach (Collection::make($models) as $model) {
                if (! $model->push()) return false;
            }
        }

        return true;
    }
731364
public function loadTasks()
    {
        if ($this->tasks === true || empty($this->tasks) || empty($this->Tasks)) {
            return true;
        }
        $this->_taskMap = $this->Tasks->normalizeArray((array)$this->tasks);
        $this->taskNames = array_merge($this->taskNames, array_keys($this->_taskMap));

        $this->_validateTasks();

        return true;
    }
850313
public function save()
	{
		// Make sure children inherit states
		if ($this->get('state') == self::STATE_DELETED
		 || $this->get('state') == self::STATE_UNPUBLISHED)
		{
			foreach ($this->replies()->rows() as $comment)
			{
				$comment->set('state', $this->get('state'));

				if (!$comment->save())
				{
					$this->addError($comment->getError());

					return false;
				}
			}
		}

		return parent::save();
	}
323286
public function save()
    {
        if ($this->dirt) {
            return $this->driver->save($this->settings, $this->dirt);
        }

        return false;
    }
403464
public function save()
    {
        parent::save();

        $action = oxNew(Actions::class);

        if ($this->isNewEditObject() !== true) {
            $action->load($this->getEditObjectId());
        }

        if ($this->checkAccessToEditAction($action) === true) {
            $action->assign($this->getActionFormData());
            $action->setLanguage($this->_iEditLang);
            $action = Registry::getUtilsFile()->processFiles($action);
            $action->save();

            $this->setEditObjectId($action->getId());
        }
    }
741748
public function save()
    {
        // Update time - now
        $updated = time();

        // Update timestamp
        $this->entries[$this->timestampKey] = $updated;

        // Update timestamp manager
        if ($this->timestampManager) {
            $this->timestampManager->update($updated);
        }

        return (bool) file_put_contents($this->path, json_encode($this->entries));
    }
1178875
public function save() {
		if ($this->installTasks === null) {
			return;
		}
		
		// Let's grab all install tasks and save them according to their scope.
		// If no scope is provided, we default to global scope.
		
		$localInstalls = array();
		$globalInstalls = array();
		
		foreach ($this->installTasks as $task) {
			switch ($task->getScope()) {
				case AbstractInstallTask::SCOPE_GLOBAL:
				case '':
					$globalInstalls[] = $task->toArray();
					break;
				case AbstractInstallTask::SCOPE_LOCAL:
					$localInstalls[] = $task->toArray();
					break;
				default:
					throw new MoufException("Unknown install task scope '".$task->getScope()."'.");
			}
		}
		
		$this->ensureWritable($this->globalInstallFile);
		$this->ensureWritable($this->localInstallFile);
		
		$fp = fopen($this->globalInstallFile, "w");
		fwrite($fp, "<?php\n");
		fwrite($fp, "/**\n");
		fwrite($fp, " * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.\n");
		fwrite($fp, " * This file contains the status of all Mouf global installation processes for packages you have installed.\n");
		fwrite($fp, " * If you are working with a source repository, this file should be commited.\n");
		fwrite($fp, " */\n");
		fwrite($fp, "return ".var_export($globalInstalls, true).";");
		fclose($fp);		
		
		$fp = fopen($this->localInstallFile, "w");
		fwrite($fp, "<?php\n");
		fwrite($fp, "/**\n");
		fwrite($fp, " * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.\n");
		fwrite($fp, " * This file contains the status of all Mouf local installation processes for packages you have installed.\n");
		fwrite($fp, " * If you are working with a source repository, this file should NOT be commited.\n");
		fwrite($fp, " */\n");
		fwrite($fp, "return ".var_export($localInstalls, true).";");
		fclose($fp);

		@chmod($this->globalInstallFile, 0664);
		@chmod($this->localInstallFile, 0664);
        if (function_exists("opcache_invalidate")) {
            opcache_invalidate($this->globalInstallFile);
            opcache_invalidate($this->localInstallFile);
        }
    }