@param string $field
@param array  $data

@return bool
350778
protected function isEmpty($field, $data) {
		if (!isset($data[ $field ])) {
			return true;
		}

		$value = $data[ $field ];

		return is_array($value) ? empty ($value) : strlen(trim($value)) == 0;
	}
1357842
public static function finagleVarcharFieldTypeForIndexListing($field, $data) {
   	if (empty($field['persist_wash'])) {
            return $data;
        }
    
        if (strtolower($field['persist_wash']) == "url") {
            $prefacedURL = self::prefaceURLwithHTTP($data);
            return '<a href="'.$prefacedURL.'" target="_blank">'.$data.'</a>';
        }

        return $data;
    }
1028741
public function createCustomField(Field $field)
		{
			$form_data = array(
				'fieldname' => $field->getName(),
				'fieldtype' => $field->getType(),
				'description' => $field->getDescription()
			);
			$this->call('customfieldcreate', $form_data);

			return TRUE;
		}
447645
public function tableHasField($table, $field)
    {
        return isset($this->cache['fields'][$table]) && array_key_exists($field, $this->cache['fields'][$table]);
    }
299597
protected static function validateDisplayColumns(array $data, array $fields): array
    {
        foreach ($data as $k => $v) {
            if (in_array($v, $fields)) {
                continue;
            }
            unset($data[$k]);
        }

        return $data;
    }
1032286
public function fieldExists($field, $table) {
        $fieldLists = $this->query("DESC " . $this->getPrefix() . $table);
        foreach ($fieldLists as $f) {
            if (strtolower($f['Field']) == strtolower($field)) {
                return TRUE;
            }
        }
        return FALSE;
    }
1161893
public function set(string $field, string $key, $data, int $expire = self::EXPIRE): bool
    {
        // 缓存数据
        $this->doSet($key, $data, $expire);

        //记录调试信息
        self::debugSet($field . ':' . $key, $data);

        // 取出此表已经缓存的所有键
        $keys = $this->get(self::PREFIX_FIELD . $field);
        if (!$keys or $keys == CacheFactory::NOT_FOUND) {
            $keys = [];
        }

        // 增加一个键,并保存回去,以便以后统一清除
        $keys[] = $key;
        return $this->doSet(self::PREFIX_FIELD . $field, $keys, $expire);
    }
356368
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case NAME:
      return isSetName();
    case DATA_TYPE:
      return isSetDataType();
    case ENCODING:
      return isSetEncoding();
    case OTHER_ARGS:
      return isSetOtherArgs();
    }
    throw new IllegalStateException();
  }
53717
protected final function popValue(&$data, $field) {
        $rtn = null;
        if (isset($data[ $field ])) {
            $rtn = $data[ $field ];
            unset($data[ $field ]);
        }

        return $rtn;
    }
885128
public function deserialize($data, Field $field, array $options = [])
    {
        if (!in_array(Options::REFRESH_UUID, $options)) {
            $this->sipe('id', 'setUuid', $data, $field);
        }

        $this->sipe('label', 'setName', $data, $field);
        $this->sipe('type', 'setType', $data, $field);
        $this->sipe('required', 'setRequired', $data, $field);
        $this->sipe('restrictions.hidden', 'setHidden', $data, $field);
        $this->sipe('restrictions.isMetadata', 'setIsMetadata', $data, $field);
        $this->sipe('restrictions.locked', 'setLocked', $data, $field);
        $this->sipe('restrictions.lockedEditionOnly', 'setLockedEditionOnly', $data, $field);
        $this->sipe('restrictions.order', 'setOrder', $data, $field);
        $this->sipe('help', 'setHelp', $data, $field);

        $fieldFacet = $field->getFieldFacet();

        if (!$fieldFacet) {
            $clacoForm = $field->getClacoForm();
            $fieldFacet = new FieldFacet();
            $fieldFacet->setResourceNode($clacoForm->getResourceNode());
            $this->om->persist($fieldFacet);
        }

        $fieldFacet = $this->fieldFacetSerializer->deserialize($data, $fieldFacet, $options);
        $this->om->persist($fieldFacet);
        $field->setFieldFacet($fieldFacet);

        if (isset($data['options']['choices'])) {
            unset($data['options']['choices']);
        }
        $this->sipe('options', 'setDetails', $data, $field);

        return $field;
    }
1008678
public function removeField($field)
    {
        if (isset($this->rules[$field])) {
            unset($this->rules[$field]);
            return true;
        }
        return false;
    }
927892
public function hDel($key, $field, ...$fields) {
        return $this->send(array_merge(['hdel', $key], (array) $field, $fields));
    }
1187047
public function puts(array $fields, array $data)
    {
        $c = count($data);
        if ($c <= 0 or count($fields) <= 0)
        {
            return false;
        }

        return $this->db->insertBatch($fields, $data, $this->table);
    }
558024
public function confirm( $value, $rule, $data = [], $field = '' )
	{
		if( '' == $rule ){
			if( strpos( $field, '_confirm' ) ){
				$rule = strstr( $field, '_confirm', true );
			} else{
				$rule = $field.'_confirm';
			}
		}
		return $this->getDataValue( $data, $rule ) === $value;
	}
1351536
public function hasError($field=null){
        if($field == null){
            return count($this->errors) > 0;
        }
        return array_key_exists($field, $this->errors);
    }
846506
public function has(string $field): bool
    {
        if (is_array($this->storage)) {
            return array_key_exists($field, $this->storage);
        }

        return $this->storage->offsetExists($field);
    }
777830
public function validator($field, array $data)
    {
        $value = isset($data[$field]) ? $data[$field] : null;
        if ($value === '' || $value === null) {
            return $this->allowEmpty ? true : $this->message('{fieldName}不在允许的范围内！', [
                '{fieldName}' => $this->getName($field),
            ], 'emptyMsg');
        }

        if (in_array($value, $this->range, $this->isStrict)) {
            return true;
        }

        return $this->message('{fieldName}不在允许的范围内！', [
            '{fieldName}' => $this->getName($field),
        ]);
    }