public function executeCheckIfTitleExists(\Library\HttpRequest $rq) { // Init result $result = $this->InitResponseWS(); //At this point check if the file name is already used $existingForm = \Applications\PMTool\Helpers\FormHelper::GetMasterformWithTitle($this, $this->dataPost["title"]); if (count($existingForm) > 0) { //Other forms found with same title $title_found = true; } else { $title_found = false; } $this->SendResponseWS($result, array("resx_file" => \Applications\PMTool\Resources\Enums\ResxFileNameKeys::Form, "resx_key" => $this->action(), "step" => $title_found ? "error" : "success")); }