getFields() публичный Метод

Evaluates the fields and no-fields options, and returns if, and which fields should be made accessible.
public getFields ( ) : array | boolean | null
Результат array | boolean | null Either an array of fields, `false` in case the no-fields option is used, or `null` if none of the field options is used.
Пример #1
0
 /**
  * Test getting accessible fields with a whitelist
  *
  * @return void
  */
 public function testGetFieldsWhiteList()
 {
     $model = TableRegistry::get('BakeArticles');
     $this->Task->params['fields'] = 'id, title  , , body ,  created';
     $result = $this->Task->getFields($model);
     $expected = ['id', 'title', 'body', 'created'];
     $this->assertEquals($expected, $result);
 }