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

Implementation of Bitwise operands #174

Merged
merged 5 commits into from
Apr 22, 2019
Merged

Conversation

peter-gribanov
Copy link
Member

@peter-gribanov peter-gribanov commented Apr 6, 2019

This is a implementation of the Bitwise operands from #169 feature.

You can use bitwise operations in specifications such as &, |, ^, <<, >>, ~.

For example, check the access for reading something with a bit mask:

// DQL: (u.access & 0100) = 0100
$spec = Spec::eq(Spec::bAnd('access', UserAccess::READ), UserAccess::READ);

You can put bitwise operations in each other. For example, select not readed mails:

// DQL: (m.status & (~ 0100)) = m.status
$spec = Spec::eq(
    Spec::bAnd(
        Spec::field('status'),
        Spec::bNot(Spec::value(MailStatus::READED))
    ),
    Spec::field('status')
);

@peter-gribanov peter-gribanov added this to the Release 1.0.0 milestone Apr 6, 2019
@peter-gribanov peter-gribanov merged commit 9b1c596 into Happyr:1.0 Apr 22, 2019
@peter-gribanov peter-gribanov mentioned this pull request Apr 28, 2019
@peter-gribanov peter-gribanov deleted the bitwise branch October 28, 2019 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant