jberall / yii2-uuidbehavior
Attaches a Ramsey V4::UUID
Package info
github.com/jberall/yii2-uuidbehavior
Type:yii2-extension
pkg:composer/jberall/yii2-uuidbehavior
dev-master
2017-04-26 22:39 UTC
Requires
- ramsey/uuid: ^3.5
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2026-03-07 06:57:00 UTC
README
Attaches a Ramsey V4::UUID
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist jberall/yii2-uuidbehavior "*"
or add
"jberall/yii2-uuidbehavior": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by : Where _id is the column in the database representing a UUID. public function behaviors() { return [ 'uuidBehavior' => [ 'class' => \jberall\uuidbehavior\UuidBehavior::className(), 'uuid_column' => '_id', ], ]; }