Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • ActionFormModel
  • ArrayUtil
  • ArrayValidator
  • AssociatedMediaBehavior
  • AuxLib
  • Changelog
  • DetailView
  • EncryptUtilTmp
  • EventsWidgetFieldFormatter
  • FailedLogins
  • FieldFormatter
  • FieldFormatterBase
  • FieldInputRenderer
  • FileFieldBehavior
  • FiltersForm
  • FilterUtil
  • FineDiff
  • FineDiffCopyOp
  • FineDiffDeleteOp
  • FineDiffInsertOp
  • FineDiffOp
  • FineDiffOps
  • FineDiffReplaceOp
  • GlobalCSSFormModel
  • GlobalImportFormModel
  • GoogleAuthenticator
  • JSONFieldsBehavior
  • JSONResponse
  • MediaFieldFormatter
  • MediaSelector
  • MobileActiveRecordFieldFormatter
  • MobileActivityFeed
  • MobileChartDashboard
  • MobileFieldFormatter
  • MobileFieldInputRenderer
  • ModuleModelNameValidator
  • MultiChildNode
  • MultiTypeAutocomplete
  • PasswordUtil
  • ProductFeature
  • ProfileWidgetLayout
  • QueryParamGenerator
  • RecordLimitBehavior
  • RecordView
  • RecordViewWidgetLayout
  • RelationshipsGridModel
  • RelationshipsJoin
  • RepairUserDataCommand
  • RequestUtil
  • RequiredIfNotSetValidator
  • ResponseUtil
  • RunMigrationScriptCommand
  • ServiceWebFormDesigner
  • Settings
  • StringUtil
  • TestEmailAction
  • TestEmailActionForm
  • ThemeGenerator
  • TimerUtil
  • TopicsFieldFormatter
  • TopicsWidgetLayout
  • TransactionalViewFieldFormatter
  • UrlUtil
  • ValidLinkValidator
  • WebFormDesigner
  • WebLeadFormDesigner
  • X2ActiveRecordBehavior
  • X2ActiveRecordFieldFormatter
  • X2ButtonColumn
  • X2ConditionList
  • X2ConsoleCommand
  • X2ControllerBehavior
  • X2DataColumn
  • X2DuplicateBehavior
  • X2Flashes
  • X2GridViewFieldFormatter
  • X2IPAddress
  • X2LeadsDataColumn
  • X2MergeableBehavior
  • X2MessageSource
  • X2MobileControllerBehavior
  • X2MobileProfileControllerBehavior
  • X2MobileQuotesControllerBehavior
  • X2MobileSiteControllerBehavior
  • X2MobileTopicsControllerBehavior
  • X2ModelConversionBehavior
  • X2ModelConversionWidget
  • X2ModelForeignKeyValidator
  • X2ModelUniqueIndexValidator
  • X2NonWebUser
  • X2StaticDropdown
  • X2StaticField
  • X2StaticFieldsBehavior
  • X2UrlManager
  • X2Validator
  • X2WidgetBehavior

Interfaces

  • AdminOwnedCredentials

Exceptions

  • CampaignMailingException
  • CodeExchangeException
  • GetCredentialsException
  • NoRefreshTokenException
  • NoUserIdException
  • StringUtilException

Functions

  • checkCurrency
  • checkDNS
  • checkServerVar
  • checkTimezone
  • decodeQuotes
  • echoIcons
  • encodeQuotes
  • exceptionForError
  • getField
  • getLanguageName
  • getModuleTitle
  • handleReqError
  • handleReqException
  • installer_t
  • installer_tr
  • isAllowedDir
  • mediaMigrationRrmdir
  • migrateMediaDir
  • printGraph
  • printR
  • renderFields
  • reqShutdown
  • RIP
  • translateOptions
  • tryGetRemote
  • Overview
  • Package
  • Class
  • Tree

Class ArrayUtil

Standalone class with miscellaneous array functions

Author: Demitri Morgan <demitri@x2engine.com>, Derek Mueller <derek@x2engine.com>
Located at x2engine/protected/components/util/ArrayUtil.php
Methods summary
public static array
# normalizeToArray( array $expectedFields, array $currentFields )

Given two associative arrays, returns an array with the same set of keys as the first, but with key/value pairs from the second if they are present. Any keys in the second and not in the first will be ignored/dropped.

Given two associative arrays, returns an array with the same set of keys as the first, but with key/value pairs from the second if they are present. Any keys in the second and not in the first will be ignored/dropped.

Parameters

$expectedFields
array
$expectedFields The array with key => default value pairs
$currentFields
array
$currentFields The array to copy values from

Returns

array
public static array
# normalizeToArrayR( array $expectedFields, array $currentFields, mixed $maintainOrder = true )

A recursive version of normalizeToArray () which optionally maintains order of current fields.

A recursive version of normalizeToArray () which optionally maintains order of current fields.

Parameters

$expectedFields
array
$expectedFields The array with key => default value pairs
$currentFields
array
$currentFields The array to copy values from
$maintainOrder

Returns

array
public static boolean
# is_assoc( array $array )

Determines whether a given array is associative

Determines whether a given array is associative

Parameters

$array
array
$array The array for which the check is made

Returns

boolean
True if $array is associative, false otherwise
public static type
# arraySearchPreg( string $find, array $in_array, array $keys_found = array() )

Similar to array_search but recursive, doesn't return needle of there's only one match, and allows for regex searching.

Similar to array_search but recursive, doesn't return needle of there's only one match, and allows for regex searching.

Parameters

$find
string
$find regex to search on
$in_array
array
$in_array an array to search in
$keys_found
array
$keys_found keys whose corresponding values match the regex

Returns

type
an array of keys if $in_array is valid, or false if not.
public static
# assocArrayShift( array & $array )

Retrieve the first entry from an associative array

Retrieve the first entry from an associative array

Parameters

$array
array
$array
public static the
# sort( array $array )

Parameters

$array
array
$array the array to sort

Returns

the
sorted array
public static the
# asorti( array $array )

Case-insensitive, no side-effects version of asort

Case-insensitive, no side-effects version of asort

Parameters

$array
array
$array the array to sort

Returns

the
sorted array
public static
# pop( array $array )

Side effect free version of array_pop

Side effect free version of array_pop

public static
# transpose( mixed $array )
public static
# numericIndexOf( mixed $needle, mixed $haystack, mixed $strict = false )

Like array_search but returns numeric index instead of key

Like array_search but returns numeric index instead of key

public static
# setAndTrue( mixed $array, mixed $val )
public static
# setEquals( mixed $array1, mixed $array2 )
public static
# coerceToArray( mixed $arr )
X2CRM Documentation API documentation generated by ApiGen 2.8.0