LFT
  • Namespace
  • Class
  • Tree

Namespaces

  • Docoflow
    • Contracts
    • Entity
    • Facades
    • Models
    • Traits
  • Docolight
    • Agno
      • Traits
    • Container
    • Http
      • Contracts
    • Rest
      • Handler
      • Http
    • Support
      • Debug
      • Traits
  • Docotory
    • Traits
  • None

Classes

  • ActiveRecordWrapper
  • Arr
  • Carbonate
  • ClassLoader
  • Collection
  • CollectionDataProvider
  • Facade
  • Factory
  • Fluent
  • Html
  • IterablePager
  • Repository
  • Set
  • Str

Class Set

Base setter - getter class.

Docolight\Support\Set implements ArrayAccess, Countable, IteratorAggregate

Direct known subclasses

Docolight\Http\Headers

Namespace: Docolight\Support
Author: Krisan Alfa Timur krisanalfa@docotel.co.id
Located at Docolight/Support/Set.php

Methods summary

public
# __construct( array $items = array() )

Constructor.

Constructor.

Parameters

$items
Pre-populate set with this key-value array
protected mixed
# normalizeKey( string $key )

Normalize data key.

Normalize data key.

Used to transform data key into the necessary key format for this set.

Parameters

$key
The data key

Returns

mixed
The transformed/normalized data key
public
# set( string|array $key, mixed $value )

Set data key to value.

Set data key to value.

Parameters

$key
The data key or key / value pair array
$value
The data value
public mixed
# get( string $key, mixed $default = null )

Get data value with key.

Get data value with key.

Parameters

$key
The data key
$default
The value to return if data key does not exist

Returns

mixed
The data value, or the default value
public
# replace( array $items )

Add data to set.

Add data to set.

Parameters

$items
Key-value array of data to append to this set
public array
# all( )

Fetch set data.

Fetch set data.

Returns

array
This set's key-value data array
public array
# keys( )

Fetch set data keys.

Fetch set data keys.

Returns

array
This set's key-value data array keys
public boolean
# has( string $key )

Does this set contain a key?

Does this set contain a key?

Parameters

$key
The data key

Returns

boolean
public
# remove( string $key )

Remove value with key from this set.

Remove value with key from this set.

Parameters

$key
The data key
public mixed
# __get( string $key )

Get value

Get value

Parameters

$key
$offset

Returns

mixed
public
# __set( string $key, mixed $value )

Set value

Set value

Parameters

$key
$offset
$value
public boolean
# __isset( $key )

Determine if value is available.

Determine if value is available.

Returns

boolean
public
# __unset( string $key )

Remove a value

Remove a value

Parameters

$key
$offset
public
# clear( )

Clear all values.

Clear all values.

public boolean
# offsetExists( $offset )

Determine if value is available.

Determine if value is available.

Returns

boolean

Implementation of

ArrayAccess::offsetExists()
public mixed
# offsetGet( string $offset )

Get value

Get value

Parameters

$offset

Returns

mixed

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( string $offset, mixed $value )

Set value

Set value

Parameters

$offset
$value

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( string $offset )

Remove a value

Remove a value

Parameters

$offset

Implementation of

ArrayAccess::offsetUnset()
public integer
# count( )

Countable.

Countable.

Returns

integer

Implementation of

Countable::count()
public ArrayIterator
# getIterator( )

IteratorAggregate.

IteratorAggregate.

Returns

ArrayIterator

Implementation of

IteratorAggregate::getIterator()
public mixed
# singleton( string $key, Closure $value )

Ensure a value or object will remain globally unique.

Ensure a value or object will remain globally unique.

Parameters

$key
The value or object name
$value
The closure that defines the object

Returns

mixed
public Closure
# protect( Closure $callable )

Protect closure from being directly invoked.

Protect closure from being directly invoked.

Parameters

$callable
A closure to keep from being invoked and evaluated

Returns

Closure

Properties summary

protected array $data

Key-value array of arbitrary data.

Key-value array of arbitrary data.

# array()
LFT API documentation generated by ApiGen