-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hasFields, Keys, Pluck, Values and Without manipulations #52 #69
Conversation
@tbolier I'm totally stuck on operators implementation, i don't get the global logic of the implementation. Especially on the
And the implementation is in HasFieldsTest The problems are:
I don't understand if the I'm afraid theses problem impact the date operators implementation too. I need to start the dev of a new API and without them I probably will switch to another driver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, will you add the missing unit tests or do you need help with that?
src/Query/Manipulation/Keys.php
Outdated
/** | ||
* @var array | ||
*/ | ||
private $keys; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this unused property?
Yeah please I need some explanations to finish those operators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Th3Mouk I will code along in this pull request to help if that is okay with you?
I have some comments ready in the pull request review, but I think participating makes it a little easier.
- For the filter implementation, check the current
GetFieldLogic
as example. What are your the issues you are running into at the moment? - The row parameter can be optional, that's no problem. I see you already worked that out.
- The return types can differ per implementation, so the return type for
row()->hasFields()
can be different thanget('ID').hasFields()
. Traits are only there to make code reusable, if we cannot reuse it, because the logic is different, there is no issue in duplicating some code / even traits. Of course we try to keep it as clean, as less complex, as less code duplication as possible, but this should not block our ease of implementation. Choose for the easy route via duplication, and later we can always slim it down again, if we see we have blocks of duplicate codes.
I will clone your branch and get the coding in this week.
src/Query/Builder.php
Outdated
@@ -70,7 +70,7 @@ public function ordening(string $key): Ordening | |||
return $this->ordering; | |||
} | |||
|
|||
public function row(string $value): Row | |||
public function row(?string $value = null): Row |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the ?
is obsolete since null
probably will never be passed?
No problem ! I prefer a few exemples to long explanations |
485bc41
to
212b333
Compare
Hey @Th3Mouk I've fixed the hasFields manipulation command for This is what I meant with code duplication is fine, if the implementation differs. We do not need to put anything in traits if we have different implementations. Does this make sense to you? |
@Th3Mouk For |
94f2651
to
0d2dcd3
Compare
@Th3Mouk I am planning to merge this, are you happy with the outcome and feedback, and do you agree I will merge this? |
A good tip to debug is to check the XHR request headers from the admin rethinkDB panel, this will show you the raw JSON query send to RethinkDB, I usually compare this to the PHP raw query that I will copy paste from xDebug. |
Purpose
#52
Open Questions and Pre-Merge TODOs
Solution
Theses operators aren't tested yet