protected function processRules($element)
	{
		// If this is a container (Form or Fieldset) loop through each of the fields
		if ($element instanceof Form or $element instanceof Fieldset)
		{
			$result = [];

			foreach ($element as $field)
			{
				$result += $this->processRules($field);
			}

			return $result;
		}

		$metaData = $element->getMetaContainer();

		if (isset($metaData['validation']))
		{
			$label = $element->getLabel();

			if (is_null($label))
			{
				$label = $element->getName();
			}

			return [$element->getName() => [
				$this->ruleProvider->getRuleKey() => $metaData['validation'],
				$this->ruleProvider->getLabelKey() => $label,
			]];
		}

		return [$element->getName() => []];
	}
protected function processRules($element)
	{
		// If this is a container (Form or Fieldset) loop through each of the fields
		if ($element instanceof Form or $element instanceof Fieldset)
		{
			$result = [];

			foreach ($element as $field)
			{
				$result += $this->processRules($field);
			}

			return $result;
		}

		$metaData = $element->getMetaContainer();

		if (isset($metaData['validation']))
		{
			$label = $element->getLabel();

			if (is_null($label))
			{
				$label = $element->getName();
			}

			return [$element->getName() => [
				$this->ruleProvider->getRuleKey() => $metaData['validation'],
				$this->ruleProvider->getLabelKey() => $label,
			]];
		}

		return [$element->getName() => []];
	}
protected function processRules ( $ element ) { // If this is a container (Form or Fieldset) loop through each of the fields if ( $ element instanceof Form or $ element instanceof Fieldset ) { $ result = [ ] ; foreach ( $ element as $ field ) { $ result += $ this -> processRules ( $ field ) ; } return $ result ; } $ metaData = $ element -> getMetaContainer ( ) ; if ( isset ( $ metaData [ 'validation' ] ) ) { $ label = $ element -> getLabel ( ) ; if ( is_null ( $ label ) ) { $ label = $ element -> getName ( ) ; } return [ $ element -> getName ( ) => [ $ this -> ruleProvider -> getRuleKey ( ) => $ metaData [ 'validation' ] , $ this -> ruleProvider -> getLabelKey ( ) => $ label , ] ] ; } return [ $ element -> getName ( ) => [ ] ] ; }
Generates a rule set that the parent FromArray can parse for fields

@param $element

@return array
Generates a rule set that the parent FromArray can parse for fields