private function _getJunctionTableColumns($relationName, $model)
    {
        $junctionTableColumns = [];
        if (array_key_exists($relationName, $this->_relationsExtraColumns)) {
            if (is_callable($this->_relationsExtraColumns[$relationName])) {
                $junctionTableColumns = $this->_relationsExtraColumns[$relationName]($model);
            } elseif (is_array($this->_relationsExtraColumns[$relationName])) {
                $junctionTableColumns = $this->_relationsExtraColumns[$relationName];
            }
            if (!is_array($junctionTableColumns)) {
                throw new RuntimeException(
                    'Junction table columns definition must return an array, got ' . gettype($junctionTableColumns)
                );
            }
        }
        return $junctionTableColumns;
    }
private function _getJunctionTableColumns($relationName, $model)
    {
        $junctionTableColumns = [];
        if (array_key_exists($relationName, $this->_relationsExtraColumns)) {
            if (is_callable($this->_relationsExtraColumns[$relationName])) {
                $junctionTableColumns = $this->_relationsExtraColumns[$relationName]($model);
            } elseif (is_array($this->_relationsExtraColumns[$relationName])) {
                $junctionTableColumns = $this->_relationsExtraColumns[$relationName];
            }
            if (!is_array($junctionTableColumns)) {
                throw new RuntimeException(
                    'Junction table columns definition must return an array, got ' . gettype($junctionTableColumns)
                );
            }
        }
        return $junctionTableColumns;
    }
private function _getJunctionTableColumns ( $ relationName , $ model ) { $ junctionTableColumns = [ ] ; if ( array_key_exists ( $ relationName , $ this -> _relationsExtraColumns ) ) { if ( is_callable ( $ this -> _relationsExtraColumns [ $ relationName ] ) ) { $ junctionTableColumns = $ this -> _relationsExtraColumns [ $ relationName ] ( $ model ) ; } elseif ( is_array ( $ this -> _relationsExtraColumns [ $ relationName ] ) ) { $ junctionTableColumns = $ this -> _relationsExtraColumns [ $ relationName ] ; } if ( ! is_array ( $ junctionTableColumns ) ) { throw new RuntimeException ( 'Junction table columns definition must return an array, got ' . gettype ( $ junctionTableColumns ) ) ; } } return $ junctionTableColumns ; }
Return array of columns to save to the junction table for a related model having a many-to-many relation.
@param string $relationName
@param BaseActiveRecord $model
@return array
@throws \RuntimeException
Return array of columns to save to the junction table for a related model having a many - to - many relation .