Closed joshdcid closed 11 years ago
All you need to do is make sure a join is being made instead of a separate query. If it's not already, search for ad-hoc joins in cakephp.
When you're setting up fields in the settings for this plugin, have Laborer.name
i just change the settings to Laborer.name and it work! Thanks...
Awesome. No problem :)
Hi @tigrang .. thanks for the plugin.. how can i use the belongs to relationship in the controller..? I have two models: Collects: public $belongsTo = array( 'Laborer' => array( 'className' => 'Laborer', 'foreignKey' => 'laborer_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); Laborer: public $hasMany = array( 'Collect' => array( 'className' => 'Collect', 'foreignKey' => 'laborer_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ) ); and in my Collects Controller inside index function: $this->DataTable->paginate = array('Collect');
And i want to display the laborer name.. not just the laborer_id... can i do that?
Thanks in advance.