yvoyer / collection Goto Github PK
View Code? Open in Web Editor NEWDifferent implementation of collections in php.
License: MIT License
Different implementation of collections in php.
License: MIT License
Extending the TypedCollection
means that we have to override the construct, doing so breaks the static creation on the filter, partition and matching methods.
We should have a way to specify the arguments on the contruct...
Ex.
SomeCollection
{
public function __construct($dep1, $dep2, $dep3)
{
parent::__construct('SomeClass');
}
}
SomeOtherCollection
{
public function __construct($dep1)
{
parent::__construct('SomeClass');
}
}
Both cases should work
Use our own interface
String index
Create a class that contains an array of fixed values.
Example of usage:
$collection = new ArrayCollection(array('val1', 'val2'));
$collection->add('val1'); // ok
$collection->add('val2'); // ok
$collection->add('val13); // Throw exception
Protected supported values
Set
when using the TypedCollection::map()
that returns anything else than the class, it silently filter out some rows. Instead of filtering out, it should throw an exception to explicitly tell the user the map do not support returning other values.
Hi,
Is it possible to add a protected getter of the "collection" attribute from the TypedCollection class? It'll be helpfull ;)
In fact, I can get a same object this way (if my class extends TypedCollection):
$collection = new ArrayCollection($this->getValues());
When loading an entity with doctrine, the TypeCollection is not automaticly mapped.
Check the options to implement it the clean way.
No changes can be made, once the collection is locked
Instance of certain type only
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.