|
@@ 2057-2065 (lines=9) @@
|
| 2054 |
|
* @return int how many deleted |
| 2055 |
|
* @throws \EE_Error |
| 2056 |
|
*/ |
| 2057 |
|
public function delete_related($relationName,$query_params = array()){ |
| 2058 |
|
if($this->ID()){ |
| 2059 |
|
$count = $this->get_model()->delete_related($this, $relationName, $query_params); |
| 2060 |
|
}else{ |
| 2061 |
|
$count = count($this->get_all_from_cache($relationName)); |
| 2062 |
|
$this->clear_cache($relationName,NULL,TRUE); |
| 2063 |
|
} |
| 2064 |
|
return $count; |
| 2065 |
|
} |
| 2066 |
|
|
| 2067 |
|
|
| 2068 |
|
|
|
@@ 2081-2089 (lines=9) @@
|
| 2078 |
|
* @return int how many deleted (including those soft deleted) |
| 2079 |
|
* @throws \EE_Error |
| 2080 |
|
*/ |
| 2081 |
|
public function delete_related_permanently($relationName,$query_params = array()){ |
| 2082 |
|
if($this->ID()){ |
| 2083 |
|
$count = $this->get_model()->delete_related_permanently($this, $relationName, $query_params); |
| 2084 |
|
}else{ |
| 2085 |
|
$count = count($this->get_all_from_cache($relationName)); |
| 2086 |
|
} |
| 2087 |
|
$this->clear_cache($relationName,NULL,TRUE); |
| 2088 |
|
return $count; |
| 2089 |
|
} |
| 2090 |
|
|
| 2091 |
|
|
| 2092 |
|
|