Skip to content

DataMapper::populate should work better with default values #1

Description

@erkie

Take this example:

class User extends DomainObject
    property $title = array('is_mandatory' => true)
    property $profile_text = array('is_mandatory' => false, 'default' => "I'm new")

$user = new User();
$user->title = 'Unique title!';
$usermapper->populate($user);

Will create the query "SELECT * FROM users WHERE title = 'Unique title!' AND profile_text = 'I'm new'" because populate takes every value when building the query.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions