<commit_before><?php
/**
 * Form class
 *
 * @package     Webenq
 * @subpackage  Forms
 * @author      <NAME> <<EMAIL>>
 */
class Webenq_Form_User_Role_Add extends Zend_Form
{
    public function init()
    {
        $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
        $this->setAction("$baseUrl/user/role");

        $this->addElements(array(
            $this->createElement('text', 'name', array(
                'label' => 'new role',
                'required' => true,
                'filters' => array('StringToLower'),
                'validators' => array('Alpha'),
            )),
            $this->createElement('submit', 'submit', array(
                'label' => 'add',
            )),
        ));
    }

    public function store()
    {
        try {
            $role = new Role();
            $role->name = $this->name->getValue();
            $role->save();
            return true;
        }
        catch (Doctrine_Connection_Mysql_Exception $e) {
            if ($e->getCode() == 23000) {
                $this->name->addError('Deze naam is al in gebruik voor een andere rol');
            } else {
                $this->name->addError('Er is een onbekende fout opgetreden');
            }
            return false;
        }
    }
}<commit_msg>[0005746] doctrine  role class  is named webenq_model_role not 'role'<commit_after><?php
/**
 * Form class
 *
 * @package     Webenq
 * @subpackage  Forms
 * @author      <NAME> <<EMAIL>>
 */
class Webenq_Form_User_Role_Add extends Zend_Form
{
    public function init()
    {
        $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
        $this->setAction("$baseUrl/user/role");

        $this->addElements(array(
            $this->createElement('text', 'name', array(
                'label' => 'new role',
                'required' => true,
                'filters' => array('StringToLower'),
                'validators' => array('Alpha'),
            )),
            $this->createElement('submit', 'submit', array(
                'label' => 'add',
            )),
        ));
    }

    public function store()
    {
        try {
            $role = new Webenq_Model_Role();
            $role->name = $this->name->getValue();
            $role->save();
            return true;
        }
        catch (Doctrine_Connection_Mysql_Exception $e) {
            if ($e->getCode() == 23000) {
                $this->name->addError('Deze naam is al in gebruik voor een andere rol');
            } else {
                $this->name->addError('Er is een onbekende fout opgetreden');
            }
            return false;
        }
    }
}
{'fraction_non_alphanumeric': 0.14809217982621836, 'fraction_numerical': 0.006422364941443143, 'mean_word_length': 1.6883248730964466, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5033858', 'n_tokens_mistral': 785, 'n_tokens_neox': 748, 'n_words': 158}