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()); }
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()); }
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()); }