public function __call($method, $args) { if (preg_match('/^(set|toggle)(?:[A-Z][a-z_]*)+$/', $method, $match) > 0) { $method = ltrim($method, $match[1]); $fieldName = strtolower(preg_replace('/(?<=\\w)(?=[A-Z])/', '_$1', $method)); return $this->setField($args[0], $fieldName, !empty($args[1]) ? $args[1] : null); } else { return parent::__call($method, $args); } }