Skip to content
Permalink
Browse files

Add API docs for accessibleFields option.

  • Loading branch information...
markstory committed Sep 10, 2014
1 parent c79f240 commit 2f12dbbd6d9ab07f78a5aa6278838a55afaed469
Showing with 15 additions and 5 deletions.
  1. +15 −5 src/ORM/Table.php
@@ -1620,7 +1620,7 @@ public function entityValidator() {
* using the options parameter:
*
* {{{
* $articles = $this->Articles->newEntity(
* $article = $this->Articles->newEntity(
* $this->request->data(),
* ['associated' => ['Tags', 'Comments.Users']]
* );
@@ -1630,13 +1630,23 @@ public function entityValidator() {
* passing the `fieldList` option, which is also accepted for associations:
*
* {{{
* $articles = $this->Articles->newEntity($this->request->data(), [
* 'fieldList' => ['title', 'body'],
* 'associated' => ['Tags', 'Comments.Users' => ['fieldList' => 'username']]
* ]
* $article = $this->Articles->newEntity($this->request->data(), [
* 'fieldList' => ['title', 'body'],
* 'associated' => ['Tags', 'Comments.Users' => ['fieldList' => 'username']]
* ]
* );
* }}}
*
* The `fieldList` option lets remove or restrict input data from ending up in
* the entity. If you'd like to relax the entity's default accessible fields,
* you can use the `accessibleFields` option:
*
* {{{
* $article = $this->Articles->newEntity(
* $this->request->data(),
* ['accessibleFields' => ['protected_field' => true]]
* );
* }}}
*/
public function newEntity(array $data = [], array $options = []) {
if (!isset($options['associated'])) {

0 comments on commit 2f12dbb

Please sign in to comment.
You can’t perform that action at this time.