| 1 | <?php |
||
| 13 | abstract class AbstractStorage |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Create instance of storage |
||
| 17 | * |
||
| 18 | * @access public |
||
| 19 | * @static |
||
| 20 | * @param string $storage default null |
||
| 21 | * @return \jones\wschat\components\AbstractStorage |
||
| 22 | */ |
||
| 23 | public static function factory($storage = null) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Load chat history |
||
| 41 | * |
||
| 42 | * @access public |
||
| 43 | * @param mixed $chatId |
||
| 44 | * @param integer $limit |
||
| 45 | * @return array |
||
| 46 | */ |
||
| 47 | abstract public function getHistory($chatId, $limit = 10); |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Store chat message |
||
| 51 | * |
||
| 52 | * @access public |
||
| 53 | * @param array $params |
||
| 54 | * @return boolean |
||
| 55 | */ |
||
| 56 | abstract public function storeMessage(array $params); |
||
| 57 | } |
||
| 58 | |||
| 59 |