/**
  * @see ProjectTemplateInterface::delete()
  * @return bool
  * @throws ProjectTemplateDeleteException
  * @throws ProjectTemplateDeleteInUseException
  * @throws ProjectTemplateDeleteOLDLDeleteExcepion
  */
 public function delete()
 {
     global $transaction;
     if ($this->project_template and $this->project_template_id) {
         $project_array = Project::list_entries_by_template_id($this->project_template_id);
         if (is_array($project_array)) {
             if (count($project_array) != 0) {
                 throw new ProjectTemplateDeleteInUseException();
             }
         }
         $transaction_id = $transaction->begin();
         $oldl = new Oldl($this->project_template->get_template_id());
         if ($this->project_template->delete() == false) {
             if ($transaction_id != null) {
                 $transaction->rollback($transaction_id);
             }
             throw new ProjectTemplateDeleteException("DB delete failed");
         }
         if ($oldl->delete() == false) {
             if ($transaction_id != null) {
                 $transaction->rollback($transaction_id);
             }
             throw new ProjectTemplateDeleteOLDLDeleteException();
         } else {
             if ($transaction_id != null) {
                 $transaction->commit($transaction_id);
             }
             return true;
         }
     } else {
         throw new ProjectTemplateDeleteException("Missing Information");
     }
 }