set connected db relation options

@return void
429483
protected function setConnectedRelationOptions()
    {
        parent::setConnectedRelationOptions();

        if (! $this->db->isFieldExists($table = $this->model->getTable(), $this->defaultOptions['primary_key'])) {
            $this->options['primary_key'] = $this->command->choice(
                "Can't find field {$this->text['primary_key']} in the table {$this->text['table']} as {$this->text['primary_text']}, choice one!",
                $this->getFields($table)
            );
        }
    }
1332428
public function setConnection($pHost, $pName, $pUser = NULL, $pPassword = NULL)
    {
        $this->_connection = $this->connect($pHost, $pName, $pUser, $pPassword);
        $this->_dbName = $pName;
        return $this;
    }
756368
protected function _setJoins()
    {
        $joins = $this->_sql->getJoins();
        foreach ($joins as $join) {
            $this->_statement .= $this->_createJoinStatement($join);
        }
        return $this;
    }
771749
public function connect() {
        $dbConfig = $this->getDbConfig();
        $this->setDbConfig($dbConfig);
        $this->setORM($dbConfig);
        HookManager::call('dbConnect', self::$dbConnections, self::$ormPath);
    }
723373
protected function configureConnectionManager(): void
    {
        if ($this->options['connection_manager']) {
            $this->connectionManager = $this->options['connection_manager'];
        } else {
            $class = $this->options['connection_manager_class'];
            $options = $this->options['connection_manager_options'];

            $this->connectionManager = new $class($this, $options);
        }

        $this->connectionManager->setLogger($this->logger);
    }
1170403
protected function setDefaultConfig() {
		//database prefix
		$this->config['db.prefix'] = '';
	
		//dynamic sql environment id
		$this->config['env.id'] = 'default';
	
		//dynamic sql environment class
		$this->config['env.class'] = 'eMapper\Dynamic\Environment\DynamicSQLEnvironment';
	
		//default relation depth
		$this->config['depth.current'] = 0;
	
		//default relation depth limit
		$this->config['depth.limit'] = 1;
		
		//cache metakey
		$this->config['cache.metakey'] = '__cache__';
	}
1360678
private function connectToDb()
    {
        if (!$this->dbConn = @mysql_connect($this->host, $this->dbUser, $this->dbPass)) {
            $this->handleError();
        } else if (!@mysql_select_db($this->dbName, $this->dbConn)) {
            $this->handleError();
        }
    }
1236587
public function loadRelations($data)
    {
        /** @var BaseActiveRecord $owner */
        $owner = $this->owner;
        foreach ($this->_relations as $relationName) {
            $keyName = $this->_getRelationKeyName($relationName);
            if (array_key_exists($keyName, $data)) {
                $owner->{$relationName} = $data[$keyName];
            }
        }
    }
1095787
private function setConnection()
    {
        switch ($this->driver) {
            case 'mysql' :
                $this->connection = new Mysql($this->config);
                break;
            case 'postgresql' :
                $this->connection = new Postgresql($this->config);
                break;
            case 'sqlite' :
                $this->connection = new Sqlite($this->config);
                break;
            case 'oracle' :
                $this->connection = new Oracle($this->config);
                break;
            default :
                $debug_msg = "~/config/database.php文件配置错误！不支持的数据库驱动类型 - " . strval($this->driver);
                throw new \InvalidArgumentException($debug_msg);
        }
    }
914359
protected function setDbColumns()
    {
        $connection = $this->model()->eloquent()->getConnectionName();

        $this->dbColumns = collect(Schema::connection($connection)->getColumnListing($this->model()->getTable()));
    }
853622
public static function setConnection()
    {
        $dhost = getenv('DB_HOST');
        $dbase = getenv('DB_BASE');
        $duser = getenv('DB_USER');
        $dpass = getenv('DB_PASS');

        $opt = [
            PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
            PDO::ATTR_EMULATE_PREPARES   => false,
        ];

        try {
            self::$pdo = new PDO("mysql:host=$dhost;dbname=$dbase", $duser, $dpass, $opt);
        } catch (\Exception $exception) {
            var_dump($exception->getMessage());
            exit();
        }
    }
687274
public function setRelations(array $relations): self
    {
        // Parse and set the relations.
        $this->relations = $this->newModelQuery()
            ->with($relations)
            ->getEagerLoads();

        return $this;
    }
900943
public function setRelation(Relationship $relation, $debug = false)
    {
        // Set the relation object.
        $this->relation = $relation;

        // Replace the attributes with those brought from the given relation.
        $this->attributes = $relation->getProperties();
        $this->setAttribute($this->primaryKey, $relation->getId());

        // Set the start and end nodes.
        $this->start = $relation->getStartNode();
        $this->end   = $relation->getEndNode();

        // Instantiate and fill out the related model.
        $relatedNode = ($this->isDirectionOut()) ? $this->end : $this->start;
        $attributes = array_merge(['id' => $relatedNode->getId()], $relatedNode->getProperties());

        // This is an existing relationship.
        $this->related = $this->related->newFromBuilder($attributes);
        $this->related->setConnection($this->related->getConnectionName());
    }
611172
public function setRelations($relations)
    {
        $this->setAvailableIncludes(array_unique(array_merge($this->availableIncludes, (array) $relations)));

        return $this;
    }
1246503
private function connect()
    {
        if (!$this->isConnected) {
            parent::__construct(
                $this->dsn,
                $this->server->getUsername(),
                $this->server->getPassword(),
                $this->driverOptions
            );
            parent::setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            parent::setAttribute(
                PDO::ATTR_STATEMENT_CLASS,
                [__NAMESPACE__ . '\\' . self::PDO_STATEMENT_CLASS, [$this]]
            );

            $this->isConnected = true;
        }
    }
491479
public function setDatabase($database)
    {
        $this->_options[ConnectionOptions::OPTION_DATABASE] = $database;
        $this->_database                                    = $database;

        $this->updateHttpHeader();
    }
1195530
protected function setConnectionOptions() {
        $options = $this->sessionVars;
        //$options['time_zone'] = date_default_timezone_get();      // synchronize connection timezone with PHP timezone

        foreach ($options as $option => $value) {
            if (strlen($value)) {
                $this->execute('set '.$option.' to '.$value);       // as is (no quoting)
            }
        }
        return $this;
    }