Browse Source

Update doc blocks for addAssociations()

Mark Story 11 years ago
parent
commit
ca27336e94
1 changed files with 10 additions and 6 deletions
  1. 10 6
      src/ORM/Table.php

+ 10 - 6
src/ORM/Table.php

@@ -565,21 +565,25 @@ class Table implements RepositoryInterface, EventListenerInterface {
 	}
 
 /**
- * Setup associations.
+ * Setup multiple associations.
  *
  * It takes an array containing set of table names indexed by association type
  * as argument:
  *
  * {{{
  * $this->Posts->associations([
- * 		'belongsTo' => [
- * 			'Users' => ['className' => 'App\Model\Table\UsersTable']
- * 		],
- * 		'hasMany' => ['Comments'],
- * 		'belongsToMany' => ['Tags']
+ *   'belongsTo' => [
+ *     'Users' => ['className' => 'App\Model\Table\UsersTable']
+ *   ],
+ *   'hasMany' => ['Comments'],
+ *   'belongsToMany' => ['Tags']
  * ]);
  * }}}
  *
+ * Each association type accepts multiple associations where the keys
+ * are the aliases, and the values are association config data. If numeric
+ * keys are used the values will be treated as association aliases.
+ *
  * @param array $params Set of associations to bind (indexed by association type)
  * @return void
  * @see \Cake\ORM\Table::belongsTo()