harp-orm / random-key
Generate a random key for a model property
Installs: 125
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/harp-orm/random-key
Requires
- php: >=5.4.0
 - harp-orm/harp: ~0.3.0
 
This package is auto-updated.
Last update: 2025-10-22 01:05:36 UTC
README
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.