<commit_before><?php

namespace G4\DataMapper\Engine\MySQL;

use G4\DataMapper\Common\AdapterInterface;
use G4\DataMapper\Common\MapperInterface;
use G4\DataMapper\Common\MappingInterface;
use G4\DataMapper\Common\SelectionIdentityInterface;
use G4\Factory\ReconstituteInterface;

class MySQLMapper implements MapperInterface
{

    /**
     * @var MySQLAdapter
     */
    private $adapter;

    private $table;

    public function __construct(AdapterInterface $adapter, $table)
    {
        $this->adapter = $adapter;
        $this->type    = $table;
    }

    public function delete(MappingInterface $mappings)
    {
        $this->adapter->delete($this->table, $mappings->identifiers());
    }

    public function find(SelectionIdentityInterface $identity)
    {
        return $this->adapter->select($this->table, $this->makeSelectionFactory($selectionIdentity));
    }

    public function insert(MappingInterface $mappings)
    {
        $this->adapter->insert($this->table, $mappings->map());
    }

    public function update(MappingInterface $mappings)
    {
        $this->adapter->update($this->table, $mappings->map(), $mappings->identifiers());
    }

    private function makeSelectionFactory(SelectionIdentityInterface $selectionIdentity)
    {
        return new MySQLSelectionFactory($selectionIdentity);
    }
}<commit_msg>MySQLMapper insert logic and test<commit_after><?php

namespace G4\DataMapper\Engine\MySQL;

use G4\DataMapper\Common\AdapterInterface;
use G4\DataMapper\Common\MapperInterface;
use G4\DataMapper\Common\MappingInterface;
use G4\DataMapper\Common\SelectionIdentityInterface;
use G4\Factory\ReconstituteInterface;

class MySQLMapper implements MapperInterface
{

    /**
     * @var MySQLAdapter
     */
    private $adapter;

    private $table;

    public function __construct(AdapterInterface $adapter, $table)
    {
        $this->adapter = $adapter;
        $this->table   = $table;
    }

    public function delete(MappingInterface $mappings)
    {
        $this->adapter->delete($this->table, $mappings->identifiers());
    }

    public function find(SelectionIdentityInterface $identity)
    {
        return $this->adapter->select($this->table, $this->makeSelectionFactory($selectionIdentity));
    }

    public function insert(MappingInterface $mappings)
    {
        $this->adapter->insert($this->table, $mappings);
    }

    public function update(MappingInterface $mappings)
    {
        $this->adapter->update($this->table, $mappings->map(), $mappings->identifiers());
    }

    private function makeSelectionFactory(SelectionIdentityInterface $selectionIdentity)
    {
        return new MySQLSelectionFactory($selectionIdentity);
    }
}
{'fraction_non_alphanumeric': 0.11977818853974122, 'fraction_numerical': 0.0044362292051756, 'mean_word_length': 3.722513089005236, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, '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': '2469185', 'n_tokens_mistral': 751, 'n_tokens_neox': 729, 'n_words': 134}