tmgmt_local.controller.task.inc 877 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @file
  4. * Contains the task controller.
  5. */
  6. /**
  7. * Controller class for the local task entity.
  8. *
  9. * @ingroup tmgmt_local_task
  10. */
  11. class TMGMTLocalTaskController extends EntityAPIController {
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public function save($entity, DatabaseTransaction $transaction = NULL) {
  16. $entity->changed = REQUEST_TIME;
  17. return parent::save($entity, $transaction);
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function delete($ids, $transaction = NULL) {
  23. parent::delete($ids, $transaction);
  24. $query = new EntityFieldQuery();
  25. $result = $query
  26. ->entityCondition('entity_type', 'tmgmt_local_task_item')
  27. ->propertyCondition('tltid', $ids)
  28. ->execute();
  29. if (!empty($result['tmgmt_local_task_item'])) {
  30. entity_delete_multiple('tmgmt_local_task_item', array_keys($result['tmgmt_local_task_item']));
  31. }
  32. }
  33. }