rbac\Assignment $userId

$userId public property User ID (see yii\web\User::$id) public string|integer $userId = null

rbac\Assignment $roleName

$roleName public property The role name public string $roleName = null

rbac\Assignment $createdAt

$createdAt public property UNIX timestamp representing the assignment creation time public integer $createdAt = null

Rate Limiting

To prevent abuse, you should consider adding rate limiting to your APIs. For example, you may want to limit the API usage of each user to be at most 100 API calls within a period of 10 minutes. If too many requests are received from a user within the stated period of the time, a response with status code 429 (meaning "Too Many Requests") should be returned. To enable rate limiting, the user identity class should implement yii\filters\RateLimitInterface. This interface requires implementation of

Quick Start

Creating a Controller Configuring URL Rules Enabling JSON Input Trying it Out Summary Yii provides a whole set of tools to simplify the task of implementing RESTful Web Service APIs. In particular, Yii supports the following features about RESTful APIs: Quick prototyping with support for common APIs for Active Record; Response format negotiation (supporting JSON and XML by default); Customizable object serialization with support for selectable output fields; Proper formatting of collection dat

Query Builder

Building Queries Query Methods Built on top of Database Access Objects, query builder allows you to construct a SQL query in a programmatic and DBMS-agnostic way. Compared to writing raw SQL statements, using query builder will help you write more readable SQL-related code and generate more secure SQL statements. Using query builder usually involves two steps: Build a yii\db\Query object to represent different parts (e.g. SELECT, FROM) of a SELECT SQL statement. Execute a query method (e.g. a

Properties

In PHP, class member variables are also called properties. These variables are part of the class definition, and are used to represent the state of a class instance (i.e., to differentiate one instance of the class from another). In practice, you may often want to handle the reading or writing of properties in special ways. For example, you may want to always trim a string when it is being assigned to a label property. You could use the following code to achieve this task: $object->label = t

Pagination

When there are too much data to be displayed on a single page, a common strategy is to display them in multiple pages and on each page only display a small portion of the data. This strategy is known as pagination. Yii uses a yii\data\Pagination object to represent the information about a pagination scheme. In particular, total count specifies the total number of data items. Note that this is usually much more than the number of data items needed to display on a single page. page size specifi

Page Caching

Page caching refers to caching the content of a whole page on the server-side. Later when the same page is requested again, its content will be served from the cache instead of regenerating it from scratch. Page caching is supported by yii\filters\PageCache, an action filter. It can be used like the following in a controller class: public function behaviors() { return [ [ 'class' => 'yii\filters\PageCache', 'only' => ['index'], 'duration' =&

mutex\PgsqlMutex releaseLock()

releaseLock() protected method Releases lock by given name. See also http://www.postgresql.org/docs/9.0/static/functions-admin.html. protected boolean releaseLock ( $name )$name string Of the lock to be released. return boolean Release result.