PHP Classes

Asit PHP Collection Class: Manages collections of elements stored in arrays

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 56 All time: 10,587 This week: 455Up
Version License PHP version Categories
asit 1.0GNU Lesser Genera...5PHP 5, Data types
Description 

Author

This package can manage collections of elements stored in arrays.

It provides a base class that stores values in an array with functions that implement the iterator seekable and countable PHP interface operations.

The package also provides sub-classes that implement more specialized collection types that provide additional possibilities:

- Collection values can only be of a single type.
- Collection that use the keys as unique primary keys for finding elements by key value. Primary keys are replaceable.
- Collections that use more than one key unique primary keys for finding elements by key value.
- Collections that can have tags, non-unique (secondary) keys, for finding elements by tag value.

Picture of Kjell-Inge Gustafsson
  Performance   Level  
Innovation award
Innovation award
Nominee: 6x

 

Documentation

[comment]: # (This file is part of Asit, manages array collections. Copyright 2020 Kjell-Inge Gustafsson, kigkonsult, All rights reserved, licence LGPL 3.0)

Asit

> Class It manages array collections * Implement _SeekableIterator_, _Countable_ and _IteratorAggregate_ methods * Collection elements are searchable using * Iterator (et al.) methods * The collection element may be of any value type

>Class ItList * Extends _It_ * Assure collection elements of expected valueType

> Class Asit manages assoc array collections * Extends _It_ * The assoc element array key is used as (unique) primary key * A primary key may be replaced by another (unique) key * Has primary key collection element get-/set-methods * Collection elements are also searchable using * primary key(s) * For non-assoc arrays, * primary key is the (numeric) array index

>Class AsitList * Extends _Asit_ * Assure collection elements of expected valueType

> Class Asmit * Extends _Asit_ * Allow multiple (unique) primary keys for (each)) collection element

>Class Asittag * Extends _Asit_ * Also secondary keys, additional (non-unique) tags (aka attributes?) may be set for each element * Collection elements are also searchable using * tag(s) * primary key(s) + tag(s)

>Class AsittagList * Extends _Asittag_ * Assure collection elements of expected valueType

>Class Asmittag * Extends _Asmit_ * Also secondary keys, additional (non-unique) tags (aka attributes?) may be set for each element * Collection elements are searchable using * Iterator (et al.) methods * primary key(s) * tag(s) * primary key(s) + tag(s)

>Class AsmittagList * Extends _Asmittag_ * Assure collection elements of expected valueType

But, review pros and cons not using some PHP built-in iterator class, ex [ArrayIterator]!

Method summary
  • [It] summary
  • [Asit/Asmit] summary
  • [Asittag/Asmittag] summary
  • It/Asit/Asmit/Asitag/Asmitag[List] summary
Sponsorship

Donation using <a href="https://paypal.me/kigkonsult?locale.x=en_US" rel="nofollow">paypal.me/kigkonsult</a> are appreciated. For invoice, <a href="mailto:ical@kigkonsult.se">please e-mail</a>.

INSTALL

composer require kigkonsult/asit:dev-master

Composer, in your composer.json:

{
    "require": {
        "kigkonsult/asit": "dev-master"
    }
}

Composer, acquire access

use Kigkonsult\Asit\Asit;
...
include 'vendor/autoload.php';

Otherwise , download and acquire

use Kigkonsult\Asit\Asit;
...
include 'pathToSource/kigkonsult/Asit/autoload.php';

Support

For support go to [github.com Asit]

License

This project is licensed under the LGPLv3 License

[ArrayIterator]:https://www.php.net/manual/en/class.arrayiterator [Asit/Asmit]:docs/AsitSummary.md [Asittag/Asmittag]:docs/AsittagSummary.md [Composer]:https://getcomposer.org/ [github.com Asit]:https://github.com/iCalcreator/Asit [It]:docs/ItSummary.md [List]:docs/ListSummary.md


  Files folder image Files (34)  
File Role Description
Files folder imagedocs (4 files)
Files folder imagesrc (11 files, 2 directories)
Files folder imagetest (4 files)
Accessible without login Plain text file autoload.php Aux. Auxiliary script
Accessible without login Plain text file changeLog.txt Doc. 1.3.3
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENCE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:56
This week:0
All time:10,587
This week:455Up