Example #1
0
 public function parseRow(array $row)
 {
     if (empty($row)) {
         return false;
     }
     $data = new ReshaperData();
     $data->setData($row);
     ProcessorFactory::newData($data);
     foreach ($this->config['required'] as $rule) {
         $processor = ProcessorFactory::getProcessor($rule['type']);
         if ($processor->requiredCol($rule) === false) {
             return false;
         }
     }
     foreach ($this->config['fields'] as $rule) {
         $processor = ProcessorFactory::getProcessor($rule['type']);
         $processor->processCol($rule);
         $data->nextCol();
     }
     return $data;
 }