PHP Classes

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

Recommend this page to a friend!
  Info   View files Documentation   View files View files (34)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 56 This week: 1All time: 10,529 This week: 571Up
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: 15 packages by
Country: Sweden Sweden
Age: ???
All time rank: 4922 in Sweden Sweden
Week rank: 50 Up1 in Sweden Sweden Up
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  
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

  Files folder image Files  /  docs  
File Role Description
  Accessible without login Plain text file AsitSummary.md Data Auxiliary data
  Accessible without login Plain text file AsittagSummary.md Data Auxiliary data
  Accessible without login Plain text file ItSummary.md Data Auxiliary data
  Accessible without login Plain text file ListSummary.md Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageExceptions (5 files)
Files folder imageTraits (4 files)
  Plain text file Asit.php Class Class source
  Plain text file AsitList.php Class Class source
  Plain text file Asittag.php Class Class source
  Plain text file AsittagList.php Class Class source
  Plain text file Asmit.php Class 1.3
  Plain text file AsmitList.php Class 1.3
  Plain text file Asmittag.php Class 1.3
  Plain text file AsmittagList.php Class 1.3
  Plain text file It.php Class Class source
  Plain text file ItList.php Class Class source
  Plain text file TypeInterface.php Class Class source

  Files folder image Files  /  src  /  Exceptions  
File Role Description
  Plain text file CollectionException.php Class 1.4.10
  Plain text file PkeyException.php Class 1.4.6
  Plain text file SortException.php Class 1.4.6
  Plain text file TagException.php Class 1.4.6
  Plain text file TypeException.php Class 1.4.6

  Files folder image Files  /  src  /  Traits  
File Role Description
  Plain text file ListTrait.php Class 1.4.6
  Plain text file PkeyTagTrait.php Class 1.4.6
  Plain text file TagTrait.php Class 1.4.6
  Plain text file TypeTrait.php Class 1.4.6

  Files folder image Files  /  test  
File Role Description
  Plain text file Asit1Test.php Class 1.4.6
  Plain text file Asit2Test.php Class 1.4.6
  Plain text file AsitListTest.php Class Class source
  Plain text file ItTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:56
This week:1
All time:10,529
This week:571Up