Skip to content

Factory methods for instantiation, removed ArrayAccess

Latest
Compare
Choose a tag to compare
@benr77 benr77 released this 08 Jan 12:28
· 5 commits to main since this release
48c15c8

What's Changed

  • BC BREAK - Require item class name to be provided via abstract method getItemClassName() instead of via the collection constructor.
  • BC BREAK - Removed support for ArrayAccess, and replicate functionality via more meaningful methods such as Collection::has() and Collection::get().
  • BC BREAK - Collection::toArray() renamed to Collection::all().
  • Added the factory methods Collection::from() and Collection::empty().
  • Added helper methods Collection::isEmpty() and Collection::isNotEmpty().
  • Added helper method Collection::mapTo() to map to a new Collection of a different type.
  • Added Collection::reverse() helper to reverse the order of the collection.
  • Support creating collections from Doctrine Collections using Collection::fromDoctrine().
  • Support creating collections by mapping array of other objects using Collection::mapFrom().