Download the PHP package bapcat/collection without Composer
On this page you can find all versions of the php package bapcat/collection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bapcat/collection
More information about bapcat/collection
Files in bapcat/collection
Package collection
Short Description Powerful but easy to use collections with support for lazy loading
License GPL-3.0-or-later
Homepage https://github.com/BapCat/Collection
Informations about the package collection
Collection
A modular, trait-based collection library that puts control of your data back in your hands.
Installation
Composer
Composer is the recommended method of installation for Collection.
GitHub
This package may also be downloaded from GitHub.
Features
Basic Collection Use
Collections make it easy to control access to your data in an object-oriented way. The standard implementation supports
reading and writing, as well as standard foreach
iteration.
Custom Collections
Collections are built with traits, so it's easy to pick-and-choose the features you want. For example, you may want a collection that can't be modified from the outside:
If you would like to implement a full read/write collection, you may extend the basic Collection
class:
Or, you may implement the interfaces and trait:
Array Access
If you would like to use array access with your collection, use the ArrayAccessCollection
class or the ArrayAccessCollectionTrait
trait.
Lazy Loading
Writable collections have support for lazy-loading built in. Lazy loading can be very useful, for example, in database interactions.