Added new website field (org_website) - link field
This commit is contained in:
parent
49bf43e5b4
commit
bca978f6f0
@ -5,6 +5,25 @@ use \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter;
|
|||||||
use \Drupal\Core\Field\BaseFieldDefinition;
|
use \Drupal\Core\Field\BaseFieldDefinition;
|
||||||
|
|
||||||
|
|
||||||
|
function opencase_entities_update_90003() {
|
||||||
|
$field_storage_definition = BaseFieldDefinition::create('link')
|
||||||
|
->setLabel(t('Website'))
|
||||||
|
->setRevisionable(TRUE)
|
||||||
|
->setSettings([
|
||||||
|
'max_length' => 50,
|
||||||
|
'text_processing' => 0,
|
||||||
|
])
|
||||||
|
->setDefaultValue('')
|
||||||
|
->setDisplayConfigurable('form', true)
|
||||||
|
->setDisplayConfigurable('view', true)
|
||||||
|
->setRequired(FALSE);
|
||||||
|
|
||||||
|
|
||||||
|
\Drupal::entityDefinitionUpdateManager()
|
||||||
|
->installFieldStorageDefinition('org_website', 'oc_organisation', 'opencase_entities', $field_storage_definition);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function opencase_entities_update_90002() {
|
function opencase_entities_update_90002() {
|
||||||
$field_storage_definition = BaseFieldDefinition::create('entity_reference')
|
$field_storage_definition = BaseFieldDefinition::create('entity_reference')
|
||||||
->setLabel(t('Target'))
|
->setLabel(t('Target'))
|
||||||
|
@ -222,6 +222,21 @@ class OCOrganisation extends EditorialContentEntityBase implements OCOrganisatio
|
|||||||
->setDisplayConfigurable('form', true)
|
->setDisplayConfigurable('form', true)
|
||||||
->setDisplayConfigurable('view', true)
|
->setDisplayConfigurable('view', true)
|
||||||
->setRequired(FALSE);
|
->setRequired(FALSE);
|
||||||
|
|
||||||
|
$fields['org_website'] = BaseFieldDefinition::create('link')
|
||||||
|
->setLabel(t('Website'))
|
||||||
|
->setRevisionable(TRUE)
|
||||||
|
->setSettings([
|
||||||
|
'max_length' => 50,
|
||||||
|
'text_processing' => 0,
|
||||||
|
'title' => 0,
|
||||||
|
'link_type' => 16
|
||||||
|
])
|
||||||
|
->setDefaultValue('')
|
||||||
|
->setDisplayConfigurable('form', true)
|
||||||
|
->setDisplayConfigurable('view', true)
|
||||||
|
->setRequired(FALSE);
|
||||||
|
|
||||||
$fields['contact_name'] = BaseFieldDefinition::create('string')
|
$fields['contact_name'] = BaseFieldDefinition::create('string')
|
||||||
->setLabel(t('Contact Name'))
|
->setLabel(t('Contact Name'))
|
||||||
->setDescription(t('Name of the main contact for this organisation.'))
|
->setDescription(t('Name of the main contact for this organisation.'))
|
||||||
|
@ -45,7 +45,7 @@ class AddEventsMenuLink extends DeriverBase implements ContainerDeriverInterface
|
|||||||
$eventTypes = $this->entityTypeManager->getStorage('oc_event_type')->loadMultiple();
|
$eventTypes = $this->entityTypeManager->getStorage('oc_event_type')->loadMultiple();
|
||||||
foreach ($eventTypes as $id => $eventType) {
|
foreach ($eventTypes as $id => $eventType) {
|
||||||
$links[$id] = [
|
$links[$id] = [
|
||||||
'title' => $eventType->label(),
|
'title' => $eventType->label() . " Event",
|
||||||
'route_name' => "entity.oc_event.add_form",
|
'route_name' => "entity.oc_event.add_form",
|
||||||
'route_parameters' => ['oc_event_type' => $eventType->id()]
|
'route_parameters' => ['oc_event_type' => $eventType->id()]
|
||||||
] + $base_plugin_definition;
|
] + $base_plugin_definition;
|
||||||
|
Reference in New Issue
Block a user