Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

addWhere method undefined ??? 07 Sep 2016 00:22 #14508

  • koenvdz
  • koenvdz's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 24
  • Thank you received: 2
Hi,

i am refining the results in a few of my drop down menu's with $this->addWhere statements and it always works fine but today I added a similar statement in one of the prepareQuery() function and I got this error:

Fatal error: Call to undefined method GuidemanModelJobitemsitem::addWhere() in C:\xampp\htdocs\mg\components\com_guideman\fork\models\jobitemsitem.php on line 102

I searched in other files of my project and every time I used the addWhere statement there was already an addWhere statememt present somewhere else in the file, in this one though there was no addWhere statement to be found, do I need to include another class or something?

Joomla 3.6.2
Project Guideman
Koen

Please Log in or Create an account to join the conversation.

Last edit: by koenvdz.

addWhere method undefined ??? 07 Sep 2016 10:31 #14510

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
This is normal.

The addWhere() function has never been available in the ITEM model.

Because the 'item' model is made by design to return only ONE element, so you cannot filter with where.
If you want to find the result using another method than the ID, you can edit prepareQuery() of your concerned model, and with a state var, to change the behavior of the search.
That's it.
Coding is now a piece of cake
The following user(s) said Thank You: koenvdz

Please Log in or Create an account to join the conversation.

addWhere method undefined ??? 07 Sep 2016 16:58 #14516

  • koenvdz
  • koenvdz's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 24
  • Thank you received: 2
Thanks again for the swift reply.

I just want to point out that I have used addWhere statements in other ITEM models before. and it worked fine. But it is OK I found a workaround that works fine for my project. ;)
Koen

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.054 seconds

  Excellent Tool ! This tool will save you a lot of time writing the same old structure. I've used others but this is really nice for a quick start. Makes a 3 hour task a 15 minute one. Thanks for this extension
dickrundell (JED)
         

Get Started