Programming Language PHP

Namespace Oro\Component\Layout\Block\OptionsResolver

Class OptionsResolver

Method/Function setDefaults

Total Examples 11

11 code examples of PHP Oro\Component\Layout\Block\OptionsResolver\OptionsResolver::setDefaults extracted from open source projects

Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'title' => '',
            ]
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $optionsResolver)
    {
        $optionsResolver->setDefaults([
            'visible' => true,
        ]);

        $optionsResolver->setDefined([
            'vars',
            'attr',
            'label',
            'label_attr',
            'translation_domain',
            'class_prefix',
            'additional_block_prefixes',
        ]);
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'type' => 'text',
            ]
        );
        $resolver->setDefined(
            [
                'id',
                'name',
                'value',
                'placeholder',
                'required',
            ]
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefined([
            'form',
            'form_action',
            'form_method',
            'form_multipart',
            'form_route_name',
            'render_rest',
        ]);

        $resolver->setDefaults([
            'form_route_parameters' => [],
            'instance_name' => '',
        ]);
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(
            [
                'entity',
                'fieldName',
                'className',
            ]
        );
        $resolver->setDefaults(
            [
                'value' => '=data["property_accessor"].getValue(entity, fieldName)',
                'visible' => $this->defaultVisible,
            ]
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(
            [
                'group',
                'entity',
                'attribute_family',
            ]
        );
        $resolver->setDefaults(
            [
                'exclude_from_rest' => true,
                'attribute_options' => [],
            ]
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritDoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'form_name' => 'form',
            'instance_name' => '',
        ]);
        $resolver->setDefined([
            'form',
            'form_action',
            'form_route_name',
            'form_route_parameters',
            'form_method',
            'form_enctype',
            'form_data',
            'form_prefix',
            'form_field_prefix',
            'form_group_prefix',
            'render_rest',
            'preferred_fields',
            'groups',
        ]);
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        parent::configureOptions($resolver);
        $resolver->setDefaults(
            [
                // example: ['jobTitle', 'user.lastName']
                'preferred_fields'  => [],
                // example:
                // [
                //   'general'    => [
                //     'title'  => 'General Info',
                //     'fields' => ['user.firstName', 'user.lastName']
                //   ],
                //   'additional'    => [
                //     'title'   => 'Additional Info',
                //     'default' => true
                //   ]
                // ]
                'groups'            => [],
                'form_prefix'       => function (Options $options, $value) {
                    return null === $value ? $options['form_name'] : $value;
                },
                'form_field_prefix' => function (Options $options, $value) {
                    return null === $value ? $options['form_prefix'] . '_' : $value;
                },
                'form_group_prefix' => function (Options $options, $value) {
                    return null === $value ? $options['form_prefix'] . ':group_' : $value;
                },
                'render_rest' => true,
            ]
        );
        $resolver->setDefined(['form_data']);
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        parent::configureOptions($resolver);
        $resolver->setDefaults(['render_rest' => false]);
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver
            ->setDefaults(
                [
                    'form' => null,
                    'form_name' => 'form',
                    'instance_name' => '',
                ]
            );
    }
                                            
Was this example useful?
0
                                                    /**
     * @inheritdoc
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(['enable_tagging' => false]);
    }