Handle on data input

@param array $data The input data row

@return null
496331
protected function onInput($data)
    {
        $ndata = array();
        foreach ($this->params as $colname) {
            if (isset($data[$colname])) {
                $ndata[$colname] = $data[$colname];
            }
        }

        $this->next($ndata);
    }
1242440
public function process(ArrayAccess $data) {
		foreach ($this->_config['fields'] as $field) {
			if (!empty($data[$field])) {
				$data[$field] = $this->_prepareInput($data[$field]);
			}
		}
	}
926389
public function applyData ( $data = NULL ) {
        if (NULL != $data && is_array( $data )) {
            foreach ($data as $propName => $propValue) {
                $this->assignValue( $propName, $propValue );
            }
        } else {
            $this->buildVars();
        }
    }
1284886
public function handle($data = null)
    {

        // Handle data with adaptor
        $adaptor = $this->getAdaptor();
        if ( $adaptor ) {
            $data = $adaptor->transform( $data, $this );
        }

        // Overwrite default data with data
        $data = array_merge( [
            'name'=>null,
            'width'=>null,
            'height'=>null,
            'focus_point_x'=>0,
            'focus_point_y'=>0,
            'resize'=>false,
        ], $data );

        // Create variables from array keys
        extract( $data );

        // Throw error if filename is not set
        if ( ! $name ) throw new \Exception( 'You need to set a name in adaptor' );

        // Throw error if both width and height is null
        if ( ! $width && ! $height ) throw new \Exception( 'The width or the height need to be set' );

        // Create handler
        $this->handler = ImageHandler::create( $name, $this->getBaseFolder(), $this->getCropsFolder() );

        // Check if we should resize or crop
        // If one of the width or height is _ This is still a resize
        if ( $resize || ( !$width || !$height ) ) {
            $this->handler->resize( $width, $height );
        }
        else {
            $this->handler->cropToFit( $width, $height, $focus_point_x, $focus_point_y );
        }

        // Return this for binding
        return $this;
    }
501043
protected function setData($data = [])
    {
        if (!isset($data[self::RS_KEY_CODE])) {
            $data[self::RS_KEY_CODE] = 0;
        }
        if (!isset($data[self::RS_KEY_MSG])) {
            $data[self::RS_KEY_MSG] = 'Success';
        }
        if (!isset($data[self::RS_KEY_TYPE])) {
            $data[self::RS_KEY_TYPE] = self::RESPONSE_XHTML;
        }

        if (!isset($data[self::RS_KEY_DATA])) {
            $data[self::RS_KEY_DATA] = new \stdClass();
        } else {
            if (!$data instanceof \stdClass) {
                $data[self::RS_KEY_DATA] = new \stdClass();
            }
        }
        $this->data = $data;
    }
205743
public function validate( array $data ) {
		// Validate use Validator.
		try {
			$this->validate_use_validator( $data, $this->get_validate_rules() );
		} catch ( \Exception $e ) {
			trigger_error( $e->getMessage(), E_USER_WARNING ); // @WPCS: XSS OK.
		}

		// Validate use custom callback.
		$callbacks = $this->fields->pluck( 'validate_cb', 'id' )->filter( 'is_callable' );

		if ( $callbacks->isNotEmpty() ) {
			$this->validate_by_callbacks( $data, $callbacks->all() );
		}
	}
975866
public function failed(array $data)
	{
		$handler = $this->dispatcher->resolveHandler($command = unserialize($data['command']));

		if (method_exists($handler, 'failed'))
		{
			call_user_func([$handler, 'failed'], $command);
		}
	}
222343
public function inputCompile(array $data)
    {
        foreach ($data['policies'] as $rule => $policy) {
            $passed = call_user_func_array([new InputRules(), $rule], [$data['value']]);
            if ($passed !== true) {
                Handler::set(
                    str_replace(':field', $data['field'], $this->messages[$rule]), $data['field']);
            }
        }
    }
1277685
protected function handlePost($data)
    {
        PWELogger::debug($_SERVER['REQUEST_METHOD'] . ": %s", $data);
        throw new HTTP5xxException('Not supported method for this call: ' . $_SERVER['REQUEST_METHOD'], HTTP5xxException::UNIMPLEMENTED);
    }
1289096
public function fill($data)
    {
        // Field value is already setted.
//        if (!is_null($this->value)) {
//            return;
//        }

        $this->data = $data;

        if (is_array($this->column)) {
            foreach ($this->column as $key => $column) {
                $this->value[$key] = Arr::get($data, $column);
            }

            return;
        }

        $this->value = Arr::get($data, $this->column);
        if (isset($this->customFormat) && $this->customFormat instanceof \Closure) {
            $this->value = call_user_func($this->customFormat, $this->value);
        }
    }
16536
public function onInput($row)
    {
        $keys = array_keys($row);
        $values = array_values($row);
        for ($i = 0; $i < count($keys); $i++) {
            if (isset($this->params[$keys[$i]])) {
                $keys[$i] = $this->params[$keys[$i]];
            }
        }
        $this->next(array_combine($keys, $values));
    }
378536
private function setData(array $data)
    {
        $_documentClass = $this->_documentClass;
        $_edgeClass = $this->_edgeClass;

        if (isset($this->_options[self::ENTRY_FLAT]) && $this->_options[self::ENTRY_FLAT]) {
            $this->_result = $data;
        } else {
            $this->_result = [];

            if ($this->_options[self::ENTRY_TYPE] === Collection::TYPE_EDGE) {
                foreach ($data as $row) {
                    $this->_result[] = $_edgeClass::createFromArray($row, $this->_options);
                }
            } else {
                foreach ($data as $row) {
                    $this->_result[] = $_documentClass::createFromArray($row, $this->_options);
                }
            }
        }
    }
422017
final public function update(array $data)
    {
        $this->query->setStartUpdate($data);

        $this->query->prepare()->bindSetForUpdate($data)->bindWhere()->bindLimit()->execute();

        $this->setRowCount();

        $this->query->close();
    }
773594
protected function loadData(array $data = [])
    {
        foreach ($data as $key => $value) {
            if (property_exists($this, $key)) {
                $this->$key = $value;
            }
        }
    }
628923
public function handleData($data)
    {
        $this->incomingBuffer .= $data;

        if ($this->connection && $this->isHeaderEnd($this->incomingBuffer)) {
            $remoteAddress = (string) $this->incoming->getRemoteAddress();
            $headersToReplace = [
                'X-PHP-PM-Remote-IP' => trim(parse_url($remoteAddress, PHP_URL_HOST), '[]'),
                'X-PHP-PM-Remote-Port' => trim(parse_url($remoteAddress, PHP_URL_PORT), '[]')
            ];

            $buffer = $this->replaceHeader($this->incomingBuffer, $headersToReplace);
            $this->connection->write($buffer);

            $this->incoming->removeListener('data', [$this, 'handleData']);
            $this->incoming->pipe($this->connection);
        }
    }
387387
public function set(array $data)
    {
        foreach ($data as $name => $value) {
            $this->setField($name, $value);
        }
    }
982728
protected function onInput($data)
    {
        $columnsMeta = $this->metaData['columns'];
        $filters = $this->filters;
        $logicalOperator = 'and';
        $isFiltered = true;
        foreach ($filters as $i => $filter) {
            if (is_array($filter)) {
                $field = $filter[0];
                $type = $columnsMeta[$field]['type'];
                if (!isset($data[$field])) {
                    continue;
                }

                $filterResult = $this->isFiltered($filter, $data[$field], $type);
                if ($logicalOperator === 'and') {
                    $isFiltered = $isFiltered && $filterResult;
                }
                if ($logicalOperator === 'or') {
                    $isFiltered = $isFiltered || $filterResult;
                }
            } else if ($filter === 'and' || $filter === 'or') {
                $logicalOperator = $filter;
                if ($filter === 'or' && $i === 0) {
                    $isFiltered = false;
                }

            }
        }
        if ($isFiltered) {
            $this->next($data);
        }
    }