/** * {@inheritdoc} * * @throws ConfigurationException */ public function loadContentTypes() { // Make sure to initialise by reading the data source. if (!$this->isInitialised()) { $this->parseDataSource(); } $globalFields = $this->loadGlobalFields(); $globalExtras = $this->loadGlobalExtras(); $contentTypes = array(); if (empty($this->config)) { throw new ConfigurationException("Configuration file is invalid"); } if (isset($this->config['ContentTypes'])) { foreach ($this->config['ContentTypes'] as $contentTypeData) { $contentType = ContentType::parseYaml($contentTypeData, $globalFields, $globalExtras); $contentTypes[$contentType->getMachineName()] = $contentType; } } else { throw new ConfigurationException("No Drupal content types are configured"); } return $contentTypes; }