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

Remove usage of Timber\PostCollection in Repository #78

Merged
merged 2 commits into from
Jan 19, 2022

Conversation

perruche
Copy link
Contributor

Motivation:

The abstract Repository must be more generic.

Removed

  • references to Timber\PostCollection are removed
  • Repository->slice() method is remove.

Closes #53 and #54

@perruche perruche added the enhancement New feature or request label Jun 28, 2021
@perruche perruche requested a review from a team June 28, 2021 09:20
@perruche perruche self-assigned this Jun 28, 2021
Copy link
Collaborator

@titouanmathis titouanmathis left a comment

Choose a reason for hiding this comment

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

Nice update, we should remove the mention of PostCollection from the doc blocks as well.

$this->result_set is an array, maybe we should lock the return value of $this->do_query() to be of type array instead of mixed? Cc @lusimeon @ptt-homme

@perruche perruche force-pushed the feature/repository-update branch 2 times, most recently from 070465c to a9d8801 Compare July 5, 2021 09:24
@perruche perruche requested review from titouanmathis and a team July 5, 2021 09:40
@perruche
Copy link
Contributor Author

perruche commented Jul 5, 2021

All docblock comment's have been updated !

*
* @return array|PostCollection
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: Should we keep ArrayObject as an allowed type?

The PostQuery and PostCollection classes are base on PHP's ArrayObject class. Allowing the usage of ArrayObject results could help implement PostCollection or PostQuery in child classes.

Maybe we can discuss this next monday?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, can plan a meeting on the topic !
There is no PostQuery or PostCollection logic in this class since the do_query() method is to implement.
This could lead to some implementation with direct SQL query with wpdb for example

@titouanmathis titouanmathis force-pushed the feature/repository-update branch from e4d09f8 to e15869c Compare July 14, 2021 21:31
@perruche
Copy link
Contributor Author

Any update on this merge request ?

Copy link
Collaborator

@titouanmathis titouanmathis left a comment

Choose a reason for hiding this comment

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

It seems good to me, I guess we will have to test it to see if the design is good.

@perruche perruche force-pushed the feature/repository-update branch 2 times, most recently from adac180 to ad15ecd Compare January 19, 2022 08:12
@perruche perruche force-pushed the feature/repository-update branch from ad15ecd to 0abde0d Compare January 19, 2022 08:17
@perruche perruche merged commit 5b3bb09 into develop Jan 19, 2022
@titouanmathis titouanmathis deleted the feature/repository-update branch June 24, 2022 08:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove TimberCollection references in the abstract Repository class
3 participants