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

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started