FailedURLRewriteSummary::getText()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace PhpTek\Exodus\Model;
4
5
use SilverStripe\Core\Injector\Injectable;
6
use SilverStripe\ORM\DataObject;
7
use SilverStripe\ORM\FieldType\DBInt;
8
use SilverStripe\ORM\FieldType\DBText;
9
10
/**
11
 * A model object that represents a single failed link-rewrite summary. This data is displayed
12
 * at the top of the {@link FailedURLRewriteReport}.
13
 *
14
 * @author Russell Michell <[email protected]>
15
 * @package phptek/silverstripe-exodus
16
 */
17
class FailedURLRewriteSummary extends DataObject
18
{
19
    use Injectable;
20
21
    /**
22
     * @var string
23
     */
24
    private static $table_name = 'FailedURLRewriteSummary';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
25
26
    /**
27
     *
28
     * @var array
29
     */
30
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
31
        'Text' => DBText::class,
32
        'ImportID' => DBInt::class,
33
    ];
34
35
    /**
36
     *
37
     * Format summary text so all totals are emboldened.
38
     *
39
     * @return string
40
     */
41
    public function getText()
42
    {
43
        return preg_replace("#([\d]*)#", "<strong>$1</strong>", $this->getField('Text'));
44
    }
45
}
46