src/Sulu/Bundle/SnippetBundle/Content/SnippetContent.php
private function getSnippets(PropertyInterface $property)
    {
        /** @var PageBridge $page */
        $page = $property->getStructure();
        $webspaceKey = $page->getWebspaceKey();
        $locale = $page->getLanguageCode();
        $shadowLocale = null;
        if ($page->getIsShadow()) {
            $shadowLocale = $page->getShadowBaseLanguage();
        }

        $refs = $property->getValue();
        $ids = $this->getUuids($refs);

        $snippetType = $this->getParameterValue($property->getParams(), 'snippetType');
        $default = $this->getParameterValue($property->getParams(), 'default', false);

        $snippetArea = $default;
        if (true === $snippetArea || 'true' === $snippetArea) {
            $snippetArea = $snippetType;
        }

        if (empty($ids) && $snippetArea && $this->defaultEnabled) {
            $ids = $this->loadSnippetAreaIds($webspaceKey, $snippetArea, $locale);
        }

        return $this->snippetResolver->resolve($ids, $webspaceKey, $locale, $shadowLocale);
    }
private function getSnippets(PropertyInterface $property)
    {
        /** @var PageBridge $page */
        $page = $property->getStructure();
        $webspaceKey = $page->getWebspaceKey();
        $locale = $page->getLanguageCode();
        $shadowLocale = null;
        if ($page->getIsShadow()) {
            $shadowLocale = $page->getShadowBaseLanguage();
        }

        $refs = $property->getValue();
        $ids = $this->getUuids($refs);

        $snippetType = $this->getParameterValue($property->getParams(), 'snippetType');
        $default = $this->getParameterValue($property->getParams(), 'default', false);

        $snippetArea = $default;
        if (true === $snippetArea || 'true' === $snippetArea) {
            $snippetArea = $snippetType;
        }

        if (empty($ids) && $snippetArea && $this->defaultEnabled) {
            $ids = $this->loadSnippetAreaIds($webspaceKey, $snippetArea, $locale);
        }

        return $this->snippetResolver->resolve($ids, $webspaceKey, $locale, $shadowLocale);
    }
private function getSnippets ( PropertyInterface $ property ) { /** @var PageBridge $page */ $ page = $ property -> getStructure ( ) ; $ webspaceKey = $ page -> getWebspaceKey ( ) ; $ locale = $ page -> getLanguageCode ( ) ; $ shadowLocale = null ; if ( $ page -> getIsShadow ( ) ) { $ shadowLocale = $ page -> getShadowBaseLanguage ( ) ; } $ refs = $ property -> getValue ( ) ; $ ids = $ this -> getUuids ( $ refs ) ; $ snippetType = $ this -> getParameterValue ( $ property -> getParams ( ) , 'snippetType' ) ; $ default = $ this -> getParameterValue ( $ property -> getParams ( ) , 'default' , false ) ; $ snippetArea = $ default ; if ( true === $ snippetArea || 'true' === $ snippetArea ) { $ snippetArea = $ snippetType ; } if ( empty ( $ ids ) && $ snippetArea && $ this -> defaultEnabled ) { $ ids = $ this -> loadSnippetAreaIds ( $ webspaceKey , $ snippetArea , $ locale ) ; } return $ this -> snippetResolver -> resolve ( $ ids , $ webspaceKey , $ locale , $ shadowLocale ) ; }
Returns snippets with given property value.
Returns snippets with given property value .