ipd.php 567 B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. * 恢复一条记录。
  4. * Undelete a record.
  5. *
  6. * @param int $actionID
  7. * @access public
  8. * @return string|bool
  9. */
  10. public function undelete($actionID)
  11. {
  12. $action = $this->getById($actionID);
  13. if($action->action != 'deleted') return false;
  14. if($action->objectType == 'demand')
  15. {
  16. $demand = $this->loadModel('demand')->getByID($action->objectID);
  17. if(isset($demand->parent)) $this->dao->update(TABLE_DEMAND)->set('parent')->eq(-1)->where('id')->eq($demand->parent)->exec();
  18. }
  19. return parent::undelete($actionID);
  20. }