本文整理匯總了PHP中Drupal\Core\Entity\EntityTypeInterface::hasHandlerClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityTypeInterface::hasHandlerClass方法的具體用法?PHP EntityTypeInterface::hasHandlerClass怎麽用?PHP EntityTypeInterface::hasHandlerClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Core\Entity\EntityTypeInterface
的用法示例。
在下文中一共展示了EntityTypeInterface::hasHandlerClass方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildForm
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
if ($this->entity && $this->entityTypeDefinition->hasHandlerClass('entity_clone')) {
$form['information'] = [
'#markup' => $this->stringTranslationManager->translate('<p>Do you want clone the <em>@entity_type</em> entity named <em>@title</em>?</p>', [
'@entity_type' => $this->entity->getEntityType()->getLabel(),
'@title' => $this->entity->label(),
]),
];
/** @var \Drupal\entity_clone\EntityClone\EntityCloneFormInterface $entity_clone_handler */
if ($this->entityTypeManager->hasHandler($this->entityTypeDefinition->id(), 'entity_clone_form')) {
$entity_clone_form_handler = $this->entityTypeManager->getHandler($this->entityTypeDefinition->id(), 'entity_clone_form');
$form = array_merge($form, $entity_clone_form_handler->formElement($this->entity));
}
$form['clone'] = [
'#type' => 'submit',
'#value' => 'Clone',
];
$form['abort'] = [
'#type' => 'submit',
'#value' => 'Abort',
'#submit' => '::cancelForm',
];
}
return $form;
}
示例2: canModerateEntitiesOfEntityType
/**
* {@inheritdoc}
*/
public function canModerateEntitiesOfEntityType(EntityTypeInterface $entity_type)
{
return $entity_type->hasHandlerClass('moderation');
}
示例3: isModeratableEntityType
/**
* {@inheritdoc}
*/
public function isModeratableEntityType(EntityTypeInterface $entity_type)
{
return $entity_type->hasHandlerClass('moderation');
}