Merge plan_record module into plan module.
This commit is contained in:
parent
36fc154c47
commit
8bf87f00fe
|
@ -19,6 +19,20 @@ plan.type.*:
|
|||
type: boolean
|
||||
label: 'Create new revision'
|
||||
|
||||
plan.record.type.*:
|
||||
type: config_entity
|
||||
label: 'Plan record relationship type'
|
||||
mapping:
|
||||
id:
|
||||
type: string
|
||||
label: 'Machine-readable name'
|
||||
label:
|
||||
type: label
|
||||
label: 'Type'
|
||||
description:
|
||||
type: text
|
||||
label: 'Description'
|
||||
|
||||
condition.plugin.plan_type:
|
||||
type: condition.plugin
|
||||
mapping:
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
plan_record.type.*:
|
||||
type: config_entity
|
||||
label: 'Plan record relationship type'
|
||||
mapping:
|
||||
id:
|
||||
type: string
|
||||
label: 'Machine-readable name'
|
||||
label:
|
||||
type: label
|
||||
label: 'Type'
|
||||
description:
|
||||
type: text
|
||||
label: 'Description'
|
|
@ -1,8 +0,0 @@
|
|||
name: Plan record relationship
|
||||
description: Provides an entity to store the relationship between a plan and a record along with additional metadata.
|
||||
type: module
|
||||
package: farmOS
|
||||
core_version_requirement: ^10
|
||||
dependencies:
|
||||
- entity:entity
|
||||
- farm:plan
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Post update hooks for the plan module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Install plan_record and plan_record_type entity types.
|
||||
*/
|
||||
function plan_post_update_install_plan_record(&$sandbox) {
|
||||
\Drupal::entityDefinitionUpdateManager()->installEntityType(
|
||||
\Drupal::entityTypeManager()->getDefinition('plan_record_type')
|
||||
);
|
||||
\Drupal::entityDefinitionUpdateManager()->installEntityType(
|
||||
\Drupal::entityTypeManager()->getDefinition('plan_record')
|
||||
);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\plan_record\Entity;
|
||||
namespace Drupal\plan\Entity;
|
||||
|
||||
use Drupal\Core\Entity\ContentEntityBase;
|
||||
use Drupal\Core\Entity\EntityTypeInterface;
|
||||
|
@ -9,6 +9,9 @@ use Drupal\Core\Field\BaseFieldDefinition;
|
|||
/**
|
||||
* Defines the Plan record relationship entity.
|
||||
*
|
||||
* This entity type can be used to create relationships between a plan and other
|
||||
* record(s) along with additional metadata fields to describe the relationship.
|
||||
*
|
||||
* @ContentEntityType(
|
||||
* id = "plan_record",
|
||||
* label = @Translation("Plan record relationship"),
|
||||
|
@ -38,7 +41,7 @@ class PlanRecord extends ContentEntityBase implements PlanRecordInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBundleLabel() {
|
||||
/** @var \Drupal\plan_record\Entity\PlanRecordTypeInterface $type */
|
||||
/** @var \Drupal\plan\Entity\PlanRecordTypeInterface $type */
|
||||
$type = \Drupal::entityTypeManager()
|
||||
->getStorage('plan_record_type')
|
||||
->load($this->bundle());
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\plan_record\Entity;
|
||||
namespace Drupal\plan\Entity;
|
||||
|
||||
use Drupal\Core\Entity\ContentEntityInterface;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\plan_record\Entity;
|
||||
namespace Drupal\plan\Entity;
|
||||
|
||||
use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
|
||||
|
||||
|
@ -20,7 +20,7 @@ use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
|
|||
* handlers = {
|
||||
* "access" = "\Drupal\entity\BundleEntityAccessControlHandler",
|
||||
* },
|
||||
* config_prefix = "type",
|
||||
* config_prefix = "record.type",
|
||||
* bundle_of = "plan_record",
|
||||
* entity_keys = {
|
||||
* "id" = "id",
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\plan_record\Entity;
|
||||
namespace Drupal\plan\Entity;
|
||||
|
||||
use Drupal\Core\Config\Entity\ConfigEntityInterface;
|
||||
use Drupal\Core\Entity\EntityDescriptionInterface;
|
Loading…
Reference in New Issue