public function filterMemberIdByProfile($ids, $column, $value, Profile $item, $publicFlag = 1)
 {
     $_result = array();
     $q = Doctrine::getTable('MemberProfile')->createQuery('m');
     $q = opFormItemGenerator::filterSearchQuery($q, 'm.' . $column, $value, $item->toArray())->select('m.member_id')->andWhere('m.profile_id = ?', $item->getId());
     $isCheckPublicFlag = is_integer($publicFlag);
     if (!$item->getIsEditPublicFlag()) {
         if (ProfileTable::PUBLIC_FLAG_SNS == $item->getDefaultPublicFlag() || ProfileTable::PUBLIC_FLAG_WEB == $item->getDefaultPublicFlag()) {
             $isCheckPublicFlag = false;
         } else {
             return array();
         }
     }
     if ($isCheckPublicFlag) {
         $publicFlags = (array) $publicFlag;
         if (1 == $publicFlag) {
             $publicFlags[] = 4;
         }
         if ($item->isMultipleSelect() && 'date' !== $item->getFormType()) {
             $q->addFrom('MemberProfile pm')->andWhere('m.tree_key = pm.id')->andWhereIn('pm.public_flag', $publicFlags);
         } else {
             $q->andWhereIn('m.public_flag', $publicFlags);
         }
     }
     $list = $q->execute();
     foreach ($list as $v) {
         $_result[] = $v->getMemberId();
     }
     if (is_array($ids)) {
         $ids = array_values(array_intersect($ids, $_result));
     } else {
         $ids = array_values($_result);
     }
     if ($isCheckPublicFlag && 'op_preset_birthday' === $item->getName()) {
         if ('%-' !== substr($value, 0, 2)) {
             $ids = $this->filterMemberIdsByAgePublicFlag($ids);
         }
     }
     return $ids;
 }
Пример #2
0
 public function filterMemberIdByProfile($ids, $column, $value, Profile $item, $publicFlag = 1)
 {
     $_result = array();
     $q = Doctrine::getTable('MemberProfile')->createQuery('m');
     $q = opFormItemGenerator::filterSearchQuery($q, 'm.' . $column, $value, $item->toArray())->select('m.member_id')->andWhere('m.profile_id = ?', $item->getId());
     if (is_integer($publicFlag)) {
         if ($item->isMultipleSelect() && $item->getFormType() !== 'date') {
             $q->addFrom('MemberProfile pm')->andWhere('m.tree_key = pm.id')->andWhere('pm.public_flag <= ?', $publicFlag);
         } else {
             $q->andWhere('m.public_flag <= ?', $publicFlag);
         }
     }
     $list = $q->execute();
     foreach ($list as $value) {
         $_result[] = $value->getMemberId();
     }
     if (is_array($ids)) {
         $ids = array_values(array_intersect($ids, $_result));
     } else {
         $ids = array_values($_result);
     }
     return $ids;
 }