@@ -40,38 +40,37 @@ public protocol ParseObject: Objectable,
4040}
4141
4242// MARK: Default Implementations
43- extension ParseObject {
43+ public extension ParseObject {
44+
45+ /**
46+ Gets an empty version of the respective object. This can be used when you only need to update a
47+ a subset of the fields of an object as oppose to updating every field of an object.
48+ - note: Using an empty object and updating a subset of the fields reduces the amount of data sent between
49+ client and server when using `save` and `saveAll` to update objects.
50+ */
51+ var emptyObject : Self {
52+ var object = Self ( )
53+ object. objectId = objectId
54+ object. createdAt = createdAt
55+ return object
56+ }
4457
4558 /**
4659 Determines if two objects have the same objectId.
4760 - parameter as: Object to compare.
4861 - returns: Returns a `true` if the other object has the same `objectId` or `false` if unsuccessful.
4962 */
50- public func hasSameObjectId< T: ParseObject > ( as other: T ) -> Bool {
63+ func hasSameObjectId< T: ParseObject > ( as other: T ) -> Bool {
5164 return other. className == className && other. objectId == objectId && objectId != nil
5265 }
5366
5467 /**
5568 Gets a Pointer referencing this object.
5669 - returns: Pointer<Self>
5770 */
58- public func toPointer( ) throws -> Pointer < Self > {
71+ func toPointer( ) throws -> Pointer < Self > {
5972 return try Pointer ( self )
6073 }
61-
62- /**
63- Gets an empty version of the respective object. This can be used when you only need to update a
64- a subset of the fields of an object as oppose to updating every field of an object.
65- - note: Using an empty object and updating a subset of the fields reduces the amount of data sent between
66- client and server when using `save` and `saveAll` to update objects.
67- - returns: Self
68- */
69- public func emptyObject( ) -> Self {
70- var object = Self ( )
71- object. objectId = objectId
72- object. createdAt = createdAt
73- return object
74- }
7574}
7675
7776// MARK: Batch Support
0 commit comments