<commit_before><?php
/**
 * Nooku Framework - http://nooku.org/framework
 *
 * @copyright   Copyright (C) 2007 - 2014 <NAME> and Timble CVBA. (http://www.timble.net)
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        https://github.com/nooku/nooku-framework for the canonical source repository
 */

/**
 * Default Model Entity
 *
 * @author  <NAME> <https://github.com/johanjanssens>
 * @package Koowa\Library\Model\Entity
 */
final class KModelEntityDefault extends KModelEntityAbstract implements KObjectInstantiable
{
    /**
     * Create an entity or a collection instance
     *
     * @param  KObjectConfigInterface   $config   A KObjectConfig object with configuration options
     * @param  KObjectManagerInterface  $manager  A ObjectInterface object
     * @return KEventPublisher
     */
    public static function getInstance(KObjectConfigInterface $config, KObjectManagerInterface $manager)
    {
        $name = $config->object_identifier->name;

        if(KStringInflector::isSingular($name)) {
            $class = 'KModelEntityRow';
        } else {
            $class = 'KModelEntityRowset';
        }

        $instance = new $class($config);
        return $instance;
    }
}<commit_msg>Re #244: Don't use Entity Row and Rowset as the default entity.<commit_after><?php
/**
 * Nooku Framework - http://nooku.org/framework
 *
 * @copyright   Copyright (C) 2007 - 2014 <NAME> and Timble CVBA. (http://www.timble.net)
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        https://github.com/nooku/nooku-framework for the canonical source repository
 */

/**
 * Default Model Entity
 *
 * @author  <NAME> <https://github.com/johanjanssens>
 * @package Koowa\Library\Model\Entity
 */
final class KModelEntityDefault extends KModelEntityAbstract implements KObjectInstantiable
{
    /**
     * Create an entity or a collection instance
     *
     * @param  KObjectConfigInterface   $config   A KObjectConfig object with configuration options
     * @param  KObjectManagerInterface  $manager  A ObjectInterface object
     * @return KEventPublisher
     */
    public static function getInstance(KObjectConfigInterface $config, KObjectManagerInterface $manager)
    {
        $name = $config->object_identifier->name;

        if(KStringInflector::isSingular($name)) {
            $class = 'KModelEntityDefault';
        } else {
            $class = 'KModelEntityComposite';
        }

        $instance = new $class($config);
        return $instance;
    }
}
{'fraction_non_alphanumeric': 0.11133043821555468, 'fraction_numerical': 0.008290564547966837, 'mean_word_length': 3.0031595576619274, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '4201264', 'n_tokens_mistral': 753, 'n_tokens_neox': 722, 'n_words': 179}