added IDbRecord::fromRecord and implemented it in User and UserSession classes