Guest User

Untitled

a guest
Jun 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. // Create and populate an object.
  2. $value = new stdClass();
  3. $value->userid = (int)$userid;
  4. $value->type = $data['type'];
  5.  
  6. // Insert the object into the user profile table.
  7. $handle = JFactory::getDbo()->insertObject('#__bestia_handles', $value);
  8.  
  9. $db = JFactory::getDbo();
  10.  
  11. $db->insertObject(...)
  12.  
  13. $db->insertid();
  14.  
  15. MyComponentTableMyTable extends JTable
  16. {
  17. public function save($src, $orderingFilter= '', $ignore= '')
  18. {
  19. /*call parent save function and return either insertid or null depending on whether or not parent save function returns true or false */
  20. return ( parent::save ( $src, $orderingFilter, $ignore ) ? $_db->insertid () : NULL ) ;
  21. }
  22. }
Add Comment
Please, Sign In to add comment