Completed
Push — develop ( bffb2a...35cb48 )
by
unknown
07:30
created

SocialProfiles::isValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
eloc 2
nc 2
nop 0
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 */
9
10
/** Auth forms */
11
namespace Auth\Form;
12
13
use Core\Form\BaseForm;
14
15
/**
16
 * Formular for adding social profiles.
17
 *
18
 * @author Mathias Gelhausen <[email protected]>
19
 */
20
class SocialProfiles extends BaseForm
21
{
22
    /**
23
     * Label for rendering purposes.
24
     * @var string
25
     */
26
    protected $label = /*@translate*/ 'Social Profiles';
27
    
28
    protected $baseFieldset = array(
29
        'type' => 'Auth/SocialProfilesFieldset',
30
        'options' => array(
31
            'profiles' => array(
32
                'facebook' => 'Facebook',
33
                'xing'     => 'Xing',
34
                'linkedin' => 'LinkedIn'
35
            ),
36
            'renderFieldset' => true,
37
38
        ),
39
    );
40
    
41
    /**
42
     * @var bool
43
     */
44
    protected $useDefaultValidation = false;
45
    
46
    /**
47
     * {@inheritDoc}
48
     *
49
     * This method is a no-op, as we do not need a button fieldset.
50
     * @see \Core\Form\BaseForm::addButtonsFieldset()
51
     */
52
    protected function addButtonsFieldset()
53
    {
54
    }
55
    
56
    /**
57
     * {@inheritDoc}
58
     */
59
    public function isValid()
60
    {
61
        return $this->useDefaultValidation ? \Zend\Form\Form::isValid() : parent::isValid();
62
    }
63
    
64
	/**
65
	 * @param bool $bool
66
	 * @return SocialProfiles
67
	 */
68
	public function setUseDefaultValidation($bool)
69
	{
70
		$this->useDefaultValidation = (bool)$bool;
71
		
72
		return $this;
73
	}
74
}
75