AllowMultiple.php
4 years ago
HasDefaultValue.php
4 years ago
HasEmailTag.php
4 years ago
HasHelpText.php
4 years ago
HasLabel.php
4 years ago
HasMaxLength.php
4 years ago
HasMinLength.php
4 years ago
HasName.php
4 years ago
HasNodes.php
4 years ago
HasOptions.php
4 years ago
HasPlaceholder.php
4 years ago
HasType.php
4 years ago
HasVisibilityConditions.php
4 years ago
InsertNode.php
4 years ago
IsReadOnly.php
4 years ago
IsRequired.php
4 years ago
Macroable.php
4 years ago
MoveNode.php
4 years ago
MoveNodeProxy.php
4 years ago
NameCollision.php
4 years ago
RemoveNode.php
4 years ago
SerializeAsJson.php
4 years ago
ShowInReceipt.php
4 years ago
StoreAsMeta.php
4 years ago
ValidationRules.php
4 years ago
WalkNodes.php
4 years ago
HasMinLength.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Framework\FieldsAPI\Concerns; |
| 4 | |
| 5 | /** |
| 6 | * @since 2.14.0 |
| 7 | * |
| 8 | * @property ValidationRules $validationRules |
| 9 | */ |
| 10 | trait HasMinLength |
| 11 | { |
| 12 | |
| 13 | /** |
| 14 | * Set the value’s minimum length. |
| 15 | * |
| 16 | * @since 2.14.0 |
| 17 | * |
| 18 | * @param int $minLength |
| 19 | * |
| 20 | * @return $this |
| 21 | */ |
| 22 | public function minLength($minLength) |
| 23 | { |
| 24 | $this->validationRules->rule('minLength', $minLength); |
| 25 | |
| 26 | return $this; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Get the value’s minimum length. |
| 31 | * |
| 32 | * @since 2.14.0 |
| 33 | * |
| 34 | * @return int|null |
| 35 | */ |
| 36 | public function getMinLength() |
| 37 | { |
| 38 | return $this->validationRules->getRule('minLength'); |
| 39 | } |
| 40 | } |
| 41 |