You are here

function backup_migrate_item::set_id in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.2 includes/crud.inc \backup_migrate_item::set_id()
  2. 8.3 includes/crud.inc \backup_migrate_item::set_id()
  3. 6.2 includes/crud.inc \backup_migrate_item::set_id()
  4. 7.3 includes/crud.inc \backup_migrate_item::set_id()
  5. 7.2 includes/crud.inc \backup_migrate_item::set_id()

Set the primary id for this item (if any is set).

1 call to backup_migrate_item::set_id()
backup_migrate_item::unique_id in includes/crud.inc
Make sure this item has a unique id. Should only be called for new items or the item will collide with itself.

File

includes/crud.inc, line 602
CRUD functions for backup and migrate types (schedules, profiles etc.).

Class

backup_migrate_item
A base class for items which can be stored in the database, listed, edited, deleted etc.

Code

function set_id($id) {
  $keys = (array) $this
    ->get_machine_name_field();
  if (!empty($keys[0])) {
    return $this->{$keys[0]} = $id;
  }
  return NULL;
}