Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
statement.php
1<?php
2namespace Bitrix\Perfmon\Php;
3
5{
6 public $tableName = '';
7 public $dependOn = '';
8 protected $bodyLines = [];
9 public $conditions = [];
10
18 public function addLine($line)
19 {
20 $this->bodyLines[] = (string)$line;
21 return $this;
22 }
23
31 public function addCondition($predicate)
32 {
33 $this->conditions[] = new Condition($predicate);
34 return $this;
35 }
36
44 public function merge(Statement $stmt)
45 {
46 foreach ($stmt->bodyLines as $line)
47 {
48 $this->addLine($line);
49 }
50 return $this;
51 }
52
60 public function formatBodyLines($level = 0)
61 {
62 $body = '';
63 foreach ($this->bodyLines as $line)
64 {
65 $body .= str_repeat("\t", $level) . $line . "\n";
66 }
67 return $body;
68 }
69}