private function _unsetRelation(array $configRelation, $callArgs)
    {
        $isDeleted = false;
        switch ($configRelation['typeRelation']) {
            case self::MANY_TO_MANY:
                // assure that we provide an array of relation to unset
                if (!is_array($callArgs[0])) {
                    $callArgs[0] = array($callArgs[0]);
                }
                foreach ($callArgs[0] as $oneRelationModel) {
                    // build delete query for this relationship
                    $query = new InternalQueryHelper();
                    $query->delete($configRelation['relationTable'])
                          ->where($configRelation['sourceField'], '=', '?')
                          ->where($configRelation['targetField'], '=', '?');

                    $query = static::$_dataSource->prepare($query->buildQuery());

                    $query->execute(
                          array(
                              $this->{$configRelation['sourceField']},
                              $oneRelationModel->{$configRelation['targetField']}
                          )
                    );
                }
                $isDeleted = true;
                break;
        }

        return $isDeleted;
    }
private function _unsetRelation(array $configRelation, $callArgs)
    {
        $isDeleted = false;
        switch ($configRelation['typeRelation']) {
            case self::MANY_TO_MANY:
                // assure that we provide an array of relation to unset
                if (!is_array($callArgs[0])) {
                    $callArgs[0] = array($callArgs[0]);
                }
                foreach ($callArgs[0] as $oneRelationModel) {
                    // build delete query for this relationship
                    $query = new InternalQueryHelper();
                    $query->delete($configRelation['relationTable'])
                          ->where($configRelation['sourceField'], '=', '?')
                          ->where($configRelation['targetField'], '=', '?');

                    $query = static::$_dataSource->prepare($query->buildQuery());

                    $query->execute(
                          array(
                              $this->{$configRelation['sourceField']},
                              $oneRelationModel->{$configRelation['targetField']}
                          )
                    );
                }
                $isDeleted = true;
                break;
        }

        return $isDeleted;
    }
private function _unsetRelation ( array $ configRelation , $ callArgs ) { $ isDeleted = false ; switch ( $ configRelation [ 'typeRelation' ] ) { case self :: MANY_TO_MANY : // assure that we provide an array of relation to unset if ( ! is_array ( $ callArgs [ 0 ] ) ) { $ callArgs [ 0 ] = array ( $ callArgs [ 0 ] ) ; } foreach ( $ callArgs [ 0 ] as $ oneRelationModel ) { // build delete query for this relationship $ query = new InternalQueryHelper ( ) ; $ query -> delete ( $ configRelation [ 'relationTable' ] ) -> where ( $ configRelation [ 'sourceField' ] , '=' , '?' ) -> where ( $ configRelation [ 'targetField' ] , '=' , '?' ) ; $ query = static :: $ _dataSource -> prepare ( $ query -> buildQuery ( ) ) ; $ query -> execute ( array ( $ this -> { $ configRelation [ 'sourceField' ] } , $ oneRelationModel -> { $ configRelation [ 'targetField' ] } ) ) ; } $ isDeleted = true ; break ; } return $ isDeleted ; }
Unset a relation value from magic setter

@param array $configRelation - Relation configuration
@param array $callArgs       - Models instance

@todo unset other relations type
@return bool
Unset a relation value from magic setter