Attach the featured article to this publication if there is one

@param array $articleData
516980
private function processFeaturedArticle($articleData)
    {
        if ($articleData) {
            $article = Article::get()->filter(['HailID' => $articleData['id']])->first();
            if (!$article) {
                $article = new Article();
                $article->importHailData($articleData);
            }

            $heroImage = $article->HeroImageID;
            $heroVideo = $article->HeroVideoID;

            $article = $article->ID;
        } else {
            $article = null;
        }

        $this->FeaturedArticleID = $article;

        if (isset($heroImage) && $heroImage) {
            $this->HeroImageID = $heroImage;
        }

        if (isset($heroVideo) && $heroVideo) {
            $this->HeroVideoID = $heroVideo;
        }

    }
18987
public function onSinglePageLoaded(array &$pageData)
    {
        if (!isset($pageData['content'])) {
            $pageData['content'] = $this->prepareFileContent($pageData['raw_content'], $pageData['meta']);
            $pageData['content'] = $this->parseFileContent($pageData['content']);
        }
    }
1236274
public function AttachContent($item, Content $content)
    {
        $item->SetContent($content);
        $item->Save();
        $content->SetContainerContent($item);
        $content->Save();
    }
555268
public function setData(array $data)
    {
        if (isset($data['attachables'])) {
            $this->setAttachables($data['attachables']);
        }

        if (isset($data['groups'])) {
            $this->setGroups($data['groups']);
        }

        if (isset($data['widgets'])) {
            $this->setWidgets($data['widgets']);
        }

        unset($data['attachables'], $data['groups'], $data['widgets']);

        return parent::setData($data);
    }
106495
public function update($featureData)
    {
        /** @var Feature $feature */
        $feature                       = $this->create($featureData);
        $data                          = $this->cleanFeatureData($feature->toArray());
        $connection                    = $this->getConnection();
        $data[ $this->getGeomField() ] = $this->transformEwkt($data[ $this->getGeomField() ]);
        unset($data[ $this->getUniqueId() ]);

        $event             = array(
            'item'    => &$data,
            'feature' => $feature
        );
        $this->allowUpdate = true;

        if (isset($this->events[ static::EVENT_ON_BEFORE_UPDATE ])) {
            $this->secureEval($this->events[ static::EVENT_ON_BEFORE_UPDATE ], $event);
        }
        if (empty($data)) {
            throw new \Exception("Feature can't be updated without criteria");
        }

        $tableName = $this->getTableName();
        $keys = array_keys($data);
        foreach($data as $key => $value){
            $quotedData[$connection->quoteIdentifier($key)] = $value;
        }



        if ($this->allowUpdate) {
            $connection->update($tableName, $quotedData, array($this->getUniqueId() => $feature->getId()));
        }

        if (isset($this->events[ self::EVENT_ON_AFTER_UPDATE ])) {
            $this->secureEval($this->events[ self::EVENT_ON_AFTER_UPDATE ], $event);
        }
        return $feature;
    }
647718
public function insert($featureData)
    {
        /** @var Feature $feature */
        $tableName                     = $this->getTableName();
        $feature                       = $this->create($featureData);
        $data                          = $this->cleanFeatureData($feature->toArray());
        $driver                        = $this->getDriver();
        $connection                    = $driver->getConnection();
        $lastId                        = null;
        $data[ $this->getGeomField() ] = $this->transformEwkt($data[ $this->getGeomField() ], $this->getSrid());
        $event                         = array(
            'item'    => &$data,
            'feature' => $feature
        );
        $this->allowInsert             = true;

        if (isset($this->events[ self::EVENT_ON_BEFORE_INSERT ])) {
            $this->secureEval($this->events[ self::EVENT_ON_BEFORE_INSERT ], $event);
        }

        if ($this->allowInsert) {
            $lastId = $driver->insert($data, false)->getId();
        }

        $feature->setId($lastId);

        if (isset($this->events[ self::EVENT_ON_AFTER_INSERT ])) {
            $this->secureEval($this->events[ self::EVENT_ON_AFTER_INSERT ], $event);
        }
        return $feature;
    }
207900
public function setFeatureData($feature, array $data)
    {
        $feature = $this->get($feature);
        if ($feature) {
            $feature->setData(array_merge($feature->getData(), $data));
            $this->save($feature);
        }
    }
349673
protected function addCData($cdata_text)
    {
        $node = dom_import_simplexml($this);
        $no = $node->ownerDocument;
        $node->appendChild($no->createCDATASection($cdata_text));
    }
343595
private void attachDocCommentAsMetaData(ASTNode node, String docCommentNodeText) {
        if (!groovydocEnabled) {
            return;
        }

        if (!(node instanceof GroovydocHolder)) {
            return;
        }

        node.putNodeMetaData(DOC_COMMENT, new groovy.lang.groovydoc.Groovydoc(docCommentNodeText, (GroovydocHolder) node));
    }
284696
public function setTemplateData(array $templateData)
    {
        if (!isset($this->templateData)) {
            $this->templateData = [];
        }

        $this->templateData = array_merge($this->templateData, $templateData);

        return $this;
    }
998640
public function addFootnotes(\DOMElement $articleContent)
    {
        $footnotesWrapper = $this->dom->createElement('footer');
        $footnotesWrapper->setAttribute('class', 'readability-footnotes');
        $footnotesWrapper->setInnerHtml('<h3>References</h3>');
        $articleFootnotes = $this->dom->createElement('ol');
        $articleFootnotes->setAttribute('class', 'readability-footnotes-list');
        $footnotesWrapper->appendChild($articleFootnotes);
        $articleLinks = $articleContent->getElementsByTagName('a');
        $linkCount = 0;

        for ($i = 0; $i < $articleLinks->length; ++$i) {
            $articleLink = $articleLinks->item($i);
            $footnoteLink = $articleLink->cloneNode(true);
            $refLink = $this->dom->createElement('a');
            $footnote = $this->dom->createElement('li');
            $linkDomain = @parse_url($footnoteLink->getAttribute('href'), PHP_URL_HOST);
            if (!$linkDomain && isset($this->url)) {
                $linkDomain = @parse_url($this->url, PHP_URL_HOST);
            }

            $linkText = $this->getInnerText($articleLink);
            if ((false !== strpos($articleLink->getAttribute('class'), 'readability-DoNotFootnote')) || preg_match($this->regexps['skipFootnoteLink'], $linkText)) {
                continue;
            }

            ++$linkCount;

            // Add a superscript reference after the article link.
            $refLink->setAttribute('href', '#readabilityFootnoteLink-' . $linkCount);
            $refLink->setInnerHtml('<small><sup>[' . $linkCount . ']</sup></small>');
            $refLink->setAttribute('class', 'readability-DoNotFootnote');
            $refLink->setAttribute('style', 'color: inherit;');

            if ($articleLink->parentNode->lastChild->isSameNode($articleLink)) {
                $articleLink->parentNode->appendChild($refLink);
            } else {
                $articleLink->parentNode->insertBefore($refLink, $articleLink->nextSibling);
            }

            $articleLink->setAttribute('style', 'color: inherit; text-decoration: none;');
            $articleLink->setAttribute('name', 'readabilityLink-' . $linkCount);
            $footnote->setInnerHtml('<small><sup><a href="#readabilityLink-' . $linkCount . '" title="Jump to Link in Article">^</a></sup></small> ');
            $footnoteLink->setInnerHtml(('' !== $footnoteLink->getAttribute('title') ? $footnoteLink->getAttribute('title') : $linkText));
            $footnoteLink->setAttribute('name', 'readabilityFootnoteLink-' . $linkCount);
            $footnote->appendChild($footnoteLink);

            if ($linkDomain) {
                $footnote->setInnerHtml($footnote->getInnerHTML() . '<small> (' . $linkDomain . ')</small>');
            }
            $articleFootnotes->appendChild($footnote);
        }

        if ($linkCount > 0) {
            $articleContent->appendChild($footnotesWrapper);
        }
    }
452360
protected function addTweetMedias(&$tweet, $data) {
    if (!isset($data['entities']['media'])) {
      if (!isset($data['retweeted_status']['entities']['media'])) {
        return;
      }
    }

    $media = isset($data['entities']['media']) ? $data['entities']['media'] : $data['retweeted_status']['entities']['media'];

    foreach ($media as $mediaData) {
      $media = new Media();
      $media->setUrl($mediaData['media_url']);
      $media->setLink($mediaData['expanded_url']);
      $tweet->addMedia($media);
    }
  }
22900
public function setImage(string $imageData) : void
    {
        $url = $this->uploadImage('communityProfileImage', $imageData);

        $this->set([
            'profileImage' => [
                'sourceUrl' => $url
            ]
        ]);
    }
601428
public function init(array $frontendData): void
    {
        $this->_frontendData = Hash::merge(
            $this->_frontendData, $frontendData
        );
        $this->_includeAppController();
        $this->_includeComponents();
    }
1144746
protected function prepareBundledArticlesDataForView($article)
    {
        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDB();
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        $articleTable = getViewName('oxarticles', $this->_iEditLang);
        $query = "select {$articleTable}.oxtitle, {$articleTable}.oxartnum, {$articleTable}.oxvarselect " .
            "from {$articleTable} where 1 ";
        // #546
        $isVariantSelectionEnabled = $config->getConfigParam('blVariantsSelection');
        $bundleIdField = 'oxarticles__oxbundleid';
        $query .= $isVariantSelectionEnabled ? '' : " and {$articleTable}.oxparentid = '' ";
        $query .= " and {$articleTable}.oxid = " . $database->quote($article->$bundleIdField->value);

        $resultFromDatabase = $database->select($query);
        if ($resultFromDatabase != false && $resultFromDatabase->count() > 0) {
            while (!$resultFromDatabase->EOF) {
                $articleNumber = new \OxidEsales\Eshop\Core\Field($resultFromDatabase->fields[1]);
                $articleTitle = new \OxidEsales\Eshop\Core\Field($resultFromDatabase->fields[0] . " " . $resultFromDatabase->fields[2]);
                $resultFromDatabase->fetchRow();
            }
        }
        $this->_aViewData['bundle_artnum'] = $articleNumber;
        $this->_aViewData['bundle_title'] = $articleTitle;
    }
419621
protected static function hasIdKey(array &$includedData)
    {
        return \array_key_exists(JsonApiTransformer::ID_KEY, $includedData)
        && !empty($includedData[JsonApiTransformer::ID_KEY]);
    }
403797
public function mergeInclude(array $data, array $includeData): array
    {
        foreach ($data as $class => $fixtures) {
            // $class is either a FQCN or 'parameters'
            $includeData[$class] = (
                    array_key_exists($class, $includeData)
                    && is_array($includeData[$class])
                    && is_array($fixtures)
                )
                ? array_merge($includeData[$class], $fixtures)
                : $fixtures
            ;
        }

        return $includeData;
    }