@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @copyright Copyright (c) 2011 - 2014 Aleksandr Torosh (http://wezoom.com.ua) |
|
| 4 | - * @author Aleksandr Torosh <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @copyright Copyright (c) 2011 - 2014 Aleksandr Torosh (http://wezoom.com.ua) |
|
| 4 | + * @author Aleksandr Torosh <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | namespace Cms\Controller; |
| 8 | 8 | |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @copyright Copyright (c) 2011 - 2014 Aleksandr Torosh (http://wezoom.net) |
|
| 4 | - * @author Aleksandr Torosh <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @copyright Copyright (c) 2011 - 2014 Aleksandr Torosh (http://wezoom.net) |
|
| 4 | + * @author Aleksandr Torosh <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | namespace Cms\Model; |
| 8 | 8 | |
@@ -45,20 +45,20 @@ |
||
| 45 | 45 | public function validation() |
| 46 | 46 | { |
| 47 | 47 | |
| 48 | - $validator = new Validation(); |
|
| 49 | - $validator->add('login', new UniquenessValidator( |
|
| 50 | - [ |
|
| 51 | - "model" => $this, |
|
| 52 | - "message" => $this->getDi()->get('helper')->translate("The Login must be unique") |
|
| 53 | - ] |
|
| 54 | - )); |
|
| 55 | - $validator->add('email', new UniquenessValidator( |
|
| 56 | - [ |
|
| 57 | - "model" => $this, |
|
| 58 | - "message" => $this->getDi()->get('helper')->translate("The Email must be unique") |
|
| 59 | - ] |
|
| 60 | - )); |
|
| 61 | - return $this->validate($validator); |
|
| 48 | + $validator = new Validation(); |
|
| 49 | + $validator->add('login', new UniquenessValidator( |
|
| 50 | + [ |
|
| 51 | + "model" => $this, |
|
| 52 | + "message" => $this->getDi()->get('helper')->translate("The Login must be unique") |
|
| 53 | + ] |
|
| 54 | + )); |
|
| 55 | + $validator->add('email', new UniquenessValidator( |
|
| 56 | + [ |
|
| 57 | + "model" => $this, |
|
| 58 | + "message" => $this->getDi()->get('helper')->translate("The Email must be unique") |
|
| 59 | + ] |
|
| 60 | + )); |
|
| 61 | + return $this->validate($validator); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public function getId() |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | $validator = new Validation(); |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * ISO |
|
| 39 | - */ |
|
| 38 | + * ISO |
|
| 39 | + */ |
|
| 40 | 40 | $validator->add('iso', new Uniqueness([ |
| 41 | 41 | 'model' => $this, |
| 42 | 42 | "message" => "The inputted ISO language is existing" |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | ])); |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * Name |
|
| 51 | - */ |
|
| 50 | + * Name |
|
| 51 | + */ |
|
| 52 | 52 | $validator->add('name', new Uniqueness([ |
| 53 | 53 | 'model' => $this, |
| 54 | 54 | "message" => "The inputted name is existing" |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | ])); |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * URL |
|
| 63 | - */ |
|
| 62 | + * URL |
|
| 63 | + */ |
|
| 64 | 64 | $validator->add('url', new Uniqueness([ |
| 65 | 65 | 'model' => $this, |
| 66 | 66 | "message" => "The inputted URL is existing" |
@@ -47,10 +47,10 @@ |
||
| 47 | 47 | { |
| 48 | 48 | $validator = new Validation(); |
| 49 | 49 | $validator->add('slug', new UniquenessValidator( |
| 50 | - [ |
|
| 51 | - "model" => $this, |
|
| 52 | - "message" => "Category with slug '" . $this->slug . "' is already exists. Take another title" |
|
| 53 | - ] |
|
| 50 | + [ |
|
| 51 | + "model" => $this, |
|
| 52 | + "message" => "Category with slug '" . $this->slug . "' is already exists. Take another title" |
|
| 53 | + ] |
|
| 54 | 54 | )); |
| 55 | 55 | return $this->validate($validator); |
| 56 | 56 | } |
@@ -54,14 +54,14 @@ |
||
| 54 | 54 | |
| 55 | 55 | public function validation() |
| 56 | 56 | { |
| 57 | - $validator = new Validation(); |
|
| 58 | - $validator->add('slug', new UniquenessValidator( |
|
| 59 | - [ |
|
| 60 | - "model" => $this, |
|
| 61 | - "message" => $this->getDi()->get('helper')->translate("Page with slug is already exists") |
|
| 62 | - ] |
|
| 63 | - )); |
|
| 64 | - return $this->validate($validator); |
|
| 57 | + $validator = new Validation(); |
|
| 58 | + $validator->add('slug', new UniquenessValidator( |
|
| 59 | + [ |
|
| 60 | + "model" => $this, |
|
| 61 | + "message" => $this->getDi()->get('helper')->translate("Page with slug is already exists") |
|
| 62 | + ] |
|
| 63 | + )); |
|
| 64 | + return $this->validate($validator); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public static function findCachedBySlug($slug) |
@@ -62,14 +62,14 @@ |
||
| 62 | 62 | |
| 63 | 63 | public function validation() |
| 64 | 64 | { |
| 65 | - $validator = new Validation(); |
|
| 66 | - $validator->add('slug', new UniquenessValidator( |
|
| 67 | - [ |
|
| 68 | - "model" => $this, |
|
| 69 | - "message" => $this->getDi()->get('helper')->translate("Publishcation with slug is already exists") |
|
| 70 | - ] |
|
| 71 | - )); |
|
| 72 | - return $this->validate($validator); |
|
| 65 | + $validator = new Validation(); |
|
| 66 | + $validator->add('slug', new UniquenessValidator( |
|
| 67 | + [ |
|
| 68 | + "model" => $this, |
|
| 69 | + "message" => $this->getDi()->get('helper')->translate("Publishcation with slug is already exists") |
|
| 70 | + ] |
|
| 71 | + )); |
|
| 72 | + return $this->validate($validator); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public function afterValidation() |