52 public function cleanOrphan($table_link =
'', $field_link =
'', $field_object =
'')
54 if (!empty($table_link)) {
55 $this->handler->table_link = $table_link;
57 if (!empty($field_link)) {
58 $this->handler->field_link = $field_link;
60 if (!empty($field_object)) {
61 $this->handler->field_object = $field_object;
64 if (empty($this->handler->field_object)
65 || empty($this->handler->table_link)
66 || empty($this->handler->field_link)
69 "The link information is not set for '" . get_class($this->handler) .
"' yet.",
83 $sql =
"DELETE `{$this->handler->table}` FROM `{$this->handler->table}`"
84 .
" LEFT JOIN `{$this->handler->table_link}` AS aa "
85 .
" ON `{$this->handler->table}`.`{$this->handler->field_object}` = aa.`{$this->handler->field_link}`"
86 .
" WHERE (aa.`{$this->handler->field_link}` IS NULL)";
88 return $this->handler->db2->executeUpdate(
$sql);
cleanOrphan($table_link= '', $field_link= '', $field_object= '')