$this->Node->saveAll(array( 0 => array( 'Node' => array( 'id' => '61348', 'title' => 'Acceloid Team', 'slug' => 'acceloid-team', 'user_id' => (int) 1, 'type' => 'csapat', 'status' => (int) 1, 'scope' => (int) 1, 'path' => '/team/acceloid-team', 'visibility_roles' => '' ), 'Team' => array( 'node_id' => '61348', 'id' => '1', 'state' => 'active', 'email' => 'acceloidxxxxx@gmail.com', 'link' => 'N/A', 'formed' => '2013-08-02', 'image' => 'images/teams/673.jpg', 'is_verified' => 0, 'Project' => array( 0 => array( 'node_id' => '61357', 'progress' => '0', 'special_count' => 0, 'state' => 'hidden', 'params' => '{}', 'modified' => '2014-03-20 14:52:53' ) ) ) ) ), array('deep' => true)); // Models: class Team extends AppModel { public $hasAndBelongsToMany = array( 'Project' => array( 'className' => 'Project', 'joinTable' => 'teams_projects', 'foreignKey' => 'team_id', 'associationForeignKey' => 'project_id', ) ); } class Project extends AppModel { public $hasAndBelongsToMany = array( 'Team' => array( 'className' => 'Team', 'joinTable' => 'teams_projects', 'foreignKey' => 'project_id', 'associationForeignKey' => 'team_id', ) ); }