Commits

Christoffer Niska  committed 89780a2

fixed some validation rules

  • Participants
  • Parent commits 7826f5c

Comments (0)

Files changed (3)

File models/CmsBlock.php

 	public function rules()
 	{
 		return array(
-			array('created, name', 'required'),
+			array('name', 'required'),
 			array('published, deleted', 'numerical', 'integerOnly'=>true),
 			array('name', 'length', 'max'=>255),
-			array('updated', 'safe'),
+			array('name', 'unique'),
+			array('created, updated', 'safe'),
 			array('id, created, updated, name, published', 'safe', 'on'=>'search'),
 		);
 	}

File models/CmsMenu.php

 			array('name', 'required'),
 			array('deleted', 'numerical', 'integerOnly'=>true),
 			array('name', 'length', 'max'=>255),
+			array('name', 'unique'),
 			array('created, updated', 'safe'),
 			array('id, name, created, updated, deleted', 'safe', 'on'=>'search'),
 		);

File models/CmsPage.php

 	public function rules()
 	{
 		return array(
+			array('name', 'required'),
 			array('parentId, published, deleted', 'numerical', 'integerOnly'=>true),
 			array('name, type', 'length', 'max'=>255),
-			array('updated', 'safe'),
+			array('name', 'unique'),
+			array('created, updated', 'safe'),
 			array('id, created, updated, parentId, name, deleted', 'safe', 'on'=>'search'),
 		);
 	}