(Guillermo) Create path /ticket/create

This commit is contained in:
AntonyAntonio 2016-06-21 00:11:52 -03:00
parent d19f8132e0
commit 9295554dd1

View File

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