# Class: ConversationDAO

## ConversationDAO

#### new ConversationDAO(db)

  Data access object for conversations.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `db` | Connection | instance of connection to data storage.

  Source:
    - app/model/dao/ConversationDAO.js, line 12

### Methods

#### find(conversationId, callback)

  Finds a Conversation according to given conversationId. At the end, given callback is executed with the result of find as argument.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `conversationId` | Number |
  `callback` | Function |

  Source:
    - app/model/dao/ConversationDAO.js, line 39

#### findAll(operator, callback)

  Finds all conversations. If operator is defined then result includes only conversations owned by given operator.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `operator` | Number |
  `callback` | Function |

  Source:
    - app/model/dao/ConversationDAO.js, line 92

#### new() → {Conversation}

  Creates new Conversation entity with prefilled fields.

  Source:
    - app/model/dao/ConversationDAO.js, line 22

  ##### Returns:

  Type
    Conversation

#### persist(conversation, callback)

  Persist given conversation to storage. Executes callback with the persisted conversation as parameter.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `conversation` | Conversation |
  `callback` | Function |

  Source:
    - app/model/dao/ConversationDAO.js, line 159