# Item

> For more details and usage information on Item, see the [guide article on security authorization](https://yii2-framework.github.io/docs/guide/security-authorization/).

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [rbac](/docs/api/yii/rbac/index.md) › Item

| class | `yii\rbac\Item` |
| --- | --- |
| Extends | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| Implements | [`yii\base\Configurable`](/docs/api/yii/base/configurable/index.md) |
| Since | 2.0 |
| Source | [`framework/rbac/Item.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/rbac/Item.php#L19) |

2 subclasses:

- [`Permission`](/docs/api/yii/rbac/permission/index.md)
- [`Role`](/docs/api/yii/rbac/role/index.md)

For more details and usage information on Item, see the [guide article on security authorization](/docs/guide/security-authorization/index.md).

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-createdAt"></span>`$createdAt` | `int` | UNIX timestamp representing the item creation time Default: `null`. | `Item` |
| <span id="property-data"></span>`$data` | `mixed` | The additional data associated with this item Default: `null`. | `Item` |
| <span id="property-description"></span>`$description` | `string` | The item description Default: `null`. | `Item` |
| [`$name`](#property-name) | `string` | The name of the item. Default: `null`. | `Item` |
| <span id="property-ruleName"></span>`$ruleName` | `string\|null` | Name of the rule associated with this item Default: `null`. | `Item` |
| [`$type`](#property-type) | `int` | The type of the item. Default: `null`. | `Item` |
| <span id="property-updatedAt"></span>`$updatedAt` | `int` | UNIX timestamp representing the item updating time Default: `null`. | `Item` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| <span id="method-__construct"></span>[`__construct()`](/docs/api/yii/base/baseobject/index.md#method-__construct) | Constructor. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__call"></span>[`__call()`](/docs/api/yii/base/baseobject/index.md#method-__call) | Calls the named method which is not a class method. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__get"></span>[`__get()`](/docs/api/yii/base/baseobject/index.md#method-__get) | Returns the value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__isset"></span>[`__isset()`](/docs/api/yii/base/baseobject/index.md#method-__isset) | Checks if a property is set, i.e. defined and not null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__set"></span>[`__set()`](/docs/api/yii/base/baseobject/index.md#method-__set) | Sets value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__unset"></span>[`__unset()`](/docs/api/yii/base/baseobject/index.md#method-__unset) | Sets an object property to null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canGetProperty"></span>[`canGetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canGetProperty) | Returns a value indicating whether a property can be read. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canSetProperty"></span>[`canSetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canSetProperty) | Returns a value indicating whether a property can be set. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-className"></span>[`className()`](/docs/api/yii/base/baseobject/index.md#method-className) static | Returns the fully qualified name of this class. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-hasMethod"></span>[`hasMethod()`](/docs/api/yii/base/baseobject/index.md#method-hasMethod) | Returns a value indicating whether a method is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-hasProperty"></span>[`hasProperty()`](/docs/api/yii/base/baseobject/index.md#method-hasProperty) | Returns a value indicating whether a property is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-init"></span>[`init()`](/docs/api/yii/base/baseobject/index.md#method-init) | Initializes the object. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-TYPE_ROLE"></span>`TYPE_ROLE` | `1` |  | `Item` |
| <span id="const-TYPE_PERMISSION"></span>`TYPE_PERMISSION` | `2` |  | `Item` |

## Property details

### $name <span id="property-name"></span>

```php
public string $name = null
```

The name of the item.

This must be globally unique.

### $type <span id="property-type"></span>

```php
public int $type = null
```

The type of the item.

This should be either [`TYPE_ROLE`](/docs/api/yii/rbac/item/index.md#const-TYPE_ROLE) or [`TYPE_PERMISSION`](/docs/api/yii/rbac/item/index.md#const-TYPE_PERMISSION).