Generate a random unique key for a model property
// 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
Copyright (c) 2014, Clippings Ltd. Developed by Ivan Kerin
Under BSD-3-Clause license, read LICENSE file.