예제 #1
0
파일: Page.php 프로젝트: eozgilik/basalt
 public function validate()
 {
     $validator = new Validator();
     $validator->importRow('name', $this->name, ['IsNotEmpty'])->importRow('slug', $this->slug, ['IsNotEmpty', 'IsSlug'])->importRow('content', $this->content, ['IsNotEmpty'])->run();
     $errors = $validator->getErrors();
     if (false === empty($errors)) {
         throw new ValidationException($errors);
     }
 }
예제 #2
0
파일: Page.php 프로젝트: sthapa123/basalt
 public function validator()
 {
     $validator = new Validator();
     $validator->importRow('name', $this->name, ['IsNotEmpty'])->importRow('slug', $this->slug, ['IsNotEmpty', 'IsSlug'])->importRow('content', $this->content, ['IsNotEmpty'])->run();
     return $validator;
 }