Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
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='') |
static | mergeRecursive (... $args) |
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 |
|
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, $result, 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, $result, $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 ExecRuleHelper\__construct(), AssociationExtensionHelper\getAssociationList(), ApplicationModel\getData(), ItemlanguageField\getOptions(), RemindModel\processRemindRequest(), ApplicationModel\removeroot(), ApplicationModel\save(), et DatabaseHelper\validateConnectionParameters().
|
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érencé par TagField\getOptions(), ArticlesModel\getTransitions(), et UpdateModel\isTemplateActive().
|
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, $result, $type, elseif, et null.
Référencé par NewsfeedController\allowAdd(), ContactController\allowAdd(), BannerController\allowAdd(), ArticleController\allowAdd(), AdminModel\batch(), UserModel\batch(), ItemModel\batchCopy(), CategoryModel\batchCopy(), ItemModel\batchMove(), User\bind(), UsersController\changeBlock(), AdministratorService\featured(), Workflow\getConditionName(), PluginModel\getForm(), StyleModel\getForm(), ItemModel\getForm(), ModuleModel\getForm(), ExecRuleHelper\getFromTask(), MenutypeField\getInput(), Joomla\Component\Scheduler\Administrator\Traits\getRoutineId(), Task\isValidState(), Joomla\CMS\MVC\Model\loadForm(), FormModel\loadForm(), PlgUserProfile\onUserAfterDelete(), PlgUserProfile\onUserAfterSave(), TemplateController\publish(), ItemsController\publish(), AdminController\publish(), Redirect\published(), WorkflowsController\setDefault(), ItemsController\setDefault(), StagesController\setDefault(), et Messages\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 |
Merge array recursively.
array | ...$args Array list to be merged. |
Références $i, $key, $result, et $value.
Référencé par ToolbarButton\__construct(), et ActionButton\render().
|
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. |
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, elseif, StringHelper\strcasecmp(), et StringHelper\strcmp().
Référencé par InstallerModel\_getList(), PluginsModel\_getList(), ModulesModel\_getList(), UpdateModel\_getList(), CategoryModel\getChildren(), DebugHelper\getComponents(), CacheModel\getData(), InstalledModel\getData(), SelectModel\getItems(), ModulesHelper\getModules(), ComponentsField\getOptions(), ComponentsCategoryField\getOptions(), ConfigComponentsField\getOptions(), ComponentsWorkflowField\getOptions(), ContenttypesField\getOptions(), TaskTypeField\getOptions(), ComponentsFieldgroupField\getOptions(), ComponentsFieldsField\getOptions(), Finder\mapslist(), Modules\positions(), Menu\preprocess(), et CssMenu\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 PlgContentJoomla\_countItemsInStage(), LinkModel\activate(), AdministratorService\association(), AdminModel\batch(), UserModel\batch(), ItemModel\batchMove(), CategoryModel\batchMove(), UserModel\batchReset(), UserModel\batchUser(), User\bind(), Router\build(), Category\categories(), TemplateModel\copyStyles(), MenuModel\delete(), ActionlogsModel\delete(), FieldModel\delete(), AdminModel\delete(), Workflow\deleteAssociation(), DiscoverModel\discover_install(), LinkModel\duplicateUrls(), Workflow\executeTransition(), ContactModel\featured(), ArticleModel\featured(), IntarrayFilter\filter(), Query\getExcludedTermIds(), MenuModel\getExtensionElementsForMenuItems(), FieldModel\getFieldValues(), FieldsModel\getGroups(), Access\getGroupsByUser(), Query\getIncludedTermIds(), CategoryModel\getItem(), BannersModel\getListQuery(), SuggestionsModel\getListQuery(), GroupsModel\getListQuery(), FieldsModel\getListQuery(), ContactsModel\getListQuery(), NewsfeedsModel\getListQuery(), FeaturedModel\getListQuery(), CategoriesModel\getListQuery(), ArticlesModel\getListQuery(), ActionlogsModel\getLogDataQuery(), FieldgroupsField\getOptions(), TagField\getOptions(), CategoryeditField\getOptions(), FinderHelper\getQuery(), Query\getRequiredTermIds(), TagsHelper\getTagIds(), TagsHelper\getTagItemsQuery(), TagsHelper\getTagNames(), ArticlesModel\getTransitions(), TagsHelper\getTypes(), Access\getUsersByGroup(), Workflow\getValidTransition(), ConsentsModel\invalidate(), Joomla\onContentChangeState(), PlgContentJoomla\onContentChangeState(), Category\options(), Tag\options(), UsersModel\populateState(), TagModel\populateState(), Query\processDynamicTaxonomy(), Query\processStaticTaxonomy(), Nested\publish(), FieldModel\save(), StyleModel\save(), CategoryModel\save(), AdminModel\save(), ItemModel\save(), TagsHelper\searchTags(), UserHelper\setUserGroups(), Tag\tags(), TagsHelper\unTagItem(), Workflow\updateAssociations(), et LevelModel\validate().
|
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 FormModel\getItem(), LanguageModel\getItem(), MenuModel\getItem(), TemplateModel\getItem(), PluginModel\getItem(), StyleModel\getItem(), Adapter\getItem(), ItemModel\getItem(), ModuleModel\getItem(), AdminModel\getItem(), Adapter\getItems(), TemplateModel\getMaster(), DatabaseModel\handleOldDatabase(), DatabaseModel\initialise(), GroupModel\preprocessForm(), ConfigurationModel\setup(), et SetupModel\validateDbConnection().
|
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 Select\genericlist(), SyndicateHelper\getLink(), Select\groupedlist(), HTMLHelper\iframe(), HTMLHelper\link(), Select\radiolist(), ToolbarButton\renderButton(), et Form\token().