Entity/Customer.php
public function setPreference(\Miky\Bundle\UserBundle\Entity\UserPreference $preference = null)
    {
        if ($preference == null){
            $preference = new UserPreference();
        }else{
        $this->preference = $preference;
        }

        return $this;
    }
public function setPreference(\Miky\Bundle\UserBundle\Entity\UserPreference $preference = null)
    {
        if ($preference == null){
            $preference = new UserPreference();
        }else{
        $this->preference = $preference;
        }

        return $this;
    }
Set preference

@param \Miky\Bundle\UserBundle\Entity\UserPreference $preference

@return Customer