Jump to content

Sorting ClientAlerts?


ShaunR

Recommended Posts

On 12/4/2017 at 18:35, ShaunR said:

I'm looking for a simple way to get the worst severity from the template variable $ClientAlerts. Any idea's on how I can do this without a looping over the collection and comparing each severity with the others?

I can't think of a simple way other than looping... if WHMCS had designed the severity values as numbers (0=danger, 1=warning, 2=info etc) rather than strings, then you could just have sorted the collection by the value... but they didn't, and so sorting alphabetically would just give you an order of : DANGER -> INFO -> WARNING (or the reverse) - neither option would give you the result that you are looking for.

... and I think that v7.4 uses v5.4 of the Laravel docs rather than 5.2 - but if i'm wrong on that, hopefully one of the WHMCS guys will correct me.

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated