public static function fromObject($object) {
    if ($object instanceof PersistentObjectProxy) {
      return $object;
    }
    else if ($object instanceof PersistentObject) {
      $proxy = new PersistentObjectProxy($object->getOID());
      $proxy->realSubject = $object;
      return $proxy;
    }
    else {
      throw new IllegalArgumentException("Cannot create proxy from unknown object");
    }
  }