CodeIgniter4 Version
4.1.9
What happened?
When using attributes, as the property/attribute name of the Entity class, the Entity::setAttributes() method is called as a setter.
Names collision.
Steps to Reproduce
$e = new CodeIgniter\Entity\Entity();
$e->a = 1;
$e->attributes = [1, 2, 3]; // called the setAttributes method as a setter.
dd($e->toRawArray());
//$e->toRawArray() array (3)
// 0 => integer 1
// 1 => integer 2
// 2 => integer 3
Expected Output
//$e->toRawArray() array (2)
// a => integer 1
// attributes => array (3)
// 0 => integer 1
// 1 => integer 2
// 2 => integer 3
Anything else?
In Laravel prior to version 9, the custom setter and getter had the following format:
set/get + AttributeName + Attribute.
public function getFullNameAttribute()
{
return "{$this->first_name} {$this->last_name}";
}
CodeIgniter4 Version
4.1.9
What happened?
When using
attributes, as the property/attribute name of the Entity class, theEntity::setAttributes()method is called as a setter.Names collision.
Steps to Reproduce
Expected Output
Anything else?
In Laravel prior to version 9, the custom setter and getter had the following format:
set/get + AttributeName + Attribute.