Advertisement
Guest User

Untitled

a guest
May 25th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. //create record
  2. $rec = $fm->createRecord('layout_name', '$data_array');
  3. $result = $rec->commit();
  4.  
  5. //new add command
  6. $newAdd = $fm->newAddCommand('layout_name', $data_array);
  7. $result = $newAdd->execute();
  8.  
  9.  
  10. //Second and main difference is what they return to $result variable. The 'createRecord()' statement returns an integer value to know the status of record creation process(whether succeed or failed). But the 'newAddCommand()' returns a bunch of information for the new created record along with record id.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement