Issues with isset, empty and unset on DBObject properties #8

Closed
djrobe opened this Issue Dec 14, 2011 · 1 comment

Comments

Projects
None yet
2 participants
@djrobe

djrobe commented Dec 14, 2011

Calls to empty() or isset() on a DBObject property always returns true, and unset() has no effect as the magic methods __isset and __unset are not defined. The following methods need to be added:

          public function __isset($key) {
              return array_key_exists($key, $this->columns);
          }


          public function __unset($key) {
              unset($this->columns[$key]);
          }
@tylerhall

This comment has been minimized.

Show comment Hide comment
@tylerhall

tylerhall Dec 14, 2011

Owner

Thanks for that! I've updated the class with the methods you supplied.

Owner

tylerhall commented Dec 14, 2011

Thanks for that! I've updated the class with the methods you supplied.

@tylerhall tylerhall closed this Dec 14, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment