// echo '<PRE>';print_r($affects);exit;
// DB_Dataobject::debugLevel(1);
-
+
$bits = array_map(function($v) { return (int)$v; } , explode(',', $req['_delete']));
$match_ar = array();
foreach($affects as $k=> $true) {
$ka = explode('.', $k);
+
$chk = DB_DataObject::factory($ka[0]);
if (!is_a($chk,'DB_DataObject') && !is_a($chk,'PDO_DataObject')) {
$this->jerr('Unable to load referenced table, check the links config: ' .$ka[0]);
continue;
}
}
-
+
$has_beforeDelete = method_exists($xx, 'beforeDelete');
// before delte = allows us to trash dependancies if needed..
$match_total = 0;
-
+
if ( $has_beforeDelete ) {
if ($xx->beforeDelete($match_ar, $this) === false) {
$errs[] = "Delete failed ({$xx->id})\n".
if (!is_a($chk,'DB_DataObject') && !is_a($chk,'PDO_DataObject')) {
$this->jerr('Unable to load referenced table, check the links config: ' .$ka[0]);
}
- $chk->{$ka[1]} = $xx->{$this->key};
+ $chk->{$ka[1]} = $xx->{$this->key};
$matches = $chk->count();
$match_total += $matches;
if ($matches) {
}
- //
-
if (!empty($match_ar)) {
$chk = $match_ar[0];
$chk->limit(1);