Handle on data input

@param array $row The data row

@return null
329030
protected function onInput($row)
    {
        if (is_array($this->params)) {
            foreach ($this->params as $cName => $cMap) {
                if (isset($this->mapFuncs[$cName])) {
                    $row[$cName] = $this->mapFuncs[$cName]($row[$cName]);
                } else if (is_array($cMap)) {
                    $row[$cName] = Utility::get($cMap, $row[$cName], $row[$cName]);
                }

            }
        } else if (is_callable($this->params)) {
            $func = $this->params;
            $pos = 0;
            foreach ($row as $cName => $value) {
                $row[$cName] = $func($value, $cName, $this->metaData['columns'][$cName], $pos);
                $pos++;
            }
        }
        $this->next($row);
    }
70063
public function process(array $row)
    {
        foreach ($row as &$item) {
            if ($item instanceof DateTimeInterface) {
                $item = $item->format($this->format);
            }
        }

        return $row;
    }
1146086
public function addRow(array $row)
    {
        if (is_array($this->fields)) {
            $assoc = $row;
            $row = [];
            foreach ($this->fields as $field) {
                $row[] = isset($assoc[$field]) ? $assoc[$field] : "";
            }
        }

        $this->data[] = $row;

        return $this;
    }
231609
public function onInput($data)
    {
        //Process data here
        foreach ($this->params as $copy => $original) {
            $data[$copy] = $data[$original];
        }
        $this->next($data);
    }
1279258
public function handleArray(array $data = []): void
    {
        $this->getForm()->submit($data);
        $this->handleForm($data['page'] ?? null);
    }
1233912
public function reset( $row = null ) {

		/**
		 * Runs directly before the Pods object is reset by reset()
		 *
		 * @since unknown
		 *
		 * @param int|string|null The ID of the row being reset to or null if being reset to the beginning.
		 * @param object|Pods $this Current Pods object.
		 */
		do_action( 'pods_pods_reset', $row, $this );

		$this->data->reset( $row );

		return $this;
	}
1283207
public function execute($row, $name = null)
    {
        parent::execute($row, $name);
        return $row[MemberNames::VALUE_ID];
    }
489857
public function setRow($row, $values)
    {

        if (!\is_array($values)) {
            \trigger_error("Values must be an array.", E_USER_ERROR);
            return false;
        }
        if (intval($row) < 1) {
            \trigger_error("Row number must be an integer greater than 1.", E_USER_ERROR);
            return false;
        }

        $i = 0;
        foreach ($values as $value) {
            $this->setCell(array($row - 1, $i), $value);
            $i++;
        }

        return true;
    }
1226469
private function processInsertOperation(array $row): int
    {
        //准备语句
        $this->statement->insert($row);

        //检查是否需要记录数据库日志
        $operationLog = self::logEnabled();

        if (!$operationLog) {
            //不需要记录,直接执行
            $this->execute2();

            // 获取插入的记录的ID,执行后置钩子
            return $this->after('Insert', 'Insert', $this->getInsertedId());
        }

        //执行原始操作
        $this->execute2();

        //获取插入的记录的ID
        $id = $this->getInsertedId();

        //判断插入是否成功
        if ($id) {
            //重新取出插入的数据
            $after = $this->select2('*', $id,null,1);

            //记录日志
            call_user_func($operationLog, $this->tableName, 'insert', ['data' => $row, 'after' => $after]);
        } else {
            //记录日志
            call_user_func($operationLog, $this->tableName, 'insert', ['data' => $row, 'id' => '插入失败']);
        }

        // 获取插入的记录的ID,执行后置钩子
        return $this->after('Insert', 'Insert', $id);
    }
89434
public function result($row = 0)
    {
        return isset($this->results[$row]) ? $this->results[$row] : false;
    }
1252287
protected function validateRowInRange($row)
    {
        $row = static::validateRow($row);
        if ($row > $this->rows) {
            throw new Exception('Requested Row exceeds matrix size');
        }

        return $row;
    }
468055
public static function SerializeRow(&$Row) {
      foreach ($Row as $Name => &$Value) {
         if (is_array($Value) && in_array($Name, array('Attributes', 'Data')))
            $Value = empty($Value) ? NULL : serialize($Value);
      }
   }
972126
protected function onInput($data)
    {
        //Process data here
        foreach ($this->params as $cName => $cParams) {
            if ($data[$cName]) {
                //Only if the value of column is not empty
                $format = Utility::get($this->metaData["columns"][$cName], "format");

                $datetime = ($format) ? \DateTime::createFromFormat($format, $data[$cName]) : new \DateTime($data[$cName]);

                $data[$cName] = $datetime->format($cParams["formatString"]);
                if ($cParams["bucket"] == "quarter") {
                    $data[$cName] = Utility::strReplace(
                        $data[$cName],
                        array(
                            "{q}" => ceil(intval($datetime->format("n")) / 3),
                        )
                    );
                }
            }
        }
        $this->next($data);
    }
1056001
private function doUpdateByQueries(array $row): void
    {
        $data = $this->generateFakeData();

        $queryBuilder = $this->dbUtils->getConn()->createQueryBuilder();
        $queryBuilder = $queryBuilder->update($this->entity);
        foreach ($data as $field => $value) {
            $value = empty($row[$field]) ?
                $this->dbUtils->getEmptyValue($this->entityCols[$field]['type']) :
                $value;

            $condition = $this->dbUtils->getCondition($field, $this->entityCols[$field]);
            $queryBuilder = $queryBuilder->set($field, $condition);
            $queryBuilder = $queryBuilder->setParameter(":$field", $value);
        }
        $queryBuilder = $queryBuilder->where("{$this->priKey} = :{$this->priKey}");
        $queryBuilder = $queryBuilder->setParameter(":{$this->priKey}", $row[$this->priKey]);

        $this->returnRes === true ?
            array_push($this->queries, $this->dbUtils->getRawSQL($queryBuilder)) :
            null;

        if ($this->pretend === false) {
            $queryBuilder->execute();
        }
    }
1155729
public function execute($row = null)
    {
        if ($row) {
            if ((! isset($row['grs_id_user'])) &&
                    isset($row['grs_ssn']) &&
                    $this->targetModel instanceof \Gems_Model_RespondentModel &&
                    $this->targetModel->hashSsn !== \Gems_Model_RespondentModel::SSN_HIDE) {

                if (\Gems_Model_RespondentModel::SSN_HASH === $this->targetModel->hashSsn) {
                    $search = $this->targetModel->saveSSN($row['grs_ssn']);
                } else {
                    $search = $row['grs_ssn'];
                }

                $sql = 'SELECT grs_id_user FROM gems__respondents WHERE grs_ssn = ?';
                $id  = $this->db->fetchOne($sql, $search);

                // Check for change in patient ID
                if ($id) {
                    if (isset($row['gr2o_id_organization']) &&
                            $this->targetModel instanceof \MUtil_Model_DatabaseModelAbstract) {

                        $sql = 'SELECT gr2o_patient_nr
                                FROM gems__respondent2org
                                WHERE gr2o_id_user = ? AND gr2o_id_organization = ?';

                        $patientId = $this->db->fetchOne($sql, array($id, $row['gr2o_id_organization']));

                        if ($patientId) {
                            // Change the patient number
                            $copyId       = $this->targetModel->getKeyCopyName('gr2o_patient_nr');
                            $row[$copyId] = $patientId;
                        }
                    }

                    $row['grs_id_user']  = $id;
                    $row['gr2o_id_user'] = $id;
                }
            }

            parent::execute($row);
        }
    }
32056
private function passesFilter(array $row)
    {
        foreach ($row as $name => $value) {
            if (isset($this->rules[$name])) {
                // check all rules for a given attribute
                foreach ($this->rules[$name] as $rule) {
                    /* @var $rule MatcherInterface */
                    if (!$rule->match($value)) {
                        return false;
                    }
                }
            }
        }

        return true;
    }
920556
protected function onInput($row)
    {
        $index = "";
        foreach ($this->groupColumns as $gColumn) {
            $index .= $row[$gColumn];
        }
        $index = strtolower($index) . md5($index);
        if (isset($this->gData[$index])) {
            $res = $this->gData[$index];
            $this->cData[$index]++;

            foreach ($this->sumColumns as $sumColumn) {
                $res[$sumColumn] += $row[$sumColumn];
            }
            foreach ($this->countColumns as $countColumn) {
                $res[$countColumn] = $this->cData[$index];
            }
            foreach ($this->minColumns as $minColumn) {
                if ($res[$minColumn] > $row[$minColumn]) {
                    $res[$minColumn] = $row[$minColumn];
                }
            }

            foreach ($this->maxColumns as $maxColumn) {
                if ($res[$maxColumn] < $row[$maxColumn]) {
                    $res[$maxColumn] = $row[$maxColumn];
                }
            }

            foreach ($this->avgColumns as $avgColumn) {
                $res[$avgColumn] = ($res[$avgColumn] * ($this->cData[$index] - 1) + $row[$avgColumn]) / $this->cData[$index];
            }

            $this->gData[$index] = $res;
        } else {
            $this->cData[$index] = 1;
            foreach ($this->countColumns as $countColumn) {
                $row[$countColumn] = 1;
            }
            $this->gData[$index] = $row;
        }
    }