Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Collection - http://pastebin.com/XbEs08gi
- // Entity - http://pastebin.com/51wfap1F
- /**
- * @return <WHAT TO WRITE HERE>
- */
- function getEntitiesFromSomeRepository() {
- // of course this will be some class method, not a function
- }
- $entities = getEntitiesFromSomeRepository();
- $collection = new Collection($entities);
- $collection-> // at this place IDE should suggest autocompletes for class \Collection methods/properties
- foreach ($collection as $entity) {
- $entity-> // and at this point IDE should suggest autocompletes for class \Entity methods/properties
- }
- // please note, that entity is a base class for entities that will be returned, each of them will have some custom methods, for example
- // ClientEntity extends \Entity
- // will have a method getFullName() { return $this->first_name.' '.$this->last_name; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement