public function addField(Field $fields) { $this->fields[$fields->getName()] = $fields; return $this; }