DependsOnManagesItemsTrait
trait DependsOnManagesItemsTrait
Methods
Initializes a new manager instance.
Hydrate with external data, optionally append
Adds a single item.
Updates an item
Push a value or values onto the end of an array inside manager
Get a single item
Return an item if it exist
Return an item if it exist Alias of getIfExists()
Return all items as array
Return all items as array Alias of getAll()
Confirm or deny that an item exists
Confirm or deny that an item exists Alias of exists()
Confirm that manager has no items
Deletes an item
Clear the manager
Reset the manager with an array of items Alias of initManager()
Get the collection of items as JSON.
When manager instance is used as a string, return json of items
Details
at line line 15
abstract $this
initManager(array $items = null)
Initializes a new manager instance.
This is useful for implementations that have their own __construct method This is an alias for reset()
at line line 24
abstract $this
hydrate($data, bool $append = false)
Hydrate with external data, optionally append
at line line 36
abstract $this
add(string $alias, mixed $item = null, array $options = null)
Adds a single item.
Allow for dot notation (one.two.three) and item nesting.
at line line 46
abstract $this
set(string $alias, null $item = null)
Updates an item
at line line 56
abstract int
push(string $alias, mixed $value, null|mixed $other = null)
Push a value or values onto the end of an array inside manager
at line line 66
abstract mixed
get(string $alias, string $fallback = '_michaels_no_fallback')
Get a single item
at line line 73
abstract NoItemFoundMessage
getIfExists($alias)
Return an item if it exist
at line line 82
abstract NoItemFoundMessage
getIfHas($alias)
Return an item if it exist Alias of getIfExists()
at line line 89
abstract array
getAll()
Return all items as array
at line line 96
abstract array
all()
Return all items as array Alias of getAll()
at line line 104
abstract bool
exists($alias)
Confirm or deny that an item exists
at line line 113
abstract bool
has($alias)
Confirm or deny that an item exists Alias of exists()
at line line 119
abstract boolean
isEmpty()
Confirm that manager has no items
at line line 127
abstract $this
remove($alias)
Deletes an item
at line line 133
abstract $this
clear()
Clear the manager
at line line 142
abstract mixed
reset(array $items)
Reset the manager with an array of items Alias of initManager()
at line line 150
abstract string
toJson(int $options)
Get the collection of items as JSON.
at line line 156
abstract string
__toString()
When manager instance is used as a string, return json of items