38 lines
621 B
PHP
38 lines
621 B
PHP
<?php define('__ROOT__', dirname(__DIR__));
|
|
|
|
require_once __ROOT__.'/autoloader.php';
|
|
|
|
debug();
|
|
|
|
use \lightdb\core\lightdb;
|
|
|
|
$sl = new lightdb('subject');
|
|
$cl = new lightdb('contact');
|
|
|
|
|
|
if( true ){
|
|
|
|
/* [1] Remove contacts
|
|
=========================================================*/
|
|
$sub = $sl->fetch(1);
|
|
|
|
$cl->deleteAll( $sub['contacts'] );
|
|
|
|
/* [2] Reset subject
|
|
=========================================================*/
|
|
|
|
unset( $sub['contacts'] );
|
|
unset( $sub['relations'] );
|
|
$sub['subject']['surveys'] = [];
|
|
|
|
$sl->delete(1);
|
|
$sl->insert(1, $sub);
|
|
|
|
}
|
|
|
|
$sl->close();
|
|
$cl->close();
|
|
|
|
|
|
?>
|