| Total Complexity | 7 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class Column implements ValueInterface { |
||
| 19 | |||
| 20 | use AggregateTrait; |
||
| 21 | use ComparisonTrait; |
||
| 22 | use DateTimeTrait; |
||
| 23 | use NumericTrait; |
||
| 24 | use TextTrait; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $name; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | protected $qualifier; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param DB $db |
||
| 38 | * @param string $name |
||
| 39 | * @param string $qualifier |
||
| 40 | */ |
||
| 41 | public function __construct (DB $db, string $name, string $qualifier = '') { |
||
| 42 | $this->db = $db; |
||
| 43 | $this->name = $name; |
||
| 44 | $this->qualifier = $qualifier; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Returns the qualified name. |
||
| 49 | * |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public function __toString (): string { |
||
| 53 | if (strlen($this->qualifier)) { |
||
| 54 | return "{$this->qualifier}.{$this->name}"; |
||
| 55 | } |
||
| 56 | return $this->name; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | final public function getName (): string { |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | final public function getQualifier (): string { |
||
| 70 | return $this->qualifier; |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @param string $name |
||
| 75 | * @return $this |
||
| 76 | */ |
||
| 77 | public function setName (string $name) { |
||
| 78 | $clone = clone $this; |
||
| 79 | $clone->name = $name; |
||
| 80 | return $clone; |
||
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @param string $qualifier |
||
| 85 | * @return $this |
||
| 86 | */ |
||
| 87 | public function setQualifier (string $qualifier) { |
||
| 91 | } |
||
| 92 | } |