cannot get all value from the contain cakephp

Solutions on MaxInterview for cannot get all value from the contain cakephp by the best coders in the world

showing results for - "cannot get all value from the contain cakephp"
Zebulon
10 Oct 2017
1// on each model MUST HAVE THIS ROW for containable the model
2	public $actsAs = array('Containable');
3
4Ex:
5<?php
6App::uses('BuildingAppModel', 'Building.Model');
7/**
8 * CreditType Model
9 *
10 * @property CompanyCredit $CompanyCredit
11 * @property CreditTypeLanguage $CreditTypeLanguage
12 */
13class CreditType extends BuildingAppModel {
14
15	public $actsAs = array('Containable');
16///   ...
17}
18 ?>
19
20// First: need to check model for the relationship is it correct?
21// next: MUST ADD THIS ROW for show all contain
22
23'BuildingFacility' => array(
24  'fields' => array(
25    'BuildingFacility.id',		// MUST ADD THIS ROW for show all contain
26  ),
27  'BuildingFacilityLanguage' => array(
28    'conditions' => array(
29      'BuildingFacilityLanguage.alias' => $this->lang18,
30    ),
31  ),
32  'BuildingPost' => array(
33    'fields' => array(
34      'BuildingPost.*',
35    ),
36    'BuildingPostLanguage' => array(
37      'conditions' => array(
38        'BuildingPostLanguage.alias' => $this->lang18,
39      ),
40    ),
41  ),
42),