コード例 #1
0
ファイル: CmsGlossaryForm.php プロジェクト: spryker/Cms
 /**
  * @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;
 }
コード例 #2
0
 /**
  * @param int $idCategoryNode
  *
  * @return \Generated\Shared\Transfer\CmsBlockTransfer[]
  */
 public function getCmsBlocksByIdCategoryNode($idCategoryNode)
 {
     return $this->cmsFacade->getCmsBlocksByIdCategoryNode($idCategoryNode);
 }