Set the palette collection class name.

@param string $paletteCollectionClassName The class name.

@return PaletteBuilder
335094
public function setPaletteCollectionClassName($paletteCollectionClassName)
    {
        $event = new SetPaletteCollectionClassNameEvent($paletteCollectionClassName, $this);
        $this->dispatchEvent($event);
        $paletteCollectionClassName = $event->getPaletteCollectionClassName();

        $this->paletteCollectionClassName = (string) $paletteCollectionClassName;
        $this->paletteCollectionClass     = new \ReflectionClass($this->paletteCollectionClassName);
        return $this;
    }
1230140
final public function collection($name = '')
    {
        return new self($this->collection, $this->name.$name, $this, $this->prefixes);
    }
706620
protected function parsePalettes(ContainerInterface $container)
    {
        $palettesDca = $this->getFromDca('palettes');

        // Skip while there is no extended palette definition.
        if (!\is_callable($palettesDca)) {
            return;
        }

        if ($container->hasDefinition(PalettesDefinitionInterface::NAME)) {
            $palettesDefinition = $container->getDefinition(PalettesDefinitionInterface::NAME);
        } else {
            $palettesDefinition = new DefaultPalettesDefinition();
            $container->setDefinition(PalettesDefinitionInterface::NAME, $palettesDefinition);
        }

        $palettesDca($palettesDefinition, $container);
    }
1317632
private function setTopicName(string $topicName): self
    {
        $this->generalRulesCheck($topicName);

        // A topic name has some additional checks, as no wildcard characters are allowed
        if (strpbrk($topicName, '#+') !== false) {
            throw new \InvalidArgumentException('Topic names can not contain wildcard characters');
        }

        $this->topicName = $topicName;
        return $this;
    }
968797
public function setClassName(string $className): ClassPaser
    {
        $this->className = $className;
        $this->reflect_object = (new \ReflectionClass($this->className));

        return $this;
    }
1268071
public function setCollectors(array $collectors)
    {
        $this->collectors = [];
        foreach ($collectors as $collector) {
            $this->addCollector($collector);
        }
    }
109113
public function findPalette(ModelInterface $model = null, PropertyValueBag $input = null)
    {
        $matches = [];

        // Determinate the matching count for each palette.
        foreach ($this->palettes as $palette) {
            $condition = $palette->getCondition();

            if ($condition) {
                $count = $condition->getMatchCount($model, $input);

                if (false !== $count) {
                    $matches[$count][] = $palette;
                }
            }
        }

        // Sort by count.
        \ksort($matches);

        // Get palettes with highest matching count.
        $palettes = \array_pop($matches);

        if (1 !== \count($palettes)) {
            throw new DcGeneralInvalidArgumentException(\sprintf('%d matching palettes found.', \count($palettes)));
        }

        return $palettes[0];
    }
669879
public function set(string $key, $value): KeyValueCollectionInterface
    {
        $this->keyMap[strtolower($key)] = $key;
        if ($value instanceof KeyValueCollectionInterface) {
            $value = $value->all();
        }
        $this->collection[$key] = $value;

        return $this;
    }
922719
public function setRepositoryClassName($repositoryClassName)
    {
        if ($this->modelType === self::MODELTYPE_VALUEOBJECT && $repositoryClassName !== null) {
            throw new Exception\ClassSchemaConstraintViolationException('Value objects must not be aggregate roots (have a repository)', 1268739172);
        }
        $this->repositoryClassName = $repositoryClassName;
    }
773002
public function getPaletteByName($paletteName)
    {
        foreach ($this->palettes as $palette) {
            if ($paletteName === $palette->getName()) {
                return $palette;
            }
        }

        throw new DcGeneralInvalidArgumentException('No palette found for name ' . $paletteName);
    }
867215
public function finishPalette(&$palette = null)
    {
        if (!$this->palette) {
            throw new DcGeneralRuntimeException('Palette is missing, please create a palette first');
        }

        if ($this->legend) {
            $this->finishLegend();
        }
        if ($this->condition) {
            $this->finishCondition();
        }

        $event = new FinishPaletteEvent($this->palette, $this);
        $this->dispatchEvent($event);
        $palette = $event->getPalette();

        if ($this->paletteCollection) {
            $this->paletteCollection->addPalette($palette);
        }

        $this->palette = null;

        return $this;
    }
1210784
public function setActiveTheme(string $name) : ThemeCollection
    {
        if (!$this->isThemeIsValid($name)) {
            $exist = $this->isThemeExists($name);
            throw new \RuntimeException(
                sprintf(
                    $exist ? 'ThemeCollection %s is not valid' : 'ThemeCollection %s is not exists.',
                    $name
                )
            );
        }

        $this->activeTheme = $name;
        return $this;
    }
1247052
private function collectIntersectModelProperties(CollectionInterface $collection, EnvironmentInterface $environment)
    {
        $palettesDefinition = $environment->getDataDefinition()->getPalettesDefinition();

        $properties = [];
        foreach ($collection->getIterator() as $model) {
            $palette = $palettesDefinition->findPalette($model);

            $modelProperties = $this->getVisibleAndEditAbleProperties($palette, $model);
            foreach ($modelProperties as $modelProperty) {
                if (!$properties[$modelProperty]) {
                    $properties[$modelProperty] = 0;
                }

                ++$properties[$modelProperty];
            }
        }

        return \array_filter(
            $properties,
            function ($count) use ($collection) {
                return $count === $collection->count();
            }
        );
    }
1001009
public function usePaletteCollection(PaletteCollectionInterface $paletteCollection)
    {
        if ($this->paletteCollection) {
            $this->finishPaletteCollection();
        }

        $event = new UsePaletteCollectionEvent($paletteCollection, $this);
        $this->dispatchEvent($event);
        $this->paletteCollection = $paletteCollection;

        return $this;
    }
864926
public function setPaletteConditionChainClassName($paletteConditionChainClassName)
    {
        $event = new SetPaletteConditionChainClassNameEvent($paletteConditionChainClassName, $this);
        $this->dispatchEvent($event);
        $paletteConditionChainClassName = $event->getPaletteConditionChainClassName();

        $this->paletteConditionChainClassName = (string) $paletteConditionChainClassName;
        $this->paletteConditionChainClass     = new \ReflectionClass($this->paletteConditionChainClassName);
        return $this;
    }
801644
public function setItems($items)
    {
        $this->items = ($items instanceof Collection) ? $items : Collection::make($items);

        return $this;
    }
1115904
public function setTheme(string $theme): FieldTypeInterface
    {
        $this->options['theme'] = $theme;

        // Update all attached fields with the given theme.
        foreach ($this->repository->all() as $field) {
            /** @var FieldTypeInterface $field */
            $field->setTheme($theme);
        }

        // Update all attached groups with the given theme.
        foreach ($this->repository()->getGroups() as $group) {
            /** @var SectionInterface $group */
            $group->setTheme($theme);
        }

        return $this;
    }