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

Recommend this page to a friend!
  Info   Documentation   View files (34)   Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-07-07 (29 days ago) Not yet rated by the usersTotal: 50 This week: 2All time: 9,834 This week: 114
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  
Name: Kjell-Inge Gustafsson <contact>
Classes: 13 packages by
Country: Sweden Sweden
Age: ???
All time rank: 5333 in Sweden Sweden
Week rank: 37 1 in Sweden Sweden
Innovation award
Innovation award
Nominee: 4x

Details

[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  
File Role Description
docs (4 files)
src (11 files, 2 directories)
test (4 files)
autoload.php Aux. Auxiliary script
changeLog.txt Doc. 1.3.3
composer.json Data Auxiliary data
LICENCE Lic. License text
phpunit.xml Data Auxiliary data
README.md Doc. Documentation

  Files  /  docs  
File Role Description
   AsitSummary.md Data Auxiliary data
   AsittagSummary.md Data Auxiliary data
   ItSummary.md Data Auxiliary data
   ListSummary.md Data Auxiliary data

  Files  /  src  
File Role Description
Exceptions (5 files)
Traits (4 files)
   Asit.php Class Class source
   AsitList.php Class Class source
   Asittag.php Class Class source
   AsittagList.php Class Class source
   Asmit.php Class 1.3
   AsmitList.php Class 1.3
   Asmittag.php Class 1.3
   AsmittagList.php Class 1.3
   It.php Class Class source
   ItList.php Class Class source
   TypeInterface.php Class Class source

  Files  /  src  /  Exceptions  
File Role Description
   CollectionException.php Class 1.4.10
   PkeyException.php Class 1.4.6
   SortException.php Class 1.4.6
   TagException.php Class 1.4.6
   TypeException.php Class 1.4.6

  Files  /  src  /  Traits  
File Role Description
   ListTrait.php Class 1.4.6
   PkeyTagTrait.php Class 1.4.6
   TagTrait.php Class 1.4.6
   TypeTrait.php Class 1.4.6

  Files  /  test  
File Role Description
   Asit1Test.php Class 1.4.6
   Asit2Test.php Class 1.4.6
   AsitListTest.php Class Class source
   ItTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:50
This week:2
All time:9,834
This week:114

For more information send a message to info at phpclasses dot org.