<?php

namespace Galileo\SettingBundle\Lib\Infrastructure\Framework;

use Doctrine\ORM\EntityManagerInterface;
use Galileo\SettingBundle\Lib\Model\Setting;
use Galileo\SettingBundle\Lib\Model\SettingRepositoryInterface;
use Galileo\SettingBundle\Lib\Model\ValueObject\Key;
use Galileo\SettingBundle\Lib\Model\ValueObject\Section;

class DoctrineSettingRepository implements SettingRepositoryInterface
{
    /**
     * @var EntityManagerInterface
     */
    private $entityManager;

    public function __construct(EntityManagerInterface $entityManager)
    {
        $this->entityManager = $entityManager;
    }

    /**
     * {@inheritdoc}
     */
    public function findWithinSection(Key $settingKey, Section $settingSection)
    {
        return $this->entityManager->getRepository('GalileoSettingBundle:Setting')->findOneBy(
            [
                'name' => $settingKey->key(),
                'section' => $settingSection->name(),
            ]
        );
    }

    /**
     * {@inheritdoc}
     */
    public function save(Setting $setting)
    {
        $this->entityManager->transactional(
            function () use ($setting){
                $this->entityManager->persist($setting);
                $this->entityManager->flush();
            }
        );
    }
}

<?php

namespace Galileo\SettingBundle\Lib\Infrastructure\Framework;

use Galileo\SettingBundle\Lib\Model\Setting;
use Galileo\SettingBundle\Lib\Model\SettingRepositoryInterface;
use Galileo\SettingBundle\Lib\Model\ValueObject\Key;
use Galileo\SettingBundle\Lib\Model\ValueObject\Section;

class DoctrineSettingRepository implements SettingRepositoryInterface
{
    /**
     * {@inheritdoc}
     */
    public function findWithinSection(Key $settingKey, Section $settingSection)
    {
        // TODO: Implement findWithinSection() method.
    }

    /**
     * {@inheritdoc}
     */
    public function save(Setting $setting)
    {
        // TODO: Implement save() method.
    }
}

--- 
+++ 
@@ -2,6 +2,7 @@
 
 namespace Galileo\SettingBundle\Lib\Infrastructure\Framework;
 
+use Doctrine\ORM\EntityManagerInterface;
 use Galileo\SettingBundle\Lib\Model\Setting;
 use Galileo\SettingBundle\Lib\Model\SettingRepositoryInterface;
 use Galileo\SettingBundle\Lib\Model\ValueObject\Key;
@@ -10,11 +11,26 @@
 class DoctrineSettingRepository implements SettingRepositoryInterface
 {
     /**
+     * @var EntityManagerInterface
+     */
+    private $entityManager;
+
+    public function __construct(EntityManagerInterface $entityManager)
+    {
+        $this->entityManager = $entityManager;
+    }
+
+    /**
      * {@inheritdoc}
      */
     public function findWithinSection(Key $settingKey, Section $settingSection)
     {
-        // TODO: Implement findWithinSection() method.
+        return $this->entityManager->getRepository('GalileoSettingBundle:Setting')->findOneBy(
+            [
+                'name' => $settingKey->key(),
+                'section' => $settingSection->name(),
+            ]
+        );
     }
 
     /**
@@ -22,6 +38,11 @@
      */
     public function save(Setting $setting)
     {
-        // TODO: Implement save() method.
+        $this->entityManager->transactional(
+            function () use ($setting){
+                $this->entityManager->persist($setting);
+                $this->entityManager->flush();
+            }
+        );
     }
 }
Implement trivial version for doctrine repository
