(Guillermo) Create path /ticket/create

This commit is contained in:
AntonyAntonio 2016-06-21 00:11:52 -03:00
parent d19f8132e0
commit 9295554dd1
1 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ class CreateController extends Controller {
private $departmentId;
private $language;
public function handler(){
public function handler() {
$this->requestTicketData();
$validateResult = $this->validateData();
@ -22,7 +22,7 @@ class CreateController extends Controller {
}
}
private function requestTicketData(){
private function requestTicketData() {
$this->title = Controller::request('title');
$this->content = Controller::request('content');
$this->departmentId = Controller::request('departmentId');
@ -30,16 +30,16 @@ class CreateController extends Controller {
}
private function validateData() {
if (strlen($this->title)<3 ){
if (strlen($this->title) < 3) {
return 'title is too short';
}
if (strlen($this->title)>30){
if (strlen($this->title) > 30) {
return 'title is very long';
}
if (strlen($this->content)<5){
if (strlen($this->content) < 5) {
return 'content is too short';
}
if (strlen($this->content)>500){
if (strlen($this->content) > 500) {
return 'content is very long';
}