| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* This file is part of the PacketeryNette Framework (https://nette.org) |
| 5 |
* Copyright (c) 2004 David Grudl (https://davidgrudl.com) |
| 6 |
*/ |
| 7 |
|
| 8 |
declare(strict_types=1); |
| 9 |
|
| 10 |
namespace PacketeryNette\Forms; |
| 11 |
|
| 12 |
|
| 13 |
/** |
| 14 |
* Defines method that must be implemented to allow a component to act like a form control. |
| 15 |
*/ |
| 16 |
interface Control |
| 17 |
{ |
| 18 |
/** |
| 19 |
* Sets control's value. |
| 20 |
* @param mixed $value |
| 21 |
* @return static |
| 22 |
*/ |
| 23 |
function setValue($value); |
| 24 |
|
| 25 |
/** |
| 26 |
* Returns control's value. |
| 27 |
* @return mixed |
| 28 |
*/ |
| 29 |
function getValue(); |
| 30 |
|
| 31 |
function validate(): void; |
| 32 |
|
| 33 |
/** |
| 34 |
* Returns errors corresponding to control. |
| 35 |
*/ |
| 36 |
function getErrors(): array; |
| 37 |
|
| 38 |
/** |
| 39 |
* Is control value excluded from $form->getValues() result? |
| 40 |
*/ |
| 41 |
function isOmitted(): bool; |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
interface_exists(IControl::class); |
| 46 |
|