Completed
Push — master ( 2f5afb...f40faa )
by Filipe
02:44
created

EntityForm::getData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
ccs 0
cts 8
cp 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
crap 6
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
    public function getData()
33
    {
34
        $data = parent::getData();
35
        if (array_key_exists('form-id', $data)) {
36
            unset($data['form-id']);
37
        }
38
        return $data;
39
    }
40
}