public function addField($field, $label = null)
{
if (is_string($field)) {
$field = new Field($field, $label);
}
if (!$field instanceof FieldInterface) {
throw new InvalidArgumentException('VAL-007: Only FieldInterfaces can be added as a field.');
}
$this->fields[$field->getName()] = $field;
$this->lastAddedField = $field;
return $this;
}