import { AnyEntity } from "../entity/any-entity.type"; import { RelationField } from "../field/field-names/relation-field.type"; import { BerryOrm } from "./berry-orm.class"; export declare class EntityRelationManager { private orm; constructor(orm: BerryOrm); /** * Destruct any bilateral relation on the specified field of the entity. * @param entity * @param field */ clearRelations(entity: Entity, field: RelationField): this; /** * Construct a bilateral relation with the target entity on the specified * field of the entity. * @param entity * @param field * @param targetEntity */ constructRelation(entity: Entity, field: RelationField, targetEntity: AnyEntity): this; /** * Destruct the bilateral relation with the target entity on the specified * field of the entity if exists. * @param entity * @param field * @param targetEntity */ destructRelation(entity: Entity, field: RelationField, targetEntity: AnyEntity): this; /** * A wrap of {@link EntityManager.invokeOnRelationField} which makes it * easier to operate on the both sides of the relation. * @param entity * @param field * @param targetEntity * @param onToOne * @param onToMany */ private invokeOnRelationFieldBilateral; /** * Invoke a callback based on the field's relation type. * @param entity * @param field * @param onToOne - The callback to be invoked on a to-one relation field. * The return value will be set as the value of the field. * @param onToMany - The callback to be invoked on a to-many relation field. */ private invokeOnRelationField; } //# sourceMappingURL=entity-relation-manager.class.d.ts.map