You are here

public static function PHPExcel_Cell::compareCells in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php \PHPExcel_Cell::compareCells()

* Compare 2 cells * *

Parameters

PHPExcel_Cell $a Cell a: * @param PHPExcel_Cell $b Cell b * @return int Result of comparison (always -1 or 1, never zero!)

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php, line 917

Class

PHPExcel_Cell
PHPExcel_Cell

Code

public static function compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b) {
  if ($a
    ->getRow() < $b
    ->getRow()) {
    return -1;
  }
  elseif ($a
    ->getRow() > $b
    ->getRow()) {
    return 1;
  }
  elseif (self::columnIndexFromString($a
    ->getColumn()) < self::columnIndexFromString($b
    ->getColumn())) {
    return -1;
  }
  else {
    return 1;
  }
}