| @@ 117-123 (lines=7) @@ | ||
| 114 | public function __set($name, $value) |
|
| 115 | { |
|
| 116 | //It's a field |
|
| 117 | if (array_key_exists($name, $this->values)) { |
|
| 118 | if ($this->values[$name] !== $value) { |
|
| 119 | $this->changed = true; |
|
| 120 | } |
|
| 121 | ||
| 122 | return $this->values[$name] = $value; |
|
| 123 | } |
|
| 124 | ||
| 125 | //It's a localizable field |
|
| 126 | $language = $this->getDatabase()->getAttribute(SimpleCrud::ATTR_LOCALE); |
|
| @@ 131-137 (lines=7) @@ | ||
| 128 | if (!is_null($language)) { |
|
| 129 | $localeName = "{$name}_{$language}"; |
|
| 130 | ||
| 131 | if (array_key_exists($localeName, $this->values)) { |
|
| 132 | if ($this->values[$localeName] !== $value) { |
|
| 133 | $this->changed = true; |
|
| 134 | } |
|
| 135 | ||
| 136 | return $this->values[$localeName] = $value; |
|
| 137 | } |
|
| 138 | } |
|
| 139 | ||
| 140 | //It's a relation |
|