You are here

public function Mock::newEntity in Realistic Dummy Content 8.2

Same name and namespace in other branches
  1. 7.2 api/src/Framework/Mock.php \Drupal\realistic_dummy_content_api\Framework\Mock::newEntity()

File

api/src/Framework/Mock.php, line 17

Class

Mock
Represents a mock framework (experimental).

Namespace

Drupal\realistic_dummy_content_api\Framework

Code

public function newEntity($entity) {
  $this
    ->hookEntityPresave($entity, $entity->type);
  $id = rand();
  $this->entites[$id] = $entity;
  return $id;
}