{"action":"opened","issue":{"url":"https://api.github.com/repos/gabordemooij/redbean/issues/567","repository_url":"https://api.github.com/repos/gabordemooij/redbean","labels_url":"https://api.github.com/repos/gabordemooij/redbean/issues/567/labels{/name}","comments_url":"https://api.github.com/repos/gabordemooij/redbean/issues/567/comments","events_url":"https://api.github.com/repos/gabordemooij/redbean/issues/567/events","html_url":"https://github.com/gabordemooij/redbean/issues/567","id":248804620,"number":567,"title":"RedBeanPHP: how to add timestamp, unique default?","user":{"login":"elieobeid7","id":660142,"avatar_url":"https://avatars0.githubusercontent.com/u/660142?v=4","gravatar_id":"","url":"https://api.github.com/users/elieobeid7","html_url":"https://github.com/elieobeid7","followers_url":"https://api.github.com/users/elieobeid7/followers","following_url":"https://api.github.com/users/elieobeid7/following{/other_user}","gists_url":"https://api.github.com/users/elieobeid7/gists{/gist_id}","starred_url":"https://api.github.com/users/elieobeid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elieobeid7/subscriptions","organizations_url":"https://api.github.com/users/elieobeid7/orgs","repos_url":"https://api.github.com/users/elieobeid7/repos","events_url":"https://api.github.com/users/elieobeid7/events{/privacy}","received_events_url":"https://api.github.com/users/elieobeid7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-08T18:27:10Z","updated_at":"2017-08-08T18:27:10Z","closed_at":null,"body":"I'm using the latest stable version, if I have to update for version 5, let me know.\r\n\r\n    $user = R::dispense('user');\r\n    $user->fname = 'Elie';\r\n    $user->lname = 'Obeid';\r\n    $user->setMeta(\"buildcommand.unique\" , array($user->email='elieobeid7@gmail.com'));\r\n    $user->pass = password_hash('password', PASSWORD_DEFAULT);\r\n\r\n    $user->gender=0; // I want this to have a default value of 0 if I don't insert anything\r\n    $user->verified=1;\r\n    $user->lastModified = date('Y-m-d G:i:s'); // I want this to be a timestamp, right now it's stored as datetime\r\n    $id= R::store($user);\r\n\r\n`lastModified` is stored as datetime. I want `gender` and `verified` to have a default value of 0. I want `email` to be unique.\r\n\r\nI tried every solution I could find on stackoverflow and nothing works\r\n\r\n    $user->setMeta(\"buildcommand.unique\" , array(array('email')));\r\n\r\n \r\n"}}
{"actor":{"display_login":"elieobeid7"}}