<commit_before><?php

/**
 * Generated_Base_Table
 *
 * Generated base class file for tables
 * Any changes here will be overridden.
 */
abstract class DDM_Scaffold_Template_Base_Table extends Zend_Db_Table_Abstract
{

    /**
     * The table metadata has been cached
     *
     * @var boolean
     */
    protected $_metadataCacheInClass = true;

    /**
     * Where should the default values come for new empty rows?
     * The code generator replaces self::DEFAULT_CLASS with its value, 'defaultClass'
     *
     * @var string
     */
    protected $_defaultSource = self::DEFAULT_CLASS;

    /**
     * Returns the schema of the table
     *
     * @return string
     */
    public function getSchema()
    {
        return $this->_schema;
    }

    /**
     * Returns the name of the table
     *
     * @return string
     */
    public function getTableName()
    {
        return $this->_name;
    }

    /**
     * Get an array of primary keys
     *
     * @return array
     */
    public function getPrimaryKeys()
    {
        return $this->_primary;
    }

    /**
     * Returns a new rowset (not from the database) optionally populated with the
     * passed in $data
     *
     * @param array|null $data
     *
     * @return Zend_Db_Table_Rowset_Abstract
     */
    public function createRowset(array $data = null)
    {
        $config = array(
            'table' => $this,
            'rowClass' => $this->getRowClass(),
            'stored' => false,
            'readOnly' => false,
        );
        $rowsetClass = $this->getRowsetClass();
        $rowset = new $rowsetClass($config);
        if ($data !== null) {
            $rowset->setFromArray($data);
        }
        return $rowset;
    }

    /**
     * Retrieve Rowset from table where $columnName matches $value
     *
     * @param string $columnName
     * @param string|number|null $value
     * @param Zend_Db_Select|Zend_Db_Table_Select|null OPTIONAL $select
     *
     * @return Zend_Db_Table_Rowset_Abstract
     */
    public function findByColumnValue($columnName, $value, Zend_Db_Select $select = null)
    {
        if ($select === null) {
            $select = $this->select();
        }
        $select->from($this);

        $columnName = $this->getAdapter()->quoteIdentifier($columnName);
        if (!is_array($value)) {
            $select->where($columnName . ' = ?', $value);
        } else {
            $expressions = array();
            $inValues = array();

            foreach ($value as $val) {
                if ($val === null) {
                    $expressions['null'] = $columnName . ' IS NULL';
                } else {
                    $inValues[] = $this->getAdapter()->quoteInto('?', $val);
                }
            }

            if (!empty($inValues)) {
                $expressions['in'] = $columnName . ' IN ('.implode(',', $inValues).')';
            }

            $select->where(implode(' OR ', $expressions));
        }

        return $this->fetchAll($select);
    }


}
<commit_msg>Fixes Potential Column Ambiguity Error in findByColumnValue<commit_after><?php

/**
 * Generated_Base_Table
 *
 * Generated base class file for tables
 * Any changes here will be overridden.
 */
abstract class DDM_Scaffold_Template_Base_Table extends Zend_Db_Table_Abstract
{

    /**
     * The table metadata has been cached
     *
     * @var boolean
     */
    protected $_metadataCacheInClass = true;

    /**
     * Where should the default values come for new empty rows?
     * The code generator replaces self::DEFAULT_CLASS with its value, 'defaultClass'
     *
     * @var string
     */
    protected $_defaultSource = self::DEFAULT_CLASS;

    /**
     * Returns the schema of the table
     *
     * @return string
     */
    public function getSchema()
    {
        return $this->_schema;
    }

    /**
     * Returns the name of the table
     *
     * @return string
     */
    public function getTableName()
    {
        return $this->_name;
    }

    /**
     * Get an array of primary keys
     *
     * @return array
     */
    public function getPrimaryKeys()
    {
        return $this->_primary;
    }

    /**
     * Returns a new rowset (not from the database) optionally populated with the
     * passed in $data
     *
     * @param array|null $data
     *
     * @return Zend_Db_Table_Rowset_Abstract
     */
    public function createRowset(array $data = null)
    {
        $config = array(
            'table' => $this,
            'rowClass' => $this->getRowClass(),
            'stored' => false,
            'readOnly' => false,
        );
        $rowsetClass = $this->getRowsetClass();
        $rowset = new $rowsetClass($config);
        if ($data !== null) {
            $rowset->setFromArray($data);
        }
        return $rowset;
    }

    /**
     * Retrieve Rowset from table where $columnName matches $value
     *
     * @param string $columnName
     * @param string|number|null $value
     * @param Zend_Db_Select|Zend_Db_Table_Select|null OPTIONAL $select
     *
     * @return Zend_Db_Table_Rowset_Abstract
     */
    public function findByColumnValue($columnName, $value, Zend_Db_Select $select = null)
    {
        if ($select === null) {
            $select = $this->select();
        }
        $select->from($this);

        $tableName = $this->getAdapter()->quoteIdentifier($this->_name);
        $columnName = $this->getAdapter()->quoteIdentifier($columnName);
        $columnName = $tableName . '.' . $columnName;
        if (!is_array($value)) {
            $select->where($columnName . ' = ?', $value);
        } else {
            $expressions = array();
            $inValues = array();

            foreach ($value as $val) {
                if ($val === null) {
                    $expressions['null'] = $columnName . ' IS NULL';
                } else {
                    $inValues[] = $this->getAdapter()->quoteInto('?', $val);
                }
            }

            if (!empty($inValues)) {
                $expressions['in'] = $columnName . ' IN ('.implode(',', $inValues).')';
            }

            $select->where(implode(' OR ', $expressions));
        }

        return $this->fetchAll($select);
    }


}

{'fraction_non_alphanumeric': 0.12915129151291513, 'fraction_numerical': 0.0, 'mean_word_length': 1.868844914864243, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 44, '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': '624919', 'n_tokens_mistral': 1820, 'n_tokens_neox': 1760, 'n_words': 431}