EntityForm::getData()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
crap 2
1
<?php
2
3
/**
4
 * This file is part of slick/mvc package
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Mvc\Form;
11
12
use Slick\Form\Form;
13
use Slick\Form\FormInterface;
14
15
/**
16
 * Entity Form
17
 * 
18
 * @package Slick\Mvc\Form
19
 * @author  Filipe Silva <[email protected]>
20
 */
21
class EntityForm extends Form implements FormInterface
22
{
23
24
    /**
25
     * Returns submitted or current data
26
     *
27
     * This method overrides the default behavior to unset the form-id from
28
     * submitted data if it exists.
29
     * 
30
     * @return array
31
     */
32 4
    public function getData()
33
    {
34 4
        $data = parent::getData();
35 4
        if (array_key_exists('form-id', $data)) {
36 4
            unset($data['form-id']);
37 2
        }
38 4
        return $data;
39
    }
40
}