Doctrine Collections is a library that contains classes for working with arrays of data. Doctrine Collections provides an interface named Doctrine\Common\Collections\Collection that resembles the nature of a regular PHP array. That is, it is essentially an ordered map that can also be used like a list. A Collection has an internal iterator just like a PHP array. In addition, a Collection can be iterated with external iterators, which is preferable. To use an external iterator simply use the foreach language construct to iterate over the collection, which calls getIterator() internally, or explicitly retrieve an iterator though getIterator() which can then be used to iterate over the collection. You can not rely on the internal iterator of the collection being at a certain position unless you explicitly positioned it before.

Features

  • ArrayCollection filter now allows filtering by key, value or both
  • When using the ClosureExpressionVisitor over objects with a defined accessor and property, the accessor is prioritized
  • Updated testing tools and coding standards, autoloading, which also led to marginal performance improvements
  • Introduced generic type docblock declarations from psalm
  • This release bumps the minimum required PHP version to 7.1.3
  • A Collection has an internal iterator just like a PHP array

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow Doctrine Collections

Doctrine Collections Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Doctrine Collections!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Libraries

Registered

2021-10-08