Skip to content

Initially dirty attributes #2

Open
@phoenixtf

Description

@phoenixtf

Carbonified attributes get dirty right after find:

$model = SomeModel::find()->one();
$model->getDirtyAttributes(); // got list of Carbon attributes here

My suggestion - rewrite oldAttribute after every conversion:

$this->owner->$attribute = Carbon::createFromTimestamp($value);
$this->owner->setOldAttribute($attribute, $this->owner->$attribute);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions