<?php

class Waindigo_InfusionsoftApi_Listener_CriteriaUser
{

    public static function criteriaUser($rule, array $data, array $user, &$returnValue)
    {
        switch ($rule) {
            case 'infusionsoft_contact_group_id_waindigo':
                if (!empty($user['infusionsoft_contact_group_ids_waindigo'])) {
                    if (strpos(",{$user['infusionsoft_contact_group_ids_waindigo']},", ",{$data['contact_group_id']},") !==
                         false) {
                        $returnValue = true;
                    }
                }
                break;
        }
    } /* END criteriaUser */
}