You are here

function cacheflush_create in CacheFlush 8

Same name and namespace in other branches
  1. 7.3 modules/cacheflush_entity/cacheflush_entity.module \cacheflush_create()

Constructs a new entity object, without permanently saving it.

Parameters

array $values: Values of the entity to be created.

Return value

object New cacheflush entity.

Throws

\Exception Throws exception if exists.

3 calls to cacheflush_create()
CacheFlushEntityTest::testCrudFunctions in modules/cacheflush_entity/tests/Functional/CacheFlushEntityTest.php
Tests CRUD functions for cacheflush entity.
CacheFlushTest::createTestEntitys in tests/src/Functional/CacheFlushTest.php
Create cacheflush test entities.
CacheFlushUICRUDAccessTest::createTestEntitys in modules/cacheflush_ui/tests/src/Functional/CacheFlushUICRUDAccessTest.php
Create cacheflush test entities.

File

modules/cacheflush_entity/cacheflush_entity.module, line 20
Cacheflush Entity API.

Code

function cacheflush_create(array $values = []) {
  return \Drupal::entityTypeManager()
    ->getStorage('cacheflush')
    ->create($values);
}