You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
434 B
28 lines
434 B
<?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;
|
|
}
|
|
]
|
|
];
|
|
|