og_massaddがユーザー名の代わりに実名に基づいて検索することは可能でしょうか?
// If not, try to check for usernames
if (!isset($account) && drupal_strlen($mail)) {
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'user')
->propertyCondition('name', check_plain($mail));
$result = $query->execute();
if (!empty($result)) {
$uids = array_keys($result['user']);
$account = user_load_multiple($uids);
$account = array_shift($account);
}
}
すでに試した
->propertyCondition('実名', check_plain($mail));
propertyConditionでEntityFieldQueryを使用していることがわかりますが、実名がエンティティのプロパティに関連しているかどうか、または確認する他の方法があるかどうかはわかりませんか?
アドバイス/ヘルプをいただければ幸いです。
アップデート
実名が含まれていない使用可能な「ユーザー」フィールドをdrushで表示する方法を見つけました:(
実名と照合する他の方法はありますか?
更新2
EFQ 内部結合がサポートされていないことがわかりましたが、サブクエリを使用した回避策について読んでいますが、それを機能させることができず、現在スタックしています。何か考えはありますか?
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'user')
$rnames_subquery = db_select('realname', 'rn');
$rnames_subquery->fields('rn', array('uid'));
$query->propertyCondition('uid', $rnames_subquery, 'IN');
$result = $query->execute();