protected static function buildOppositeRelation($relation)
    {
        if (!$relation) {
            return null;
        }
        $opposite = static::buildRelation($relation->recipient, $relation->initiator);
        if ($relation->relationType == static::$relationSingle) {
            $opposite->relationType = static::$relationSingle;
        } elseif ($relation->relationType == static::$relationMutual) {
            $opposite->setMutualType($relation->getMutualType());
        }
        return $opposite;
    }
protected static function buildOppositeRelation($relation)
    {
        if (!$relation) {
            return null;
        }
        $opposite = static::buildRelation($relation->recipient, $relation->initiator);
        if ($relation->relationType == static::$relationSingle) {
            $opposite->relationType = static::$relationSingle;
        } elseif ($relation->relationType == static::$relationMutual) {
            $opposite->setMutualType($relation->getMutualType());
        }
        return $opposite;
    }
protected static function buildOppositeRelation ( $ relation ) { if ( ! $ relation ) { return null ; } $ opposite = static :: buildRelation ( $ relation -> recipient , $ relation -> initiator ) ; if ( $ relation -> relationType == static :: $ relationSingle ) { $ opposite -> relationType = static :: $ relationSingle ; } elseif ( $ relation -> relationType == static :: $ relationMutual ) { $ opposite -> setMutualType ( $ relation -> getMutualType ( ) ) ; } return $ opposite ; }
Build opposite relation throughout the current relation. The opposite
relation will be given if existed.
@param static $relation
@return static
Build opposite relation throughout the current relation . The opposite relation will be given if existed .