You are here

public function EntityformTypeController::create in Entityform 7

Same name and namespace in other branches
  1. 7.2 entityform.module \EntityformTypeController::create()

Create a entityform type - we first set up the values that are specific to our entityform type schema but then also go through the EntityAPIController function.

Parameters

$type: The machine-readable type of the entityform.

Return value

A entityform type object with all default fields initialized.

Overrides EntityAPIController::create

File

./entityform.module, line 1259
Module for the Entityform Entity - a starting point to create your own Entity and associated administration interface

Class

EntityformTypeController
The Controller for Entityform entities

Code

public function create(array $values = array()) {

  // Add values that are specific to our Entityform
  $default_values = variable_get('entityform_type_defaults', array());
  $values += $default_values;
  $values += array(
    'id' => '',
    'is_new' => TRUE,
    'data' => array(
      'submissions_view' => 'entityforms',
      'user_submissions_view' => 'user_entityforms',
    ),
  );
  $entityform_type = parent::create($values);
  return $entityform_type;
}