Get search text from repeater blocks
@param null|string $content
@return null|string
4612
public function generateSearchText($content)
    {
        $searchText = '';
        $repeaterRows = PageBlockRepeaterData::loadRepeaterData($content, $this->_block->getVersionId());
        $repeaterBlocks = BlockRepeater::getRepeaterBlocks($this->_block->id);

        foreach ($repeaterRows as $rowId => $repeaterRow) {
            foreach ($repeaterBlocks as $blockId => $repeaterBlock) {
                if(($blockContent = array_key_exists($blockId, $repeaterRow) ? $repeaterRow[$blockId] : null) !== null) {
                    $block = Block::preloadClone($blockId)->setRepeaterData($this->_block->getRepeaterId(), $this->_block->getRepeaterRowId())->setPageId($this->_block->getPageId());
                    if ($block->exists && $block->search_weight > 0) {
                        $blockSearchText = $block->getTypeObject()->generateSearchText($blockContent);
                        $searchText .= ($blockSearchText !== null) ? $blockSearchText . "\n" : '';
                    }
                }
            }
        }

        return parent::generateSearchText($searchText);
    }
564785
public function getSerializedContent($content)
    {
        $serializationContext = clone $this->serializationContext;

        return $this->serializer->serialize(
            $content,
            'json',
            $serializationContext
        );
    }
658516
protected function ajaxContent($content)
    {
        $message = null;

        $this->header('Content-Type', 'application/json');

        if ($content instanceof Arrayable) {
            $content = $content->toArray();
        } elseif (is_string($content)) {
            $content = ['content' => $content];
        } elseif (!is_array($content) && !$content instanceof \Exception) {
            return $this->ajaxContent(new \Exception("No valid content has been submitted!", BaseResponse::HTTP_BAD_REQUEST));
        } elseif ($content instanceof \Exception) {

            $this->setStatusCode($content->getCode() < 300 ? BaseResponse::HTTP_BAD_REQUEST : $content->getCode());

            $message = $content->getMessage();

            if ($content instanceof MbException) {
                $content = $content->getMessages();
            } else {
                $content = null;
            }
        }

        $this->original = [
            'meta' => [
                'code'    => $this->getStatusCode(),
                'message' => $message,
            ],
            'data' => $content,
        ];

        $this->getMbAudit()->setResponseType('ajax');
        $this->getMbAudit()->setResponseData($this->original);

        return $this->original;
    }
254833
public function parseNoTemplate($content) {
        $this->_content = $content;
        $this->_parseDebugStart();
        $this->_parseExtend();
        $this->_parseInclude();
        $this->_parsePath();
        $this->_parseGravatar();
        $this->_parseAsset();
        $this->_parseUrl();
        $this->_parsePhp();
        $this->_parseLang();
        $this->_parseForeach();
        $this->_parseFor();
        $this->_parseVar();
        $this->_parseVarFunc();
        $this->_parseCondition();
        $this->_parseFunction();
        $this->_parseException();
        $this->_parseMinify();
        $this->_parseDebugEnd();

        return $this->_content;
    }
334010
protected function _replace($content)
    {
        $content = trim($content, "\r\n ");
        if (!$this->blocks) {
            return $content;
        }

        return strtr($content, $this->blocks);
    }
929942
protected function serialize($content)
    {
        if (!empty($content)) {
            if (is_object($content)) {
                $content = $this->serializer->serialize($content, 'json');
            }
        }

        return $content;
    }
105368
public function generateSearchText($content)
    {
        $content = $this->_defaultData($content);
        $searchText = $this->_generateSearchText($content->text, $content->colour);
        return parent::generateSearchText($searchText);
    }
761425
public function easyReadingContent($content)
	{
		global $post;

		if (isset($_GET['readable']) && $_GET['readable'] == '1' && get_field('easy_reading_select') == true && is_object($post) && isset($post->post_content) && in_the_loop() && is_main_query()) {
			$post_content = $post->post_content;
			if (strpos($post_content,  '<!--more-->') !== false) {
				$content_parts = explode('<!--more-->', $post_content);
				$post_content  = $content_parts[1];
			}
			$post_content 	   = preg_replace('/[^a-z]/i', '', sanitize_text_field($post_content));
			$sanitized_content = preg_replace('/[^a-z]/i', '', sanitize_text_field($content));

			if ($post_content == $sanitized_content) {
				$content = get_field('easy_reading_content');
				if (strpos($content,  '<!--more-->') !== false) {
					$content_parts = explode('<!--more-->', $content);
					$content = '<p class="lead">' . sanitize_text_field($content_parts[0]) . '</p>' . $content_parts[1];
				}
			}
		}

		return $content;
	}
33416
private function getFirstBlock($content)
    {
        $lines = preg_split('/\r\n|\n/', $content);
        $block = [];
        $found = false;

        foreach ($lines as $line) {
            $line = trim($line);
            if (!$line && $found === true) {
                break;
            }

            $found   = true;
            $block[] = $line;
        }

        return implode(' ', $block);
    }
123905
public function cleanSQL(string $content = null): string
    {
        try {
            return $content === null ? parent::quote(null) : parent::quote($content);
        } catch (PDOException $exception) {
            throw $exception;
        }
    }
354357
private function tryParseXML($content)
	{
		$xml = new ProtectedXMLReader(null);
		if(!$xml->XML($content) || !$xml->read(-1))
			return false;
		if($xml->isElement(self::XML_ROOT))
		{
			$d = $xml->depth();
			while($xml->read($d))
			{
				if($xml->isElement(self::XML_KEY))
				{
					$keyD = $xml->depth();
					while($xml->read($keyD))
					{
						if($xml->isElement(self::XML_DATA))
						{
							$value = $xml->readTextInside();
							$this->hash = base64_decode($value);
							$xml->close();
							return true;
						}
					}
				}
			}
		}
		$xml->close();
		return false;
	}
928132
protected function getPages($content)
    {
        if ($content instanceof Pages) {
            return $content;
        }
        elseif ($content instanceof Site) {
            return $content->index();
        }
        else {
            $pages = new Pages([]);
            if ($content instanceof Page) $pages->add($content);
            return $pages;
        }
    }
674502
private function recursivelyStringify($content = null)
        {
            $return = [];
            if (false === $content || null === $content) {
                return;
            } else if (!is_array($content)) {
                $return[] = $content;
            } else {
                foreach ($content as $element) {
                    $return[] = $this->recursivelyStringify($element);
                }
            }
            return implode('', $return);
        }
97307
public function normalize($content, $format = null, array $context = [])
    {
        $data = parent::normalize($content, $format, $context);

        if ($this->contextHasGroup(['Search', 'Content'], $context)) {
            // TODO localized block's text
            // $data[$locale] = ...
        }

        return $data;
    }
903744
public function findPagesByContent($content)
    {
        $contentUids = array_merge($this->getContentsParentUids($content->getUid()), [$content->getUid()]);
        $contentUids = implode(', ', array_unique(array_map(function ($uid) {
            return '"'.$uid.'"';
        }, $contentUids)));

        $pageUids = $this->_em->getConnection()->executeQuery(
            sprintf('SELECT uid FROM page WHERE contentset IN (%s)', $contentUids)
        )->fetchAll(\PDO::FETCH_COLUMN);

        return $this->_em->createQueryBuilder('p')
            ->select('p')
            ->from('BackBee\NestedNode\Page', 'p')
            ->where('p._uid IN (:uids)')
            ->setParameter('uids', $pageUids)
            ->getQuery()
            ->getResult()
        ;
    }
1266061
private function removeTitle($content)
    {
        $titles = [
            'Whoops, looks like something went wrong.',
            'Sorry, the page you are looking for could not be found.',
        ];

        foreach ($titles as $title) {
            $content = str_replace("<h1>{$title}</h1>", '', $content);
        }

        return $content;
    }
250432
static function FirstChildOf (Content $content)
    {
        $provider = self::GetTreeProvider($content);
        if (!$provider)
        {
            return null;
        }
        $item = $provider->ItemByContent($content);
        return $provider->ContentByItem($provider->FirstChildOf($item));
    }