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.169 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started