Uses the hidden and no-hidden options.
public getHiddenFields ( |
||
$model | The model to introspect. | |
return | array | The columns to make accessible |
/** * Test getting hidden field with a whitelist * * @return void */ public function testGetHiddenFieldsWhiteList() { $model = TableRegistry::get('Users'); $this->Task->params['hidden'] = 'id, title , , body , created'; $result = $this->Task->getHiddenFields($model); $expected = ['id', 'title', 'body', 'created']; $this->assertEquals($expected, $result); }