Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes

This commit is contained in:
Pantheon Automation 2016-04-20 09:56:34 -07:00 committed by Greg Anderson
parent b11a755ba8
commit c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\ParamConverter\AdminPathConfigEntityConverter.
*/
namespace Drupal\Core\ParamConverter;
use Drupal\Core\Routing\AdminContext;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\ParamConverter\EntityConverter.
*/
namespace Drupal\Core\ParamConverter;
use Drupal\Core\Entity\EntityInterface;

View file

@ -0,0 +1,60 @@
<?php
namespace Drupal\Core\ParamConverter;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\Routing\Route;
/**
* Parameter converter for upcasting entity revision IDs to full objects.
*
* This is useful for pages which want to show a specific revision, like
* "/entity_example/{entity_example}/revision/{entity_example_revision}".
*
*
* In order to use it you should specify some additional options in your route:
* @code
* example.route:
* path: /foo/{entity_example_revision}
* options:
* parameters:
* entity_example_revision:
* type: entity_revision:entity_example
* @endcode
*/
class EntityRevisionParamConverter implements ParamConverterInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Creates a new EntityRevisionParamConverter instance.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager) {
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public function convert($value, $definition, $name, array $defaults) {
list (, $entity_type_id) = explode(':', $definition['type'], 2);
$entity_storage = $this->entityTypeManager->getStorage($entity_type_id);
return $entity_storage->loadRevision($value);
}
/**
* {@inheritdoc}
*/
public function applies($definition, $name, Route $route) {
return isset($definition['type']) && strpos($definition['type'], 'entity_revision:') !== FALSE;
}
}

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\ParamConverter\MenuLinkPluginConverter.
*/
namespace Drupal\Core\ParamConverter;
use Drupal\Core\Menu\MenuLinkManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\ParamConverter\ParamConverterInterface.
*/
namespace Drupal\Core\ParamConverter;
use Symfony\Component\Routing\Route;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\ParamConverter\ParamConverterManager.
*/
namespace Drupal\Core\ParamConverter;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\ParamConverter\ParamConverterManagerInterface.
*/
namespace Drupal\Core\ParamConverter;
use Symfony\Component\Routing\RouteCollection;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Core\ParamConverter\ParamNotConvertedException.
*/
namespace Drupal\Core\ParamConverter;
/**