W3cubDocs

/Drupal 8

class SortArray

Provides generic array sorting helper methods.

Hierarchy

Related topics

Utility classes and functions
Overview of utility classes and functions for developers.

File

core/lib/Drupal/Component/Utility/SortArray.php, line 10

Namespace

Drupal\Component\Utility

Members

Name Modifiers Type Description
SortArray::sortByKeyInt public static function Sorts an integer array item by an arbitrary key.
SortArray::sortByKeyString public static function Sorts a string array item by an arbitrary key.
SortArray::sortByTitleElement public static function Sorts a structured array by 'title' key (no # prefix).
SortArray::sortByTitleProperty public static function Sorts a structured array by '#title' property.
SortArray::sortByWeightElement public static function Sorts a structured array by the 'weight' element.
SortArray::sortByWeightProperty public static function Sorts a structured array by '#weight' property.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!SortArray.php/class/SortArray/8.1.x