/** * Add a mapping to the workflow * * If we can get the field names from the reader, they are just to check the * $fromField against. * * @param string $fromField Field to map from * @param string|array $toField Field or array to map to * * @return $this * @throws \InvalidArgumentException */ public function addMapping($fromField, $toField) { if (count($this->reader->getFields()) > 0) { if (!in_array($fromField, $this->reader->getFields())) { throw new \InvalidArgumentException("{$fromField} is an invalid field"); } } $this->getMappingItemConverter()->addMapping($fromField, $toField); return $this; }
/** * @return array */ public function getFields() { return array_merge($this->leftReader->getFields(), array($this->nestKey)); }