Get block cache tags
@param ReadBlockInterface $block

@throws DisplayBlockStrategyNotFoundException

@return array
491250
public function getCacheTags(ReadBlockInterface $block)
    {
        $strategy = $this->getStrategy($block);
        if (null === $strategy) {
            throw new DisplayBlockStrategyNotFoundException($block->getComponent());
        }

        $cacheTags = $strategy->getCacheTags($block);
        $cacheTags[] = $this->tagManager->formatBlockTypeTag($block->getComponent());

        return $cacheTags;
    }
955335
public static function fetchAllAnnotationsFromDocblock($docblock)
    {
        $annotations = [];
        if (!preg_match_all(sprintf(self::$regex, '(\w+)'), $docblock, $matched)) {
            return $annotations;
        }
        foreach ($matched[1] as $k => $annotation) {
            if (!isset($annotations[$annotation])) {
                $annotations[$annotation] = [];
            }
            $annotations[$annotation][] = $matched[2][$k];
        };
        return $annotations;
    }
1240198
public function getListEmployees($includeBlock = true) {
		$fields = [
			$this->alias . '.id',
			$this->alias . '.' . $this->displayField,
		];
		$conditions = [];
		$blockExists = $this->hasField('block');
		if (!$includeBlock && $blockExists) {
			$conditions[$this->alias . '.block'] = false;
		}
		$order = $this->getOrderFiled();
		$this->recursive = -1;

		return $this->find('list', compact('fields', 'conditions', 'order'));
	}
717950
public function getManagerInfoByBlockId($idBlock)
    {
        foreach ($this->blockManagers as $index => $blockManager) {
            if ($blockManager->get()->getId() == $idBlock) {
                return array('index' => $index, 'manager' => $blockManager);
            }
        }

        return null;
    }
1044897
public function show(ReadBlockInterface $block)
    {
        $strategy = $this->getStrategy($block);
        if (null === $strategy) {
            throw new DisplayBlockStrategyNotFoundException($block->getComponent());
        }

        $this->dispatcher->dispatch(
            BlockEvents::PRE_BLOCK_RENDER,
            new BlockEvent($block)
        );

        $response = $strategy->show($block);

        $cacheStatus = CacheableInterface::CACHE_PRIVATE;
        if ($strategy->isPublic($block)) {
            $cacheStatus = CacheableInterface::CACHE_PUBLIC;
        }

        $response = $this->cacheableManager->setResponseCacheParameters(
            $response,
            $block->getMaxAge(),
            $cacheStatus
        );

        $this->dispatcher->dispatch(
            BlockEvents::POST_BLOCK_RENDER,
            new BlockEvent($block, $response)
        );

        return $response;

    }
526961
private function loadBlocks(PageInterface $page)
    {
        $blocks = $this->blockInteractor->loadPageBlocks($page);

        // save a local cache
        foreach ($blocks as $block) {
            $this->blocks[$block->getId()] = $block;
        }
    }
349397
public function show(ReadBlockInterface $block)
    {
        $parameters = array(
            'pubid' => $block->getAttribute('pubid'),
            'class' => $block->getStyle(),
            'id' => $block->getId(),
            'addThisClass' => $block->getAttribute('addThisClass'),
        );

        return $this->render('OpenOrchestraDisplayBundle:Block/AddThis:show.html.twig', $parameters);
    }
43555
public function getBlockRenderer(BlockInterface $block)
    {
        $type = $block->getType();

        $name = isset($this->blockRenderers[$type]) ? $this->blockRenderers[$type] : $this->defaultRenderer;
        $service = $this->getRendererService($name);

        if (!$service instanceof RendererInterface) {
            throw new \RuntimeException(sprintf('The service "%s" is not an exception renderer', $name));
        }

        return $service;
    }
488601
protected function convertBlockToHash(Block $block)
    {
        $hash = array();

        foreach ($block->getState() as $propName => $propValue) {
            switch ($propName) {
                case 'id':
                case 'name':
                case 'type':
                case 'view':
                case 'overflowId':
                case 'customAttributes':
                case 'action':
                case 'rotation':
                case 'zoneId':
                    if ($propValue !== null) {
                        $hash[$propName] = $propValue;
                    }
                    break;
                case 'attributes':
                    if ($propValue !== null && $propValue !== array()) {
                        $hash['attributes'] = $propValue;
                    }
                    break;
                case 'items':
                    foreach ($propValue as $item) {
                        $hash['items'][] = $this->convertItemToHash($item);
                    }
                    break;
            }
        }

        return $hash;
    }
389253
public function getValidBlockItems(Block $block)
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->select(
                $this->connection->quoteIdentifier('p.object_id'),
                $this->connection->quoteIdentifier('p.node_id'),
                $this->connection->quoteIdentifier('p.priority'),
                $this->connection->quoteIdentifier('p.ts_publication'),
                $this->connection->quoteIdentifier('p.ts_visible'),
                $this->connection->quoteIdentifier('p.ts_hidden'),
                $this->connection->quoteIdentifier('p.rotation_until'),
                $this->connection->quoteIdentifier('p.moved_to')
            )
            ->from($this->connection->quoteIdentifier(self::EZM_POOL_TABLE), 'p')
            ->innerJoin(
                'p',
                $this->connection->quoteIdentifier('ezcontentobject_tree'),
                't',
                $query->expr()->eq(
                    $this->connection->quoteIdentifier('t.node_id'),
                    $this->connection->quoteIdentifier('p.node_id')
                )
            )
            ->where(
                $query->expr()->eq('p.block_id', ':blockId'),
                $query->expr()->gt('p.ts_visible', ':tsVisible'),
                $query->expr()->eq('p.ts_hidden', ':tsHidden')
            )
            ->setParameter(':blockId', $block->id)
            ->setParameter(':tsVisible', 0, PDO::PARAM_INT)
            ->setParameter(':tsHidden', 0, PDO::PARAM_INT)
            ->orderBy('p.priority', 'DESC')
        ;

        $statement = $query->execute();

        $rows = $statement->fetchAll(PDO::FETCH_ASSOC);
        $items = [];
        foreach ($rows as $row) {
            $items[] = $this->buildBlockItem(
                $row + [
                    'block_id' => $block->id,
                    'ts_hidden' => 0,
                ]
            );
        }

        return $items;
    }
726739
public function getCacheTags(ReadBlockInterface $block)
    {
        $contentId = $this->requestStack->getCurrentRequest()->get('contentId');

        $content = $this->getContent($contentId);

        return array(
            $this->tagManager->formatContentIdTag($contentId),
            $this->tagManager->formatContentTypeTag($content->getContentType()),
        );
    }
356597
public function getCacheKeys(BlockInterface $block)
    {
        $settings = $block->getSettings();

        $keys = parent::getCacheKeys($block);

        $keys['environment'] = $this->getContainer()->get('kernel')->getEnvironment();

        if (isset($settings['template'])) {
            $keys['template'] = $settings['template'];
        }

        if (isset($settings['id'])) {
            $key = $this->getName() . ':' . $settings['id'];

            if (isset($settings['template'])) {
                $key = $key . ':' . $settings['template'];
            }

            $keys['block_id'] = $key;
        }

        $keys['updated_at'] = '';

        return $keys;
    }
642885
public function parse_docblock(string $block){
    $b = [
			'description' => '',
			'tags' => []
		];
    // Remove start pattern
    //$block = trim(substr($block, 3));
		// Remove end pattern
		$block = trim(substr($block, 0, strlen($block) - 2));
		// Tags
    $tags = $this->get_tags($block);
    foreach ( $tags as $i => $tag ){
			if (
				(
					isset($tags[$i+1]) &&
					($t = $this->parse_tag(substr($block, $tag[1], $tags[$i+1][1] - $tag[1])))
        ) ||
				($t = $this->parse_tag(substr($block, $tag[1])))
			){
				$b['tags'][] = $t;
			}
    }
    // Get Description
    $b['description'] = $this->clear_text(isset($tags[0]) ? substr($block, 3, $tags[0][1]-1) : substr($block, 3));
    return $b;
  }
838002
private function visitCollections(Block $block, VisitorInterface $subVisitor): Generator
    {
        foreach ($block->getCollections() as $identifier => $collection) {
            yield $identifier => $subVisitor->visit($collection);
        }
    }
323946
public function generateSubQuery(ReadBlockInterface $block, array $baseSubQuery)
    {
        $subQueryGeneratorManager = $this->container->get('open_orchestra_front.sub_query.manager');

        return $subQueryGeneratorManager->generate($block, $baseSubQuery);
    }
367298
protected function getDailymotionParameters(ReadBlockInterface $block)
    {
        $urlParams = array();

        foreach (array('dailymotionAutoplay', 'dailymotionChromeless') as $key) {
            if ($block->getAttribute($key) === true) {
                $urlParams[strtolower(substr($key, 11))] = 1;
            }
        }
        foreach (array('dailymotionLogo', 'dailymotionInfo', 'dailymotionRelated') as $key) {
            if ($block->getAttribute($key) === false) {
                $urlParams[strtolower(substr($key, 11))] = 0;
            }
        }
        foreach (array('dailymotionBackground', 'dailymotionForeground', 'dailymotionHighlight', 'dailymotionQuality') as $key) {
            if ($block->getAttribute($key) !== '') {
                $urlParams[strtolower(substr($key, 11))] = $block->getAttribute($key);
            }
        }

        $url = "//www.dailymotion.com/embed/video/" . $block->getAttribute('dailymotionVideoId') . "?" . http_build_query($urlParams);

        return array(
            'url' => $url,
            'width' => $block->getAttribute('dailymotionWidth'),
            'height' => $block->getAttribute('dailymotionHeight')
        );
    }
132506
public function getGutterClasses(BlockInterface $block)
    {
        $gutterStyles = array();

        if ($block->getColumnCount()) {
            $properties = $block->getProperties();
            if (isset($properties['gutters']) && count($properties['gutters']) > 0) {
                foreach ($properties['gutters'] as $screen => $cols) {
                    if (!$cols) {
                        continue;
                    }
                    foreach ($cols as $col => $span) {
                        if ($span === null) {
                            continue;
                        }
                        $gutterStyles[$col][] = "px-$screen-$span";
                    }
                }
            }
        }

        return $gutterStyles;
    }