TopicService Class
Provides interactions with topics
Constructor
TopicService
        - 
                        
context 
Parameters:
- 
                        
contextObject 
Item Index
Methods
- _emit
 - _get
 - _retrieveOnUpdateAndMerge
 - add
 - count
 - deleteById
 - deleteSingle
 - format static
 - get
 - getAll
 - getAllWithCount
 - getContext
 - getIdWhere
 - getSingle
 - getType
 - merge static
 - save
 - update
 - validate static
 
Methods
_emit
        - 
                        
event - 
                        
data - 
                        
cb 
Parameters:
- 
                        
eventString - 
                        
dataObject - 
                        
cbFunction 
_get
        - 
                        
id - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
idString - 
                        
[options]Object optional - 
                        
cbFunction 
_retrieveOnUpdateAndMerge
        - 
                        
dto - 
                        
options - 
                        
cb 
Parameters:
- 
                        
dtoObject - 
                        
optionsObject- 
                                    
[isCreate]Boolean optional 
 - 
                                    
 - 
                        
cbFunction 
add
        - 
                        
dto - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
dtoObject - 
                        
[options]Object optional - 
                        
cbFunctionA callback that takes two parameters. The first is an error, if occurred. The second is the object that matches the specified query 
count
        - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
[options]Object optional- 
                                    
[where]Object optional 
 - 
                                    
 - 
                        
cbFunctionA callback that takes two parameters. The first is an error, if occurred. The second is the number of results that match the specified query 
deleteById
        - 
                        
id - 
                        
options - 
                        
cb 
Parameters:
- 
                        
idString - 
                        
optionsObject - 
                        
cbFunction 
deleteSingle
        - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
[options]Object optionalSee BaseObjectService#getSingle- 
                                    
[where]Object optional 
 - 
                                    
 - 
                        
cbFunction 
format
        - 
                        
context - 
                        
cb 
Parameters:
- 
                        
contextObject- 
                                    
serviceTopicServiceAn instance of the service that triggered the event that called this handler
 
 - 
                                    
 - 
                        
cbFunctionA callback that takes a single parameter: an error if occurred
 
get
        - 
                        
id - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
idString - 
                        
[options]Object optional - 
                        
cbFunction(Error, object|null) A callback that takes two parameters. The first is an error, if occurred. The second is the object with the specified ID
 
getAll
        - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
[options]Object optional- 
                                    
[select]Object optional - 
                                    
[where]Object optional - 
                                    
[order]Array optional - 
                                    
[limit]Integer optional - 
                                    
[offset]Integer optional 
 - 
                                    
 - 
                        
cbFunctionA callback that takes two parameters. The first is an error, if occurred. The second is an array representing the results of the query.
 
getAllWithCount
        - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
[options]Object optional- 
                                    
[select]Object optional - 
                                    
[where]Object optional - 
                                    
[order]Array optional - 
                                    
[limit]Integer optional - 
                                    
[offset]Integer optional 
 - 
                                    
 - 
                        
cbFunctionA callback that takes two parameters. The first is an error, if occurred. The second is an object representing the results of the query. 
getContext
        - 
                        
[data] 
Parameters:
- 
                        
[data]String | Object | Number | Boolean optional 
Returns:
getIdWhere
        - 
                        
dto 
Parameters:
- 
                        
dtoObject 
Returns:
getSingle
        - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
[options]Object optional- 
                                    
[select]Object optional - 
                                    
[where]Object optional - 
                                    
[order]Array optional - 
                                    
[offset]Integer optional 
 - 
                                    
 - 
                        
cbFunctionA callback that takes two parameters. The first is an error, if occurred. The second is the object that matches the specified query
 
getType
        ()
        
            String
        
    
    Returns:
merge
        - 
                        
context - 
                        
cb 
Parameters:
- 
                        
contextObject- 
                                    
serviceTopicServiceAn instance of the service that triggered the event that called this handler
 
 - 
                                    
 - 
                        
cbFunctionA callback that takes a single parameter: an error if occurred
 
save
        - 
                        
dto - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
dtoObject - 
                        
[options]Object optional- 
                                    
[isCreate]Boolean optional 
 - 
                                    
 - 
                        
cbFunctionA callback that takes two parameters. The first is an error, if occurred. The second is the object that matches the specified query 
update
        - 
                        
dto - 
                        
[options] - 
                        
cb 
Parameters:
- 
                        
dtoObject - 
                        
[options]Object optional - 
                        
cbFunctionA callback that takes two parameters. The first is an error, if occurred. The second is the object that matches the specified query 
validate
        - 
                        
context - 
                        
cb 
Parameters:
- 
                        
contextObject- 
                                    
dataObjectThe DTO that was provided for persistence
 - 
                                    
serviceTopicServiceAn instance of the service that triggered the event that called this handler
 
 - 
                                    
 - 
                        
cbFunctionA callback that takes a single parameter: an error if occurred
 
