harp-orm/random-key

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Generate a random key for a model property

0.3.0 2014-07-14 09:24 UTC

This package is auto-updated.

Last update: 2021-05-21 14:35:27 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

Generate a random unique key for a model property

Usage

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

class User extends AbstractModel
{
    use RandomKeyTrat;

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

Database Table:

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

License

Copyright (c) 2014, Clippings Ltd. Developed by Ivan Kerin

Under BSD-3-Clause license, read LICENSE file.