@param $type
@param $name
@param $default_fields

@return array
511554
public function groups_get( $type, $name, $default_fields = null ) {

		static $groups_cache = array();

		if ( isset( $groups_cache[ $type . '/' . $name ] ) ) {
			return $groups_cache[ $type . '/' . $name ];
		}

		if ( 'post_type' == $type && 'attachment' == $name ) {
			$type = 'media';
			$name = 'media';
		} elseif ( 'term' == $type ) {
			$type = 'taxonomy';
		}

		do_action( 'pods_meta_groups', $type, $name );

		$pod    = array();
		$fields = array();

		$object = self::$post_types;

		if ( 'taxonomy' == $type ) {
			$object = self::$taxonomies;
		} elseif ( 'media' == $type ) {
			$object = self::$media;
		} elseif ( 'user' == $type ) {
			$object = self::$user;
		} elseif ( 'comment' == $type ) {
			$object = self::$comment;
		} elseif ( 'pod' == $type ) {
			$object = self::$advanced_content_types;
		}

		if ( ! empty( $object ) && is_array( $object ) && isset( $object[ $name ] ) ) {
			$fields = $object[ $name ]['fields'];
		} else {
			if ( empty( self::$current_pod_data ) || ! is_object( self::$current_pod_data ) || self::$current_pod_data['name'] != $name ) {
				self::$current_pod_data = pods_api()->load_pod( array( 'name' => $name ), false );
			}

			$pod = self::$current_pod_data;

			if ( ! empty( $pod ) ) {
				$fields = $pod['fields'];
			}
		}

		if ( null !== $default_fields ) {
			$fields = $default_fields;
		}

		$defaults = array(
			'name'   => 'post',
			'object' => 'post',
			'type'   => 'post_type'
		);

		$pod = array_merge( $defaults, (array) $pod );

		if ( empty( $pod['name'] ) ) {
			$pod['name'] = $pod['object'];
		} elseif ( empty( $pod['object'] ) ) {
			$pod['object'] = $pod['name'];
		}

		if ( $pod['type'] != $type ) {
			$groups_cache[ $type . '/' . $name ] = array();

			return $groups_cache[ $type . '/' . $name ];
		}

		$groups = array(
			array(
				'pod'      => $pod,
				/**
				 * Filter the title of the Pods Metabox In The Post Editor
				 *
				 * @param string  $title  The title to use, default is 'More Fields'
				 * @param obj|Pod $pod    Current Pods Object
				 * @param array   $fields Array of fields that will go in the metabox
				 * @param string  $type   The type of Pod
				 * @param string  $name   Name of the Pod
				 *
				 * @return string The title for the metabox.
				 *
				 * @since unknown
				 */
				'label'    => apply_filters( 'pods_meta_default_box_title', __( 'More Fields', 'pods' ), $pod, $fields, $type, $name ),
				'fields'   => $fields,
				'context'  => 'normal',
				'priority' => 'default'
			)
		);

		if ( isset( self::$groups[ $type ] ) && isset( self::$groups[ $type ][ $name ] ) ) {
			$groups = self::$groups[ $type ][ $name ];
		}

		/**
		 * Filter the array of field groups
		 *
		 * @param array  $groups Array of groups
		 * @param string $type   The type of Pod
		 * @param string $name   Name of the Pod
		 *
		 * @since 2.6.6
		 */
		$groups = apply_filters( 'pods_meta_groups_get', $groups, $type, $name );

		$groups_cache[ $type . '/' . $name ] = $groups;

		return $groups_cache[ $type . '/' . $name ];
	}
653037
public static function has_fields($post_type_name) {
    global $wpdb;

    $sql = $wpdb->prepare("SELECT COUNT(1) FROM ".MF_TABLE_CUSTOM_FIELDS. " WHERE post_type = %s",$post_type_name);

    return $wpdb->get_var( $sql ) > 0;
  }
202862
public function getFieldTypeFor($name, $column, $field = null)
    {
        $type = null;
        if ($column instanceof Column) {
            if ($column->getType()) {
                $type = get_class($column->getType());
            }
            $column = $column->getName();
        }
        if ($field !== null) {
            if (isset($this->contenttypes[$name]) && isset($this->contenttypes[$name]['fields'][$column]['fields'][$field])) {
                $type = $this->contenttypes[$name]['fields'][$column]['fields'][$field]['type'];
            }
        } elseif (isset($this->contenttypes[$name]) && isset($this->contenttypes[$name]['fields'][$column])) {
            $type = $this->contenttypes[$name]['fields'][$column]['type'];
        }

        if ($column === 'slug') {
            $type = 'slug';
        }

        if ($type === 'select' && isset($this->contenttypes[$name]['fields'][$column]['multiple']) && $this->contenttypes[$name]['fields'][$column]['multiple'] === true) {
            $type = 'selectmultiple';
        }

        if ($type && isset($this->typemap[$type])) {
            $type = $this->typemap[$type];
        } else {
            $type = $this->typemap['text'];
        }

        return $type;
    }
911721
function get($field_name, $default=null)
    {
        if (!Auth_OpenID_checkFieldName($field_name)) {
            return null;
        }

        return Auth_OpenID::arrayGet($this->data, $field_name, $default);
    }
680400
public function getQuery(string $name, string $type = null, $default = null)
    {
        $value = $this->getUserData($this->uri->getQueries(), $name);

        if ($type) {
            $value = $this->validateType($value, $type, $default);
        }

        return $value;
    }
186868
protected function ___getterSetterCheckAccess ($type, $name)
    {
        // Check for explicit definition
        if (isset($this->_getterSetterAccessMap)) {
            if (array_key_exists($name, $this->_getterSetterAccessMap)) {
                if (array_key_exists($type, $this->_getterSetterAccessMap[$name])) {
                    return $this->_getterSetterAccessMap[$name][$type];
                }
            }
        }

        // Check for default privilege setting
        $typeUcf = ucfirst($type);
        $defaultAccessPropertyName = "_getterSetterDefault{$typeUcf}Allow";
        if (isset($this->{$defaultAccessPropertyName})) {
            return $this->{$defaultAccessPropertyName};
        }

        // Otherwise return default sensible answer (write no, read yes)
        if ('read' == $type) {
            return true;
        } else {
            return false;
        }
    }
754924
public function getConverterForField($field_name)
    {
        if (!isset($this->converters[$field_name])) {
            throw new \RuntimeException(
                sprintf(
                    "Error, '%s' field has no converters registered. Fields are {%s}.",
                    $field_name,
                    join(', ', array_keys($this->converters))
                )
            );
        }

        return $this->converters[$field_name];
    }
1305573
public function field($name)
    {
        if (!isset($this->_fields[$name])) {
            return null;
        }

        return $this->_fields[$name];
    }
991092
public function getTypeInformation($type_name, $type_schema = null)
    {
        $condition = Where::create("t.typname = $*", [$type_name]);
        $sql = <<<SQL
select
    t.oid as "oid",
    t.typcategory as "category"
from
    pg_catalog.pg_type t :join
where
    {condition}
SQL;

        if ($type_schema !== null) {
            $sql = strtr($sql, [':join' => 'join pg_namespace n on n.oid = t.typnamespace']);
            $condition->andWhere('n.nspname = $*', [$type_schema]);
        } else {
            $sql = strtr($sql, [':join' => '']);
        }

        $iterator = $this->executeSql($sql, $condition);

        return $iterator->isEmpty() ? null : $iterator->current();
    }
1177335
public function get($name = null, $default = null)
    {
        $source = $this->_context->_REQUEST;

        if ($name === null) {
            return $source;
        }

        if (isset($source[$name]) && $source[$name] !== '') {
            $value = $source[$name];

            if (is_array($value) && is_scalar($default)) {
                throw new InvalidValueException(['the value of `:name` name is not scalar', 'name' => $name]);
            }

            if ($default !== null) {
                $type = gettype($default);
                if ($type === 'string') {
                    return (string)$value;
                } elseif ($type === 'integer') {
                    return (int)$value;
                } elseif ($type === 'double') {
                    return (float)$value;
                } elseif ($type === 'boolean') {
                    return (bool)$value;
                } else {
                    return $value;
                }
            } else {
                return $value;
            }
        } else {
            if ($default === null) {
                throw new MissingRequiredFieldsException($name);
            }

            return $default;
        }
    }
1059045
public function object_get( $type, $name ) {

		$object = self::$post_types;

		if ( 'term' == $type ) {
			$type = 'taxonomy';
		}

		if ( 'taxonomy' == $type ) {
			$object = self::$taxonomies;
		} elseif ( 'media' == $type ) {
			$object = self::$media;
		} elseif ( 'user' == $type ) {
			$object = self::$user;
		} elseif ( 'comment' == $type ) {
			$object = self::$comment;
		}

		if ( 'pod' != $type && ! empty( $object ) && is_array( $object ) && isset( $object[ $name ] ) ) {
			$pod = $object[ $name ];
		} else {
			if ( empty( self::$current_pod_data ) || ! is_object( self::$current_pod_data ) || self::$current_pod_data['name'] != $name ) {
				self::$current_pod_data = pods_api()->load_pod( array( 'name' => $name ), false );
			}

			$pod = self::$current_pod_data;
		}

		if ( empty( $pod ) ) {
			return array();
		}

		$defaults = array(
			'name'   => 'post',
			'object' => 'post',
			'type'   => 'post_type'
		);

		$pod = array_merge( $defaults, (array) $pod );

		if ( empty( $pod['name'] ) ) {
			$pod['name'] = $pod['object'];
		} elseif ( empty( $pod['object'] ) ) {
			$pod['object'] = $pod['name'];
		}

		if ( $pod['type'] != $type ) {
			return array();
		}

		return $pod;
	}
195801
public function read_default_value(Schema $field_schema, $default_value)
    {
        switch ($field_schema->type()) {
            case Schema::NULL_TYPE:
                return null;
            case Schema::BOOLEAN_TYPE:
                return $default_value;
            case Schema::INT_TYPE:
            case Schema::LONG_TYPE:
                return (int)$default_value;
            case Schema::FLOAT_TYPE:
            case Schema::DOUBLE_TYPE:
                return (float)$default_value;
            case Schema::STRING_TYPE:
            case Schema::BYTES_TYPE:
                return $default_value;
            case Schema::ARRAY_SCHEMA:
                $array = array();
                foreach ($default_value as $json_val) {
                    $val = $this->read_default_value($field_schema->items(), $json_val);
                    $array [] = $val;
                }
                return $array;
            case Schema::MAP_SCHEMA:
                $map = array();
                foreach ($default_value as $key => $json_val)
                    $map[$key] = $this->read_default_value($field_schema->values(),
                        $json_val);
                return $map;
            case Schema::UNION_SCHEMA:
                return $this->read_default_value($field_schema->schema_by_index(0),
                    $default_value);
            case Schema::ENUM_SCHEMA:
            case Schema::FIXED_SCHEMA:
                return $default_value;
            case Schema::RECORD_SCHEMA:
                $record = array();
                foreach ($field_schema->fields() as $field) {
                    $field_name = $field->name();
                    if (!$json_val = $default_value[$field_name])
                        $json_val = $field->default_value();

                    $record[$field_name] = $this->read_default_value($field->type(),
                        $json_val);
                }
                return $record;
            default:
                throw new Exception(sprintf('Unknown type: %s', $field_schema->type()));
        }
    }
978437
public function getFieldsByName( $name )
	{
		$name	= strtolower( $name );
		if( isset( $this->fields[$name] ) )
			return $this->fields[$name];
		return array();
	}
1014655
protected function makeField($name, $type = 'text', array $options = [])
    {
        $this->setupFieldOptions($name, $options);

        $fieldName = $this->getFieldName($name);

        $fieldType = $this->getFieldType($type);

        $field = new $fieldType($fieldName, $type, $this, $options);

        $this->eventDispatcher->dispatch(new AfterFieldCreation($this, $field));

        return $field;
    }
1124044
public static function input($type, $name, $attributes)
    {
        // Set id attribute to be same as the name
        // if one has not been set
        if (!isset($attributes['id'])) {
            $attributes['id'] =  $name;
        }

        // Check if the value is set in the
        // attributes array
        if (isset($attributes['value'])) {
            $value = $attributes['value'];
        }
        // Check if its in the _POST array
        elseif (isset($_POST[$name])) {
            $value = $_POST[$name];
        }
        // It's nowhere...
        else {
            $value = '';
        }

        // Add selected or checked attribute?
        foreach (array('selected', 'checked') as $attr) {
            if (isset($attributes[$attr]) and !$attributes[$attr]) {
                unset($attributes[$attr]);
            } elseif (isset($attributes[$attr])) {
                $attributes[$attr] = $attr;
            }
        }

        // Merge default attributes with
        // the specified attributes.
        $attributes = array_merge(array('type' => $type, 'name' => $name), $attributes);

        // Textareas
        if ($type == 'textarea') {
            return "<textarea " . HTML::buildAttributes($attributes) . ">{$value}</textarea>";
        }
        // Everything else
        else {
            // Don't pass the checked attribute if its false.
            if (isset($attributes['checked']) and !$attributes['checked']) {
                unset($attributes['checked']);
            }
            return "<input " . HTML::buildAttributes($attributes) . ">";
        }
    }
1360506
public function getParam($name, $default = null)
    {
        if (\is_array($this->params)) {
            // Check in params that are arrays or implement array access
            return $this->params[$name] ?? $default;
        } elseif (\is_object($this->params)) {
            // Check in normal objects
            return $this->params->{$name} ?? $default;
        } else {
            // Wrong type, return default value
            return $default;
        }
    }
1012931
public static function attributes( $attributes, $name = null, $type = null, $options = null ) {

		$attributes = (array) apply_filters( "pods_form_ui_field_{$type}_attributes", $attributes, $name, $options );

		foreach ( $attributes as $attribute => $value ) {
			if ( null === $value ) {
				continue;
			}

			echo ' ' . esc_attr( (string) $attribute ) . '="' . esc_attr( (string) $value ) . '"';
		}
	}