You are here

public function EntityExampleBasicController::create in Examples for Developers 7

Create and return a new entity_example_basic entity.

Overrides EntityExampleBasicControllerInterface::create

File

entity_example/entity_example.module, line 544
Implements the basic functionality required to create and display an entity.

Class

EntityExampleBasicController
EntityExampleBasicController extends DrupalDefaultEntityController.

Code

public function create() {
  $entity = new stdClass();
  $entity->type = 'entity_example_basic';
  $entity->basic_id = 0;
  $entity->bundle_type = 'first_example_bundle';
  $entity->item_description = '';
  return $entity;
}