Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. public function fire($job, $data)
  2. {
  3. foreach (unserialize($data['message']) as $org)
  4. {
  5. // Ignore ID 33421 this will time out.
  6. // It contains all users in the system.
  7. if($org->id != 33421) {
  8. $organization = new Organization();
  9. $organization->orgsync_id = $org->id;
  10. $organization->short_name = $org->short_name;
  11. $organization->long_name = $org->long_name;
  12. $organization->category = $org->category->name;
  13. $organization->save();
  14.  
  15. $org_groups = $this->getGroupsInOrganization($org->id);
  16. if (!is_int($org_groups))
  17. {
  18. foreach ($org_groups as $group)
  19. {
  20. foreach($group->account_ids as $account_id)
  21. {
  22. $student = Student::where('orgsync_id', '=', $account_id)->first();
  23. if (is_object($student))
  24. {
  25. $student->organizations()->attach($organization->id, array('is_officer' => ($group->name == 'Officers')));
  26. }
  27. }
  28. }
  29. }
  30. }
  31. }
  32.  
  33. $job->delete();
  34. }
  35.  
  36. SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared (SQL: insert into `organization_student` (`is_officer`, `organization_id`, `student_id`) values (0, 284, 26))
  37.  
  38. SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared (SQL: insert into `organizations` (`orgsync_id`, `short_name`, `long_name`, `category`, `updated_at`, `created_at`) values (24291, SA, Society of American, Professional, 2014-09-15 16:26:01, 2014-09-15 16:26:01))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement