main/core/Manager/ContactManager.php
public function getUserOptions(User $user)
    {
        $options = $this->optionsRepo->findOneBy(['user' => $user]);

        if (is_null($options)) {
            $options = new Options();
            $options->setUser($user);
            $defaultValues = [
                'show_all_my_contacts' => true,
                'show_all_visible_users' => true,
                'show_username' => true,
                'show_mail' => false,
                'show_phone' => false,
                'show_picture' => true,
            ];
            $options->setOptions($defaultValues);
            $this->om->persist($options);
            $this->om->flush();
        }

        return $options;
    }
public function getUserOptions(User $user)
    {
        $options = $this->optionsRepo->findOneBy(['user' => $user]);

        if (is_null($options)) {
            $options = new Options();
            $options->setUser($user);
            $defaultValues = [
                'show_all_my_contacts' => true,
                'show_all_visible_users' => true,
                'show_username' => true,
                'show_mail' => false,
                'show_phone' => false,
                'show_picture' => true,
            ];
            $options->setOptions($defaultValues);
            $this->om->persist($options);
            $this->om->flush();
        }

        return $options;
    }
public function getUserOptions ( User $ user ) { $ options = $ this -> optionsRepo -> findOneBy ( [ 'user' => $ user ] ) ; if ( is_null ( $ options ) ) { $ options = new Options ( ) ; $ options -> setUser ( $ user ) ; $ defaultValues = [ 'show_all_my_contacts' => true , 'show_all_visible_users' => true , 'show_username' => true , 'show_mail' => false , 'show_phone' => false , 'show_picture' => true , ] ; $ options -> setOptions ( $ defaultValues ) ; $ this -> om -> persist ( $ options ) ; $ this -> om -> flush ( ) ; } return $ options ; }
Fetches user options.

@param User $user

@return Options
Fetches user options .