AloFramework documentation
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • Alo
    • Cache
    • CLI
    • Controller
    • Db
      • Query
    • Exception
    • FileSystem
    • Session
    • Traversables
    • Validators
    • Windows
  • Controller
  • None
  • PHP

Classes

  • ArrayObj
  • SmartObj

Class SmartObj

Some smarter array functions. This is a very work-in-progress class.

Alo\Traversables\ArrayObjimplementsIteratorAggregate,ArrayAccess,Countable
Extended byAlo\Traversables\SmartObj
Namespace:Alo\Traversables
Author:Art <a.molcanovas@gmail.com>
Located atsys/class/alo/traversables/smartobj.php

Methods summary

public staticAlo\Traversables\SmartObj
#smartObj(array$initial= [])

Initialises our smart array-based object

Initialises our smart array-based object

Parameters

$initial
array
$initial The initial array to set

Returns

Alo\Traversables\SmartObj

Author

Art <a.molcanovas@gmail.com>
publicAlo\Traversables\SmartObj
#uniqueRecursive( )

Removes all the duplicate values from an array

Removes all the duplicate values from an array

Returns

Alo\Traversables\SmartObj

Author

Art <a.molcanovas@gmail.com>
protected
#deleteRegexInternal(string$regex,boolean$recursive,boolean$checkingKey,boolean$inverse,array& $currArray)

Internal handler for regex deletion

Internal handler for regex deletion

Parameters

$regex
string
$regex The regular expression
$recursive
boolean
$recursive Whther to recurse into child arrays
$checkingKey
boolean
$checkingKey true if checking key regex, false if checking value regex
$inverse
boolean
$inverse If set to true the method will delete items that do NOT match the regex
$currArray
array
$currArray Reference to the currently checked array

Author

Art <a.molcanovas@gmail.com>
publicAlo\Traversables\SmartObj
#deleteWithValueRegex(string$regex,boolean$recursive=true,boolean$inverse=false)

Deletes all elements from an array where the value matches the supplied regular expression

Deletes all elements from an array where the value matches the supplied regular expression

Parameters

$regex
string
$regex The regular expression
$recursive
boolean
$recursive Whether to recurse into child arrays
$inverse
boolean
$inverse If set to true the method will delete items that do NOT match the regex

Returns

Alo\Traversables\SmartObj

Author

Art <a.molcanovas@gmail.com>
publicAlo\Traversables\SmartObj
#deleteWithKeyRegex(string$regex,boolean$recursive=true,boolean$inverse=false)

Deletes all elements from an array where the key matches the supplied regular expression

Deletes all elements from an array where the key matches the supplied regular expression

Parameters

$regex
string
$regex The regular expression
$recursive
boolean
$recursive Whether to recurse into child arrays
$inverse
boolean
$inverse If set to true the method will delete items that do NOT match the regex

Returns

Alo\Traversables\SmartObj

Author

Art <a.molcanovas@gmail.com>
protected
#uniqueRecursiveInternal(array& $curr)

Internal handler for uniquefyRecursively

Internal handler for uniquefyRecursively

Parameters

$curr
array
$curr Reference to the currently processed step

Author

Art <a.molcanovas@gmail.com>

Methods inherited fromAlo\Traversables\ArrayObj

__construct(),__get(),__set(),count(),getIterator(),offsetExists(),offsetGet(),offsetSet(),offsetUnset(),toArray()

Magic methods summary

Properties summary

Properties inherited fromAlo\Traversables\ArrayObj

$data

AloFramework documentation API documentation generated byApiGen 2.8.0