Actions

API17

Difference between revisions of "JArrayHelper::sortObjects"

From Joomla! Documentation

(Bulk upload by Doxiki2)
 
(Updated to r1448:247ba8d88526)
(One intermediate revision by one user not shown)
Line 8: Line 8:
 
<nowiki>[</nowiki>[[Description:JArrayHelper::sortObjects|Edit Descripton]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[Description:JArrayHelper::sortObjects|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
</span>
===Since===
 
{{JVer|11.1 }}
 
===Synopsis===
 
 
<source lang="php">
 
<source lang="php">
public static JArrayHelper::sortObjects (&$a, $k, $direction=1, $casesensitive=true, $locale=false)
+
public static function sortObjects (
 +
        &$a
 +
        $k
 +
        $direction=1
 +
        $casesensitive=true
 +
        $locale=false
 +
)
 
</source>
 
</source>
 
{| class="wikitable"
 
{| class="wikitable"
Line 39: Line 42:
 
|bool|array
 
|bool|array
 
|true
 
|true
|Let sort occur casesensitive or insensitive  
+
|Let sort occur case sensitive or insensitive  
 
|-
 
|-
 
|$locale
 
|$locale
Line 47: Line 50:
 
|-
 
|-
 
|}
 
|}
===Returns===
+
* '''Returns''' array The sorted array of objects
array The sorted array of objects
+
* '''Defined''' on line 294 of libraries/joomla/utilities/arrayhelper.php
===Defined in===
+
* '''Since''' {{JVer|11.1 }}
libraries/joomla/utilities/arrayhelper.php
+
===Referenced by===
+
 
===See also===
 
===See also===
 +
* {{JVer|11.1}} '''JArrayHelper::sortObjects source code''' on [[jplatform:utilities/arrayhelper.php#cl-286|BitBucket]]
 +
* {{JVer|11.1}} Class [[JArrayHelper/11.1|JArrayHelper]]
 +
* {{JVer|11.1}} Subpackage [[Subpackage_Utilities/11.1|Utilities]]
 +
* [[JArrayHelper::sortObjects|Other versions of JArrayHelper::sortObjects]]
 +
{{SeeAlso:JArrayHelper::sortObjects}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JArrayHelper::sortObjects|Edit See Also]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[SeeAlso:JArrayHelper::sortObjects|Edit See Also]]<nowiki>]</nowiki>
 
</span>
 
</span>
* [[JArrayHelper/11.1|JArrayHelper]]
+
===User contributed notes===
* [[JArrayHelper::sortObjects|Other versions of this method]]
+
{{SeeAlso:JArrayHelper::sortObjects}}
+
===Examples===
+
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 67: Line 70:
 
category=MethodExample
 
category=MethodExample
 
include=*
 
include=*
 +
namespace=CodeExample
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
 
<noinclude>[[Category:JArrayHelper]][[Category:JArrayHelper::sortObjects]]</noinclude>
 
<noinclude>[[Category:JArrayHelper]][[Category:JArrayHelper::sortObjects]]</noinclude>

Revision as of 19:10, 27 April 2011

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Joomla 11.1 JArrayHelper::sortObjects

Description

Utility function to sort an array of objects on a given field.

Description:JArrayHelper::sortObjects [Edit Descripton]

public static function sortObjects (
        &$a
        $k
        $direction=1
        $casesensitive=true
        $locale=false
)
Parameter Type Default Description
&$a array $arr An array of objects
$k array The key or a array of key to sort on
$direction array 1 Direction or an array of direction to sort in [1 = Ascending] [-1 = Descending]
$casesensitive array true Let sort occur case sensitive or insensitive
$locale array false Let sort occur using the locale language or not
  • Returns array The sorted array of objects
  • Defined on line 294 of libraries/joomla/utilities/arrayhelper.php
  • Since Joomla 11.1

See also

SeeAlso:JArrayHelper::sortObjects [Edit See Also]

User contributed notes

<CodeExamplesForm />