harp-orm/random-key

为模型属性生成随机键

0.3.0 2014-07-14 09:24 UTC

This package is auto-updated.

Last update: 2024-09-21 22:00:03 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

为模型属性生成随机唯一键

用法

// Model Class
use Harp\Harp\AbstractModel
use Harp\RandomKey\RandomKeyTrait

class User extends AbstractModel
{
    use RandomKeyTrat;

    public static function initialize($config)
    {
        // ...
        RandomKeyTrait::initialize($config);
    }
}

数据库表

┌─────────────────────────┐
│ Table: User             │
├─────────────┬───────────┤
│ id          │ ingeter   │
│ name        │ string    │
│ uniqueKey*  │ string    │
└─────────────┴───────────┘
* Required fields

许可证

版权 (c) 2014, Clippings Ltd. 由 Ivan Kerin 开发

根据 BSD-3-Clause 许可证,请参阅 LICENSE 文件。