Item implements ItemInterface
Item class. Represents an item in a collection, implementing the ArrayAccess interface to allow array-like access to its properties.
Table of Contents
Interfaces
- ItemInterface
- Item interface.
Properties
- $id : string
- Item's identifier.
- $properties : array<string|int, mixed>
- Item's properties.
Methods
- __construct() : mixed
- getId() : string
- Returns the item's identifier.
- offsetExists() : bool
- Implements \ArrayAccess.
- offsetGet() : mixed|null
- Implements \ArrayAccess.
- offsetSet() : void
- Implements \ArrayAccess.
- offsetUnset() : void
- Implements \ArrayAccess.
- setId() : BaseInterface
- Set the item's identifier.
- toArray() : array<string|int, mixed>
- Returns properties as array.
Properties
$id
Item's identifier.
protected
string
$id
$properties
Item's properties.
protected
array<string|int, mixed>
$properties
= []
Methods
__construct()
public
__construct(string $id) : mixed
Parameters
- $id : string
getId()
Returns the item's identifier.
public
getId() : string
Return values
stringoffsetExists()
Implements \ArrayAccess.
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Attributes
- #[ReturnTypeWillChange]
Return values
booloffsetGet()
Implements \ArrayAccess.
public
offsetGet(mixed $offset) : mixed|null
Parameters
- $offset : mixed
Attributes
- #[ReturnTypeWillChange]
Return values
mixed|nulloffsetSet()
Implements \ArrayAccess.
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
Attributes
- #[ReturnTypeWillChange]
offsetUnset()
Implements \ArrayAccess.
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
Attributes
- #[ReturnTypeWillChange]
setId()
Set the item's identifier.
public
setId(string $id) : BaseInterface
Parameters
- $id : string
Return values
BaseInterfacetoArray()
Returns properties as array.
public
toArray() : array<string|int, mixed>