-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing services and validation files
- Loading branch information
1 parent
981851f
commit 26cec03
Showing
20 changed files
with
652 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BitBag\SyliusCmsPlugin\Entity\Media: | ||
exclusion_policy: ALL | ||
xml_root_name: media | ||
properties: | ||
id: | ||
expose: true | ||
type: integer | ||
xml_attribute: true | ||
groups: [Autocomplete] | ||
code: | ||
expose: true | ||
type: string | ||
groups: [Autocomplete] | ||
path: | ||
expose: true | ||
type: string | ||
groups: [Autocomplete] | ||
relations: | ||
- | ||
rel: self | ||
href: | ||
route: bitbag_sylius_cms_plugin_shop_media_inline | ||
parameters: | ||
_locale: expr(object.getTranslation().getLocale()) | ||
code: expr(object.getCode()) | ||
virtual_properties: | ||
getName: | ||
serialized_name: name | ||
groups: [Autocomplete] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
BitBag\SyliusCmsPlugin\Entity\Section: | ||
exclusion_policy: ALL | ||
xml_root_name: section | ||
properties: | ||
id: | ||
expose: true | ||
type: integer | ||
xml_attribute: true | ||
groups: [Autocomplete] | ||
code: | ||
expose: true | ||
type: string | ||
groups: [Autocomplete] | ||
virtual_properties: | ||
getName: | ||
serialized_name: name | ||
groups: [Autocomplete] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping | ||
http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> | ||
|
||
<class name="BitBag\SyliusCmsPlugin\Entity\Block"> | ||
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity"> | ||
<option name="fields"> | ||
<value>code</value> | ||
</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
<option name="message">bitbag_sylius_cms_plugin.block.code.unique</option> | ||
</constraint> | ||
|
||
<property name="code"> | ||
<constraint name="NotBlank"> | ||
<option name="message">bitbag_sylius_cms_plugin.block.code.not_blank</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
<constraint name="Length"> | ||
<option name="min">2</option> | ||
<option name="max">250</option> | ||
<option name="minMessage">bitbag_sylius_cms_plugin.block.code.min_length</option> | ||
<option name="maxMessage">bitbag_sylius_cms_plugin.block.code.max_length</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
<constraint name="Regex"> | ||
<option name="pattern">/^[\w-]*$/</option> | ||
<option name="message">bitbag_sylius_cms_plugin.block.code.regex</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
|
||
<property name="translations"> | ||
<constraint name="Valid"/> | ||
</property> | ||
</class> | ||
</constraint-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping | ||
http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> | ||
|
||
<class name="BitBag\SyliusCmsPlugin\Entity\BlockTranslation"> | ||
<property name="name"> | ||
<constraint name="Length"> | ||
<option name="min">2</option> | ||
<option name="max">250</option> | ||
<option name="minMessage">bitbag_sylius_cms_plugin.block.name.min_length</option> | ||
<option name="maxMessage">bitbag_sylius_cms_plugin.block.name.max_length</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
|
||
<property name="link"> | ||
<constraint name="Length"> | ||
<option name="min">2</option> | ||
<option name="max">250</option> | ||
<option name="minMessage">bitbag_sylius_cms_plugin.block.link.min_length</option> | ||
<option name="maxMessage">bitbag_sylius_cms_plugin.block.link.max_length</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
|
||
<property name="content"> | ||
<constraint name="Length"> | ||
<option name="min">2</option> | ||
<option name="minMessage">bitbag_sylius_cms_plugin.block.content.min_length</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
</class> | ||
</constraint-mapping> |
62 changes: 62 additions & 0 deletions
62
src/Resources/config/validation/FrequentlyAskedQuestion.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping | ||
http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> | ||
|
||
<class name="BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestion"> | ||
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity"> | ||
<option name="fields"> | ||
<value>position</value> | ||
</option> | ||
<option name="message">bitbag_sylius_cms_plugin.frequently_asked_question.position.unique</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity"> | ||
<option name="fields"> | ||
<value>code</value> | ||
</option> | ||
<option name="message">bitbag_sylius_cms_plugin.frequently_asked_question.code.unique</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
|
||
<property name="code"> | ||
<constraint name="NotBlank"> | ||
<option name="message">bitbag_sylius_cms_plugin.frequently_asked_question.code.not_blank</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
<constraint name="Length"> | ||
<option name="min">2</option> | ||
<option name="minMessage">bitbag_sylius_cms_plugin.frequently_asked_question.code.min_length</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
<constraint name="Regex"> | ||
<option name="pattern">/^[\w-]*$/</option> | ||
<option name="message">bitbag_sylius_cms_plugin.frequently_asked_question.code.regex</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
|
||
<property name="position"> | ||
<constraint name="NotBlank"> | ||
<option name="message">bitbag_sylius_cms_plugin.frequently_asked_question.position.not_blank</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
|
||
<property name="translations"> | ||
<constraint name="Valid"/> | ||
</property> | ||
</class> | ||
</constraint-mapping> |
39 changes: 39 additions & 0 deletions
39
src/Resources/config/validation/FrequentlyAskedQuestionTranslation.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping | ||
http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> | ||
|
||
<class name="BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionTranslation"> | ||
<property name="question"> | ||
<constraint name="NotBlank"> | ||
<option name="message">bitbag_sylius_cms_plugin.frequently_asked_question.question.not_blank</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
<constraint name="Length"> | ||
<option name="min">2</option> | ||
<option name="minMessage">bitbag_sylius_cms_plugin.frequently_asked_question.question.min_length</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
|
||
<property name="answer"> | ||
<constraint name="NotBlank"> | ||
<option name="message">bitbag_sylius_cms_plugin.frequently_asked_question.answer.not_blank</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
<constraint name="Length"> | ||
<option name="min">2</option> | ||
<option name="minMessage">bitbag_sylius_cms_plugin.frequently_asked_question.answer.min_length</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
</class> | ||
</constraint-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping | ||
http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> | ||
|
||
<class name="BitBag\SyliusCmsPlugin\Entity\Media"> | ||
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity"> | ||
<option name="fields"> | ||
<value>code</value> | ||
</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
<option name="message">bitbag_sylius_cms_plugin.media.code.unique</option> | ||
</constraint> | ||
<constraint name="BitBag\SyliusCmsPlugin\Validator\Constraint\FileMatchesType"> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
<option name="messageImage">bitbag_sylius_cms_plugin.media.file.type_image</option> | ||
<option name="messageVideo">bitbag_sylius_cms_plugin.media.file.type_video</option> | ||
<option name="field">type</option> | ||
</constraint> | ||
|
||
<property name="code"> | ||
<constraint name="NotBlank"> | ||
<option name="message">bitbag_sylius_cms_plugin.media.code.not_blank</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
<constraint name="Length"> | ||
<option name="min">2</option> | ||
<option name="max">250</option> | ||
<option name="minMessage">bitbag_sylius_cms_plugin.media.code.min_length</option> | ||
<option name="maxMessage">bitbag_sylius_cms_plugin.media.code.max_length</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
<constraint name="Regex"> | ||
<option name="pattern">/^[\w-]*$/</option> | ||
<option name="message">bitbag_sylius_cms_plugin.media.code.regex</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
|
||
<property name="file"> | ||
<constraint name="Expression"> | ||
<option name="expression">!(this.getPath() == null and this.getFile() == null)</option> | ||
<option name="message">bitbag_sylius_cms_plugin.media.file.not_blank</option> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
|
||
<property name="translations"> | ||
<constraint name="Valid"> | ||
<option name="groups"> | ||
<value>bitbag</value> | ||
</option> | ||
</constraint> | ||
</property> | ||
</class> | ||
</constraint-mapping> |
Oops, something went wrong.