public function removeFriendship(DataObject $relationship) {
		if ($relationship && $relationship->canDelete()) {
			
			// need to remove this user from the 'other's followers group and friends group
			// if needbe
			if ($relationship->Status == 'Approved') {
				$reciprocal = $relationship->reciprocal();
				if ($reciprocal) {
					// set it back to pending
					$reciprocal->Status = 'Pending';
					$reciprocal->write();
				}
				
				$friends = $relationship->Other()->getGroupFor(MicroBlogMember::FRIENDS);
				$relationship->Initiator()->Groups()->remove($friends);
				
				$friends = $relationship->Initiator()->getGroupFor(MicroBlogMember::FRIENDS);
				$relationship->Other()->Groups()->remove($friends);
			}
			
			$followers = $relationship->Other()->getGroupFor(MicroBlogMember::FOLLOWERS);
			$relationship->Initiator()->Groups()->remove($followers);
			
			$relationship->delete();
			return $relationship;
		}
	}
public function removeFriendship(DataObject $relationship) {
		if ($relationship && $relationship->canDelete()) {
			
			// need to remove this user from the 'other's followers group and friends group
			// if needbe
			if ($relationship->Status == 'Approved') {
				$reciprocal = $relationship->reciprocal();
				if ($reciprocal) {
					// set it back to pending
					$reciprocal->Status = 'Pending';
					$reciprocal->write();
				}
				
				$friends = $relationship->Other()->getGroupFor(MicroBlogMember::FRIENDS);
				$relationship->Initiator()->Groups()->remove($friends);
				
				$friends = $relationship->Initiator()->getGroupFor(MicroBlogMember::FRIENDS);
				$relationship->Other()->Groups()->remove($friends);
			}
			
			$followers = $relationship->Other()->getGroupFor(MicroBlogMember::FOLLOWERS);
			$relationship->Initiator()->Groups()->remove($followers);
			
			$relationship->delete();
			return $relationship;
		}
	}
public function removeFriendship ( DataObject $ relationship ) { if ( $ relationship && $ relationship -> canDelete ( ) ) { // need to remove this user from the 'other's followers group and friends group // if needbe if ( $ relationship -> Status == 'Approved' ) { $ reciprocal = $ relationship -> reciprocal ( ) ; if ( $ reciprocal ) { // set it back to pending $ reciprocal -> Status = 'Pending' ; $ reciprocal -> write ( ) ; } $ friends = $ relationship -> Other ( ) -> getGroupFor ( MicroBlogMember :: FRIENDS ) ; $ relationship -> Initiator ( ) -> Groups ( ) -> remove ( $ friends ) ; $ friends = $ relationship -> Initiator ( ) -> getGroupFor ( MicroBlogMember :: FRIENDS ) ; $ relationship -> Other ( ) -> Groups ( ) -> remove ( $ friends ) ; } $ followers = $ relationship -> Other ( ) -> getGroupFor ( MicroBlogMember :: FOLLOWERS ) ; $ relationship -> Initiator ( ) -> Groups ( ) -> remove ( $ followers ) ; $ relationship -> delete ( ) ; return $ relationship ; } }
Remove a friendship object
@param DataObject $relationship
Remove a friendship object