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

deleteAll with strict_types=1 #93

Closed
cmazx opened this issue Jan 17, 2017 · 5 comments
Closed

deleteAll with strict_types=1 #93

cmazx opened this issue Jan 17, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@cmazx
Copy link

cmazx commented Jan 17, 2017

What steps will reproduce the problem?

Call deleteAll with "IN" condition
\yii\redis\ActiveRecord::deleteAll(['in','id',[1,2,3]);

What's expected?

Count of deleted in return.

What do you get instead?

[yii\base\ErrorException] array_intersect(): Argument #1 is not an array

Additional info

In \yii\yii2-redis\ActiveQuery.php:355
called $modelClass::isPrimaryKey($this->where[1])
isPrimaryKey first argument must be array (by phpdoc)

Q A
Yii vesion 2.0.10
PHP version 7.0.4(strict_types=1)
Operating system Ubuntu
@samdark
Copy link
Member

samdark commented Jan 17, 2017

What do you mean by "with strict_types=1"? How to reproduce that?

@cmazx
Copy link
Author

cmazx commented Jan 17, 2017

declare strict types on, in enter script
declare(strict_types = 1);

@samdark
Copy link
Member

samdark commented Jan 17, 2017

In index.php?

@cmazx
Copy link
Author

cmazx commented Jan 17, 2017

Yep. When php will check incoming attributes for array_intersect(array $array1, array $array2, array $_ = null)

Or in child class file, wich extend ActiveRecord.

@cmazx
Copy link
Author

cmazx commented Jan 17, 2017

Even if no strict_types, problem exist. array_intersect require array attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants