Hi Gareth, I just read your blog entry on that subject, and I have to admit that it never occurred to me to use bits to store multiple flags in one column. I like it! :) Thanks.
My question, if I may, is why the classification column is not just an integer? What is the Criteria::BINARY_AND for? Thanks for enlightening me :) Have a great day. Daniel On Apr 29, 1:09 am, Gareth McCumskey <[email protected]> wrote: > Hi all, > > I need the great minds that populate this liust to assist me with a small > dilema. We currently use an integer field that stores a range of values as a > bitwise number depending on certain criteria of an item stored in the db. > What we want to do now is write a sql query like: > > SELECT [columns] FROM [tablename] WHERE classification & 1 AND > classification & ~2 > > I am struggling to find the negation (~) operator as part of the criteria > syntax. So far I have: > > $status_criterion = $c->getNewCriterion(MailDetailsPeer::CLASSIFICATION, 1, > Criteria::BINARY_AND); > $status_criterion->addAnd($c->getNewCriterion(MailDetailsPeer::CLASSIFICATION, > 2 , Criteria::BINARY_AND)); > > As you can see I have no negation on the second-line because I do not know > how I should do that. There aren't any obvious options as part of Propel. > > ANy help would be appreciated guys :) > > -- > Gareth McCumskeyhttp://garethmccumskey.blogspot.com > twitter: @garethmcc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
