Class: PostRepository
backend.PostRepository
#
Hierarchy↳
PostRepository
#
Table of contents#
Constructors#
Properties#
Methods- applyBaseFilter
- applyDeleteMany
- applyGetEntityViews
- applyPostFilter
- createEntity
- createPost
- deleteEntity
- deleteMany
- deleteManyFilteredPosts
- deletePost
- getAll
- getById
- getBySlug
- getEntityViews
- getFilteredEntities
- getFilteredPosts
- getPaged
- getPostById
- getPostBySlug
- getPosts
- getSqlBoolStr
- getSqlLike
- getTagsOfPost
- quote
- updateEntity
- updatePost
#
Constructors#
constructor• new PostRepository()
#
Overrides#
Defined insystem/core/backend/src/repositories/post.repository.ts:21
#
Properties#
dbType• dbType: "mysql"
| "mariadb"
| "postgres"
| "cockroachdb"
| "sqlite"
| "mssql"
| "sap"
| "oracle"
| "cordova"
| "nativescript"
| "react-native"
| "sqljs"
| "mongodb"
| "aurora-data-api"
| "aurora-data-api-pg"
| "expo"
| "better-sqlite3"
| "capacitor"
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:24
#
Methods#
applyBaseFilterâ–¸ applyBaseFilter<EntityType
>(qb
, filter?
): SelectQueryBuilder
<EntityType
>
#
Type parametersName | Type |
---|---|
EntityType | TBasePageEntity |
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <EntityType > |
filter? | BaseFilterInput |
#
ReturnsSelectQueryBuilder
<EntityType
>
#
Inherited fromBaseRepository.applyBaseFilter
#
Defined insystem/core/backend/src/repositories/base.repository.ts:155
#
applyDeleteManyâ–¸ applyDeleteMany(qb
, input
): Promise
<void
>
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <Post > | DeleteQueryBuilder <Post > |
input | TDeleteManyInput |
#
ReturnsPromise
<void
>
#
Inherited fromBaseRepository.applyDeleteMany
#
Defined insystem/core/backend/src/repositories/base.repository.ts:108
#
applyGetEntityViewsâ–¸ applyGetEntityViews(qb
, entityType
): SelectQueryBuilder
<TBasePageEntity
>
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <TBasePageEntity > |
entityType | EDBEntity |
#
ReturnsSelectQueryBuilder
<TBasePageEntity
>
#
Inherited fromBaseRepository.applyGetEntityViews
#
Defined insystem/core/backend/src/repositories/base.repository.ts:133
#
applyPostFilterâ–¸ applyPostFilter(qb
, filterParams?
): SelectQueryBuilder
<TPost
>
#
ParametersName | Type |
---|---|
qb | SelectQueryBuilder <TPost > |
filterParams? | PostFilterInput |
#
ReturnsSelectQueryBuilder
<TPost
>
#
Defined insystem/core/backend/src/repositories/post.repository.ts:113
#
createEntityâ–¸ createEntity(input
, id?
): Promise
<Post
>
#
ParametersName | Type |
---|---|
input | Post |
id? | null | number |
#
ReturnsPromise
<Post
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:70
#
createPostâ–¸ createPost(createPost
, id?
): Promise
<Post
>
#
ParametersName | Type |
---|---|
createPost | TPostInput |
id? | null | number |
#
ReturnsPromise
<Post
>
#
Defined insystem/core/backend/src/repositories/post.repository.ts:82
#
deleteEntityâ–¸ deleteEntity(id
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
id | number |
#
ReturnsPromise
<boolean
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:97
#
deleteManyâ–¸ deleteMany(input
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
input | TDeleteManyInput |
#
ReturnsPromise
<boolean
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:125
#
deleteManyFilteredPostsâ–¸ deleteManyFilteredPosts(input
, filterParams?
): Promise
<undefined
| boolean
>
#
ParametersName | Type |
---|---|
input | TDeleteManyInput |
filterParams? | PostFilterInput |
#
ReturnsPromise
<undefined
| boolean
>
#
Defined insystem/core/backend/src/repositories/post.repository.ts:174
#
deletePostâ–¸ deletePost(id
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
id | number |
#
ReturnsPromise
<boolean
>
#
Defined insystem/core/backend/src/repositories/post.repository.ts:101
#
getAllâ–¸ getAll(): Promise
<Post
[]>
#
ReturnsPromise
<Post
[]>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:44
#
getByIdâ–¸ getById(id
, relations?
): Promise
<Post
>
#
ParametersName | Type |
---|---|
id | number |
relations? | string [] |
#
ReturnsPromise
<Post
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:49
#
getBySlugâ–¸ getBySlug(slug
, relations?
): Promise
<Post
>
#
ParametersName | Type |
---|---|
slug | string |
relations? | string [] |
#
ReturnsPromise
<Post
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:60
#
getEntityViewsâ–¸ getEntityViews(entityId
, entityType
): Promise
<any
>
#
ParametersName | Type |
---|---|
entityId | number |
entityType | EDBEntity |
#
ReturnsPromise
<any
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:144
#
getFilteredEntitiesâ–¸ getFilteredEntities(pagedParams?
, filterParams?
): Promise
<TPagedList
<Post
>>
#
ParametersName | Type |
---|---|
pagedParams? | PagedParamsInput <Post > |
filterParams? | BaseFilterInput |
#
ReturnsPromise
<TPagedList
<Post
>>
#
Inherited fromBaseRepository.getFilteredEntities
#
Defined insystem/core/backend/src/repositories/base.repository.ts:164
#
getFilteredPostsâ–¸ getFilteredPosts(pagedParams?
, filterParams?
): Promise
<TPagedList
<TPost
>>
#
ParametersName | Type |
---|---|
pagedParams? | PagedParamsInput <Post > |
filterParams? | PostFilterInput |
#
ReturnsPromise
<TPagedList
<TPost
>>
#
Defined insystem/core/backend/src/repositories/post.repository.ts:167
#
getPagedâ–¸ getPaged(params?
): Promise
<TPagedList
<Post
>>
#
ParametersName | Type |
---|---|
params? | TPagedParams <Post > |
#
ReturnsPromise
<TPagedList
<Post
>>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:38
#
getPostByIdâ–¸ getPostById(id
): Promise
<undefined
| Post
>
#
ParametersName | Type |
---|---|
id | number |
#
ReturnsPromise
<undefined
| Post
>
#
Defined insystem/core/backend/src/repositories/post.repository.ts:30
#
getPostBySlugâ–¸ getPostBySlug(slug
): Promise
<undefined
| Post
>
#
ParametersName | Type |
---|---|
slug | string |
#
ReturnsPromise
<undefined
| Post
>
#
Defined insystem/core/backend/src/repositories/post.repository.ts:35
#
getPostsâ–¸ getPosts(params
): Promise
<TPagedList
<Post
>>
#
ParametersName | Type |
---|---|
params | TPagedParams <Post > |
#
ReturnsPromise
<TPagedList
<Post
>>
#
Defined insystem/core/backend/src/repositories/post.repository.ts:25
#
getSqlBoolStrâ–¸ getSqlBoolStr(b
): "true"
| "false"
| "1"
| "0"
#
ParametersName | Type |
---|---|
b | boolean |
#
Returns"true"
| "false"
| "1"
| "0"
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:34
#
getSqlLikeâ–¸ getSqlLike(): "ILIKE"
| "LIKE"
#
Returns"ILIKE"
| "LIKE"
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:35
#
getTagsOfPostâ–¸ getTagsOfPost(postId
): Promise
<undefined
| null
| Tag
[]>
#
ParametersName | Type |
---|---|
postId | number |
#
ReturnsPromise
<undefined
| null
| Tag
[]>
#
Defined insystem/core/backend/src/repositories/post.repository.ts:187
#
quoteâ–¸ quote(str
): string
#
ParametersName | Type |
---|---|
str | string |
#
Returnsstring
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:36
#
updateEntityâ–¸ updateEntity(id
, input
): Promise
<Post
>
#
ParametersName | Type |
---|---|
id | number |
input | Post |
#
ReturnsPromise
<Post
>
#
Inherited from#
Defined insystem/core/backend/src/repositories/base.repository.ts:82
#
updatePostâ–¸ updatePost(id
, updatePost
): Promise
<Post
>
#
ParametersName | Type |
---|---|
id | number |
updatePost | TPostInput |
#
ReturnsPromise
<Post
>