@param $name

@return mixed

@throws FieldError

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
770482
public function getLookup($name)
    {
        if (array_key_exists($name, self::$lookups)) {
            return self::$lookups[$name];
        }

        throw new FieldError(sprintf('Lookup %s is not recognized', $name));
    }
520005
public function getHasManyField($name)
    {
        $field = $this->getField($name);

        return $field instanceof HasManyField ? $field : null;
    }
1368628
public function getFieldValue($name)
    {
        $result = null;
        foreach ($this->fields as $key => $fields) {
            if (isset($fields[$name])) {
                $result = $this->fields[$key][$name]->getValue();
            }
        }
        return $result;
    }
495117
public function field($name)
    {
        if (!isset($this->keyMap[$name])) {
            throw new Exception(sprintf('Unable to find %s named field.', $name));
        }
        return $this->controls[$this->keyMap[$name]];
    }
1076069
public function getForeignField($name)
    {
        $field = $this->getField($name);

        return $field instanceof ForeignField ? $field : null;
    }
11956
public function getFieldType($name)
    {
        return $this->checkFieldExist($name)->types[$name] != null
            ? rtrim($this->types[$name], '[]')
            : null;
    }
908830
public function getField($name)
    {
        return (null !== $name && array_key_exists($name, $this->fields)) ? $this->fields[$name] : null;
    }
941043
function Field($name)
    {
        if (!array_key_exists($name, $this->fields))
            throw new \InvalidArgumentException($name . ' is not a valid field for '. $this->name);
        
        return $this->fields[$name];
    }
121010
public function getField($name)
    {
        if ($this->has($name)) {
            return $this->fields[$name];
        }

        $this->fieldDoesNotExist($name);
    }
648588
public function getCollector($name)
    {
        if (!isset($this->collectors[$name])) {
            throw new DebugBarException("'$name' is not a registered collector");
        }
        return $this->collectors[$name];
    }
795113
public function fields( $name )
    {
        if( $this->fields instanceof FieldCollection ) {
            $this->fields->field($name); //Sets active field
        }
        return $this->fields; // Is a direct access to the property
    }
500733
private function getClosure($name) {
        return isset($this->bindings[$name]) ? $this->bindings[$name]['closure'] : $name;
    }
1281353
public function getField(string $name): Field
    {
        if (!$this->hasField($name)) {
            throw new \OutOfBoundsException(sprintf('Field "%s" not found', $name));
        }

        return $this->fields[$name];
    }
1134966
protected function _operatorCallable($name)
    {
        $operator = $this->config("operators.{$name}");

        if ($operator) {
            $handler = $operator['handler'];

            if (is_callable($handler)) {
                return function ($query, $token) use ($handler) {
                    return $handler($query, $token);
                };
            } elseif ($handler instanceof BaseOperator) {
                return function ($query, $token) use ($handler) {
                    return $handler->scope($query, $token);
                };
            } elseif (is_string($handler) && method_exists($this->_table, $handler)) {
                return function ($query, $token) use ($handler) {
                    return $this->_table->$handler($query, $token);
                };
            } elseif (is_string($handler) && is_subclass_of($handler, '\Search\Operator\BaseOperator')) {
                return function ($query, $token) use ($operator) {
                    $instance = new $operator['handler']($this->_table, $operator['options']);

                    return $instance->scope($query, $token);
                };
            }
        }

        return false;
    }
48483
public function get_script($name)
    {
        if (!$this->sieve)
            return $this->_set_error(self::ERROR_INTERNAL);

        $content = $this->sieve->getScript($name);

        if (is_a($content, 'PEAR_Error')) {
            return $this->_set_error(self::ERROR_OTHER);
        }

        return $content;
    }
1296896
public function getErrors($name = null)
    {
        if (!$name) {
            $errors = array();
            //flatten the errors array into a single array
            array_walk_recursive($this->errors, function ($error) use (&$errors) {
                    $errors[] = $error;
                }
            );

            return $errors;
        }

        return isset($this->errors[$name]) ? $this->errors[$name] : array();
    }
1012208
public function get($name)
    {
        if (!$this->has($name)) {
            throw new \InvalidArgumentException(sprintf('The field guesser "%s" does not exist.', $name));
        }

        return $this->fieldGuessers[$name];
    }