SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```
  2.  
  3. $this->loadModel('Cfc.Events');
  4.  
  5. $data = [
  6.     'eid' => rand(0, 99999),
  7.     'name' => 'TEST ' . rand(0, 99999),
  8.     'start_date_time' => Time::now(),
  9.     'end_date_time' => Time::now(),
  10.     'capacity' => 10,
  11.     'free_space' => 5,
  12.     'instructor' => 'Kim',
  13.     'is_canceled' => false,
  14.     'gym' => [
  15.         'eid' => rand(0, 99999),
  16.         'name' => 'Gym name',
  17.         'logo_url' => 'url'
  18.     ]
  19. ];
  20. $event = $this->Events->newEntity($data, [
  21.     'associated' => [
  22.         'Gyms'
  23.     ]
  24. ]);
  25.  
  26. $this->Events->saveOrFail($event);
  27.  
  28. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top