Note that there are some explanatory texts on larger screens.

plurals
  1. POCakephp 2.0 I am using HABTM relation but intermediate table model not fetching associated data
    primarykey
    data
    text
    <p>For example i am having tenders table and consortiums table, and for HABTM i created intermediate table tenders_consortiums. now for my requirement i created a model TendersConsortium </p> <pre><code>class TendersConsortium extends AppModel { /** * Use table * @var mixed False or table name */ public $useTable = 'tenders_consortiums'; /** * Display field * @var string */ public $displayField = 'counsortium_id'; //The Associations below have been created with all possible keys, those that are not needed can be removed /** * belongsTo associations * @var array */ public $belongsTo = array( 'Tender' =&gt; array( 'className' =&gt; 'Tender', 'foreignKey' =&gt; 'tender_id', 'conditions' =&gt; '', 'fields' =&gt; '', 'order' =&gt; '' ), 'Counsortium' =&gt; array( 'className' =&gt; 'Counsortium', 'foreignKey' =&gt; 'counsortium_id', 'conditions' =&gt; '', 'fields' =&gt; '', 'order' =&gt; '' ) ); </code></pre> <p>}</p> <p>But when i fetch pagination data <code>$this-&gt;paginate('TendersConsortium', $TendersConsortium_cond)</code> it returns</p> <pre><code>array( (int) 0 =&gt; array( 'TendersConsortium' =&gt; array( 'id' =&gt; '6', 'tender_id' =&gt; '3', 'consortium_id' =&gt; '3', 'state' =&gt; 'Winner', 'created' =&gt; '2012-08-08 12:21:28' ) ), (int) 1 =&gt; array( 'TendersConsortium' =&gt; array( 'id' =&gt; '7', 'tender_id' =&gt; '3', 'consortium_id' =&gt; '1', 'state' =&gt; 'Winner', 'created' =&gt; '2012-08-08 12:21:28' ) ) ) </code></pre> <p>i have also set recursive level 2 but not getting the associated data from tenders and consortium table.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload