LingotekContentEntityActionBase.php in Lingotek Translation 3.6.x
Same filename and directory in other branches
- 8.2 src/Plugin/Action/LingotekContentEntityActionBase.php
- 4.0.x src/Plugin/Action/LingotekContentEntityActionBase.php
- 3.0.x src/Plugin/Action/LingotekContentEntityActionBase.php
- 3.1.x src/Plugin/Action/LingotekContentEntityActionBase.php
- 3.2.x src/Plugin/Action/LingotekContentEntityActionBase.php
- 3.3.x src/Plugin/Action/LingotekContentEntityActionBase.php
- 3.4.x src/Plugin/Action/LingotekContentEntityActionBase.php
- 3.5.x src/Plugin/Action/LingotekContentEntityActionBase.php
- 3.7.x src/Plugin/Action/LingotekContentEntityActionBase.php
- 3.8.x src/Plugin/Action/LingotekContentEntityActionBase.php
Namespace
Drupal\lingotek\Plugin\ActionFile
src/Plugin/Action/LingotekContentEntityActionBase.phpView source
<?php
namespace Drupal\lingotek\Plugin\Action;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Action\Plugin\Action\EntityActionBase;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\lingotek\LingotekContentTranslationServiceInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class LingotekContentEntityActionBase extends EntityActionBase {
/**
* The Lingotek content translation service.
*
* @var \Drupal\lingotek\LingotekContentTranslationServiceInterface
*/
protected $translationService;
/**
* Constructs a new UploadToLingotekAction action.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\lingotek\LingotekContentTranslationServiceInterface $translation_service
* The Lingotek content translation service.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, LingotekContentTranslationServiceInterface $translation_service) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager);
$this->translationService = $translation_service;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('entity_type.manager'), $container
->get('lingotek.content_translation'));
}
/**
* {@inheritdoc}
*/
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
$result = AccessResult::allowed();
return $return_as_object ? $result : $result
->isAllowed();
}
}
Classes
Name | Description |
---|---|
LingotekContentEntityActionBase |