Move validator methods
This commit is contained in:
@@ -39,7 +39,7 @@ class Auth extends Base
|
||||
{
|
||||
$values = $this->request->getValues();
|
||||
$this->sessionStorage->hasRememberMe = ! empty($values['remember_me']);
|
||||
list($valid, $errors) = $this->authentication->validateForm($values);
|
||||
list($valid, $errors) = $this->authValidator->validateForm($values);
|
||||
|
||||
if ($valid) {
|
||||
$this->redirectAfterLogin();
|
||||
|
||||
@@ -57,7 +57,7 @@ class Category extends Base
|
||||
$project = $this->getProject();
|
||||
|
||||
$values = $this->request->getValues();
|
||||
list($valid, $errors) = $this->category->validateCreation($values);
|
||||
list($valid, $errors) = $this->categoryValidator->validateCreation($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->category->create($values)) {
|
||||
@@ -99,7 +99,7 @@ class Category extends Base
|
||||
$project = $this->getProject();
|
||||
|
||||
$values = $this->request->getValues();
|
||||
list($valid, $errors) = $this->category->validateModification($values);
|
||||
list($valid, $errors) = $this->categoryValidator->validateModification($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->category->update($values)) {
|
||||
|
||||
@@ -78,7 +78,7 @@ class Comment extends Base
|
||||
$values = $this->request->getValues();
|
||||
$ajax = $this->request->isAjax() || $this->request->getIntegerParam('ajax');
|
||||
|
||||
list($valid, $errors) = $this->comment->validateCreation($values);
|
||||
list($valid, $errors) = $this->commentValidator->validateCreation($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->comment->create($values)) {
|
||||
@@ -127,7 +127,7 @@ class Comment extends Base
|
||||
$comment = $this->getComment();
|
||||
|
||||
$values = $this->request->getValues();
|
||||
list($valid, $errors) = $this->comment->validateModification($values);
|
||||
list($valid, $errors) = $this->commentValidator->validateModification($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->comment->update($values)) {
|
||||
|
||||
@@ -51,7 +51,7 @@ class Currency extends Base
|
||||
public function create()
|
||||
{
|
||||
$values = $this->request->getValues();
|
||||
list($valid, $errors) = $this->currency->validate($values);
|
||||
list($valid, $errors) = $this->currencyValidator->validateCreation($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->currency->create($values['currency'], $values['rate'])) {
|
||||
|
||||
@@ -42,7 +42,7 @@ class Customfilter extends Base
|
||||
$values = $this->request->getValues();
|
||||
$values['user_id'] = $this->userSession->getId();
|
||||
|
||||
list($valid, $errors) = $this->customFilter->validateCreation($values);
|
||||
list($valid, $errors) = $this->customFilterValidator->validateCreation($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->customFilter->create($values)) {
|
||||
@@ -121,7 +121,7 @@ class Customfilter extends Base
|
||||
$values += array('append' => 0);
|
||||
}
|
||||
|
||||
list($valid, $errors) = $this->customFilter->validateModification($values);
|
||||
list($valid, $errors) = $this->customFilterValidator->validateModification($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->customFilter->update($values)) {
|
||||
|
||||
@@ -79,7 +79,7 @@ class Group extends Base
|
||||
public function save()
|
||||
{
|
||||
$values = $this->request->getValues();
|
||||
list($valid, $errors) = $this->group->validateCreation($values);
|
||||
list($valid, $errors) = $this->groupValidator->validateCreation($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->group->create($values['name']) !== false) {
|
||||
@@ -120,7 +120,7 @@ class Group extends Base
|
||||
public function update()
|
||||
{
|
||||
$values = $this->request->getValues();
|
||||
list($valid, $errors) = $this->group->validateModification($values);
|
||||
list($valid, $errors) = $this->groupValidator->validateModification($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->group->update($values) !== false) {
|
||||
|
||||
@@ -67,7 +67,7 @@ class Link extends Base
|
||||
public function save()
|
||||
{
|
||||
$values = $this->request->getValues();
|
||||
list($valid, $errors) = $this->link->validateCreation($values);
|
||||
list($valid, $errors) = $this->linkValidator->validateCreation($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->link->create($values['label'], $values['opposite_label']) !== false) {
|
||||
@@ -108,7 +108,7 @@ class Link extends Base
|
||||
public function update()
|
||||
{
|
||||
$values = $this->request->getValues();
|
||||
list($valid, $errors) = $this->link->validateModification($values);
|
||||
list($valid, $errors) = $this->linkValidator->validateModification($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->link->update($values)) {
|
||||
|
||||
Reference in New Issue
Block a user