Can function calls occur within a PDO transaction block? This is simplified code (using MySql database)...

try{  
  $db->beginTransaction();  

  // call to function that creates user
  $user_id = create_user();  

  // call to function that creates company      
  $company_id = create_company();

  // call to function to link user & company
  add_user_to_company($user_id, $company_id);

  $db->commit();  
}

If this can't happen using transactions, what is the recommended strategy?

Edit
Report