1 | <?php |
||
9 | class MongoSaver implements SaverInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var MongoCollection |
||
13 | */ |
||
14 | private $_collection; |
||
15 | |||
16 | public function __construct(MongoCollection $collection) |
||
20 | |||
21 | public function save(array $data, string $id = null): string |
||
49 | |||
50 | /** |
||
51 | * MongoDB can't save keys with values containing a dot: |
||
52 | * |
||
53 | * InvalidArgumentException: invalid document for insert: keys cannot contain ".": |
||
54 | * "Zend_Controller_Dispatcher_Standard::loadClass==>load::controllers/ArticleController.php" |
||
55 | * |
||
56 | * Replace the dots with underscrore in keys. |
||
57 | * |
||
58 | * @see https://github.com/perftools/xhgui/issues/209 |
||
59 | */ |
||
60 | private function encodeProfile(array $profile): array |
||
72 | } |
||
73 |