Joomla CMS
3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
|
Fonctions membres publiques statiques | |
static | toInteger ($array, $default=null) |
static | toObject (array $array, $class='stdClass', $recursive=true) |
static | toString (array $array, $innerGlue='=', $outerGlue=' ', $keepOuterKey=false) |
static | fromObject ($source, $recurse=true, $regex=null) |
static | addColumn (array $array, array $column, $colName, $keyCol=null) |
static | dropColumn (array $array, $colName) |
static | getColumn (array $array, $valueCol, $keyCol=null) |
static | getValue ($array, $name, $default=null, $type='') |
static | invert (array $array) |
static | isAssociative ($array) |
static | pivot (array $source, $key=null) |
static | sortObjects (array $a, $k, $direction=1, $caseSensitive=true, $locale=false) |
static | arrayUnique (array $array) |
static | arraySearch ($needle, array $haystack, $caseSensitive=true) |
static | flatten ($array, $separator='.', $prefix='') |
Fonctions membres privées | |
__construct () | |
Fonctions membres privées statiques | |
static | arrayFromObject ($item, $recurse, $regex) |
ArrayHelper is an array utility class for doing all sorts of odds and ends with arrays.
|
private |
Private constructor to prevent instantiation of this class
|
static |
Adds a column to an array of arrays or objects
array | $array | The source array |
array | $column | The array to be used as new column |
string | $colName | The index of the new column or name of the new object property |
string | $keyCol | The index of the column or name of object property to be used for mapping with the new column |
|
staticprivate |
Utility function to map an object or array to an array
mixed | $item | The source object or array |
boolean | $recurse | True to recurse through multi-level objects |
string | $regex | An optional regular expression to match on field names |
Références $item.
|
static |
An improved array_search that allows for partial matching of strings values in associative arrays.
string | $needle | The text to search for within the array. |
array | $haystack | Associative array to search in to find $needle. |
boolean | $caseSensitive | True to search case sensitive, false otherwise. |
|
static |
Multidimensional array safe unique test
array | $array | The array to make unique. |
|
static |
Remove a column from an array of arrays or objects
array | $array | The source array |
string | $colName | The index of the column or name of object property to be removed |
Références $i, $item, et elseif.
Référencé par PlgPrivacyUser\createNotesDomain().
|
static |
Method to recursively convert data to a one dimension array.
array | object | $array | The array or object to convert. |
string | $separator | The key separator. |
string | $prefix | Last level key prefix. |
Références $key, $prefix, $separator, et elseif.
Utility function to map an object to an array
object | $source | The source object |
boolean | $recurse | True to recurse through multi-level objects |
string | $regex | An optional regular expression to match on field names |
Référencé par AssociationExtensionHelper\getAssociationList(), et BaseDatabaseModel\loadHistory().
|
static |
Extracts a column from an array of arrays or objects
array | $array | The source array |
string | $valueCol | The index of the column or name of object property to be used as value It may also be NULL to return complete arrays or objects (this is useful together with $keyCol to reindex the array). |
string | $keyCol | The index of the column or name of object property to be used as key |
Références $item, $key, $subject, et $value.
Référencé par JAdminCssMenu\check().
|
static |
Utility function to return a value from a named array or a specified default
array | \ArrayAccess | $array | A named array or object that implements ArrayAccess |
string | $name | The key to search for (this can be an array index or a dot separated key sequence as in Registry) |
mixed | $default | The default value to give if no key found |
string | $type | Return type for the variable (INT, FLOAT, STRING, WORD, BOOLEAN, ARRAY) |
Références $default, $name, $type, elseif, et null.
Référencé par NewsfeedsControllerNewsfeed\allowAdd(), AdminModel\batch(), UsersModelUser\batch(), User\bind(), UsersControllerUsers\changeBlock(), JHtmlContentAdministrator\featured(), ModulesModelModule\getForm(), ConfigModelForm\loadForm(), FormModel\loadForm(), ListModel\loadForm(), PlgUserTerms\onUserAfterSave(), PlgUserTerms\onUserBeforeSave(), InstallerControllerUpdatesites\publish(), AdminController\publish(), MenusControllerItems\publish(), MenusControllerItems\setDefault(), et JHtmlMessages\status().
|
static |
Takes an associative array of arrays and inverts the array keys to values using the array values as keys.
Example: $input = array( 'New' => array('1000', '1500', '1750'), 'Used' => array('3000', '4000', '5000', '6000') ); $output = ArrayHelper::invert($input);
Output would be equal to: $output = array( '1000' => 'New', '1500' => 'New', '1750' => 'New', '3000' => 'Used', '4000' => 'Used', '5000' => 'Used', '6000' => 'Used' );
array | $array | The source array. |
|
static |
Method to determine if an array is an associative array.
array | $array | An array to test. |
Référencé par Form\bindLevel(), et Ini\objectToString().
|
static |
Pivots an array to create a reverse lookup of an array of scalars, arrays or objects.
array | $source | The source array. |
string | $key | Where the elements of the source array are objects or arrays, the key to pivot on. |
Références $counter, $key, $value, et elseif.
Référencé par LanguageHelper\getContentLanguages(), et LanguageHelper\getInstalledLanguages().
Utility function to sort an array of objects on a given field
array | $a | An array of objects |
mixed | $k | The key (string) or an array of keys to sort on |
mixed | $direction | Direction (integer) or an array of direction to sort in [1 = Ascending] [-1 = Descending] |
mixed | $caseSensitive | Boolean or array of booleans to let sort occur case sensitive or insensitive |
mixed | $locale | Boolean or array of booleans to let sort occur using the locale language or not |
Références $b, $count, $direction, $i, $key, et elseif.
Référencé par InstallerModel\_getList(), ModulesModelModules\_getList(), LanguageHelper\getContentLanguages(), LanguageHelper\getInstalledLanguages(), ModulesHelper\getModules(), JFormFieldComponentsCategory\getOptions(), JFormFieldComponents\getOptions(), JFormFieldConfigComponents\getOptions(), JFormFieldContentTypes\getOptions(), JHtmlModules\positions(), et JAdminCssMenu\preprocess().
|
static |
Function to convert array to integer values
array | $array | The source array to convert |
int | array | $default | A default value to assign if $array is not an array |
Référencé par RedirectModelLink\activate(), AdminModel\batch(), UsersModelUser\batch(), UsersModelUser\batchReset(), UsersModelUser\batchUser(), User\bind(), MenusModelMenu\delete(), ActionlogsModelActionlogs\delete(), RedirectModelLink\duplicateUrls(), Form\filterField(), Access\getGroupsByUser(), FinderModelSuggestions\getListQuery(), NewsfeedsModelNewsfeeds\getListQuery(), ActionlogsModelActionlogs\getLogDataQuery(), TagField\getOptions(), TagsHelper\getTagIds(), TagsHelper\getTagItemsQuery(), TagsHelper\getTagNames(), TagsHelper\getTypes(), Access\getUsersByGroup(), JHtmlTag\options(), UsersModelUsers\populateState(), TagsModelTag\populateState(), UsersTableNote\publish(), MessagesTableMessage\publish(), Extension\publish(), CoreContent\publish(), Nested\publish(), CategoriesModelCategory\save(), AdminModel\save(), MenusModelItem\save(), TagsHelper\searchTags(), UserHelper\setUserGroups(), JHtmlTag\tags(), et TagsHelper\unTagItem().
|
static |
Utility function to map an array to a stdClass object.
array | $array | The array to map. |
string | $class | Name of the class to create |
boolean | $recursive | Convert also any array inside the main array |
Références $class.
Référencé par InstallationModelFtp\detectFtpRoot(), ContentModelForm\getItem(), LanguagesModelLanguage\getItem(), MenusModelMenu\getItem(), TagsModelTag\getItem(), ModulesModelModule\getItem(), AdminModel\getItem(), InstallationModelConfiguration\setup(), et InstallationModelFtp\verifyFtpSettings().
|
static |
Utility function to map an array to a string.
array | $array | The array to map. |
string | $innerGlue | The glue (optional, defaults to '=') between the key and the value. |
string | $outerGlue | The glue (optional, defaults to ' ') between array elements. |
boolean | $keepOuterKey | True if final key should be kept. |
Références $item, $key, et $output.
Référencé par HeadRenderer\fetchHead(), HTMLHelper\iframe(), HTMLHelper\image(), HTMLHelper\link(), et JHtmlForm\token().