Commit 92f22165 by Carsten Brandt

add support for _parent to elasticsearch active fixture

parent a0038ab1
...@@ -100,6 +100,13 @@ class ActiveFixture extends BaseActiveFixture ...@@ -100,6 +100,13 @@ class ActiveFixture extends BaseActiveFixture
foreach ($this->getData() as $alias => $row) { foreach ($this->getData() as $alias => $row) {
$options = []; $options = [];
$id = isset($row[$idField]) ? $row[$idField] : null; $id = isset($row[$idField]) ? $row[$idField] : null;
if ($idField === '_id') {
unset($row[$idField]);
}
if (isset($row['_parent'])) {
$options['parent'] = $row['_parent'];
unset($row['_parent']);
}
try { try {
$response = $this->db->createCommand()->insert($this->index, $this->type, $row, $id, $options); $response = $this->db->createCommand()->insert($this->index, $this->type, $row, $id, $options);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment