|
@@ 2307-2315 (lines=9) @@
|
| 2304 |
|
* @return int how many deleted |
| 2305 |
|
* @throws \EE_Error |
| 2306 |
|
*/ |
| 2307 |
|
public function delete_related($relationName, $query_params = array()) |
| 2308 |
|
{ |
| 2309 |
|
if ($this->ID()) { |
| 2310 |
|
$count = $this->get_model()->delete_related($this, $relationName, $query_params); |
| 2311 |
|
} else { |
| 2312 |
|
$count = count($this->get_all_from_cache($relationName)); |
| 2313 |
|
$this->clear_cache($relationName, null, true); |
| 2314 |
|
} |
| 2315 |
|
return $count; |
| 2316 |
|
} |
| 2317 |
|
|
| 2318 |
|
|
|
@@ 2332-2340 (lines=9) @@
|
| 2329 |
|
* @return int how many deleted (including those soft deleted) |
| 2330 |
|
* @throws \EE_Error |
| 2331 |
|
*/ |
| 2332 |
|
public function delete_related_permanently($relationName, $query_params = array()) |
| 2333 |
|
{ |
| 2334 |
|
if ($this->ID()) { |
| 2335 |
|
$count = $this->get_model()->delete_related_permanently($this, $relationName, $query_params); |
| 2336 |
|
} else { |
| 2337 |
|
$count = count($this->get_all_from_cache($relationName)); |
| 2338 |
|
} |
| 2339 |
|
$this->clear_cache($relationName, null, true); |
| 2340 |
|
return $count; |
| 2341 |
|
} |
| 2342 |
|
|
| 2343 |
|
|