mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
调整Model类setAttr方法
This commit is contained in:
@@ -283,7 +283,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
// 检测修改器
|
// 检测修改器
|
||||||
$method = 'set' . Loader::parseName($name, 1) . 'Attr';
|
$method = 'set' . Loader::parseName($name, 1) . 'Attr';
|
||||||
if (method_exists($this, $method)) {
|
if (method_exists($this, $method)) {
|
||||||
$value = $this->$method($value, array_merge($data, $this->data));
|
$value = $this->$method($value, $data);
|
||||||
} elseif (isset($this->type[$name])) {
|
} elseif (isset($this->type[$name])) {
|
||||||
// 类型转换
|
// 类型转换
|
||||||
$value = $this->writeTransform($value, $this->type[$name]);
|
$value = $this->writeTransform($value, $this->type[$name]);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class BelongsTo extends OneToOne
|
|||||||
* @param string $foreignKey 关联外键
|
* @param string $foreignKey 关联外键
|
||||||
* @param string $localKey 关联主键
|
* @param string $localKey 关联主键
|
||||||
* @param string $joinType JOIN类型
|
* @param string $joinType JOIN类型
|
||||||
|
* @param string $relation 关联名
|
||||||
*/
|
*/
|
||||||
public function __construct(Model $parent, $model, $foreignKey, $localKey, $joinType = 'INNER', $relation = null)
|
public function __construct(Model $parent, $model, $foreignKey, $localKey, $joinType = 'INNER', $relation = null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user