Skip to content
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

Additional sort option for eZPersistentObject::fetchObjectList() #1

Closed
wants to merge 4 commits into from
Closed

Conversation

jeromegamez
Copy link
Contributor

Greetings!

Currently eZPersistendObject::fetchObjectList() allows only to sort by a key ascending or descending. In a current project, I had the need to sort the list by a custom order, determined by a precedent select, so that I would have a query like:

SELECT ... FROM ... ORDER BY FIELD(id, 1, 4, 3, 5, 2)

That's why I added another else if to check if the $sorts parameter is an array, and if it is, create the sort query accordingly.

I hope you find that useful - for the time being, I will have to create a new class that inherits vom eZContentObject to get this behaviour.

Best

  • Jérôme

PS: Sorry for the added newline in eztranslationcache.php - I don't know how it got there :).

@nfrp
Copy link
Contributor

nfrp commented Oct 25, 2010

Hi Jérôme,

Thanks for sharing !
Would the generated SQL sort query be generic ( read : working on MySQL, Posgres and Oracle ) ?

Cheers,

  • -
    Nicolas

@andrerom
Copy link
Contributor

Added comment on commit, basically order by field seems to be mysql specifc, so think we should close this (the other commits have been manually merged if I remember correctly)

andrerom added a commit that referenced this pull request Sep 19, 2012
Fixed #19022: ezformtoken error if logging in frontend with DebugRedirection
brookinsconsulting pushed a commit to brookinsconsulting/ezpublish-legacy that referenced this pull request Mar 3, 2023
* php8 fix: An unexpected error has occurred. Please contact the webmaster.
    method_exists(): Argument ezsystems#1 ($object_or_class) must be of type object|string, array given in
    lib/eztemplate/classes/eztemplate.php on line 1432

* php8 fix: removing comments

---------

Co-authored-by: felix <[email protected]>
brookinsconsulting pushed a commit to brookinsconsulting/ezpublish-legacy that referenced this pull request Mar 3, 2023
- An unexpected error has occurred. Please contact the webmaster.
  count(): Argument ezsystems#1 ($value) must be of type Countable|array, null given in
  kernel/classes/datatypes/ezenum/ezenumtype.php on line 155
brookinsconsulting pushed a commit to brookinsconsulting/ezpublish-legacy that referenced this pull request Mar 3, 2023
- An unexpected error has occurred. Please contact the webmaster.
  DOMDocument::loadXML(): Argument ezsystems#1 ($source) must not be empty
  in kernel/classes/datatypes/ezxmltext/ezxmltexttype.php on line 174
brookinsconsulting pushed a commit to brookinsconsulting/ezpublish-legacy that referenced this pull request Mar 3, 2023
- Deprecated: strlen(): Passing null to parameter ezsystems#1 ($string) of type string is deprecated in
 /kernel/classes/ezpersistentobject.php on line 403  => patch update
brookinsconsulting pushed a commit to brookinsconsulting/ezpublish-legacy that referenced this pull request Mar 3, 2023
- An unexpected error has occurred. Please contact the webmaster.
  array_chunk(): Argument ezsystems#1 ($array) must be of type array, null given in
  /kernel/classes/ezsection.php on line 264

- in backend change section of node without childs
brookinsconsulting pushed a commit to brookinsconsulting/ezpublish-legacy that referenced this pull request Mar 3, 2023
- Deprecated: mb_strlen(): Passing null to parameter ezsystems#1 ($string) of type string is deprecated in /lib/ezdb/classes/ezdbinterface.php on line 1561
brookinsconsulting pushed a commit to brookinsconsulting/ezpublish-legacy that referenced this pull request Mar 3, 2023
- Deprecated: trim(): Passing null to parameter ezsystems#1 ($string) of type string is deprecated in
  /lib/eztemplate/classes/eztemplatestringoperator.php on line 641
- Deprecated: htmlspecialchars(): Passing null to parameter ezsystems#1 ($string) of type string is deprecated in
  /lib/eztemplate/classes/eztemplatestringoperator.php on line 386
- Deprecated: mb_strlen(): Passing null to parameter ezsystems#1 ($string) of type string is deprecated in
  /mnt/data/htdocs/fi1903-kundenportal/htdocs/lib/eztemplate/classes/eztemplatestringoperator.php on line 544

- Undefined variable '$type'
brookinsconsulting pushed a commit to brookinsconsulting/ezpublish-legacy that referenced this pull request Mar 3, 2023
- An unexpected error has occurred. Please contact the webmaster.
  count(): Argument ezsystems#1 ($var) must be of type Countable|array, null given in
  /kernel/content/removeobject.php on line 35
brookinsconsulting pushed a commit to brookinsconsulting/ezpublish-legacy that referenced this pull request Mar 3, 2023
- count(): Argument ezsystems#1 ($value) must be of type Countable|array, bool given in kernel/role/edit.php on line 407
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants