Files
lichterei-web/kirby/config/sections/mixins/max.php
Bastian Allgeier eb29ef6d6c Upgrade to 3.1.2
2019-04-09 14:34:12 +02:00

29 lines
587 B
PHP
Executable File

<?php
return [
'props' => [
/**
* Sets the maximum number of allowed entries in the section
*/
'max' => function (int $max = null) {
return $max;
}
],
'methods' => [
'isFull' => function () {
if ($this->max) {
return $this->total >= $this->max;
}
return false;
},
'validateMax' => function () {
if ($this->max && $this->total > $this->max) {
return false;
}
return true;
}
]
];