-
Notifications
You must be signed in to change notification settings - Fork 61
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 ObjectField Operator for extracting fields from Data Objects. #436
base: 1.x
Are you sure you want to change the base?
Conversation
30c3bc4
to
6c1abba
Compare
very nice, thx! will check in detail as soon we get some time. two things I noticed right away:
thx again. |
What do you mean here? The translation keys I chose exist and are used by: https://pimcore.com/docs/pimcore/10.1/User_Documentation/DataObjects/Grid_Configuration_Operators/Extractors/AnyGetter.html
|
|
ff5d7b8
to
1211d33
Compare
@fashxp can we get this merged? lmk if i need to clean up the number of return. imho the current form is more readable than collapsing the first two returns. |
@cancan101 could you please once more merge 1.x branch an see if tests become green then? Thx. |
b5382ed
to
5fc7811
Compare
rebased onto 1.x. I am getting this error: |
I accepted sonar cloud, but phpstan needs to be fixed... |
|
public function process(mixed $inputData, bool $dryRun = false): mixed | ||
{ | ||
if (!$inputData instanceof ElementInterface) { | ||
// is this how to handle type mismatch? |
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.
yes, would say this is the best approach.
alternative would be to throw an exception - this is also done here and there.
but I would say, we should also add some notes to the logs, like here for example
} | ||
|
||
if (!$this->attribute) { | ||
// is this how to handle no attrinute |
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.
see comment above
$getter = 'get' . ucfirst($this->attribute); | ||
|
||
if (!method_exists($inputData, $getter)) { | ||
// is there a better default here? |
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.
see comment above
Closes: https://github.com/orgs/pimcore/discussions/17798
CC @fashxp