フィールド単体の構文解析を行います。
@param string $fieldName フィールド名。未知のフィールド名が指定された場合はそのまま返します。
@param string $field フィールド値。
@return string|string[]|float|null 矯正したフィールド値を返します。矯正の結果フィールドの削除が生じるときは null を返します。
430903
protected function parseField(string $fieldName, string $field)
    {
        $field = str_replace("\t", '    ', $field);
        
        switch ($fieldName) {
            case 'image':
            case 'audio':
            case 'video':
                $validator = new FileLocationValidator($fieldName, $this->filenames);
                $validator->setLogger($this->logger);
                $output = $validator->correct($field);
                break;

            case 'image-source':
            case 'audio-source':
            case 'video-source':
                $validator = new LightweightMarkupValidator(true);
                $validator->setLogger($this->logger);
                $output = $validator->correct($field);
                if ($output !== '') {
                    $output = [
                        'lml' => $output,
                        'html' => (new HTMLFilter())->filter((new CommonMarkConverter())->convertToHtml($output)),
                    ];
                }
                break;

            case 'answer':
            case 'option':
                $validator = new AnswerValidator();
                $validator->setLogger($this->logger);
                $output = $validator->correct($field);
                break;

            case 'description':
            case '@summary':
                $validator = new LightweightMarkupValidator(false, $this->filenames);
                $validator->setLogger($this->logger);
                $output = $validator->correct($field);
                if ($output !== '') {
                    $output = [
                        'lml' => $output,
                        'html' => (new HTMLFilter())->filter((new CommonMarkConverter())->convertToHtml($output)),
                    ];
                }
                break;

            case 'weight':
                $validator = new NumberValidator(true);
                $validator->setLogger($this->logger);
                $number = $validator->correct($field);
                if ($number > 0) {
                    $output = $number;
                } else {
                    $this->logger->error(sprintf(_('「%s」は0より大きい実数として扱えません。'), $field));
                    $output = '';
                }
                if ($output !== '') {
                    $output = (float)$output;
                }
                break;

            case 'specifics':
                $validator = new SpecificsValidator();
                $validator->setLogger($this->logger);
                $output = $validator->correct($field);
                break;

            case '@regard':
                if (preg_match('/^\\[.{3,}]$/u', $field) === 1
                    && (new AnswerValidator())->validateRegexp("/$field/")) {
                    $output = $field;
                } else {
                    $this->logger->error(sprintf(_('「%s」は妥当な正規表現文字クラスではありません。'), $field));
                    $output = '';
                }
                break;
            
            default:
                $output = $field;
        }
        
        $correctedField = is_array($output) ? $output['lml'] : $output;
        $fieldLength = mb_strlen($correctedField, 'UTF-8');
        $maxFieldLength
            = in_array($fieldName, self::MARKUP_FIELD_NAMES) ? self::MAX_MARKUP_FIELD_LENGTH : self::MAX_FIELD_LENGTH;
        if ($fieldLength > $maxFieldLength) {
            throw new SyntaxException(sprintf(
                _('「%1$s」フィールドの値は%2$d文字です。%3$d文字以内にしなければなりません:'),
                $fieldName,
                $fieldLength,
                $maxFieldLength
            ) . "\n$correctedField");
        }
        
        return $output === '' ? null : $output;
    }
118737
public function getFieldMapping($fieldName)
    {
        if (!isset($this->fieldMappings[$fieldName])) {
            return false;
        }

        return $this->fieldMappings[$fieldName];
    }
24590
public function getField($fieldName)
    {
        $this->debug->group(__METHOD__, $fieldName);
        $field = false;
        if (\preg_match('|^(.*?)[/.](.*)$|', $fieldName, $matches)) {
            $pageName = $matches[1];
            $fieldName = $matches[2];
        } else {
            $pageName = $this->status['currentPageName'];
        }
        if ($pageName == $this->status['currentPageName'] && isset($this->currentFields[$fieldName])) {
            $field = &$this->currentFields[$fieldName];
            if (!\is_object($field)) {
                $field['pageI'] = $this->persist->get('i');
                $this->currentFields[$fieldName] = $this->buildField($field, $fieldName);
            }
        } elseif (isset($this->cfg['pages'][$pageName])) {
            $pages = $this->persist->get('pages');
            foreach ($pages as $pageI => $page) {
                if ($page['name'] != $pageName) {
                    continue;
                }
                foreach ($this->cfg['pages'][$pageName] as $k => $fieldProps) {
                    if ($k === $fieldName
                        || isset($fieldProps['attribs']['name']) && $fieldProps['attribs']['name'] == $fieldName
                        || isset($fieldProps['name']) && $fieldProps['name'] == $fieldName
                    ) {
                        $this->debug->info('found field');
                        $fieldProps['pageI'] = $pageI;
                        $field = $this->buildField($fieldProps, $k);
                        $val = $this->getValue($fieldName, $pageI);
                        $field->val($val, false);
                        break 2;
                    }
                }
                break;
            }
        }
        $this->debug->groupEnd();
        return $field;
    }
274116
public function getField($field)
    {
        if (!$this->isFieldSupported($field)) {
            return null;
        }

        if (!$this->hasLoadedField($field)) {
            $loaderData = $this->getLoaderData($field);
            if ($normalizer = $this->normalizersMap->getNormalizerForField($field)) {
                switch ($normalizer[ 'type' ]) {
                    case NormalizersMap::TYPE_METHOD:
                        $this->fields[ $field ] =
                            $this->{sprintf('%sNormalizer', $normalizer[ 'method' ])}($loaderData);
                        break;

                    case NormalizersMap::TYPE_ARRAY_PATH:
                        $this->fields[ $field ] =
                            ArrayUtils::getNested($loaderData, $normalizer[ 'path' ], $normalizer[ 'defaultValue' ]);
                        break;

                    case NormalizersMap::TYPE_PREFILLED_VALUE:
                        $this->fields[ $field ] = $normalizer[ 'value' ];
                        break;

                    default:
                        throw new GenericException("Unknown normalizer type \"{$normalizer['type']}\"");
                }

                switch ($field) {
                    case self::FIELD_WEBSITES:
                    case self::FIELD_EXTRA:
                        if ($this->fields[ $field ]) {
                            $this->fields[ $field ] = (array) $this->fields[ $field ];
                        } else {
                            $this->fields[ $field ] = [];
                        }
                        break;
                }
            } // Don't need to be normalized
            else {
                $this->fields[ $field ] = $loaderData;
            }
        }

        return parent::getField($field);
    }
1335807
private function getFieldValue($field)
    {
        return isset($this->values[$field]) ? $this->values[$field] : null;
    }
640584
private function fieldNameToUpperCamelCase(string $fieldName) : string
    {
        $handler = function ($matches) {
            return strtoupper($matches[0][1]);
        };
        $result = (string) preg_replace_callback('#\\_[a-zA-Z]#', $handler, $fieldName);
        $result = ucfirst($result);

        return $result;
    }
1211389
function field($fieldName) {
        if ($fieldName) {
            if ($this->fields && $this->fields != '*') {
                if ($fieldName == 'SQL_CALC_FOUND_ROWS *') {
                    $this->fields = 'SQL_CALC_FOUND_ROWS' . " $this->fields";
                }
                else if ($fieldName != '*') {
                    $this->fields = $fieldName . ",$this->fields";
                }
                //else {
                //    $this->fields .= ',' . $fieldName;
                //}
            }
            else {
                $this->fields = $fieldName;
            }
        }
        return $this;
    }
1196340
public function parseField($field = null,$default = '')
	{
		if(null === $field)
		{
			if(isset($this->operationOption['field']))
			{
				$field = $this->operationOption['field'];
			}
			else
			{
				return $default . ' ';
			}
		}
		$result = '';
		foreach($field as $tField)
		{
			if(is_array($tField))
			{
				foreach($tField as $key => $value)
				{
					if(is_numeric($key))
					{
						$result .= $this->parseKeyword($value) . ',';
					}
					else
					{
						$result .= $this->parseKeyword($key) . ' as ' . $this->parseKeyword($value) . ',';
					}
				}
			}
			else
			{
				$result .= $tField . ',';
			}
		}
		return isset($result[1]) ? (substr($result,0,-1) . ' ') : '';
	}
256780
protected function _getUpdateFieldValue($fieldName, $field)
    {
        $fieldValue = null;
        if ($field instanceof Field) {
            $fieldValue = $field->getRawValue();
        } elseif (isset($field->value)) {
            $fieldValue = $field->value;
        }

        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        //Check if this field value is null AND it can be null according if not returning default value
        if ((null === $fieldValue)) {
            if ($this->_canFieldBeNull($fieldName)) {
                return 'null';
            } elseif ($fieldValue = $this->_getFieldDefaultValue($fieldName)) {
                return $database->quote($fieldValue);
            }
        }

        return $database->quote($fieldValue);
    }
1276233
public function getField($fieldName)
    {
        if (!array_key_exists($fieldName, $this->_fields)) {
            include_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception("Field name \"$fieldName\" not found in document.");
        }
        return $this->_fields[$fieldName];
    }
386762
public function getFieldByName($name)
    {
        foreach ($this->fieldList as $field) {
            if ($field->getFieldName() === $name) {
                return $field;
            }
        }

        return null;
    }
483184
private function getField($fieldName)
    {
        if (array_key_exists($fieldName, $this->snsMessage)) {
            return $this->snsMessage[$fieldName];
        } else {
            return null;
        }
    }
783564
final private static function getColumnType($fieldName) {
		
		$db = Database::getInstance();
		$column = $db->describeColumn(static::TABLE_NAME, $fieldName);
		
		if (is_null($column)) {
			return NULL;
		}
		
		// split the column Type to recognize field type and length
		preg_match('#^([\w]+)(\([^\)]+\))? ?(unsigned)?#i', $column->Type, $matches);
		
		$field = new \stdClass();
		
		$field->name	= $fieldName;
		$field->type	= $matches[1];
		$field->unsigned= (isset($matches[3]));
		$field->nullable= 'YES' == $column->Null ? TRUE : FALSE;
		$field->key		= $column->Key;
		$field->default	= $column->Default;
		$field->extra	= $column->Extra;

		if (isset($matches[2])) {
			if (in_array($field->type, ['enum','set'])) {
				$field->length = explode("','", substr($matches[2], 2, -2));
			} else {
				$field->length = explode(",", substr($matches[2], 1, -1));
			}
		} else {
			$field->length = NULL;
		}
		
		return $field;
		
	}
495976
public function relField($fieldName)
    {
        // default case
        if ($value = parent::relField($fieldName)) {
            return $value;
        }

        // check values for a form field with the matching name.
        $formField = SubmittedFormField::get()->filter(array(
            'ParentID' => $this->ID,
            'Name' => $fieldName
        ))->first();

        if ($formField) {
            return $formField->getFormattedValue();
        }
    }
115415
private function convertToCustomField($field)
    {
        if (!empty($field->attributes())) {
            if (isset($field->attributes()->{'field-name'}) && isset($field->attributes()->{'field-value'})) {
                $rawName = (string)$field->attributes()->{'field-name'};
                list($normalizedName, $prefix) = $this->splitFieldNameAndPrefix($rawName);
                $value = (string)$field->attributes()->{'field-value'};
                if (!empty($normalizedName)) {
                    return new CustomField($normalizedName, $value, $prefix);
                }
            }
        }
        return null;
    }
26971
public function linkList($field = null)
    {
        $result = [];
        foreach ($this->getFileList() as $path) {
            $name = basename($path);
            $result[$name] = $this->getFileLink($field, basename($path));
        }
        return $result;
    }
884980
public function getLabelTextFromField($fieldName = null) {
		$text = '';
		if (empty($fieldName)) {
			return $text;
		}

		if (strpos($fieldName, '.') !== false) {
			$fieldElements = explode('.', $fieldName);
			$text = array_pop($fieldElements);
		} else {
			$text = $fieldName;
		}
		if (substr($text, -3) === '_id') {
			$text = substr($text, 0, -3);
		}
		$text = Inflector::humanize(Inflector::underscore($text));

		return $text;
	}