public function addViaIds($ids, $defaultData = [])
    {
        if (!$ids) {
            return true;
        }
        foreach ($ids as $key => $id) {
            $id = is_array($id)
                ? $id
                : [reset($this->relationAttribute) => $id];
            $ids[$key] = array_merge($id, $this->condition, $defaultData);
        }
        MigrationHelper::insertUpdate($this->viaTable, array_keys(reset($ids)), $ids);
    }
public function addViaIds($ids, $defaultData = [])
    {
        if (!$ids) {
            return true;
        }
        foreach ($ids as $key => $id) {
            $id = is_array($id)
                ? $id
                : [reset($this->relationAttribute) => $id];
            $ids[$key] = array_merge($id, $this->condition, $defaultData);
        }
        MigrationHelper::insertUpdate($this->viaTable, array_keys(reset($ids)), $ids);
    }
public function addViaIds ( $ ids , $ defaultData = [ ] ) { if ( ! $ ids ) { return true ; } foreach ( $ ids as $ key => $ id ) { $ id = is_array ( $ id ) ? $ id : [ reset ( $ this -> relationAttribute ) => $ id ] ; $ ids [ $ key ] = array_merge ( $ id , $ this -> condition , $ defaultData ) ; } MigrationHelper :: insertUpdate ( $ this -> viaTable , array_keys ( reset ( $ ids ) ) , $ ids ) ; }
Adds relation data
@param $ids
@param array $defaultData
@return bool
Adds relation data