original_string: private function applyOrdering()
      {
          if (empty($this->menu)
              || $this->orderingApplied
          ) {
              return;
          }
  
          uasort($this->menu, array($this, 'menuCompare'));
          foreach ($this->menu as $key => &$element) {
              if (is_null($element)) {
                  unset($this->menu[$key]);
              } elseif ($element['_hasSubmenu']) {
                  uasort($element, array($this, 'menuCompare'));
              }
          }
  
          $this->orderingApplied = true;
      }
code: private function applyOrdering()
      {
          if (empty($this->menu)
              || $this->orderingApplied
          ) {
              return;
          }
  
          uasort($this->menu, array($this, 'menuCompare'));
          foreach ($this->menu as $key => &$element) {
              if (is_null($element)) {
                  unset($this->menu[$key]);
              } elseif ($element['_hasSubmenu']) {
                  uasort($element, array($this, 'menuCompare'));
              }
          }
  
          $this->orderingApplied = true;
      }
code_tokens: private function applyOrdering ( ) { if ( empty ( $ this -> menu ) || $ this -> orderingApplied ) { return ; } uasort ( $ this -> menu , array ( $ this , 'menuCompare' ) ) ; foreach ( $ this -> menu as $ key => & $ element ) { if ( is_null ( $ element ) ) { unset ( $ this -> menu [ $ key ] ) ; } elseif ( $ element [ '_hasSubmenu' ] ) { uasort ( $ element , array ( $ this , 'menuCompare' ) ) ; } } $ this -> orderingApplied = true ; }
docstring: Orders the menu according to their order.
docstring_tokens: Orders the menu according to their order .