Created
March 2, 2017 19:19
-
-
Save cyberlex404/fa8f05d595f1f930d3ba786a638eaf1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Drupal\Core\Entity\EntityTypeManager definition. | |
| * | |
| * @var \Drupal\Core\Entity\EntityTypeManager | |
| */ | |
| protected $entityTypeManager; | |
| /** | |
| * Drupal\Core\Entity\Query\QueryFactory definition. | |
| * | |
| * @var \Drupal\Core\Entity\Query\QueryFactory | |
| */ | |
| protected $entityQuery; | |
| /** | |
| * Drupal\Core\Session\AccountProxy definition. | |
| * | |
| * @var \Drupal\Core\Session\AccountProxy | |
| */ | |
| protected $currentUser; | |
| public function __construct( | |
| EntityTypeManager $entity_type_manager, | |
| QueryFactory $entity_query, | |
| AccountProxy $current_user | |
| ) { | |
| $this->entityTypeManager = $entity_type_manager; | |
| $this->entityQuery = $entity_query; | |
| $this->currentUser = $current_user; | |
| } | |
| public static function create(ContainerInterface $container) { | |
| return new static( | |
| $container->get('entity_type.manager'), | |
| $container->get('entity.query'), | |
| $container->get('current_user') | |
| ); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment