private function recursiveDelete(int $directory, string $cabin) : bool
{
foreach ($this->getFilesInDirectory($directory) as $file) {
$this->deleteFile($file);
}
$this->db->beginTransaction();
foreach ($this->getChildrenOf($directory, $cabin) as $dir) {
$this->recursiveDelete((int) $dir['directoryid'], $cabin);
}
$this->db->delete('airship_dirs', ['directoryid' => $directory]);
return $this->db->commit();
}