Advertisement
pushrbx

Untitled

Mar 20th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.31 KB | None | 0 0
  1. $this->Node->saveAll(array(
  2.     0 => array(
  3.         'Node' => array(
  4.             'id' => '61348',
  5.             'title' => 'Acceloid Team',
  6.             'slug' => 'acceloid-team',
  7.             'user_id' => (int) 1,
  8.             'type' => 'csapat',
  9.             'status' => (int) 1,
  10.             'scope' => (int) 1,
  11.             'path' => '/team/acceloid-team',
  12.             'visibility_roles' => ''
  13.         ),
  14.         'Team' => array(
  15.             'node_id' => '61348',
  16.             'id' => '1',
  17.             'state' => 'active',
  18.             'email' => 'acceloidxxxxx@gmail.com',
  19.             'link' => 'N/A',
  20.             'formed' => '2013-08-02',
  21.             'image' => 'images/teams/673.jpg',
  22.             'is_verified' => 0,
  23.             'Project' => array(
  24.                 0 => array(
  25.                     'node_id' => '61357',
  26.                     'progress' => '0',
  27.                     'special_count' => 0,
  28.                     'state' => 'hidden',
  29.                     'params' => '{}',
  30.                     'modified' => '2014-03-20 14:52:53'
  31.                 )
  32.             )
  33.         )
  34.     )
  35. ), array('deep' => true));
  36.  
  37. // Models:
  38. class Team extends AppModel
  39. {
  40.     public $hasAndBelongsToMany = array(
  41.         'Project' => array(
  42.             'className' => 'Project',
  43.             'joinTable' => 'teams_projects',
  44.             'foreignKey' => 'team_id',
  45.             'associationForeignKey' => 'project_id',
  46.         )
  47.     );
  48. }
  49.  
  50. class Project extends AppModel
  51. {
  52.     public $hasAndBelongsToMany = array(
  53.         'Team' => array(
  54.             'className' => 'Team',
  55.             'joinTable' => 'teams_projects',
  56.             'foreignKey' => 'project_id',
  57.             'associationForeignKey' => 'team_id',
  58.         )
  59.     );
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement