Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not filter values in AbstractCreationalQuery #113

Merged
merged 1 commit into from
Apr 7, 2020

Conversation

makeey
Copy link
Contributor

@makeey makeey commented Mar 5, 2020

Hi @nilportugues !

Thank you for your great package, I really enjoy using it.

I have a problem with a query when my query should contain something which is not == to true (except the "0").
For example, I have a table which has the next structure:

CREATE TABLE IF NOT EXISTS `Example`
(
    `Id`          int(1)       NOT NULL,
    `Tittle`      VARCHAR(255) NOT NULL,
    `Description` LONGTEXT     NULL DEFAULT NULL,
    `IsSomething` bool not null default TRUE,

) ENGINE = InnoDB;

The problem is the description was set you can't set it to null anymore, and also you can't change IsSomething on false.

Reproduce the issue:

$genericBuilder = new GenericBuilder();
echo $genericBuilder->write(
    $genericBuilder->update()
        ->setTable('Example')
        ->setValues([
            'Title' => "example title",
            'isSomething' => false,
            'Description' => null
        ])
        ->where()
        ->equals('id', 5)
        ->end()
);
// ACTUAL: UPDATE Example SET  Example.Title = :v1 WHERE (Example.id = :v2)
// EXPECTED: UPDATE Example SET  Example.Title = :v1, Example.isSomething = :v2, Example.Description = :v3 WHERE (Example.id = :v4)

The issue was occurred before in the issue #82 but wasn't completely solve, only the integer case.
Also a related issue: #92

@makeey
Copy link
Contributor Author

makeey commented Mar 27, 2020

Hi, @nilportugues have you had a chance to take a look at the PR?

@nilportugues nilportugues merged commit b00877e into nilportugues:master Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants