<commit_before><?php

/**
 * This is an abstract adapter class. It's should provide an interface for
 * interaction between the JForg_Dodb_Document and the document oriented
 * database.
 * 
 * @package   JForg_Dodb
 * @author    <NAME> <<EMAIL>>
 * @copyright (c) 2010 <NAME>
 * @since     2010-01-28
 */
abstract class JForg_Dodb_Adapter extends Solar_Base
{
	/**
     * Default configuration values.
	 * 
     * @config string default_doc The document class to use if the document
     *   type is unrecognized
     *
     * @config bool type_safe If the adapter should fall back to default_doc if
     *   the document type is unrecognized
     *
     * @var array
	 * @since 2010-01-26
	 */
    protected $_JForg_Dodb_Document_Adapter = array(
            'default_doc'   => 'JForg_Dodb_Document',
            'type_safe'     => false,
            );

    /**
     * Fetchs a document by id and returns it as an instance of
     * JForg_Dodb_Document
     * 
     * @param scalar $id The document id
     * 
     * @return JForg_Dodb_Document
     * @author <NAME> <<EMAIL>>
     */
    public abstract function fetch($id);

    /**
     * Fetchs documents by ids and returns an instance of
     * JForg_Dodb_Document_Collection containing instances of JForg_Dodb_Document s
     * 
     * @param array $ids Indexed array containing the documents ids
     * 
     * @return JForg_Dodb_Document_Collection containing all the documents as instances of JForg_Dodb_Document
     * @author <NAME> <<EMAIL>>
     */
    public abstract function fetchCollection(array $ids);<commit_msg>Added isTypeSafe and __postConfig();<commit_after><?php

/**
 * This is an abstract adapter class. It's should provide an interface for
 * interaction between the JForg_Dodb_Document and the document oriented
 * database.
 * 
 * @package   JForg_Dodb
 * @author    <NAME> <<EMAIL>>
 * @copyright (c) 2010 <NAME>
 * @since     2010-01-28
 */
abstract class JForg_Dodb_Adapter extends Solar_Base
{
	/**
     * Default configuration values.
	 * 
     * @config string default_doc The document class to use if the document
     *   type is unrecognized
     *
     * @config bool type_safe If the adapter should fall back to default_doc if
     *   the document type is unrecognized
     *
     * @var array
	 * @since 2010-01-26
	 */
    protected $_JForg_Dodb_Document_Adapter = array(
            'default_doc'   => 'JForg_Dodb_Document',
            'type_safe'     => false,
            );

    /**
     * The default document type to use
     * 
     * @var string  Defaults to null. 
     * @since 2010-02-07
     */
    protected $_default_doc = null;

    /**
     * If the adapter should fall back to default_doc if the document type is
     * unrecognized
     * 
     * @var boolean  Defaults to false. 
     * @since 2010-02-07
     */
    protected $_type_safe = false;

    /**
     * TODO: short description.
     * 
     * @return TODO
     * @author <NAME> <<EMAIL>>
     */
    protected function _postConfig()
    {
        $this->_default_doc = $this->_config['default_doc'];
        $this->_type_safe = $this->_config['type_safe'];
    }

    /**
     * TODO: short description.
     * 
     * @return boolean
     * @author <NAME> <<EMAIL>>
     */
    public function isTypeSafe()
    {
        return $this->_type_safe;
    }

    /**
     * Fetchs a document by id and returns it as an instance of
     * JForg_Dodb_Document
     * 
     * @param scalar $id The document id
     * 
     * @return JForg_Dodb_Document
     * @author <NAME> <<EMAIL>>
     */
    public abstract function fetch($id);

    /**
     * Fetchs documents by ids and returns an instance of
     * JForg_Dodb_Document_Collection containing instances of JForg_Dodb_Document s
     * 
     * @param array $ids Indexed array containing the documents ids
     * 
     * @return JForg_Dodb_Document_Collection containing all the documents as instances of JForg_Dodb_Document
     * @author <NAME> <<EMAIL>>
     */
    public abstract function fetchCollection(array $ids);
{'fraction_non_alphanumeric': 0.0914257474672597, 'fraction_numerical': 0.013837410427477144, 'mean_word_length': 2.433418150975403, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 38, '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': '1034047', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1164, 'n_words': 376}