@@ -281,8 +281,7 @@ public function __set($key, $value)
281281 */
282282 public function &__get ($ key )
283283 {
284- $ this ->accessColumn ($ key );
285- if (array_key_exists ($ key , $ this ->data )) {
284+ if ($ this ->accessColumn ($ key )) {
286285 return $ this ->data [$ key ];
287286 }
288287
@@ -300,8 +299,7 @@ public function &__get($key)
300299
301300 public function __isset ($ key )
302301 {
303- $ this ->accessColumn ($ key );
304- if (array_key_exists ($ key , $ this ->data )) {
302+ if ($ this ->accessColumn ($ key )) {
305303 return isset ($ this ->data [$ key ]);
306304 }
307305 $ this ->removeAccessColumn ($ key );
@@ -320,15 +318,14 @@ public function __unset($key)
320318 */
321319 public function accessColumn ($ key , $ selectColumn = TRUE )
322320 {
323- $ this ->table ->accessColumn ($ key , $ selectColumn );
324- if ($ this ->table ->getDataRefreshed () && !$ this ->dataRefreshed ) {
321+ if ($ this ->table ->accessColumn ($ key , $ selectColumn ) && !$ this ->dataRefreshed ) {
325322 if (!isset ($ this ->table [$ this ->getSignature ()])) {
326323 throw new Nette \InvalidStateException ('Database refetch failed; row does not exist! ' );
327324 }
328325 $ this ->data = $ this ->table [$ this ->getSignature ()]->data ;
329326 $ this ->dataRefreshed = TRUE ;
330327 }
331- return array_key_exists ($ key , $ this ->data );
328+ return isset ( $ this -> data [ $ key ]) || array_key_exists ($ key , $ this ->data );
332329 }
333330
334331
0 commit comments