public function addValidator(ValidatorInterface $validator)
    {
        foreach ((array) $validator->getGroups() as $group_name) {
            if (false === array_key_exists($group_name, $this->validators)) {
                $this->validators[$group_name] = array();
            }

            $this->validators[$group_name][] = $validator;
        }
    }