Skip to content

Entity's fill method is not supporting key mapping #1567

Description

@hwiesmann

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'];

	$mappedEntity = $this->getMappedEntity();
	$mappedEntity->fill($data);
	$whatsnew = $mappedEntity->toArray(true);
	$expected = $data;
	$this->assertEquals($expected,$whatsnew);
}

CodeIgniter 4 version
CodeIgniter 4.0.0 Alpha 2 release

Affected module(s)
Entity

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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