Skip to content

Commit 401dbf6

Browse files
committed
Add return from the autocommit resutl to action and it's extensions
1 parent b22d142 commit 401dbf6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Classes/Bulk.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,24 @@ public function id($_id = false)
143143
/**
144144
* Add pending document for insert
145145
* @param array $data
146+
* @return mixed
146147
*/
147148
public function insert($data = [])
148149
{
149150

150-
$this->action('index', $data);
151+
return $this->action('index', $data);
151152

152153
}
153154

154155
/**
155156
* Add pending document for update
156157
* @param array $data
158+
* @return mixed
157159
*/
158160
public function update($data = [])
159161
{
160162

161-
$this->action('update', $data);
163+
return $this->action('update', $data);
162164

163165
}
164166

@@ -168,14 +170,15 @@ public function update($data = [])
168170
public function delete()
169171
{
170172

171-
$this->action('delete');
173+
return $this->action('delete');
172174

173175
}
174176

175177
/**
176178
* Add pending document abstract action
177179
* @param string $actionType
178180
* @param array $data
181+
* @return mixed
179182
*/
180183
public function action($actionType, $data = [])
181184
{
@@ -198,8 +201,10 @@ public function action($actionType, $data = [])
198201
$this->reset();
199202

200203
if ($this->autocommitAfter > 0 && $this->operationCount >= $this->autocommitAfter) {
201-
$this->commit();
204+
return $this->commit();
202205
}
206+
207+
return true;
203208
}
204209

205210
/**

0 commit comments

Comments
 (0)