onlyFields() public méthode

Sets which fields we will select.
public onlyFields ( array $fields = [] )
$fields array
Exemple #1
0
 public function testException1fixed()
 {
     $m = new Model();
     $m->addField('name');
     $m->addField('surname');
     $m->onlyFields(['surname']);
     $m->allFields();
     $m['name'] = 5;
 }
Exemple #2
0
 public function testSystem1()
 {
     $m = new Model();
     $m->addField('foo', ['system' => true]);
     $m->addField('bar');
     $this->assertEquals(false, $m->getElement('foo')->isEditable());
     $this->assertEquals(false, $m->getElement('foo')->isVisible());
     $m->onlyFields(['bar']);
     // TODO: build a query and see if the field is there
 }