summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/TypedData/TypedDataInternalPropertiesHelper.php
blob: a9a59d74202155758e26be8d2ad5000eaeee29a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

namespace Drupal\Core\TypedData;

/**
 * Helper class for internal properties.
 */
class TypedDataInternalPropertiesHelper {

  /**
   * Gets an array non-internal properties from a complex data object.
   *
   * @param \Drupal\Core\TypedData\ComplexDataInterface $data
   *   The complex data object.
   *
   * @return \Drupal\Core\TypedData\TypedDataInterface[]
   *   The non-internal properties, keyed by property name.
   */
  public static function getNonInternalProperties(ComplexDataInterface $data) {
    return array_filter($data->getProperties(TRUE), function (TypedDataInterface $property) {
      return !$property->getDataDefinition()->isInternal();
    });
  }

}