How can I use a core classe in my ORM Model ?
Is working:
protected static $_properties = array(
'id',
'user_id',
'v_key' => array('default' => 'abc' ),
'a_key' => array('default' => 'def' ),
'created_at',
'updated_at'
);
Isn't working:
protected static $_properties = array(
'id',
'v_key' => array('default' => Str::random('alnum', 6) ),
'a_key' => array('default' => Str::random('alnum', 6) ),
'created_at',
'updated_at'
);
Thanks!!
Your actual problem here is that you can't perform function calls when making static assignments in PHP. How to initialize static variables