interface Comparable

Comparable interface that allows to compare two value objects to each other for similarity.

@license http://www.opensource.org/licenses/lgpl-license.php LGPL @link www.doctrine-project.com @since 2.2 @author Benjamin Eberlei <kontakt@beberlei.de> @author Guilherme Blanco <guilhermeblanco@hotmail.com>

Hierarchy

Expanded class hierarchy of Comparable

All classes that implement Comparable

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php, line 32

Namespace

Doctrine\Common
View source
interface Comparable {

  /**
   * Compare the current object to the passed $other.
   *
   * Returns 0 if they are semantically equal, 1 if the other object
   * is less than the current one, or -1 if its more than the current one.
   *
   * This method should not check for identity using ===, only for semantical equality for example
   * when two different DateTime instances point to the exact same Date + TZ.
   *
   * @param mixed $other
   *
   * @return int
   */
  public function compareTo($other);

}

Members

Namesort descending Modifiers Type Description Overrides
Comparable::compareTo public function Compare the current object to the passed $other.