function ConfigTest::toArray

Same name in other branches
  1. 10 core/modules/config/tests/config_test/src/Entity/ConfigTest.php \Drupal\config_test\Entity\ConfigTest::toArray()

Overrides ConfigEntityBase::toArray

File

core/modules/config/tests/config_test/src/Entity/ConfigTest.php, line 332

Class

ConfigTest
Defines the ConfigTest configuration entity.

Namespace

Drupal\config_test\Entity

Code

public function toArray() {
    $properties = parent::toArray();
    // Only export the 'array_property' is there is data.
    if (empty($properties['array_property'])) {
        unset($properties['array_property']);
    }
    return $properties;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.