Test Failed
Push — master ( aff3ac...48396d )
by 世昌
02:34
created

DataObject   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkFieldExist() 0 3 1
1
<?php
2
namespace suda\application\database;
3
4
use suda\orm\struct\ArrayDataTrait;
5
use suda\orm\struct\ArrayDataInterface;
6
use suda\orm\struct\TableStructAwareTrait;
7
use suda\orm\struct\TableStructAwareInterface;
8
9
/**
10
 * 数据表抽象对象
11
 *
12
 * 用于提供对数据表的操作
13
 *
14
 */
15
abstract class DataObject implements TableStructAwareInterface, ArrayDataInterface
16
{
17
    use ArrayDataTrait;
18
    use TableStructAwareTrait;
19
20
    /**
21
     * 检查字段是否存在
22
     *
23
     * @param string $name
24
     * @return boolean
25
     */
26
    public function checkFieldExist(string $name)
27
    {
28
        return static::getTableStruct()->getFields()->hasField($name);
29
    }
30
}
31