validates_numericality_of('quantity',array('only_integer'=>true)); #if there were errors, return false $errors = $this->invalidFields(); return (count($errors) == 0); } } ?>