Infusionsoft_CustomFieldService::getAllValuesFor PHP Method

getAllValuesFor() public static method

public static getAllValuesFor ( $field_name )
    public static function getAllValuesFor($field_name)
    {
        $field_name = trim($field_name, '_');
        $fields = Infusionsoft_ObjectTools::findObjectsInList(Infusionsoft_CustomFieldService::getCachedCustomFields(new Infusionsoft_Contact()), array('Name' => $field_name));
        $field = array_shift($fields);
        $values = array();
        if (is_object($field)) {
            $values = $field->getValues();
        }
        $keyed_array = array();
        foreach ($values as $value) {
            $keyed_array[$value] = $value;
        }
        return $keyed_array;
    }