改进Model类的getAttr异常提示

This commit is contained in:
thinkphp
2016-07-06 16:30:23 +08:00
parent 3d910ea299
commit 08bff50a26

View File

@@ -245,7 +245,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
} elseif (array_key_exists($name, $this->data)) {
return $this->data[$name];
} else {
throw new InvalidArgumentException('property not exists:' . __CLASS__ . '->' . $name);
throw new InvalidArgumentException('property not exists:' . $this->class . '->' . $name);
}
}
@@ -383,7 +383,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
$this->data[$name] = $value;
return $value;
} else {
throw new InvalidArgumentException('property not exists:' . __CLASS__ . '->' . $name);
throw new InvalidArgumentException('property not exists:' . $this->class . '->' . $name);
}
}
}