I have the tables Users, Emails, and UserEmails. in the UserEmails pivot table I have a flag for Primary, where would I set that in this scenario when saving?
// Initiate User Information
$user = new \Api\Models\User();
// Add Emails to User
$email = new \Api\Models\Email();
$email->setEmail($_POST['email']);
$email->setPrimary(1); // Creates error because this flag is on the pivot table
$emails[] = $email;
$user->emails = $emails;
$user->create();
Thanks