You are here

protected function EntityHandlerBase::getDateProperty in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 2.1.x src/Plugin/EntityHandlerBase.php \Drupal\cms_content_sync\Plugin\EntityHandlerBase::getDateProperty()
1 call to EntityHandlerBase::getDateProperty()
EntityHandlerBase::setEntityValues in src/Plugin/EntityHandlerBase.php
Set the values for the pulled entity.

File

src/Plugin/EntityHandlerBase.php, line 744

Class

EntityHandlerBase
Common base class for entity handler plugins.

Namespace

Drupal\cms_content_sync\Plugin

Code

protected function getDateProperty(SyncIntent $intent, string $name) {
  $value = $intent
    ->getProperty($name);
  if (is_array($value)) {
    return isset($value[0]['value']) ? $value[0]['value'] : $value['value'];
  }
  return (int) $value;
}