Applications are open for the 2015 Fall session of Drupal Career Online (DCO) program. Classes start early September! Learn more.
Interested in learning more about Drupal, but can't find the training you're looking for? Help us help you by letting us know what workshops interest you. Take this short survey to let us know!
DrupalEasy is a training and consulting company that specializes in public and private Drupal training as well as site building and consulting with a focus on best practices and building sustainable web sites. More...
Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...
More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...
I was working on a Drupal migration project today using the Migrate module where I needed to import only select user roles from the source (Drupal 6) database.
The Migrate module allows for a custom query to select only the user roles that need to be imported. In my case, the two roles I wanted to import had role IDs of 4 and 6. So, how do I write a query using the Drupal Database API to do this? Turns out there's a pretty elegant answer. Rather than writing something like:
SELECT * FROM role r WHERE rid=4 OR rid=6;
The proper way of writing the select query is:
$query = parent::query();
$ored = db_or();
Note the elegant "db_or()" function that returns a DatabaseCondition object. Add the two conditions to this object, and they're automagically "or"ed.
I discovered all this via this nice blog post by Rahul Singla.
We are meticulous experts in Drupal and how to leverage the web for business, outreach and data collection. DrupalEasy Consulting focuses on timely solutions that work for our clients and their end users.
Learn more about DrupalEasy Consulting.
DrupalEasy Training gets you up to speed fast. Standard workshops are available throughout the US, and can also be presented as association, user group and corporate/organization customized training events. Check out our upcoming schedule as well as our past workshops.
Learn more about DrupalEasy Training.