Download the PHP package eden/collection without Composer
On this page you can find all versions of the php package eden/collection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eden/collection
More information about eden/collection
Files in eden/collection
Package collection
Short Description Eden generic collection component
License MIT
Homepage http://eden-php.com
Informations about the package collection
Eden Collection
- Install
- Introduction
- Contributing
====
Install
composer install eden/collection
====
Introduction
Manipulating table, matrix or multidimensional data in most cases can be expressed as a collection. Collections in Eden is defined loosely and as a utility class to help managing data in a controlled and chainable format. The basic setup of a collection is described in Figure 1
.
Figure 1. Setup
eden('collection', $users);
Collections do exactly the same thing as models except it manipulates multiple models instead. Collections can be iterable and access as arrays as well. Collections only hold model objects so if you wanted to use your own extended model, you would need to call ->setModel('Your_Model')
. From here we can access properties in our collection as a method, property or back as an array. Figure 2
shows the ways to access data in action.
Figure 2. Accessing Collection, Models and Rows
Some other utility methods not covered by th above examples are date formating and copying from one column to another. Figure 3
, show how we would go about doing these things.
Figure 3. Utility methods
====
Contributing to Eden
Contributions to Eden are following the Github work flow. Please read up before contributing.
Setting up your machine with the Eden repository and your fork
- Fork the repository
- Fire up your local terminal create a new branch from the
v4
branch of your fork with a branch name describing what your changes are. Possible branch name types:- bugfix
- feature
- improvement
- Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")
Making pull requests
- Please ensure to run
phpunit
before making a pull request. - Push your code to your remote forked version.
- Go back to your forked version on GitHub and submit a pull request.
- An Eden developer will review your code and merge it in when it has been classified as suitable.
All versions of collection with dependencies
eden/core Version 4.*
eden/string Version 4.*
eden/array Version 4.*
eden/model Version 4.*