Comparable.php 717 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Doctrine\Common;
  3. /**
  4. * Comparable interface that allows to compare two value objects to each other for similarity.
  5. *
  6. * @link www.doctrine-project.org
  7. */
  8. interface Comparable
  9. {
  10. /**
  11. * Compares the current object to the passed $other.
  12. *
  13. * Returns 0 if they are semantically equal, 1 if the other object
  14. * is less than the current one, or -1 if its more than the current one.
  15. *
  16. * This method should not check for identity using ===, only for semantical equality for example
  17. * when two different DateTime instances point to the exact same Date + TZ.
  18. *
  19. * @param mixed $other
  20. *
  21. * @return int
  22. */
  23. public function compareTo($other);
  24. }