pietdevries94 / single-class-collection
This package is abandoned and no longer maintained.
No replacement package was suggested.
An abstract class which provides provides an collection which only can only contain objects of a single class
0.2.2
2017-09-11 12:19 UTC
Requires
- php: ^7.1
- illuminate/support: 5.4.*|5.5.*
This package is not auto-updated.
Last update: 2020-01-24 16:42:18 UTC
README
An abstract class which provides provides an collection which only can only contain objects of a single class.
Ther reason for this package is if you want to make a collection with specific methods for a class, you can be sure that the class solely contains that specific class.
Usage
Extend the abstract class in this package and overwrite the protected property $collectionClass
with the fully
qualified class name. The best way to do this is by using ::class
.
Example
class IssueCollection extends \Pietdevries94\SingleClassCollection\AbstractSingleClassCollection { protected $collectionClass = Foo::class; }