fixed issues

This commit is contained in:
Umed Khudoiberdiev 2016-05-26 19:28:57 +05:00
parent 5daf0d3ef5
commit fb29d6cbe4
3 changed files with 10 additions and 11 deletions

View File

@ -306,9 +306,9 @@ export class EntityManager {
* Should be used when you want quickly and efficiently and and remove a many-to-many relation between two entities.
* Note that event listeners and event subscribers won't work (and will not send any events) when using this operation.
*/
async addAndRemoveFromRelation<Entity>(entityClass: ConstructorFunction<Entity>|Function, relation: string, entityId: any, addRelatedEntityIds: any[], removeRelatedEntityIds: any[]): Promise<void>;
async addAndRemoveFromRelation<Entity>(entityClass: ConstructorFunction<Entity>|Function, relation: ((t: Entity) => string|any), entityId: any, addRelatedEntityIds: any[], removeRelatedEntityIds: any[]): Promise<void>;
async addAndRemoveFromRelation<Entity>(entityClass: ConstructorFunction<Entity>|Function, relation: string|((t: Entity) => string|any), entityId: any, addRelatedEntityIds: any[], removeRelatedEntityIds: any[]): Promise<void> {
addAndRemoveFromRelation<Entity>(entityClass: ConstructorFunction<Entity>|Function, relation: string, entityId: any, addRelatedEntityIds: any[], removeRelatedEntityIds: any[]): Promise<void>;
addAndRemoveFromRelation<Entity>(entityClass: ConstructorFunction<Entity>|Function, relation: ((t: Entity) => string|any), entityId: any, addRelatedEntityIds: any[], removeRelatedEntityIds: any[]): Promise<void>;
addAndRemoveFromRelation<Entity>(entityClass: ConstructorFunction<Entity>|Function, relation: string|((t: Entity) => string|any), entityId: any, addRelatedEntityIds: any[], removeRelatedEntityIds: any[]): Promise<void> {
return this.getRepository(entityClass).addAndRemoveFromRelation(relation as any, entityId, addRelatedEntityIds, removeRelatedEntityIds);
}
@ -316,7 +316,7 @@ export class EntityManager {
* Removes entity with the given id.
* Note that event listeners and event subscribers won't work (and will not send any events) when using this operation.
*/
removeById<Entity>(entityClass: ConstructorFunction<Entity>|Function, id: any) {
removeById<Entity>(entityClass: ConstructorFunction<Entity>|Function, id: any): Promise<void> {
return this.getRepository(entityClass).removeById(id);
}
@ -324,7 +324,7 @@ export class EntityManager {
* Removes all entities with the given ids.
* Note that event listeners and event subscribers won't work (and will not send any events) when using this operation.
*/
removeByIds<Entity>(entityClass: ConstructorFunction<Entity>|Function, ids: any[]) {
removeByIds<Entity>(entityClass: ConstructorFunction<Entity>|Function, ids: any[]): Promise<void> {
return this.getRepository(entityClass).removeByIds(ids);
}

View File

@ -289,7 +289,7 @@ export class ReactiveEntityManager {
* Removes entity with the given id.
* Note that event listeners and event subscribers won't work (and will not send any events) when using this operation.
*/
removeById<Entity>(entityClass: ConstructorFunction<Entity>|Function, id: any) {
removeById<Entity>(entityClass: ConstructorFunction<Entity>|Function, id: any): Rx.Observable<void> {
return this.getReactiveRepository(entityClass).removeById(id);
}
@ -297,11 +297,10 @@ export class ReactiveEntityManager {
* Removes all entities with the given ids.
* Note that event listeners and event subscribers won't work (and will not send any events) when using this operation.
*/
removeByIds<Entity>(entityClass: ConstructorFunction<Entity>|Function, ids: any[]) {
removeByIds<Entity>(entityClass: ConstructorFunction<Entity>|Function, ids: any[]): Rx.Observable<void> {
return this.getReactiveRepository(entityClass).removeByIds(ids);
}
/**
* Roots are entities that have no ancestors. Finds them all.
*/

View File

@ -257,7 +257,7 @@ export class ReactiveRepository<Entity> {
* Removes entity with the given id.
* Note that event listeners and event subscribers won't work (and will not send any events) when using this operation.
*/
removeById(id: any) {
removeById(id: any): Rx.Observable<void> {
return Rx.Observable.fromPromise(this.repository.removeById(id));
}
@ -265,7 +265,7 @@ export class ReactiveRepository<Entity> {
* Removes all entities with the given ids.
* Note that event listeners and event subscribers won't work (and will not send any events) when using this operation.
*/
removeByIds(ids: any[]) {
removeByIds(ids: any[]): Rx.Observable<void> {
return Rx.Observable.fromPromise(this.repository.removeByIds(ids));
}