Airship\Cabin\Bridge\Blueprint\Files::recursiveDelete PHP Method

recursiveDelete() private method

Recursively delete everything in a specific directory
private recursiveDelete ( integer $directory, string $cabin ) : boolean
$directory integer
$cabin string
return boolean
    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();
    }