🇮🇳India @ashwani737

Account created on 17 January 2012, over 12 years ago
#

Recent comments

🇮🇳India ashwani737

Hi @dpi #dpi

As per this documentation Entity type definitions are arrays, not objects.

\web\core\lib\Drupal\Core\Entity\entity.api.php

function hook_entity_type_build(array &$entity_types) {
  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
  // Add a form for a custom node form without overriding the default
  // node form. To override the default node form, use hook_entity_type_alter().
  $entity_types['node']->setFormClass('mymodule_foo', 'Drupal\mymodule\NodeFooForm');
}
🇮🇳India ashwani737

Hi @dpi

As per this documentation Entity type definitions are arrays, not objects.

\core\lib\Drupal\Core\Entity\entity.api.php

function hook_entity_type_build(array &$entity_types) {
  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
  // Add a form for a custom node form without overriding the default
  // node form. To override the default node form, use hook_entity_type_alter().
  $entity_types['node']->setFormClass('mymodule_foo', 'Drupal\mymodule\NodeFooForm');
}
🇮🇳India ashwani737

hi @dpi
as per this documentation its an array not an object.

\core\lib\Drupal\Core\Entity\entity.api.php

function hook_entity_type_build(array &$entity_types) {
/** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
// Add a form for a custom node form without overriding the default
// node form. To override the default node form, use hook_entity_type_alter().
$entity_types['node']->setFormClass('mymodule_foo', 'Drupal\mymodule\NodeFooForm');
}

Production build 0.69.0 2024