Model/UserPreferenceManager.php
public function getPreference($userName)
    {
        $em = $this->doctrine->getManager();
        $userPreference = $em->getRepository('KitpagesCmsBundle:UserPreference')->findOneByUserName($userName);
        if (!($userPreference instanceof UserPreference)) {
            $userPreference = $this->setUserPreference($userName);
        }
        return $userPreference;
    }
public function getPreference($userName)
    {
        $em = $this->doctrine->getManager();
        $userPreference = $em->getRepository('KitpagesCmsBundle:UserPreference')->findOneByUserName($userName);
        if (!($userPreference instanceof UserPreference)) {
            $userPreference = $this->setUserPreference($userName);
        }
        return $userPreference;
    }
//