public function __call($methodName, $args)
{
if (preg_match('~^(get)([A-Z])(.*)$~', $methodName, $matches)) {
$field = strtolower($matches[2]) . $matches[3];
return $this->__get($field);
}
if (preg_match('~^(findOneBy)([A-Z])(.*)$~', $methodName, $matches)) {
$field = strtolower($matches[2]) . $matches[3];
return $this->findOne([$field => $args[0]]);
}
throw new UnknownFieldException('Method ' . $methodName . ' doesn\'t exist');
}