Last active
April 13, 2019 10:40
-
-
Save biesbjerg/6d7985ec3b2a3ddeb580abf9aeb39b3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
$this->loadModel('Cfc.Events'); | |
$data = [ | |
'eid' => rand(0, 99999), | |
'name' => 'TEST ' . rand(0, 99999), | |
'start_date_time' => Time::now(), | |
'end_date_time' => Time::now(), | |
'capacity' => 10, | |
'free_space' => 5, | |
'instructor' => 'Kim', | |
'is_canceled' => false, | |
'gym' => [ | |
'eid' => rand(0, 99999), | |
'name' => 'Gym name', | |
'logo_url' => 'url' | |
] | |
]; | |
$event = $this->Events->newEntity($data, [ | |
'associated' => [ | |
'Gyms' | |
] | |
]); | |
$this->Events->saveOrFail($event); | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment