pietdevries94 / single-class-collection
An abstract class which provides provides an collection which only can only contain objects of a single class
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/pietdevries94/single-class-collection
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; }