getRaw() public méthode

This is usefull for input validation for example.
public getRaw ( string $field ) : mixed
$field string the field
Résultat mixed null on invalid field or else the raw value
Exemple #1
0
 public function testGetRaw()
 {
     $definition = $this->crudServiceProvider->getData('book')->getDefinition();
     $entity = new Entity($definition);
     $entity->set('test', 'testdata');
     $read = $entity->getRaw('test');
     $expected = 'testdata';
     $this->assertSame($expected, $read);
     $read = $entity->getRaw('test2');
     $this->assertNull($read);
 }