Return the defined field instance based on its basename property.
If not set, return all fields from the "default" group.

@param string $name
@param string $group

@return FieldTypeInterface|FieldTypeInterface[]|array
322321
public function getField(string $name = '', string $group = 'default')
    {
        /** @var SectionInterface $section */
        $section = $this->groups[$group];

        $foundItems = array_filter($section->getItems(), function (FieldTypeInterface $item) use ($name) {
            return $name === $item->getBaseName();
        });

        return ! empty($foundItems) ? array_shift($foundItems) : [];
    }
633517
public function get($name)
    {
        if (isset($this->fields[$name])) {
            return $this->fields[$name];
        }

        throw new FieldException("Fielder doesn't have [$name] field registered.");
    }
244878
protected function getGroup(string $name): array
    {
        if (!$this->container->has('config_'.$name)) {
            $this->loadGroup($name);
        }

        return $this->container->get('config_'.$name);
    }
316992
public static function getKeys($group)
    {
        self::loadKeys();
        self::$keys[$group] = isset(self::$keys[$group]) ? self::$keys[$group] : [];

        return self::$keys[$group];
    }
895374
public function getLabel($name, $group = null)
	{
		// Attempt to get the form field.
		if ($field = $this->getField($name, $group))
		{
			return $field->label;
		}

		return '';
	}
628001
public function getConfigFromFile($group, $name)
    {
        // Do we have a value in the ini?
        // Does it validate?
        if (isset($this->iniSettings[$group][$name]) === true &&
            $this->security->evaluateSetting($group, $name, $this->iniSettings[$group][$name]) === true
        ) {
            return $this->iniSettings[$group][$name];
        }

        return null;
    }
1140592
public function getRelationshipField($name)
    {
        $result = array_filter($this->getRelationshipFields(), function($field) use ($name) {
            return $name === $field->getName();
        });

        return reset($result);
    }
1222607
public function getConfigurator(string $name): FieldSetConfigurator
    {
        if (!isset($this->configurators[$name])) {
            if (isset($this->serviceIds[$name])) {
                $configurator = $this->container->get($this->serviceIds[$name]);
            } elseif (class_exists($name)) {
                // Support fully-qualified class names.
                $configurator = new $name();
            } else {
                throw new InvalidArgumentException(sprintf('Could not load FieldSet configurator "%s".', $name));
            }

            if (!$configurator instanceof FieldSetConfigurator) {
                throw new InvalidArgumentException(sprintf('Configurator class "%s" is expected to be an instance of '.FieldSetConfigurator::class, $name));
            }

            $this->configurators[$name] = $configurator;
        }

        return $this->configurators[$name];
    }
120434
public function findByName($name)
	{
		$model = $this->createModel();

		$group = $model->where('name', '=', $name)->find();

		if ( ! $group->loaded() )
		{
			throw new GroupNotFoundException("A group could not be found with the name [$name].");
		}

		return $group;
	}
858673
public function field($name)
  {
    return isset($this->fields[$name]) ? $this->fields[$name] : false;
  }
751157
protected function getVersionedResourceClassName($group, $name)
    {
        $class = \str_replace('.', '\\', $name);
        $version = $this->getVersionNamespace();

        return \sprintf('%s\%s\%s\%s', $this->namespace, $group, $version, $class);
    }
993977
public function getField($name, $key, $default = null)
    {
        if (array_key_exists($name, $this->fields) && array_key_exists($key, $this->fields[$name])) {
            return $this->fields[$name][$key];
        }
        return $default;
    }
821814
public function group($group = null) {
		if (is_null($group))
			return $this->discard('query.group');
	
		if ($group instanceof Column) {
			//get referred attribute
			$map = $this->entityProfile->getPropertyMap();
			if (!in_array($group->getName(), $map))
				throw new \InvalidArgumentException(sprintf("Column '%s' is unknown for class '%s'", $group->getName(), $this->entityProfile->getReflectionClass()->getName()));
			$name = array_flip($map)[$group->getName()];
		}
		elseif ($group instanceof Attr)
			$name = $group->getName();
		elseif (is_string($group))
			$name = $group;
		else
			throw new \InvalidArgumentException("Group must be specified through an Attr instance or a valid property name");
		
		//get custom type (if any)
		$type = $group->getType();
		if (isset($type))
			return $this->merge(['query.group' => $group->getName() . ':' . $type]);
		return $this->merge(['query.group' => $group->getName()]);
	}
10036
protected function getGroupByRoleName(string $name) : ?EntityInterface
    {
        $result = TableRegistry::get('Groups.Groups')->find()
            ->enableHydration(true)
            ->where(['name' => $name])
            ->first();

        Assert::nullOrIsInstanceOf($result, EntityInterface::class);

        return $result;
    }
121010
public function getField($name)
    {
        if ($this->has($name)) {
            return $this->fields[$name];
        }

        $this->fieldDoesNotExist($name);
    }
158731
public function field($name)
    {
        return isset($this->_properties['fields'][$name])?
            $this->_properties['fields'][$name]:null;
    }
279954
public function getField($name)
		{
			return isset($this->fields[$name])
				? $this->fields[$name]
				: null;
		}