public function __set($property, $value) { if ($this->hasMethod($method = "set{$property}")) { $this->{$method}($value); } elseif (isset($this->coordinates[$property])) { $args = func_get_args(); $markChanged = array_key_exists(1, $args) ? $args[1] : true; $this->coordinates[$property] = $value; if ($markChanged) { $this->isChanged = true; } } else { parent::__set($property, $value); } }