Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamoDbModel constructor is not calling the initializeTraits() method like the parent #261

Open
nelson6e65 opened this issue Oct 11, 2022 · 1 comment
Assignees

Comments

@nelson6e65
Copy link
Collaborator

nelson6e65 commented Oct 11, 2022

Describe the bug
DynamoDbModel is no calling initializeTraits() method, introduced in 5.7 (https://github.com/laravel/framework/blob/5.7/src/Illuminate/Database/Eloquent/Model.php#L168).

Current package constructor implementation:

public function __construct(array $attributes = [])
{
$this->bootIfNotBooted();
$this->syncOriginal();
$this->fill($attributes);
$this->setupDynamoDb();
}

This should be solved, without BC, by just calling the base constructor:

 public function __construct(array $attributes = []) 
 { 
     parent::__construct($attributes); 

     $this->setupDynamoDb(); 
 } 

Schema

Debug info

Version info

  • Laravel: 5.8
  • laravel-dynamodb: 6.1
@nelson6e65 nelson6e65 changed the title DynamoDbModel is not calling its parent::__construct DynamoDbModel constructor is not calling its initializeTraits() method like the parent Oct 13, 2022
@nelson6e65 nelson6e65 changed the title DynamoDbModel constructor is not calling its initializeTraits() method like the parent DynamoDbModel constructor is not calling the initializeTraits() method like the parent Oct 13, 2022
@nelson6e65 nelson6e65 self-assigned this Feb 23, 2023
@nelson6e65
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant