You are here

public function ViewStorageController::create in Views (for Drupal 7) 8.3

Overrides Drupal\config\ConfigStorageController::create().

File

lib/Drupal/views/ViewStorageController.php, line 72
Definition of Drupal\views\ViewStorageController.

Class

ViewStorageController
Defines the storage controller class for ViewStorage entities.

Namespace

Drupal\views

Code

public function create(array $values) {

  // If there is no information about displays available add at least the
  // default display.
  $values += array(
    'display' => array(
      'default' => array(
        'display_plugin' => 'default',
        'id' => 'default',
        'display_title' => 'Master',
      ),
    ),
  );
  $entity = parent::create($values);
  $this
    ->attachDisplays($entity);
  return $entity;
}