Answers the span class names for the extended object.

@param DBViewports $span Optional viewports field to use instead of extended object field.

@return array
10848
public function getSpanClassNames(DBViewports $span = null)
    {
        $classes = [];
        
        if (!$span) {
            $span = $this->owner->getSpanViewports();
        }
        
        if ($span->allEqualTo('auto')) {
            
            // Add Span Prefix Only:
            
            $classes[] = $this->spanPrefix;
            
        } elseif ($span->allEmpty()) {
            
            // Add Column Span Defaults:
            
            foreach ($this->columnSpanDefaults as $viewport => $value) {
                $classes[] = $this->getSpanClass($viewport, $value);
            }
            
        } else {
            
            // Add Column Span Field Values:
            
            foreach ($span->getViewports() as $viewport) {
                $classes[] = $this->getSpanClass($viewport, $span->getField($viewport));
            }
            
        }
        
        return $classes;
    }
849613
public function getActiveViewsNames()
    {
        $names = [];

        if (is_array($this->getActiveViewsList())) {
            foreach ($this->getActiveViewsList() as $view) {
                $names[] = $view->getClassName();
            }
        }

        return $names;
    }
968165
public function processNode(Node $node, Scope $scope): array
    {
        if (!$node->extends instanceof Node\Name) {
            return [];
        }

        $extendedClassName = $node->extends->toString();

        if (\in_array($extendedClassName, $this->classesAllowedToBeExtended, true)) {
            return [];
        }

        if (!isset($node->namespacedName)) {
            return [
                \sprintf(
                    'Anonymous class is not allowed to extend "%s".',
                    $extendedClassName
                ),
            ];
        }

        return [
            \sprintf(
                'Class "%s" is not allowed to extend "%s".',
                $node->namespacedName,
                $extendedClassName
            ),
        ];
    }
349195
public function getViewClassNameForViewBuilder()
    {
        list($plugin, $theme) = namespaceSplit(get_class($this));
        $plugin = preg_replace('/\\\/', '/', $plugin);
        return $plugin . '.' . $theme;
    }
773012
public function withSpan(Span $span)
    {
        $spanData = $span->spanData();
        $startTime = $spanData->startTime()
            ? (float)($spanData->startTime()->format('U.u'))
            : microtime(true);
        $info = [
            'traceId' => $spanData->traceId(),
            'spanId' => $spanData->spanId(),
            'parentSpanId' => $spanData->parentSpanId(),
            'startTime' => $startTime,
            'attributes' => $spanData->attributes(),
            'stackTrace' => $spanData->stackTrace(),
            'kind' => $spanData->kind(),
            'sameProcessAsParentSpan' => $spanData->sameProcessAsParentSpan()
        ];
        opencensus_trace_begin($spanData->name(), $info);
        $this->hasSpans = true;
        $span->attach();
        foreach ($spanData->timeEvents() as $timeEvent) {
            $this->timeEventAdded($span, $timeEvent);
        }
        foreach ($spanData->links() as $link) {
            $this->linkAdded($span, $link);
        }
        return new Scope(function () {
            opencensus_trace_finish();
        });
    }
944487
public function parseSimpleAnnotations($docBlock)
    {
        return $this->parseAnnotations(
            $docBlock,
            '/@(?P<name>[A-Za-z_-]+)(?:[ \t]+(?P<value>.*?))?[ \t]*\r?$/m',
            function (array $matches) {
                $annotations = [];
                $numMatches = count($matches[0]);
                for ($i = 0; $i < $numMatches; ++$i) {
                    $annotations[$matches['name'][$i]][] = $matches['value'][$i];
                }

                return $annotations;
            }
        );
    }
516816
public function getViewConfiguration($objectName, $viewName)
    {
        $modelConfiguration = $this->getModelConfiguration($objectName);
        if (isset($modelConfiguration['views'][$viewName])) {
            $viewConfiguration = $modelConfiguration['views'][$viewName];
            if (isset($viewConfiguration['fields']) === false) {
                $viewConfiguration['fields'] = array();
            }

            foreach ($viewConfiguration['fields'] as $i => $viewField) {
                $fieldConfiguration = $this->getField($objectName, $viewField['name'], false);
                if (is_array($fieldConfiguration)) {
                    $viewConfiguration['fields'][$i] = array_replace_recursive($fieldConfiguration, $viewField);
                }
            }
            usort($viewConfiguration['fields'], array($this, 'sortByLocation'));

            return $viewConfiguration;
        }
    }
1299654
public function doViewFields()
    {
        $this->setDefaultResponseGroups( array( self::VIEWFIELDS_RESPONSEGROUP_FIELDVALUES ) );

        $isNodeRequested = false;
        if ( isset( $this->nodeId ) )
        {
            $content = ezpContent::fromNodeId( $this->nodeId );
            $isNodeRequested = true;
        }
        else if ( isset( $this->objectId ) )
        {
            $content = ezpContent::fromObjectId( $this->objectId );
        }

        $result = new ezpRestMvcResult();

        // translation parameter
        if ( $this->hasContentVariable( 'Translation' ) )
            $content->setActiveLanguage( $this->getContentVariable( 'Translation' ) );

        // Handle field values
        if ( $this->hasResponseGroup( self::VIEWFIELDS_RESPONSEGROUP_FIELDVALUES ) )
        {
            $result->variables['fields'] = ezpRestContentModel::getFieldsByContent( $content );
        }

        // Handle object/node metadata
        if ( $this->hasResponseGroup( self::VIEWFIELDS_RESPONSEGORUP_METADATA ) )
        {
            $objectMetadata = ezpRestContentModel::getMetadataByContent( $content );
            if ( $isNodeRequested )
            {
                $nodeMetadata = ezpRestContentModel::getMetadataByLocation( ezpContentLocation::fetchByNodeId( $this->nodeId ) );
                $objectMetadata = array_merge( $objectMetadata, $nodeMetadata );
            }
            $result->variables['metadata'] = $objectMetadata;
        }

        return $result;
    }
580330
public function spans()
    {
        // each span returned from opencensus_trace_list should be a
        // OpenCensus\Span object
        $traceId = $this->spanContext()->traceId();
        return array_map(function ($span) use ($traceId) {
            return $this->mapSpan($span, $traceId);
        }, opencensus_trace_list());
    }
689683
private function classes(): string
    {
        $classes = '';

        if ($this->style !== null) {
            $classes .= ' btn-' . $this->style;
        }

        if ($this->large === true) {
            $classes .= ' btn-lg';
        }

        if ($this->small === true) {
            $classes .= ' btn-sm';
        }

        if ($this->extra_small === true) {
            $classes .= ' btn-xs';
        }

        if ($this->block === true) {
            $classes .= ' btn-block';
        }

        if ($this->active === true) {
            $classes .= ' active';
        }

        if (count($this->custom_classes) > 0) {
            $classes .= ' ' . implode(' ', $this->custom_classes);
        }

        return $classes;
    }
104711
public function getTextAlignmentClass($viewport, $value)
    {
        if ($value) {
            
            $class = [$this->getStyle('text')];
            
            $class[] = $this->getStyle('viewport', $viewport);
            
            $class[] = $this->getStyle('align', $value);
            
            return implode('-', array_filter($class));
            
        }
    }
539671
protected function _getVars(string $tableName) : array
    {
        $table = Inflector::tableize($tableName);

        $name = Inflector::camelize($tableName) . $this->_getLastModifiedTime($table);

        return [$table, $name];
    }
137063
protected function buildViewportField($viewport)
    {
        if ($this->useTextInput) {
            
            $field = TextField::create(
                $this->getViewportName($viewport),
                $this->getViewportLabel($viewport)
            );
            
        } else {
            
            $field = DropdownField::create(
                $this->getViewportName($viewport),
                $this->getViewportLabel($viewport),
                $this->getSource()
            );
            
        }
        
        return $field;
    }
1249607
protected function _getPortableViewsList($views)
    {
        $list = [];
        foreach ($views as $value) {
            $view = $this->_getPortableViewDefinition($value);

            if (! $view) {
                continue;
            }

            $viewName        = strtolower($view->getQuotedName($this->_platform));
            $list[$viewName] = $view;
        }

        return $list;
    }
532661
public function getWrapperClassNames()
    {
        $classes = $this->styles('navbar');
        
        $classes[] = $this->style('navbar', sprintf('expand-%s', $this->ExpandOn));
        
        if ($this->Background) {
            $classes[] = $this->style('background', $this->Background);
        }
        
        if ($this->Foreground) {
            $classes[] = $this->style('navbar', sprintf('fg-%s', $this->Foreground));
        }
        
        if ($this->Position) {
            $classes[] = $this->style('position', $this->Position);
        }
        
        $this->extend('updateWrapperClassNames', $classes);
        
        return $classes;
    }
800425
public function parse($content)
    {
        if (!$content || strpos($content, '@') === false) {
            return [];
        }
        $ret = [];

        if (preg_match(self::VIEW_RENDER, $content, $match)) {
            $ret[0] = array_pop($match);
        } else {
            $ret[0] = null;
        }

        if (preg_match(self::VIEW_TEMPLATE_FILE, $content, $match)) {
            $ret[1] = array_pop($match);
        } else {
            $ret[1] = null;
        }

        if (preg_match_all(self::VIEW_PARAMETERS, $content, $match)) {

            foreach($match as $subMatch) {
                $ret[] = [$subMatch[0] => $subMatch[1]];
            }
        }

        return $ret;
    }
1092137
protected function getVariantLines(stdClass $item, $parentQuantity, $vatRangeTags)
    {
        $result = array();

        // It is not possible (other then by copying a lot of awful code) to get
        // a list of separate attribute and value values. So we stick with
        // calling some code that prints the attributes on an order and
        // "disassemble" that code...
        if (!class_exists('VirtueMartModelCustomfields')) {
            /** @noinspection PhpIncludeInspection */
            require(VMPATH_ADMIN . '/models/customfields.php');
        }
        $product_attribute = VirtueMartModelCustomfields::CustomsFieldOrderDisplay($item, 'FE');
        if (!empty($product_attribute)) {
            $document = new DOMDocument();
            $document->loadHTML($product_attribute);
            $spans = $document->getElementsByTagName('span');
            /** @var \DOMElement $span */
            foreach ($spans as $span) {
                // There tends to be a span around the list of spans containing
                // the actual text, ignore it and only process the lowest level
                // spans.
                if ($span->getElementsByTagName('span')->length === 0) {
                    $text[] = $span->textContent;
                    $result[] = array(
                        Tag::Product => $span->textContent,
                        Tag::UnitPrice => 0,
                        Tag::Quantity => $parentQuantity,
                      ) + $vatRangeTags;
                }
            }
        }

        return $result;
    }