MenaraSolutions\Geographer\Traits\ExposesFields::__call PHP Method

__call() public method

public __call ( $methodName, $args ) : string | integer
$methodName
$args
return string | integer
    public function __call($methodName, $args)
    {
        if (preg_match('~^(get)([A-Z])(.*)$~', $methodName, $matches)) {
            $field = strtolower($matches[2]) . $matches[3];
            return $this->__get($field);
        }
        if (preg_match('~^(findOneBy)([A-Z])(.*)$~', $methodName, $matches)) {
            $field = strtolower($matches[2]) . $matches[3];
            return $this->findOne([$field => $args[0]]);
        }
        throw new UnknownFieldException('Method ' . $methodName . ' doesn\'t exist');
    }