Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

EntityDateFormat.php

Namespace

Drupal\system\Plugin\migrate\destination

File

core/modules/system/src/Plugin/migrate/destination/EntityDateFormat.php

View source
<?php

namespace Drupal\system\Plugin\migrate\destination;

use Drupal\Core\Datetime\DateFormatInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\migrate\Attribute\MigrateDestination;
use Drupal\migrate\Plugin\migrate\destination\EntityConfigBase;

/**
 * Migration destination for date format entity.
 */
class EntityDateFormat extends EntityConfigBase {
    
    /**
     * {@inheritdoc}
     */
    protected function updateEntityProperty(EntityInterface $entity, array $parents, $value) {
        assert($entity instanceof DateFormatInterface);
        if ($parents[0] == 'pattern') {
            $entity->setPattern($value);
        }
        else {
            parent::updateEntityProperty($entity, $parents, $value);
        }
    }

}

Classes

Title Deprecated Summary
EntityDateFormat Migration destination for date format entity.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal