| @@ 199-218 (lines=20) @@ | ||
| 196 | * @param BaseModel $model |
|
| 197 | * @return static |
|
| 198 | */ |
|
| 199 | protected function cacheByString(BaseModel $model) |
|
| 200 | { |
|
| 201 | ||
| 202 | $stringValue = $this->stringValue($model); |
|
| 203 | ||
| 204 | if (null === $stringValue) { |
|
| 205 | return $this; |
|
| 206 | } |
|
| 207 | ||
| 208 | // Check if already in cache |
|
| 209 | if (!$this->isCachedByString($stringValue)) { |
|
| 210 | ||
| 211 | // Cache it |
|
| 212 | $this->_cacheByString[$stringValue] = $model; |
|
| 213 | ||
| 214 | } |
|
| 215 | ||
| 216 | return $this; |
|
| 217 | ||
| 218 | } |
|
| 219 | ||
| 220 | /** |
|
| 221 | * @param Record $record |
|
| @@ 190-209 (lines=20) @@ | ||
| 187 | * @param BaseObject $model |
|
| 188 | * @return static |
|
| 189 | */ |
|
| 190 | protected function cacheByString(BaseObject $model) |
|
| 191 | { |
|
| 192 | ||
| 193 | $stringValue = $this->stringValue($model); |
|
| 194 | ||
| 195 | if (null === $stringValue) { |
|
| 196 | return $this; |
|
| 197 | } |
|
| 198 | ||
| 199 | // Check if already in cache |
|
| 200 | if (!$this->isCachedByString($stringValue)) { |
|
| 201 | ||
| 202 | // Cache it |
|
| 203 | $this->_cacheByString[$stringValue] = $model; |
|
| 204 | ||
| 205 | } |
|
| 206 | ||
| 207 | return $this; |
|
| 208 | ||
| 209 | } |
|
| 210 | ||
| 211 | /** |
|
| 212 | * @param Record $record |
|