# UnknownMethodException

> UnknownMethodException represents an exception caused by accessing an unknown object method.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [base](/docs/api/yii/base/index.md) › UnknownMethodException

| class | `yii\base\UnknownMethodException` |
| --- | --- |
| Extends | [`BadMethodCallException`](https://www.php.net/manual/en/class.badmethodcallexception.php) |
| Since | 2.0 |
| Source | [`framework/base/UnknownMethodException.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/base/UnknownMethodException.php#L17) |

UnknownMethodException represents an exception caused by accessing an unknown object method.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`getName()`](#method-getName) |  | `UnknownMethodException` |

## Method details

### getName() <span id="method-getName"></span>

```php
public function getName(): string
```

**Returns**

`string`: The user-friendly name of this exception