original_string: protected function sortProperty($a, $b) {
      $property = $this->sortProperty;
      $parent = $this->sortParent;
      if (isset($parent)
          && (isset($a->$parent->$property) || isset($b->$parent->$property))) {
        if (!$this->sortCaseSensitive
            && is_string($a->$parent->$property)
            && is_string($b->$parent->$property)) {
          $aprop = strtoupper($a->$parent->$property);
          $bprop = strtoupper($b->$parent->$property);
          if ($aprop > $bprop) {
            return 1;
          }
          if ($aprop < $bprop) {
            return -1;
          }
        } else {
          if ($a->$parent->$property > $b->$parent->$property) {
            return 1;
          }
          if ($a->$parent->$property < $b->$parent->$property) {
            return -1;
          }
        }
      }
      // If they have the same parent, order them by their own property.
      if (!$this->sortCaseSensitive
          && is_string($a->$property)
          && is_string($b->$property)) {
        $aprop = strtoupper($a->$property);
        $bprop = strtoupper($b->$property);
        if ($aprop > $bprop) {
          return 1;
        }
        if ($aprop < $bprop) {
          return -1;
        }
      } else {
        if ($a->$property > $b->$property) {
          return 1;
        }
        if ($a->$property < $b->$property) {
          return -1;
        }
      }
      return 0;
    }
code: protected function sortProperty($a, $b) {
      $property = $this->sortProperty;
      $parent = $this->sortParent;
      if (isset($parent)
          && (isset($a->$parent->$property) || isset($b->$parent->$property))) {
        if (!$this->sortCaseSensitive
            && is_string($a->$parent->$property)
            && is_string($b->$parent->$property)) {
          $aprop = strtoupper($a->$parent->$property);
          $bprop = strtoupper($b->$parent->$property);
          if ($aprop > $bprop) {
            return 1;
          }
          if ($aprop < $bprop) {
            return -1;
          }
        } else {
          if ($a->$parent->$property > $b->$parent->$property) {
            return 1;
          }
          if ($a->$parent->$property < $b->$parent->$property) {
            return -1;
          }
        }
      }
      // If they have the same parent, order them by their own property.
      if (!$this->sortCaseSensitive
          && is_string($a->$property)
          && is_string($b->$property)) {
        $aprop = strtoupper($a->$property);
        $bprop = strtoupper($b->$property);
        if ($aprop > $bprop) {
          return 1;
        }
        if ($aprop < $bprop) {
          return -1;
        }
      } else {
        if ($a->$property > $b->$property) {
          return 1;
        }
        if ($a->$property < $b->$property) {
          return -1;
        }
      }
      return 0;
    }
code_tokens: protected function sortProperty ( $ a , $ b ) { $ property = $ this -> sortProperty ; $ parent = $ this -> sortParent ; if ( isset ( $ parent ) && ( isset ( $ a -> $ parent -> $ property ) || isset ( $ b -> $ parent -> $ property ) ) ) { if ( ! $ this -> sortCaseSensitive && is_string ( $ a -> $ parent -> $ property ) && is_string ( $ b -> $ parent -> $ property ) ) { $ aprop = strtoupper ( $ a -> $ parent -> $ property ) ; $ bprop = strtoupper ( $ b -> $ parent -> $ property ) ; if ( $ aprop > $ bprop ) { return 1 ; } if ( $ aprop < $ bprop ) { return - 1 ; } } else { if ( $ a -> $ parent -> $ property > $ b -> $ parent -> $ property ) { return 1 ; } if ( $ a -> $ parent -> $ property < $ b -> $ parent -> $ property ) { return - 1 ; } } } // If they have the same parent, order them by their own property. if ( ! $ this -> sortCaseSensitive && is_string ( $ a -> $ property ) && is_string ( $ b -> $ property ) ) { $ aprop = strtoupper ( $ a -> $ property ) ; $ bprop = strtoupper ( $ b -> $ property ) ; if ( $ aprop > $ bprop ) { return 1 ; } if ( $ aprop < $ bprop ) { return - 1 ; } } else { if ( $ a -> $ property > $ b -> $ property ) { return 1 ; } if ( $ a -> $ property < $ b -> $ property ) { return - 1 ; } } return 0 ; }
docstring: Determine the sort order between two entities.
  
  @param Entity $a Entity A.
  @param Entity $b Entity B.
  @return int Sort order.
  @access protected
docstring_tokens: Determine the sort order between two entities .