Пример #1
0
 /**
  * This is a simple wrapper with (currently) no additional functionality
  * over get_by_id that resynchronizes the object state with the database.
  * Use this if you think that your current object is stale. It does full
  * access control.
  *
  * On any failure, the object is cleared.
  *
  * @param midcom_core_dbaobject $object The DBA object we're working on
  * @return bool Indicating Success
  */
 public static function refresh(midcom_core_dbaobject $object)
 {
     // FIXME: be GUID based, but needs further testing...
     /**
      * Use try/catch here since the object might have been deleted...
      * @see http://trac.midgard-project.org/ticket/927
      */
     try {
         $refreshed = $object->get_by_id($object->id);
     } catch (exception $e) {
         return false;
     }
     return $refreshed;
 }