Skip to content
Snippets Groups Projects
Commit f6958ea1 authored by damjan's avatar damjan
Browse files

[FEATURE] MinVersion is not null and lowest value = 4.5

parent 8bcd9ecc
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ namespace SGalinski\TypoScriptBackendBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Property
......@@ -51,7 +52,11 @@ class Property {
* @var string The TYPO3 version in which the property was introduced
* Example: "4.5" "6.1" "6.2"), NULL is default and NULL is interpreted as most early version.
*
* @ORM\Column(name="min_version", type="decimal", precision=4, scale=1, options={"default" = "4.5"}, nullable=true)
* @Assert\Range(
* min = 4.5,
* minMessage = "Lowest supported version is {{ limit }}.",
* )
* @ORM\Column(name="min_version", type="decimal", precision=4, scale=1, options={"default" = "4.5"}, nullable=false)
*/
private $minVersion = Type::MIN_VERSION_DEFAULT;
......
......@@ -4,6 +4,7 @@ namespace SGalinski\TypoScriptBackendBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Type
......@@ -31,8 +32,7 @@ class Type {
const USER_GROUP = 3;
/**
* Default value of property $minVersion. Default value also needs to be specified in property annotation:
* options={"default" = "4.5"}
* Default value of property $minVersion. Default value also needs to be specified in property annotations.
*/
const MIN_VERSION_DEFAULT = "4.5";
......@@ -70,7 +70,11 @@ class Type {
* @var string The TYPO3 version in which the type was introduced
* Example: "4.5" "6.1" "6.2"), NULL is interpreted as most early version.
*
* @ORM\Column(name="min_version", type="decimal", precision=4, scale=1, options={"default" = "4.5"}, nullable=true)
* @Assert\Range(
* min = 4.5,
* minMessage = "Lowest supported version is {{ limit }}.",
* )
* @ORM\Column(name="min_version", type="decimal", precision=4, scale=1, options={"default" = "4.5"}, nullable=false)
*/
private $minVersion = Type::MIN_VERSION_DEFAULT;
......@@ -110,6 +114,7 @@ class Type {
/**
* Properties of the Type
*
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="Property", mappedBy="parentType")
......@@ -153,7 +158,6 @@ class Type {
return $this->name;
}
/**
* Get urlName
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment