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

TOPIC:

fork on model 20 Mar 2014 15:15 #12317

  • albert
  • albert's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 70
  • Thank you received: 2
Hi i did a component

on the model i have models/experiment_type.php
class RmnmanagementCkModelExperimenttype extends RmnmanagementClassModelList
{
.....
code
....
protected function prepareQuery(&$query)
{
... code ...
}

...
}

I want to make some changes, thus i go to _fork/models/experiment_type.php
class RmnmanagementModelExperimenttype extends RmnmanagementCkModelExperimenttype
{

/**
* Preparation of the list query.
*
* @access protected
* @param object &$query returns a filled query object.
* @return void
*/
protected function prepareQuery(&$query)
{
echo 'a';die;
}
}

and it does nothing !!
why??

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

fork on model 21 Mar 2014 19:42 #12332

Did you copy the model from the _fork directory to the fork directory?

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

fork on model 21 Mar 2014 19:43 #12333

  • albert
  • albert's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 70
  • Thank you received: 2
i just copied the function

protected function prepareQuery(&$query)
{
echo 'a';die;
}

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

fork on model 21 Mar 2014 23:02 #12338

Sorry, I wasn't very clear

The file experiment_type.php needs to be in the directory fork/models, i.e. copy it from _fork

_fork contains the base files for forking but that directory is not used at runtime, the fork directory is where the code looks for overrides

Dave

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

fork on model 22 Mar 2014 09:20 #12342

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Documentation for the forks :
www.j-cook.pro/index.php/f/forks

Also, you must respect the fork location (front or back)
Coding is now a piece of cake

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

  • Page:
  • 1
Time to create page: 0.119 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