BaseCollection
abstract class BaseCollection implements ArrayAccess, Countable, JsonSerializable, Iterator (View source)
| internal | For internal use, a will be coded to fit what is needed in this project. | 
Properties
| protected | $items | ||
| protected TKey> | $keys | The keys in this collection. | |
| protected int | $position | The current position of the iterator. | 
Methods
No description
No description
No description
Add an item.
Get an item by {@param $key}.
Check if the collection is empty.
Count the number of items.
Check if an offset($key) exists.
Get the item at offset($key).
Set/Add an item.
Unset an item from the list.
Get the current element.
Get the key of the current element.
Move forward to next element.
Rewind the iterator to the first element.
Checks if current iterator position is valid.
Details
        
                            
    __construct($items = [])
        
    
    No description
        
            abstract                mixed
    jsonSerialize()
        
    
    No description
        
                            
    all()
        
    
    No description
        
                            BaseCollection
    add(TValue $item, TKey $key = null)
        
    
    Add an item.
        
                            TValue|null
    get(TKey $key)
        
    
    Get an item by {@param $key}.
        
                            bool
    isEmpty()
        
    
    Check if the collection is empty.
        
                            int
    count()
        
    
    Count the number of items.
        
                            bool
    offsetExists(TKey $key)
        
    
    Check if an offset($key) exists.
        
                            mixed
    offsetGet(TKey $key)
        
    
    Get the item at offset($key).
        
                            void
    offsetSet(TKey|null $key, TValue $value)
        
    
    Set/Add an item.
        
                            void
    offsetUnset(TKey $key)
        
    
    Unset an item from the list.
        
                            TValue
    current()
        
    
    Get the current element.
        
                            TKey
    key()
        
    
    Get the key of the current element.
        
                            void
    next()
        
    
    Move forward to next element.
        
                            void
    rewind()
        
    
    Rewind the iterator to the first element.
        
                            bool
    valid()
        
    
    Checks if current iterator position is valid.