spotorm / spot2

Spot v2.x DataMapper built on top of Doctrine's Database Abstraction Layer
http://phpdatamapper.com
BSD 3-Clause "New" or "Revised" License
601 stars 101 forks source link

Spot\Mapper::save() must implement interface Spot\EntityInterface, array given, #223

Closed tablecell closed 7 years ago

tablecell commented 7 years ago
$mapper=$spot->mapper('Entity\User');

$user=['usernmae'=>'tom','password'=>'xxxx'];
$mapper->save($user);

Catchable fatal error: Argument 1 passed to Spot\Mapper::save() must implement interface Spot\EntityInterface, array given,

tuupola commented 7 years ago

You must give $mapper->save() an Entity\User object, not an array.