Esempio n. 1
0
 private static function compareGatewayEntryPoints(RequestGatewayEntryPoint $rgepFirst, RequestGatewayEntryPoint $rgepSecond)
 {
     $nReturnValue = 0;
     // returns >0 if rgepFirst greater than rgepSecond
     // returns 0 if they are equal
     // returns <0 if rgepFirst less than rgepSecond
     // both null, then they are the same
     if ($rgepFirst == null && $rgepSecond == null) {
         $nReturnValue = 0;
     } elseif ($rgepFirst == null && $rgepSecond != null) {
         $nReturnValue = 1;
     } elseif ($rgepFirst != null && $rgepSecond == null) {
         $nReturnValue = -1;
     } elseif ($rgepFirst->getMetric() == $rgepSecond->getMetric()) {
         $nReturnValue = 0;
     } elseif ($rgepFirst->getMetric() < $rgepSecond->getMetric()) {
         $nReturnValue = -1;
     } elseif ($rgepFirst->getMetric() > $rgepSecond->getMetric()) {
         $nReturnValue = 1;
     }
     return $nReturnValue;
 }
Esempio n. 2
0
	   	private static function compareGatewayEntryPoints(RequestGatewayEntryPoint $rgepFirst, RequestGatewayEntryPoint $rgepSecond)
	   	{
			$nReturnValue = 0;
	      	// returns >0 if rgepFirst greater than rgepSecond
	      	// returns 0 if they are equal
	      	// returns <0 if rgepFirst less than rgepSecond
	      
	      	// both null, then they are the same
	      	if ($rgepFirst == null &&
	          	$rgepSecond == null)
	   		{
	        	$nReturnValue = 0;
	        }
	      	// just first null? then second is greater
	      	elseif ($rgepFirst == null &&
		    		$rgepSecond != null)
	      	{
	        	$nReturnValue = 1;
	        }
	      	// just second null? then first is greater
	      	elseif ($rgepFirst != null  && $rgepSecond == null)
	      	{
	        	$nReturnValue = -1;
	        }
	      	// can now assume that first & second both have a value
	      	elseif ($rgepFirst->getMetric() == $rgepSecond->getMetric())
	        {
	        	$nReturnValue = 0;
	        }
	      	elseif ($rgepFirst->getMetric() < $rgepSecond->getMetric())
	        {
	        	$nReturnValue = -1;
	        }
	      	elseif ($rgepFirst->getMetric() > $rgepSecond->getMetric())
		    {
				$nReturnValue = 1;
	  	    }

	      	return $nReturnValue;
	   	}