<commit_before><?php
namespace Rawebone\Ormish;

/**
 * Provides an abstraction between a model and a database.
 */
interface GatewayInterface
{
    /**
     * Creates the gateway.
     */
    function __construct(ConnectorInterface $connector, Populator $pop, ModelInfo $info);

    /**
     * Finds a record on the gateway by $id.
     * 
     * @param string $id
     * @return \Rawebone\Ormish\Entity|null
     */
    function find($id);
    
    /**
     * Returns records where a condition is met on the table.
     * 
     * @return array|\Rawebone\Ormish\Entity
     */
    function findWhere($condition);
    
    /**
     * Saves a record on the gateway.
     * 
     * @param \Rawebone\Ormish\Entity
     * @return boolean
     */
    function save(Entity $entity);
    
    /**<commit_msg>Updated the GatewayInterface so that the Container is also passed. This is then passed onto return model instances.<commit_after><?php
namespace Rawebone\Ormish;

/**
 * Provides an abstraction between a model and a database.
 */
interface GatewayInterface
{
    /**
     * Creates the gateway.
     */
    function __construct(ConnectorInterface $connector, Populator $pop, ModelInfo $info, Container $orm);

    /**
     * Finds a record on the gateway by $id.
     * 
     * @param string $id
     * @return \Rawebone\Ormish\Entity|null
     */
    function find($id);
    
    /**
     * Returns records where a condition is met on the table.
     * 
     * @return array|\Rawebone\Ormish\Entity
     */
    function findWhere($condition);
    
    /**
     * Saves a record on the gateway.
     * 
     * @param \Rawebone\Ormish\Entity
     * @return boolean
     */
    function save(Entity $entity);
    
    /**
{'fraction_non_alphanumeric': 0.10930232558139535, 'fraction_numerical': 0.0, 'mean_word_length': 2.2471698113207546, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '7140441', 'n_tokens_mistral': 527, 'n_tokens_neox': 503, 'n_words': 151}