|
@@ 2342-2350 (lines=9) @@
|
| 2339 |
|
* @return int how many deleted |
| 2340 |
|
* @throws EE_Error |
| 2341 |
|
*/ |
| 2342 |
|
public function delete_related($relationName, $query_params = array()) |
| 2343 |
|
{ |
| 2344 |
|
if ($this->ID()) { |
| 2345 |
|
$count = $this->get_model()->delete_related($this, $relationName, $query_params); |
| 2346 |
|
} else { |
| 2347 |
|
$count = count($this->get_all_from_cache($relationName)); |
| 2348 |
|
$this->clear_cache($relationName, null, true); |
| 2349 |
|
} |
| 2350 |
|
return $count; |
| 2351 |
|
} |
| 2352 |
|
|
| 2353 |
|
|
|
@@ 2367-2375 (lines=9) @@
|
| 2364 |
|
* @return int how many deleted (including those soft deleted) |
| 2365 |
|
* @throws EE_Error |
| 2366 |
|
*/ |
| 2367 |
|
public function delete_related_permanently($relationName, $query_params = array()) |
| 2368 |
|
{ |
| 2369 |
|
if ($this->ID()) { |
| 2370 |
|
$count = $this->get_model()->delete_related_permanently($this, $relationName, $query_params); |
| 2371 |
|
} else { |
| 2372 |
|
$count = count($this->get_all_from_cache($relationName)); |
| 2373 |
|
} |
| 2374 |
|
$this->clear_cache($relationName, null, true); |
| 2375 |
|
return $count; |
| 2376 |
|
} |
| 2377 |
|
|
| 2378 |
|
|