You are here

public function EntityMenuLinkController::save in Entity menu links 7

Overrides save from EntityAPIController

Overrides EntityAPIController::save

File

./entity_menu_links.controller.inc, line 81

Class

EntityMenuLinkController
Controller class for menu links.

Code

public function save($entity, DatabaseTransaction $transaction = NULL) {
  $menu_link = (array) $entity;
  $mlid = menu_link_save($menu_link);
  if (FALSE === $mlid) {
    $transaction
      ->rollback();
    throw new Exception('Could not save menu_link');
  }
  $entity->mlid = $mlid;
}