Same filename and directory in other branches
- 8.x-1.x src/Services/EntityCloneServiceProvider.php
Namespace
Drupal\entity_clone\Services
File
-
src/Services/EntityCloneServiceProvider.php
View source
<?php
namespace Drupal\entity_clone\Services;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\user\EntityOwnerTrait;
class EntityCloneServiceProvider {
protected $entityType;
public function __construct() {
}
public function entityTypeHasOwnerTrait(EntityTypeInterface $entityType) {
try {
$reflectionClass = new \ReflectionClass($entityType->getOriginalClass());
} catch (\ReflectionException $e) {
return FALSE;
}
return in_array(EntityOwnerTrait::class, array_keys($reflectionClass->getTraits()));
}
}
Classes