Skip to content

Commit d5f702e

Browse files
Merge pull request #1050 from acrobertson/fix/relationship-isset
Add `__isset()` method to `Relationship` class
2 parents 35931c8 + f213a67 commit d5f702e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

php/relate/class-relationship.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ public function __get( $key ) {
117117
return $return;
118118
}
119119

120+
/**
121+
* Check the existence of a relationship data value.
122+
*
123+
* @param string $key The key.
124+
*
125+
* @return bool
126+
*/
127+
public function __isset( $key ) {
128+
$data_cache = $this->get_data();
129+
130+
return isset( $data_cache[ $key ] );
131+
}
132+
120133
/**
121134
* Set the save on shutdown flag.
122135
*/

0 commit comments

Comments
 (0)