The Model layer is for modelling how your application would work in the real world, so it's not just necessarily for dealing with data.
A common approach to validation functions is to create a Validator
class for each type of validation you wish to perform. The Validators should implement an interface, so that any code utilizing a Validator object can be assured that they all work the same.
Something like this:
interface iValidator
{
public function validate($mixed);
public function getMessage();
}
class Validator_Email implements iValidator
{
public function validate($data)
{
//validate an email address
}
public function getMessage()
{
return 'invalid email address.';
}
}
class Validator_PositiveInteger implements iValidator
{
public function validate($data)
{
return ctype_digit((string) $data) && $data != 0;
}
public function getMessage()
{
return 'must be a positive integer';
}
}
If you're using a framework, it may already have validation classes that you can utilize or extend in a similar manner.