Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / lib / Drupal / Core / TypedData / TypedDataInternalPropertiesHelper.php
1 <?php
2
3 namespace Drupal\Core\TypedData;
4
5 /**
6  * Helper class for internal properties.
7  */
8 class TypedDataInternalPropertiesHelper {
9
10   /**
11    * Gets an array non-internal properties from a complex data object.
12    *
13    * @param \Drupal\Core\TypedData\ComplexDataInterface $data
14    *   The complex data object.
15    *
16    * @return \Drupal\Core\TypedData\TypedDataInterface[]
17    *   The non-internal properties, keyed by property name.
18    */
19   public static function getNonInternalProperties(ComplexDataInterface $data) {
20     return array_filter($data->getProperties(TRUE), function (TypedDataInterface $property) {
21       return !$property->getDataDefinition()->isInternal();
22     });
23   }
24
25 }