set() public method

Calling this method replaces the entire entity body. To add or modify a single value on the entity, use the array syntax for assignment. Example: $entity->set([ 'firstName' => 'Dave' ]);
public set ( array $entity ) : void
$entity array The new entity body.
return void
Beispiel #1
0
 public function testSet()
 {
     $data = ['foo' => 'bar'];
     $entity = new Entity($this->key, []);
     $entity->set($data);
     $this->assertEquals($data, $entity->get());
 }