protected function sort($order)
    {
        $ordered = [];

        $matrix = [
            'label'     => 'getLabels',
            'component' => 'getComponents',
            'message'   => 'getMessage',
        ];

        foreach ($order as $identifier) {
            $components = $this->{$matrix[$identifier]}();
            foreach ($components as $component) {
                $index                              = count($ordered);
                $this->indexReverse[$identifier][0] = $index;
                $this->index[$index]                = $identifier;
                $ordered[]                          = $component;
            }
        }

        return $ordered;
    }
protected function sort($order)
    {
        $ordered = [];

        $matrix = [
            'label'     => 'getLabels',
            'component' => 'getComponents',
            'message'   => 'getMessage',
        ];

        foreach ($order as $identifier) {
            $components = $this->{$matrix[$identifier]}();
            foreach ($components as $component) {
                $index                              = count($ordered);
                $this->indexReverse[$identifier][0] = $index;
                $this->index[$index]                = $identifier;
                $ordered[]                          = $component;
            }
        }

        return $ordered;
    }
protected function sort ( $ order ) { $ ordered = [ ] ; $ matrix = [ 'label' => 'getLabels' , 'component' => 'getComponents' , 'message' => 'getMessage' , ] ; foreach ( $ order as $ identifier ) { $ components = $ this -> { $ matrix [ $ identifier ] } ( ) ; foreach ( $ components as $ component ) { $ index = count ( $ ordered ) ; $ this -> indexReverse [ $ identifier ] [ 0 ] = $ index ; $ this -> index [ $ index ] = $ identifier ; $ ordered [ ] = $ component ; } } return $ ordered ; }
Sorts an array by passed order.

@param array $order The order of the components

@author Benjamin Carl <opensource@clickalicious.de>

@return array The ordered result
Sorts an array by passed order .