src/Flipbox/OrmManager/BothRelations/ManyToMany.php
protected function setConnectedRelationOptions()
    {
        $pivotTable = $this->defaultOptions['pivot_table'];
        $foreignKey = $this->defaultOptions['foreign_key'];
        $relatedKey = $this->defaultOptions['related_key'];

        if (! $this->db->isTableExists($pivotTable)) {
            $question = "Can't find table {$this->text['pivot_table']} in the database as {$this->text['pivot_text']}, choice one!";
            $pivotTable = $this->options['pivot_table'] = $this->command->choice(
                $question, $this->getTables());

            $this->text['pivot_table'] = "[".$this->command->paintString($pivotTable, 'green')."]";
        }

        if (! $this->db->isFieldExists($pivotTable, $foreignKey)) {
            $question = "Can't find field {$this->text['foreign_key']} in the table {$this->text['pivot_table']} as {$this->text['foreign_text']} of table {$this->text['table']}, choice one!";
            $this->options['foreign_key'] = $this->command->choice($question, $this->getFields($pivotTable));
        }

        if (! $this->db->isFieldExists($pivotTable, $relatedKey)) {
            $question = "Can't find field {$this->text['related_key']} in the table {$this->text['pivot_table']} as {$this->text['related_text']} of table {$this->text['to_table']}, choice one!";
            $this->options['related_key'] = $this->command->choice($question, $this->getFields($pivotTable));
        }
    }
protected function setConnectedRelationOptions()
    {
        $pivotTable = $this->defaultOptions['pivot_table'];
        $foreignKey = $this->defaultOptions['foreign_key'];
        $relatedKey = $this->defaultOptions['related_key'];

        if (! $this->db->isTableExists($pivotTable)) {
            $question = "Can't find table {$this->text['pivot_table']} in the database as {$this->text['pivot_text']}, choice one!";
            $pivotTable = $this->options['pivot_table'] = $this->command->choice(
                $question, $this->getTables());

            $this->text['pivot_table'] = "[".$this->command->paintString($pivotTable, 'green')."]";
        }

        if (! $this->db->isFieldExists($pivotTable, $foreignKey)) {
            $question = "Can't find field {$this->text['foreign_key']} in the table {$this->text['pivot_table']} as {$this->text['foreign_text']} of table {$this->text['table']}, choice one!";
            $this->options['foreign_key'] = $this->command->choice($question, $this->getFields($pivotTable));
        }

        if (! $this->db->isFieldExists($pivotTable, $relatedKey)) {
            $question = "Can't find field {$this->text['related_key']} in the table {$this->text['pivot_table']} as {$this->text['related_text']} of table {$this->text['to_table']}, choice one!";
            $this->options['related_key'] = $this->command->choice($question, $this->getFields($pivotTable));
        }
    }
protected function setConnectedRelationOptions ( ) { $ pivotTable = $ this -> defaultOptions [ 'pivot_table' ] ; $ foreignKey = $ this -> defaultOptions [ 'foreign_key' ] ; $ relatedKey = $ this -> defaultOptions [ 'related_key' ] ; if ( ! $ this -> db -> isTableExists ( $ pivotTable ) ) { $ question = "Can't find table {$this->text['pivot_table']} in the database as {$this->text['pivot_text']}, choice one!" ; $ pivotTable = $ this -> options [ 'pivot_table' ] = $ this -> command -> choice ( $ question , $ this -> getTables ( ) ) ; $ this -> text [ 'pivot_table' ] = "[" . $ this -> command -> paintString ( $ pivotTable , 'green' ) . "]" ; } if ( ! $ this -> db -> isFieldExists ( $ pivotTable , $ foreignKey ) ) { $ question = "Can't find field {$this->text['foreign_key']} in the table {$this->text['pivot_table']} as {$this->text['foreign_text']} of table {$this->text['table']}, choice one!" ; $ this -> options [ 'foreign_key' ] = $ this -> command -> choice ( $ question , $ this -> getFields ( $ pivotTable ) ) ; } if ( ! $ this -> db -> isFieldExists ( $ pivotTable , $ relatedKey ) ) { $ question = "Can't find field {$this->text['related_key']} in the table {$this->text['pivot_table']} as {$this->text['related_text']} of table {$this->text['to_table']}, choice one!" ; $ this -> options [ 'related_key' ] = $ this -> command -> choice ( $ question , $ this -> getFields ( $ pivotTable ) ) ; } }
get connected db relation options

@return void
get connected db relation options