예제 #1
0
 public static function update($id, $data)
 {
     foreach ($data as $key => $value) {
         switch ($key) {
             case "idParamosPriemones":
                 break;
             case "Kodas":
                 if (!ParamosPriemonesValidation::validateKodas($value)) {
                     return false;
                 }
                 break;
             case "Pavadinimas":
                 if (!ParamosPriemonesValidation::validatePavadinimas($value)) {
                     return false;
                 }
                 break;
             case "Kryptis":
                 if (!ParamosPriemonesValidation::validateKryptis($value)) {
                     return false;
                 }
                 break;
         }
     }
     return parent::update($id, $data, get_class());
 }
예제 #2
0
파일: User.php 프로젝트: remarco-mif/ppos
 public static function update($id, $data)
 {
     foreach ($data as $key => $value) {
         switch ($key) {
             case "idUser":
                 break;
             case "username":
                 if (!UserValidation::validateUsername($value)) {
                     User::$error = "Inocorrenct username.";
                     return false;
                 }
                 break;
             case "password":
                 if (!UserValidation::validatePassword($value)) {
                     User::$error = "Inocorrenct password.";
                     return false;
                 }
                 break;
         }
     }
     return parent::update($id, $data, get_class());
 }
예제 #3
0
 public static function update($id, $data)
 {
     foreach ($data as $key => $value) {
         //validation
         switch ($key) {
             case "idParamosKiekiai":
                 break;
             case "ParamosPriemone":
                 if (!ParamosKiekiaiValidation::validateParamosPriemone($value)) {
                     return false;
                 }
                 break;
             case "Nuo":
                 if (!ParamosKiekiaiValidation::validateNuo($value)) {
                     return false;
                 }
                 break;
             case "Iki":
                 if (!ParamosKiekiaiValidation::validateIki($value)) {
                     return false;
                 }
                 break;
             case "ParaiskuKiekis":
                 if (!ParamosKiekiaiValidation::validateParaiskuKiekis($value)) {
                     return false;
                 }
                 break;
         }
     }
     return parent::update($id, $data, get_class());
 }