Skip to content

Commit

Permalink
Add docblocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jun 1, 2018
1 parent 79be6c0 commit 97c9ba1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Form/Form.php
Expand Up @@ -94,6 +94,7 @@ class Form implements EventListenerInterface, EventDispatcherInterface, Validato
* Form's data.
*
* @var array
* @since 3.7.0
*/
protected $_data = [];

Expand Down Expand Up @@ -312,6 +313,14 @@ protected function _execute(array $data)
return true;
}

/**
* Get field data.
*
* @param string|null $field The field name or null to get data array with
* all fields.
* @return mixed
* @since 3.7.0
*/
public function getData($field = null)
{
if ($field === null) {
Expand All @@ -321,6 +330,13 @@ public function getData($field = null)
return Hash::get($this->_data, $field);
}

/**
* Set form data.
*
* @param array $data Data array.
* @return $this
* @since 3.7.0
*/
public function setData(array $data)
{
$this->_data = $data;
Expand Down

0 comments on commit 97c9ba1

Please sign in to comment.