Returns embed's parameters.

@param \DOMElement $embed

@return array
335238
protected function getParameters(DOMElement $embed)
    {
        $parameters = [
            'noLayout' => true,
            'objectParameters' => [],
        ];

        $linkParameters = $this->getLinkParameters($embed);

        if ($linkParameters !== null) {
            $parameters['linkParameters'] = $linkParameters;
        }

        foreach ($embed->attributes as $attribute) {
            // We only consider tags in the custom namespace, and skip disallowed names
            if (
                !isset($this->excludedAttributes[$attribute->localName])
                && $attribute->localName !== 'url'
                && strpos($attribute->localName, EmbedLinking::TEMP_PREFIX) !== 0
            ) {
                $parameters['objectParameters'][$attribute->localName] = $attribute->nodeValue;
            }
        }

        return $parameters;
    }
822385
public function getEmbeddedsOneChanged()
    {
        $embeddedsOneChanged = array();
        if (isset($this->data['embeddedsOne'])) {
            foreach ($this->data['embeddedsOne'] as $name => $embedded) {
                if ($this->isEmbeddedOneChanged($name)) {
                    $embeddedsOneChanged[$name] = $this->getOriginalEmbeddedOneValue($name);
                }
            }
        }

        return $embeddedsOneChanged;
    }
1096365
public function getChangeSet()
    {
        return [
            'attributes'    => $this->filterNotSavedProperties($this->attributes->calculateChangeSet()),
            'embedOne'      => $this->hasOneEmbeds->calculateChangeSet(),
            'embedMany'     => $this->hasManyEmbeds->calculateChangeSet(),
        ];
    }
464846
public function getCompiledAttributes(): array
    {
        $key = $this->getKeyName();

        $embeddables = array_keys($this->getEmbeddables());

        $relationships = $this->getRelationships();

        $attributes = $this->getAttributes();

        return array_merge([$key], $embeddables, $relationships, $attributes);
    }
958450
protected function serializeEmbedOne(EmbedMetadata $embedMeta, Embed $embed = null)
    {
        if (null === $embed) {
            return;
        }
        $serialized = [];
        foreach ($embedMeta->getAttributes() as $key => $attrMeta) {
            $serialized[$key] = $this->serializeAttribute($embed->get($key), $attrMeta);
        }
        foreach ($embedMeta->getEmbeds() as $key => $embeddedPropMeta) {
            $serialized[$key] = $this->serializeEmbed($embed->get($key), $embeddedPropMeta);
        }

        return empty($serialized) ? null : $serialized;
    }
269603
protected function getEmbeddedObjectAttributes() : array
    {
        $entityMap = $this->getRelatedMapper()->getEntityMap();

        $attributes = $entityMap->getAttributes();
        $properties = $entityMap->getProperties();

        return array_merge($attributes, $properties);
    }
369063
public static function renderWrapperAttrs(array $embed): string
    {
        // attributes to be rendered
        $classes = array();
        $styles = array();
        // shortcuts
        $d = &$embed['dimension'];
        // determine classes
        $classes[] = 'video-wrapper';
        if ($d->dynamic) {
            $classes[] = 'wrap-'.$d->scale_model;
        }
        // determine inline CSS style(s)
        if ($d->dynamic && ($d->scale_model == 'scale-width-height')) {
            $styles[] = 'padding-bottom: ' . ($d->factor * 100) . '%;';
        }
        // render the attributes
        $class = implode(' ', $classes);
        $style = implode('; ', $styles) . (!empty($styles) ? ';' : '');
        return 'class="'.$class.'" style="'.$style.'"';
    }
120795
protected function parseEmbeds($embeds)
    {
        if ($embeds === false || $embeds === '') {
            return [];
        } elseif ($embeds === null) {
            return $this->defaultEmbeds;
        }

        if (is_string($embeds)) {
            $embeds = explode(',', $embeds);
        }

        if (is_array($embeds)) {
            $embeds = array_filter(array_map('trim', $embeds));
        } else {
            $embeds = [];
        }

        return $embeds;
    }
942854
private function getRelatedObjectList( DOMNodeList $domNodeList )
    {
        $embeddedObjectIdArray = array();
        foreach( $domNodeList as $embed )
        {
            if ( $embed->hasAttribute( 'object_id' ) )
            {
                $embeddedObjectIdArray[] = $embed->getAttribute( 'object_id' );
            }
            elseif ( $embed->hasAttribute( 'node_id' ) )
            {
                if ( $object = eZContentObject::fetchByNodeID( $embed->getAttribute( 'node_id' ) ) )
                {
                    $embeddedObjectIdArray[] = $object->attribute( 'id' );
                }
            }
        }
        return $embeddedObjectIdArray;
    }
1342156
public function getParams(array $overrides = null) {
        $params = array(
            'token' => $this->_token,
            'channel' => $this->_channel,
            'icon_emoji' => $this->_icon_emoji,
            'username' => $this->_username
        );

        if ($overrides) {
            $params = array_merge($params, $overrides);
        }

        return $params;
    }
945603
public function getInheritedContensetZoneParams(ContentSet $contentSet)
    {
        $zone = null;

        if (
            null === $this->getLayout()
            || null === $this->getParent()
            || false === is_array($this->getLayout()->getZones())
        ) {
            return $zone;
        }

        $layoutZones = $this->getLayout()->getZones();
        $count = $this->getParent()->getContentSet()->count();
        for ($i = 0; $i < $count; $i++) {
            $parentContentset = $this->getParent()->getContentSet()->item($i);

            if ($contentSet->getUid() === $parentContentset->getUid()) {
                $zone = $layoutZones[$i];
            }
        }

        return $zone;
    }
148415
protected function getBlockList(\DOMElement $element) {
    $lines = array();
    $prefix = $element->nodeName == 'ol' ? ' 1. ' : ' - ';
    // Markdown does not support definition lists, convert to ul.
    if ($element->nodeName == 'dl') {
      $newline = TRUE;
      /** @var \DOMElement $child */
      foreach ($element->childNodes as $child) {
        switch ($child->nodeName) {

          case 'dt':
            if ($newline) {
              $lines[] = $prefix . $this->getBlock($child);
            }
            else {
              $lines[count($lines) - 1] .= '<br/>' . $this->getBlock($child);
            }
            $newline = FALSE;
            break;

          case 'dd':
            $lines[count($lines) - 1] .= '<br/>' . $this->getBlock($child);
            $newline = TRUE;
            break;

        }
      }
    }
    else {
      /** @var \DOMElement $child */
      foreach ($element->childNodes as $child) {
        switch ($child->nodeName) {

          case 'li':
            $lines[] = $prefix . $this->getBlock($child);
            break;

        }
      }
    }
    return implode("\n", $lines);
  }
141899
protected function getParametrizationValues(array $config)
    {
        return [
            'elcodi.entity.image.class' => $config['mapping']['image']['class'],
            'elcodi.entity.image.mapping_file' => $config['mapping']['image']['mapping_file'],
            'elcodi.entity.image.manager' => $config['mapping']['image']['manager'],
            'elcodi.entity.image.enabled' => $config['mapping']['image']['enabled'],

            'elcodi.media_filesystem_service' => $config['filesystem'],

            'elcodi.image_generated_route_host' => $config['images']['generated_route_host'],
            'elcodi.image_view_max_age' => $config['images']['view']['max_age'],
            'elcodi.image_view_shared_max_age' => $config['images']['view']['shared_max_age'],
            'elcodi.image_upload_field_name' => $config['images']['upload']['field_name'],

            'elcodi.image_resize_converter_bin_path' => $config['images']['resize']['converter_bin_path'],
            'elcodi.image_resize_converter_default_profile' => $config['images']['resize']['converter_default_profile'],
        ];
    }
1273326
public function getEmbed($key)
    {
        if (!isset($this->embeds[$key])) {
            return null;
        }
        return $this->embeds[$key];
    }
569020
public function withAllowEmbed($allowEmbed)
    {
        $choices = [
            PlayerLocationInterface::ALLOW_EMBED_NO,
            PlayerLocationInterface::ALLOW_EMBED_YES,
        ];

        Assertion::choice($allowEmbed, $choices);

        $instance = clone $this;

        $instance->allowEmbed = $allowEmbed;

        return $instance;
    }
984217
private function normalizeConfig(array $embedConfig)
    {

        $config = $embedConfig;

        // apply deprecated configuration keys if exists:
        if (array_key_exists('video_player', $embedConfig)) {
            $config['video']['player'] = $embedConfig['video_player'];
        }
        if (array_key_exists('video_autoplay', $embedConfig)) {
            $config['video']['autoplay'] = $embedConfig['video_autoplay'];
        }
        if (array_key_exists('video_available_speeds', $embedConfig)) {
            $config['video']['available-speeds'] = $embedConfig['video_available_speeds'];
        }
        if (array_key_exists('audio_player', $embedConfig)) {
            $config['audio']['player'] = $embedConfig['audio_player'];
        }
        if (array_key_exists('audio_autoplay', $embedConfig)) {
            $config['audio']['autoplay'] = $embedConfig['audio_autoplay'];
        }
        if (array_key_exists('audio_available_speeds', $embedConfig)) {
            $config['audio']['available-speeds'] = $embedConfig['audio_available_speeds'];
        }
        if (array_key_exists('enable_pdfjs', $embedConfig['document'])) {
            $config['document']['enable-pdfjs'] = $embedConfig['document']['enable_pdfjs'];
        }

        return $config;
    }
1346736
public function setEmbedType($embedType)
    {
        $embedType = strtolower($embedType);
        $this->validateType($embedType);
        $this->embedType = $embedType;
        return $this;
    }