Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Do not extend from ObjectSet #69

Merged
merged 7 commits into from
May 3, 2016
Merged

Do not extend from ObjectSet #69

merged 7 commits into from
May 3, 2016

Conversation

johanjanssens
Copy link
Member

resolve #68

- Add clear() method to clear the set
- Use iterator_to_array in the toArray() method
- Add filter() method to handle filtering of the set using a callable
- Make the 'data' property private

BREAKING! If you are extending from ObjectSet you can no longer access the 'data' property. To migrate your code use the API instead.
- Do not extend from ObjectSet, compose it
- Implement missing interface methods
- Refactor implemetation of filter() method
- Change toArray() to return the current entity in the set

BREAKING! ModelEntityComposite::toArray() no longer flattens the whole entity collection it only returns a array representation of the current entity. To migrate your code, use iterator_to_array if you want to get a array representation of the all entities in the collection, or traverse through the collection.
- Do not extend from ObjectSet, compose it
- Implement missing interface methods
- Refactor implemetation of filter() method
- Change toArray() to return the current entity in the set

BREAKING! DatabaseRowsetAbstract::toArray() no longer flattens the whole entity collection it only returns a array representation of the current entity. To migrate your code, use iterator_to_array if you want to get a array representation of the all entities in the collection, or traverse through the collection.
@johanjanssens johanjanssens added this to the 3.0.0-beta.2 milestone Apr 28, 2016
@johanjanssens
Copy link
Member Author

@ercanozkaya Can you review, especially changes here: f548db9

foreach ($this as $key => $row) {
$result[$key] = $row->toArray();
if($row = $this->getIterator()->current()) {
$result = $row->toArray();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johanjanssens this is only returning a single row now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, this is an intended behavior change of the method.

@johanjanssens johanjanssens merged commit 422d4f8 into master May 3, 2016
@johanjanssens johanjanssens deleted the feature/68-objectset branch May 3, 2016 18:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not extend from ObjectSet
2 participants