public function getMetadataServiceDescribeAsArray(Metadata $metadata)
 {
     $metadataArray = [];
     $metadataArray['name'] = $metadata->getName();
     $metadataArray['description'] = $metadata->getDescription();
     $metadataArray['displayName'] = $metadata->getDisplayName();
     $metadataArray['imageUrl'] = $metadata->getImageUrl();
     $metadataArray['longDescription'] = $metadata->getLongDescription();
     $metadataArray['providerDisplayName'] = $metadata->getProviderDisplayName();
     $metadataArray['documentationUrl'] = $metadata->getDocumentationUrl();
     $metadataArray['supportUrl'] = $metadata->getSupportUrl();
     return $metadataArray;
 }
 public function createMetadata(array $metadata)
 {
     $em = $this->doctrineBoot->getEntityManager();
     $repo = $em->getRepository(Metadata::class);
     $metadataObject = null;
     if (!isset($metadata['name'])) {
         $metadata['name'] = $metadata['displayName'];
     }
     if ($metadata['name'] !== null) {
         $metadataObject = $repo->find($metadata['name']);
     }
     if ($metadataObject === null) {
         $metadataObject = new Metadata($metadata['name'], $metadata['displayName']);
     }
     $bullets = !isset($metadata['bullets']) ? [] : $metadata['bullets'];
     $costs = !isset($metadata['costs']) ? [] : $metadata['costs'];
     $metadataObject->setBullets($bullets);
     $metadataObject->setCosts($costs);
     $metadataObject->setDescription($metadata['description']);
     $metadataObject->setDocumentationUrl($metadata['documentationUrl']);
     $metadataObject->setImageUrl($metadata['imageUrl']);
     $metadataObject->setLongDescription($metadata['longDescription']);
     $metadataObject->setProviderDisplayName($metadata['providerDisplayName']);
     $metadataObject->setSupportUrl($metadata['supportUrl']);
     $em->persist($metadataObject);
     return $metadataObject;
 }