/** * @return array */ protected function getPlaceholderConstants() { $placeholderConstraints = [new Required(), new NotBlank(), new Length(['max' => 255])]; $placeholderConstraints[] = new Callback(['methods' => [function ($placeholder, ExecutionContextInterface $context) { $formData = $context->getRoot()->getViewData(); if ($this->cmsFacade->hasPagePlaceholderMapping($formData[self::FIELD_FK_PAGE], $placeholder)) { $context->addViolation('Placeholder has already mapped'); } }], 'groups' => [self::GROUP_PLACEHOLDER_CHECK]]); return $placeholderConstraints; }
/** * @param int $idCategoryNode * * @return \Generated\Shared\Transfer\CmsBlockTransfer[] */ public function getCmsBlocksByIdCategoryNode($idCategoryNode) { return $this->cmsFacade->getCmsBlocksByIdCategoryNode($idCategoryNode); }