@@ -181,19 +181,19 @@ discard block |
||
| 181 | 181 | return 0; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - if(($condition = $this->getOldPrimaryKey(true)) !== $this->getPrimaryKey(true)) { |
|
| 184 | + if (($condition = $this->getOldPrimaryKey(true)) !== $this->getPrimaryKey(true)) { |
|
| 185 | 185 | // TODO Change DN |
| 186 | 186 | static::getDb()->rename($condition, $newRdn, $newParent, true); |
| 187 | - if (!$this->refresh()){ |
|
| 187 | + if (!$this->refresh()) { |
|
| 188 | 188 | Yii::info('Model not refresh.', __METHOD__); |
| 189 | 189 | return false; |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | foreach ($values as $key => $value) { |
| 194 | - if(empty ($this->getOldAttribute($key)) && $value === ''){ |
|
| 194 | + if (empty ($this->getOldAttribute($key)) && $value === '') { |
|
| 195 | 195 | unset($values[$key]); |
| 196 | - } else if($value === ''){ |
|
| 196 | + } else if ($value === '') { |
|
| 197 | 197 | $attributes[] = ['attrib' => $key, 'modtype' => LDAP_MODIFY_BATCH_REMOVE]; |
| 198 | 198 | } else if (empty ($this->getOldAttribute($key))) { |
| 199 | 199 | $attributes[] = ['attrib' => $key, 'modtype' => LDAP_MODIFY_BATCH_ADD, 'values' => [$value]]; |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public static function updateAll($attributes, $condition = '') |
| 238 | 238 | { |
| 239 | - if(is_array($condition)){ |
|
| 239 | + if (is_array($condition)) { |
|
| 240 | 240 | $condition = $condition['dn']; |
| 241 | 241 | } |
| 242 | 242 | |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function __construct(Connection $conn, $results, $config = []) |
| 73 | 73 | { |
| 74 | - $this->_conn = $conn; |
|
| 74 | + $this->_conn = $conn; |
|
| 75 | 75 | $this->_results = $results; |
| 76 | 76 | |
| 77 | - if(is_array($this->_results)){ |
|
| 77 | + if (is_array($this->_results)) { |
|
| 78 | 78 | foreach ($this->_results as $result) { |
| 79 | 79 | $this->_count += $this->_conn->countEntries($result); |
| 80 | 80 | $this->setEntries($result); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * @param resource $result |
| 99 | 99 | * @return void |
| 100 | 100 | */ |
| 101 | - protected function setEntries($result){ |
|
| 101 | + protected function setEntries($result) { |
|
| 102 | 102 | $identifier = $this->_conn->getFirstEntry($result); |
| 103 | 103 | |
| 104 | 104 | while (false !== $identifier) { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public function close() |
| 137 | 137 | { |
| 138 | - if(is_array($this->_results)){ |
|
| 138 | + if (is_array($this->_results)) { |
|
| 139 | 139 | foreach ($this->_results as $result) { |
| 140 | 140 | $this->_conn->freeResult($result); |
| 141 | 141 | } |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | return '('.$this->operator[$operator].'('.implode(") (", $parts).')'.implode($other).')'; |
| 133 | 133 | } else if (!empty($other)) { |
| 134 | 134 | return '('.$this->operator[$operator].implode($other).')'; |
| 135 | - }else { |
|
| 135 | + } else { |
|
| 136 | 136 | return ''; |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | return '('.$this->operator[$operator].'('.implode(") (", $parts).')'.implode($other).')'; |
| 133 | 133 | } else if (!empty($other)) { |
| 134 | 134 | return '('.$this->operator[$operator].implode($other).')'; |
| 135 | - }else { |
|
| 135 | + } else { |
|
| 136 | 136 | return ''; |
| 137 | 137 | } |
| 138 | 138 | } |