__EntityRelatable
public protocol __EntityRelatable
Protocol used in generated code to provide an ID getter (wrapped as EntityId<T>) of an object.
The code generator will make your entity types conform to this and implement the requirements.
Currently only used to check if the ID is 0 in Box.remove and the LazyProxyRelation.State constructor.
The type information (T of EntityId<T>) is unused. Also note that IDs no longer have to implement EntityId.
For example:
class Person: __EntityRelatable {
typealias EntityType = Person
var _id: EntityId<Person> {
return EntityId<Person>(self.id.value)
}
}
-
Used to get the ID value of an object of the associated entity type.
Declaration
Swift
var _id: EntityId<EntityType> { get }
View on GitHub
Install in Dash
__EntityRelatable Protocol Reference