public function updateDBRelations($modelName, $structure) {
        if (empty($structure['relations'])) return true;

        foreach($structure['relations'] as $relationName => $relationInfo) {
            $info = ModelOperator::calculateRelationVariables($modelName, $relationName);
            switch($info['relationType']) {
                case 'many_to_many':
                    $this->updateManyTable($info);
                    break;
                case 'many_to_one':
                    break;
                case 'one_to_many':
                    break;
            }
        }
    }
public function updateDBRelations($modelName, $structure) {
        if (empty($structure['relations'])) return true;

        foreach($structure['relations'] as $relationName => $relationInfo) {
            $info = ModelOperator::calculateRelationVariables($modelName, $relationName);
            switch($info['relationType']) {
                case 'many_to_many':
                    $this->updateManyTable($info);
                    break;
                case 'many_to_one':
                    break;
                case 'one_to_many':
                    break;
            }
        }
    }
public function updateDBRelations ( $ modelName , $ structure ) { if ( empty ( $ structure [ 'relations' ] ) ) return true ; foreach ( $ structure [ 'relations' ] as $ relationName => $ relationInfo ) { $ info = ModelOperator :: calculateRelationVariables ( $ modelName , $ relationName ) ; switch ( $ info [ 'relationType' ] ) { case 'many_to_many' : $ this -> updateManyTable ( $ info ) ; break ; case 'many_to_one' : break ; case 'one_to_many' : break ; } } }
Updates relations in database
@param string $modelName
@param mixed $structure
@throws \Exception
Updates relations in database