You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name: Bug report
about: Entity's fill method is not supporting key mapping
Describe the bug
The header already says it. While the magic method __set maps the key by $key = $this->mapProperty($key); this is not the case in the fill method.
PS: See also next bug report concerning magic methods __get and __set.
** TEST **
public function testFillWithMappedEntity()
{
$data = ['bar' => 'foo', 'orig' => 'simple'];
Good catch! I've fixed that up, though I couldn't use your test as is. The toArray doesn't bring back exactly what you're expecting. it's intended for use by the model, so does some weird things with the mapped properties to ensure that it gets the original field names. Plus the setter and getter for 'orig' add strings around it.
name: Bug report
about: Entity's fill method is not supporting key mapping
Describe the bug
The header already says it. While the magic method __set maps the key by
$key = $this->mapProperty($key);
this is not the case in the fill method.PS: See also next bug report concerning magic methods __get and __set.
** TEST **
public function testFillWithMappedEntity()
{
$data = ['bar' => 'foo', 'orig' => 'simple'];
CodeIgniter 4 version
CodeIgniter 4.0.0 Alpha 2 release
Affected module(s)
Entity
The text was updated successfully, but these errors were encountered: