<commit_before><?php
class Vps_Form_Field_ComboBox extends Vps_Form_Field_SimpleAbstract
{
    public function __construct($field_name = null, $field_label = null)
    {
        parent::__construct($field_name, $field_label);
        $this->setXtype('combobox');
    }

    protected function _addValidators()
    {
        parent::_addValidators();
        $store = $this->_getStoreData();
        if (isset($store['data'])) {
            $a = array('');
            foreach ($store['data'] as $r) {
                $a[] = $r[0];
            }
            $this->addValidator(new Zend_Validate_InArray($a));
        } else if (isset($store['url'])) {
            //todo, keine ahnung wie :D
        }
    }

    //setValues
        //url (string), rowset, array
    
    //setFields
        //array mit feldern

    //setTpl
        //string mit template, standardwert in ext definiert:
        //'<tpl for="."><div class="x-combo-list-item">{' + this.displayField + '}</div></tpl>';

    //setShowNoSelection
        //keine auswahl anbieten

    //setFilterValue
        //wird von ComboBoxFilter aufgerufen
        

    public function getMetaData()
    {
        $ret = parent::getMetaData();


        $ret['store'] = $this->_getStoreData();
        if (isset($ret['fields'])) unset($ret['fields']);
        if (isset($ret['values'])) unset($ret['values']);

        return $ret;
    }
    
    protected function _getStoreData()
    {
        $store = $this->getStore();
        if (!$store) $store = array();

        $fields = $this->getFields();
        if ($fields) {
            $store['fields'] = $fields;
        }

        if ($this->getStoreUrl()) {
            $store['url'] = $this->getStoreUrl();
        }
        $data = $this->getValues();
        if (is_string($data)) {
            $store['url'] = $data;<commit_msg>doku (sagen wir halt so dazu)<commit_after><?php
class Vps_Form_Field_ComboBox extends Vps_Form_Field_SimpleAbstract
{
    public function __construct($field_name = null, $field_label = null)
    {
        parent::__construct($field_name, $field_label);
        $this->setXtype('combobox');
    }

    protected function _addValidators()
    {
        parent::_addValidators();
        $store = $this->_getStoreData();
        if (isset($store['data'])) {
            $a = array('');
            foreach ($store['data'] as $r) {
                $a[] = $r[0];
            }
            $this->addValidator(new Zend_Validate_InArray($a));
        } else if (isset($store['url'])) {
            //todo, keine ahnung wie :D
        }
    }

    //setValues
        //url (string), rowset, array
    
    //setFields
        //array mit feldern

    //setTpl
        //string mit template, standardwert in ext definiert:
        //'<tpl for="."><div class="x-combo-list-item">{' + this.displayField + '}</div></tpl>';

    //setShowNoSelection
        //keine auswahl anbieten

    //setFilterValue
        //wird von ComboBoxFilter aufgerufen

    //setDisplayField
    //setListWidth
        

    public function getMetaData()
    {
        $ret = parent::getMetaData();


        $ret['store'] = $this->_getStoreData();
        if (isset($ret['fields'])) unset($ret['fields']);
        if (isset($ret['values'])) unset($ret['values']);

        return $ret;
    }
    
    protected function _getStoreData()
    {
        $store = $this->getStore();
        if (!$store) $store = array();

        $fields = $this->getFields();
        if ($fields) {
            $store['fields'] = $fields;
        }

        if ($this->getStoreUrl()) {
            $store['url'] = $this->getStoreUrl();
        }
        $data = $this->getValues();
        if (is_string($data)) {
            $store['url'] = $data;
{'fraction_non_alphanumeric': 0.16684491978609625, 'fraction_numerical': 0.0005347593582887701, 'mean_word_length': 2.02914979757085, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 29, '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': '3920797', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1132, 'n_words': 228}