--
CakePHP Tuga (cakephp-pt)
Utilize http://bin.cakephp.org para códigos
Cookbook: http://book.cakephp.org
Website do CakePHP: http://cakephp.org/
Website do grupo: http://groups.google.com/group/cakephp-pt?hl=pt-PT
Thiago,
Erro: SQLSTATE[42000]: Syntax error or access violation: 1110 Column 'topico_id' specified twice
public $hasAndBelongsToMany = array('Topico' => array('className' => 'Topico','joinTable' => 'topicos_topicos','foreignKey' => 'topico_id','associationForeignKey' => 'topico_id','unique' => true,'conditions' => '','fields' => '','order' => '','limit' => '','offset' => '','finderQuery' => '','deleteQuery' => '','insertQuery' => ''),'Topico1' => array('className' => 'Topico','joinTable' => 'topicos_topicos','foreignKey' => 'topico_id1','associationForeignKey' => 'topico_id','unique' => true,'conditions' => '','fields' => '','order' => '','limit' => '','offset' => '','finderQuery' => '','deleteQuery' => '','insertQuery' => ''))
será que não da pra fazer somente uma table com os campos
id
campo1
campo2
campo...
teste_id
????
<?php
class Post extends AppModel {
public $name = 'Post';
public $belongsTo = array(
'Parent' => array(
'className' => 'Post',
'foreignKey' => 'parent_id'
)
);
public $hasMany = array(
'Children' => array(
'className' => 'Post',
'foreignKey' => 'parent_id'
)
);
}