Merge branch 'master' of github.com:hoegrammer/opencase

This commit is contained in:
Naomi 2020-02-24 13:01:15 +00:00
commit 88b5ce3d2e
2 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,15 @@
<?php <?php
function opencase_entities_update_8013() {
$update_manager = \Drupal::entityDefinitionUpdateManager();
$definition = $update_manager->getFieldStorageDefinition('activity_date_time', 'oc_activity');
// $definition->setDescription('');
// $definition->setRequired('');
//->setDefaultValueCallback('Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
$update_manager->updateFieldStorageDefinition($definition);
}
/** /**
* Add 'activity_date_time' field to 'oc_activity' entities. * Add 'activity_date_time' field to 'oc_activity' entities.
*/ */

View File

@ -86,7 +86,6 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
public static function currentDateTime() { public static function currentDateTime() {
$current_time = DrupalDateTime::createFromTimestamp(time()); $current_time = DrupalDateTime::createFromTimestamp(time());
$formatted = $current_time->format(DateTimeItem::DATETIME_STORAGE_FORMAT); $formatted = $current_time->format(DateTimeItem::DATETIME_STORAGE_FORMAT);
\Drupal::logger("nr_debug")->notice($formatted);
return $formatted; return $formatted;
} }
/** /**