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