@param \Interpro\Extractor\Contracts\Db\AMapper

@return void
184660
public function registerAMapper(AMapper $mapper)
    {
        $family = $mapper->getFamily();

        if(array_key_exists($family, $this->mappersA))
        {
            throw new ExtractorException('Маппер агрегатных(A) типов пакета '.$family.' уже зарегестрирована в медиаторе!');
        }

        $this->mappersA[$family] = $mapper;
    }
350929
private function execute()
    {
        $this->connect();
        try {
            $this->create->execute($this->dados);
            $this->result = $this->conn->lastInsertId();
        } catch (\PDOException $e) {
            $this->result = null;
            $this->erro = "<b>Erro ao cadastrar: ({$this->tabela})</b> {$e->getMessage()}";
        }

        parent::setDefault();
    }
1160460
public function initActiveQuery()
    {
        $this->activeQuery = Tree::find();

        if ($this->treePid) {
            $this->activeQuery->andWhere(['pid' => $this->treePid]);
        }

        if ($this->level) {
            $this->activeQuery->andWhere(['level' => $this->level]);
        }

        if ($this->active) {
            $this->activeQuery->andWhere(['active' => $this->active]);
        }

        if ($this->site_codes) {
            $cmsSites = CmsSite::find()->where(['code' => $this->site_codes])->all();
            if ($cmsSites) {
                $ids = ArrayHelper::map($cmsSites, 'id', 'id');
                $this->activeQuery->andWhere(['cms_site_id' => $ids]);
            }
        }

        if ($this->enabledCurrentSite == Cms::BOOL_Y && \Yii::$app->cms->site) {
            $this->activeQuery->andWhere(['cms_site_id' => \Yii::$app->cms->site->id]);
        }

        if ($this->orderBy) {
            $this->activeQuery->orderBy([$this->orderBy => (int)$this->order]);
        }

        if ($this->tree_type_ids) {
            $this->activeQuery->andWhere(['tree_type_id' => $this->tree_type_ids]);
        }


        if ($this->with) {
            $this->activeQuery->with($this->with);
        }

        if ($this->activeQueryCallback && is_callable($this->activeQueryCallback)) {
            $callback = $this->activeQueryCallback;
            $callback($this->activeQuery);
        }

        return $this;
    }
1267293
public function exec(): void
    {
        $this->queryExecuted = false;
        $sql = $this->getSQL();
        $adapter = $this->getAdapter();

        $adapter->prepare($sql);
        $bindings = $this->getBindings();

        try {
            foreach ($bindings->getBindings() as $bind) {
	            $adapter->getStatement()->bindValue($bind->getParameter(), $bind->getValue(), $bind->getType());
            }

	        $adapter->getStatement()->execute();

            Log::sql("{$this->adapter}>>>\n{$this->debug()}");
        } catch (PDOException $e) {
            // more descriptive error handling when query fails

            switch ($e->getCode()) {
                case 'HY093': // PDO miss match parameter count
                    //Log::debug("[{$e->getCode()}] Tried and failed to execute SQL query:\n{$sql}");
                    //Log::debug('BINDINGS', $bindings->getAsArray());
	                $exception = new QueryException("[{$e->getCode()}] Query bindings parameter miss match: {$e->getMessage()}", (int) $e->getCode(), $e);
                    break;

                default:
                    //Log::debug("[{$e->getCode()}] Tried and failed to execute SQL query:\n{$this->debug()}");
	                $exception = new QueryException("[{$e->getCode()}] Tried and failed to execute SQL query: {$e->getMessage()}", (int) $e->getCode(), $e);
                    break;
            }

            $exception->setAdapter($adapter->getConfigKey());
	        $exception->setSql($this->debug());
	        $exception->setBindings($bindings);
	        $exception->setWasPrepared(true);
            throw $exception;
        }

        $this->queryExecuted = true;
    }
1006475
protected function job(): void
    {
        $history = $this->retrieve([
            'corporation_id' => $this->getCorporationId(),
        ]);

        if ($history->isCachedLoad()) return;

        collect($history)->each(function ($alliance) {

            CorporationAllianceHistory::firstOrNew([
                'corporation_id' => $this->getCorporationId(),
                'record_id'      => $alliance->record_id,
            ])->fill([
                'start_date'  => carbon($alliance->start_date),
                'alliance_id' => $alliance->alliance_id ?? null,
                'is_deleted'  => $alliance->is_deleted ?? false,
            ])->save();

        });
    }
1209077
public function execute() {
        $areaid = $this->get_custom_data();

        try {
            \core_search\manager::clean_up_non_existing_area($areaid);
        } catch (\core_search\engine_exception $e) {
            mtrace('Search is not configured. Skip deleting index for search area ' . $areaid);
        }
    }
656953
public function run()
    {
        $this->_scanner->stdout('Detect DatabaseTable - BEGIN', Console::FG_GREY);
        if (is_array($this->_tables)) {
            foreach ($this->_tables as $tables) {
                $this->_scanningTable($tables);
            }
        }

        $this->_scanner->stdout('Detect DatabaseTable - END', Console::FG_GREY);
    }
340195
private function execute()
    {
        $this->Connect();
        try {
            $this->delete->execute($this->places);
            $this->result = true;
        } catch (\PDOException $e) {
            $this->result = null;
            $this->erro = "<b>Erro ao Deletar:</b> {$e->getMessage()}";
        }

        parent::setDefault();
    }
456428
public function execute()
    {
        $row = $this->_stmt->fetch();

        $batch = $this->getBatch();
        $count = $batch->getCounter('inserted_token_replacements');

        if ($row['gtrp_id_token_new'] == $this->_lastTokenId) {
            if (! $count) {
                $batch->addMessage($this->_('No token replacements to create'));
            }
            $this->_stopped = true;
            return;
        }

        $this->db->insert('gems__token_replacements', $row);

        $count = $batch->addToCounter('inserted_token_replacements');
        $batch->setMessage('inserted_replacements', sprintf(
                $this->plural('Created %d token replacement', 'Created %d token replacements', $count),
                $count
                ));

        $this->_lastTokenId = $row['gtrp_id_token_new'];
    }
1130580
private function loadAll(): void
  {
    $this->findSourceFiles();
    $this->detectNameConflicts();
    $this->getColumnTypes();
    $this->readStoredRoutineMetadata();
    $this->getConstants();
    $this->getOldStoredRoutinesInfo();
    $this->getCorrectSqlMode();

    $this->loadStoredRoutines();

    // Drop obsolete stored routines.
    $this->dropObsoleteRoutines();

    // Remove metadata of stored routines that have been removed.
    $this->removeObsoleteMetadata();

    $this->io->writeln('');

    // Write the metadata to file.
    $this->writeStoredRoutineMetadata();
  }
764850
public function run()
    {
        foreach($this->dumpFiles() as $dumpPart) {

            $query = "LOAD DATA LOCAL INFILE '"
                    . str_replace('\\', '/', $dumpPart) . "'
                    INTO TABLE `" . Config::citiesTableName() . "` 
                        FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'
                        LINES TERMINATED BY '\n' IGNORE 1 LINES
                        (country,
                        city_ascii,
                        city,
                        region,
                        population,
                        latitude,
                        longitude
                    )";

            DB::connection()->getpdo()->exec($query);

        }
    }
739546
public function remove()
    {
        $mPrimaryKeyName = $this->_mPrimaryKeyName;
        $bInsertMode = false;

        if ($mPrimaryKeyName === false) {

            throw new Exception('['.__FILE__.' (l.'.__LINE__.'] no primary key on this table!');
        }
        else if (is_string($mPrimaryKeyName)) {

            $sMethodPrimaryKey = 'get_'.$this->_mPrimaryKeyNameWithoutMapping;
            $aPrimaryKey = array($mPrimaryKeyName => $this->$sMethodPrimaryKey());
        }
        else {

            $aPrimaryKey = array();

            foreach($mPrimaryKeyName as $sKey => $sPrimaryKey) {

                $sMethodPrimaryKey = 'get_'.$this->_mPrimaryKeyNameWithoutMapping[$sKey];
                $aPrimaryKey[$sPrimaryKey] = $this->$sMethodPrimaryKey();
            }
        }

        /**
         * check if the virtual foreign key in this model is respected
         */
        if (count($this->_aForeignKey) > 0) {

            foreach ($this->_aForeignKey as $sName => $aForeignKey) {

                if ($aForeignKey['has_one'] == 1 && isset($aForeignKey['foreign_key_options']['action'])
                    && $aForeignKey['foreign_key_options']['action'] == self::CASCADE) {

                    $sMethodPrimaryKey = 'get_'.$aForeignKey['foreign_key'];
                    $mFIeld = $this->$sMethodPrimaryKey();

                    if ($mFIeld) {

                        $oOrm = new Orm;

                        $iResults = $oOrm->select(array('*'))
                            ->from($aForeignKey['entity_join_name']);

                        $oWhere = new Where;

                        $oWhere->whereEqual($aForeignKey['primary_key_name'], $mFIeld);

                        $aResults = $oOrm->where($oWhere)
                            ->load();

                        if (count($aResults) > 0) {

                            $oOrm = new Orm;

                            $oOrm->delete($aForeignKey['entity_join_name'])
                                ->where($oWhere)
                                ->save();
                        }
                    }
                }
            }
        }

        $oOrm = new Orm;

        $oOrm->delete(preg_replace('/^.*\\\\([a-zA-Z0-9_]+)$/', '$1', get_called_class()))
            ->where($aPrimaryKey)
            ->save();

        return $this;
    }
697844
public function initialize($instance, ServiceLocatorInterface $serviceLocator)
    {
        if ($instance instanceof ApplicationDbAware) {
            $instance->setApplicationDb($serviceLocator->get('prooph.link.app.db'));
        }
    }
896200
public function execute() {
        $manager = new \tool_dataprivacy\expired_contexts_manager(new \text_progress_trace());
        list($courses, $users) = $manager->process_approved_deletions();
        mtrace("Processed deletions for {$courses} course contexts, and {$users} user contexts as expired");
    }
4498
public function execute(): void
	{
		$migrations = $this->getOutstanding();

		if(empty($migrations))
		{
			$this->write('<blue>There are no outstanding migrations.</blue>');

			return;
		}

		$batch = $this->builder()->max('batch') + 1;

		foreach($migrations as $migration)
		{
			$this->runMigration($migration, 'up', $batch);
		}

		$this->write('Ran the following migrations:' . PHP_EOL);

		$this->outputMigrationList($migrations);
	}
981254
public function execute() {
        $accessrecords = access::get_records();
        $expires = new DateTime();
        $expires->sub(new DateInterval("P7D"));
        $timestamp = $expires->getTimestamp();

        $issuerid = get_config('onedrive', 'issuerid');
        $issuer = \core\oauth2\api::get_issuer($issuerid);

        // Add the current user as an OAuth writer.
        $systemauth = \core\oauth2\api::get_system_oauth_client($issuer);

        if ($systemauth === false) {
            $details = 'Cannot connect as system user';
            throw new repository_exception('errorwhilecommunicatingwith', 'repository', '', $details);
        }
        $systemservice = new \repository_onedrive\rest($systemauth);

        foreach ($accessrecords as $access) {
            if ($access->get('timemodified') < $timestamp) {
                $params = ['permissionid' => $access->get('permissionid'), 'itemid' => $access->get('itemid')];
                try {
                    $systemservice->call('delete_permission', $params);
                } catch (rest_exception $re) {
                    // We log and give up here or we will always fail for eternity.
                    mtrace('Failed to remove access from file: ' . $access->get('itemid'));
                }
                $access->delete();
            }
        }
    }
274924
public function execute()
    {
        $this->cleanHistory();
        $this->log();
        $this->instanceManager->update($this->instance);
    }