/** * @return $this */ public function prepare() { $this->progress = new ProgressBar($this->output, $this->reader->count()); $this->progress->setFormat($this->verbosity); $this->progress->setRedrawFrequency($this->redrawFrequency); $this->progress->start(); return $this; }
/** * 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; }
/** * Count elements of an object * The return value is cast to an integer. */ public function count() { return $this->leftReader->count(); }