/** * {@inheritdoc} */ public function toArray() { $properties = parent::toArray(); // The 'roles' property is only used during install and should never // actually be saved. unset($properties['roles']); return $properties; }
/** * {@inheritdoc} */ public function toArray() { $properties = parent::toArray(); $names = array('protections', 'protectedEntityTypeId', 'protectedEntityId'); foreach ($names as $name) { $properties[$name] = $this->get($name); } return $properties; }
/** * @covers ::toArray * * @expectedException \Drupal\Core\Config\Schema\SchemaIncompleteException */ public function testToArrayFallback() { $this->entityType->expects($this->any())->method('getPropertiesToExport')->willReturn([]); $this->entity->toArray(); }
/** * @covers ::toArray * * @expectedException \Drupal\Core\Config\Schema\SchemaIncompleteException */ public function testToArrayFallback() { $this->entity->toArray(); }
/** * {@inheritdoc} */ public function toArray() { $properties = parent::toArray(); // Do not store options for fields whose display is not set to be // configurable. foreach ($this->getFieldDefinitions() as $field_name => $definition) { if (!$definition->isDisplayConfigurable($this->displayContext)) { unset($properties['content'][$field_name]); unset($properties['hidden'][$field_name]); } } return $properties; }
/** * {@inheritdoc} */ public function toArray() { // @todo It's a bug that we have to do this. Backend configuration should // always be set via the server's setBackendConfiguration() method, // otherwise the two can diverge causing this and other problems. The // alternative would be to call $server->setBackendConfiguration() in the // backend's setConfiguration() method and use a second $propagate // parameter to avoid an infinite loop. Similar things go for the index's // various plugins. Maybe using plugin bags is the solution here? $properties = parent::toArray(); if ($this->hasValidBackend()) { $properties['backend_config'] = $this->getBackend()->getConfiguration(); } return $properties; }
/** * {@inheritdoc} */ public function toArray() { $properties = parent::toArray(); // Additionally, include the field type, that is needed to be able to // generate the field-type-dependant parts of the config schema and to // allow for mapping settings from storage by field type. // @see \Drupal\field\FieldInstanceConfigStorage::mapFromStorageRecords(). $properties['field_type'] = $this->getType(); return $properties; }
/** * {@inheritdoc} */ public function toArray() { $properties = parent::toArray(); // Additionally, include the field type, that is needed to be able to // generate the field-type-dependant parts of the config schema. $properties['field_type'] = $this->getType(); return $properties; }
/** * {@inheritdoc} */ public function toArray() { $properties = parent::toArray(); $names = ['id', 'label', 'path', 'display_variants', 'access_conditions', 'access_logic', 'use_admin_theme', 'static_context']; foreach ($names as $name) { $properties[$name] = $this->get($name); } return $properties; }