protected function getTableForeignKeys(): array
    {
        $data = [];

        $fks = $this->db->schema->getTableForeignKeys($this->tableName, true);

        /* @var $fk ForeignKeyConstraint */
        foreach ($fks as $fk) {
            $data[$fk->name] = new TableForeignKey([
                'name' => $fk->name,
                'columns' => $fk->columnNames,
                'refTable' => $fk->foreignTableName,
                'refColumns' => $fk->foreignColumnNames,
                'onDelete' => $fk->onDelete,
                'onUpdate' => $fk->onUpdate,
            ]);
        }

        return $data;
    }
protected function getTableForeignKeys(): array
    {
        $data = [];

        $fks = $this->db->schema->getTableForeignKeys($this->tableName, true);

        /* @var $fk ForeignKeyConstraint */
        foreach ($fks as $fk) {
            $data[$fk->name] = new TableForeignKey([
                'name' => $fk->name,
                'columns' => $fk->columnNames,
                'refTable' => $fk->foreignTableName,
                'refColumns' => $fk->foreignColumnNames,
                'onDelete' => $fk->onDelete,
                'onUpdate' => $fk->onUpdate,
            ]);
        }

        return $data;
    }
protected function getTableForeignKeys ( ) : array { $ data = [ ] ; $ fks = $ this -> db -> schema -> getTableForeignKeys ( $ this -> tableName , true ) ; /* @var $fk ForeignKeyConstraint */ foreach ( $ fks as $ fk ) { $ data [ $ fk -> name ] = new TableForeignKey ( [ 'name' => $ fk -> name , 'columns' => $ fk -> columnNames , 'refTable' => $ fk -> foreignTableName , 'refColumns' => $ fk -> foreignColumnNames , 'onDelete' => $ fk -> onDelete , 'onUpdate' => $ fk -> onUpdate , ] ) ; } return $ data ; }
Returns foreign keys structure.
@return TableForeignKey[]
Returns foreign keys structure .