@@ 2264-2272 (lines=9) @@ | ||
2261 | * @return int how many deleted |
|
2262 | * @throws \EE_Error |
|
2263 | */ |
|
2264 | public function delete_related($relationName, $query_params = array()) |
|
2265 | { |
|
2266 | if ($this->ID()) { |
|
2267 | $count = $this->get_model()->delete_related($this, $relationName, $query_params); |
|
2268 | } else { |
|
2269 | $count = count($this->get_all_from_cache($relationName)); |
|
2270 | $this->clear_cache($relationName, null, true); |
|
2271 | } |
|
2272 | return $count; |
|
2273 | } |
|
2274 | ||
2275 | ||
@@ 2289-2297 (lines=9) @@ | ||
2286 | * @return int how many deleted (including those soft deleted) |
|
2287 | * @throws \EE_Error |
|
2288 | */ |
|
2289 | public function delete_related_permanently($relationName, $query_params = array()) |
|
2290 | { |
|
2291 | if ($this->ID()) { |
|
2292 | $count = $this->get_model()->delete_related_permanently($this, $relationName, $query_params); |
|
2293 | } else { |
|
2294 | $count = count($this->get_all_from_cache($relationName)); |
|
2295 | } |
|
2296 | $this->clear_cache($relationName, null, true); |
|
2297 | return $count; |
|
2298 | } |
|
2299 | ||
2300 |