示例#1
0
 /**
  * Checks to see if the first data point has a datetime before, after or equal to the second data point.
  *
  * @param TwlDataPoint $dataPoint1 The first point to compare.
  * @param TwlDataPoint $dataPoint2 The second point to compare.
  *
  * @return int -1 if DP1<DP2, 0 if DP1=DP2, 1 if DP1>DP2.
  */
 public static final function compareDataPointTime(TwlDataPoint $dataPoint1, TwlDataPoint $dataPoint2)
 {
     if ($dataPoint1->getTimestamp() < $dataPoint2->getTimestamp()) {
         return -1;
     } elseif ($dataPoint1->getTimestamp() > $dataPoint2->getTimestamp()) {
         return 1;
     } else {
         return 0;
     }
 }