当前位置: 首页>>代码示例>>PHP>>正文


PHP get_name_value函数代码示例

本文整理汇总了PHP中get_name_value函数的典型用法代码示例。如果您正苦于以下问题:PHP get_name_value函数的具体用法?PHP get_name_value怎么用?PHP get_name_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_name_value函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_name_value_list

function get_name_value_list($value)
{
    $list = array();
    $field_defs = $_SESSION['field_defs'];
    if (!empty($field_defs)) {
        foreach ($field_defs as $var) {
            $tmp = $var->name;
            if (isset($value->{$tmp})) {
                $val = $value->{$tmp};
                $list[] = get_name_value($tmp, $val);
            }
        }
    }
    return $list;
}
开发者ID:EvgenyPopov,项目名称:DotProject-SOAP,代码行数:15,代码来源:SoapHelperFunctions.php

示例2: new_handle_set_entries


//.........这里部分代码省略.........
        }
        foreach ($name_value_list as $value) {
            $val = $value['value'];
            if ($seed->field_name_map[$value['name']]['type'] == 'enum') {
                $vardef = $seed->field_name_map[$value['name']];
                if (isset($app_list_strings[$vardef['options']]) && !isset($app_list_strings[$vardef['options']][$value])) {
                    if (in_array($val, $app_list_strings[$vardef['options']])) {
                        $val = array_search($val, $app_list_strings[$vardef['options']]);
                    }
                }
            }
            $seed->{$value}['name'] = $val;
        }
        if ($count == $total) {
            $seed->update_vcal = false;
        }
        $count++;
        //Add the account to a contact
        if ($module_name == 'Contacts') {
            Log::debug('Creating Contact Account');
            add_create_account($seed);
            $duplicate_id = check_for_duplicate_contacts($seed);
            if ($duplicate_id == null) {
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    $seed->save();
                    if ($seed->deleted == 1) {
                        $seed->mark_deleted($seed->id);
                    }
                    $ids[] = $seed->id;
                }
            } else {
                //since we found a duplicate we should set the sync flag
                if ($seed->ACLAccess('Save')) {
                    $seed = new $class_name();
                    $seed->id = $duplicate_id;
                    $seed->contacts_users_id = $current_user->id;
                    $seed->save();
                    $ids[] = $duplicate_id;
                    //we have a conflict
                }
            }
        } else {
            if ($module_name == 'Meetings' || $module_name == 'Calls') {
                //we are going to check if we have a meeting in the system
                //with the same outlook_id. If we do find one then we will grab that
                //id and save it
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    if (empty($seed->id) && !isset($seed->id)) {
                        if (!empty($seed->outlook_id) && isset($seed->outlook_id)) {
                            //at this point we have an object that does not have
                            //the id set, but does have the outlook_id set
                            //so we need to query the db to find if we already
                            //have an object with this outlook_id, if we do
                            //then we can set the id, otherwise this is a new object
                            $order_by = "";
                            $query = $seed->table_name . ".outlook_id = '" . $GLOBALS['db']->quote($seed->outlook_id) . "'";
                            $response = $seed->get_list($order_by, $query, 0, -1, -1, 0);
                            $list = $response['list'];
                            if (count($list) > 0) {
                                foreach ($list as $value) {
                                    $seed->id = $value->id;
                                    break;
                                }
                            }
                            //fi
                        }
                        //fi
                    }
                    //fi
                    $seed->save();
                    if ($seed->deleted == 1) {
                        $seed->mark_deleted($seed->id);
                    }
                    $ids[] = $seed->id;
                }
                //fi
            } else {
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    $seed->save();
                    $ids[] = $seed->id;
                }
            }
        }
        // if somebody is calling set_entries_detail() and wants fields returned...
        if ($select_fields !== FALSE) {
            $ret_values[$count] = array();
            foreach ($select_fields as $select_field) {
                if (isset($seed->{$select_field})) {
                    $ret_values[$count][] = get_name_value($select_field, $seed->{$select_field});
                }
            }
        }
    }
    // handle returns for set_entries_detail() and set_entries()
    if ($select_fields !== FALSE) {
        return array('name_value_lists' => $ret_values);
    } else {
        return array('ids' => $ids);
    }
}
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:101,代码来源:SoapHelperFunctions.php

示例3: handle_set_entries


//.........这里部分代码省略.........
        //Add the account to a contact
        if ($module_name == 'Contacts') {
            $GLOBALS['log']->debug('Creating Contact Account');
            add_create_account($seed);
            $duplicate_id = check_for_duplicate_contacts($seed);
            if ($duplicate_id == null) {
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    //Now apply the values, since this is not a duplicate we can just pass false for the $firstSync argument
                    apply_values($seed, $dataValues, false);
                    $seed->save();
                    if ($seed->deleted == 1) {
                        $seed->mark_deleted($seed->id);
                    }
                    $ids[] = $seed->id;
                }
            } else {
                //since we found a duplicate we should set the sync flag
                if ($seed->ACLAccess('Save')) {
                    //Determine if this is a first time sync.  We find out based on whether or not a contacts_users relationship exists
                    $seed->id = $duplicate_id;
                    $seed->load_relationship("user_sync");
                    $beans = $seed->user_sync->getBeans();
                    $first_sync = empty($beans);
                    //Now apply the values and indicate whether or not this is a first time sync
                    apply_values($seed, $dataValues, $first_sync);
                    $seed->contacts_users_id = $current_user->id;
                    $seed->save();
                    $ids[] = $duplicate_id;
                    //we have a conflict
                }
            }
        } else {
            if ($module_name == 'Meetings' || $module_name == 'Calls') {
                //we are going to check if we have a meeting in the system
                //with the same outlook_id. If we do find one then we will grab that
                //id and save it
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    if (empty($seed->id) && !isset($seed->id)) {
                        if (!empty($seed->outlook_id) && isset($seed->outlook_id)) {
                            //at this point we have an object that does not have
                            //the id set, but does have the outlook_id set
                            //so we need to query the db to find if we already
                            //have an object with this outlook_id, if we do
                            //then we can set the id, otherwise this is a new object
                            $order_by = "";
                            $query = $seed->table_name . ".outlook_id = '" . $seed->outlook_id . "'";
                            $response = $seed->get_list($order_by, $query, 0, -1, -1, 0);
                            $list = $response['list'];
                            if (count($list) > 0) {
                                foreach ($list as $value) {
                                    $seed->id = $value->id;
                                    break;
                                }
                            }
                            //fi
                        }
                        //fi
                    }
                    //fi
                    if (empty($seed->reminder_time)) {
                        $seed->reminder_time = -1;
                    }
                    if ($seed->reminder_time == -1) {
                        $defaultRemindrTime = $current_user->getPreference('reminder_time');
                        if ($defaultRemindrTime != -1) {
                            $seed->reminder_checked = '1';
                            $seed->reminder_time = $defaultRemindrTime;
                        }
                    }
                    $seed->save();
                    if ($seed->deleted == 1) {
                        $seed->mark_deleted($seed->id);
                    }
                    $ids[] = $seed->id;
                }
                //fi
            } else {
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    $seed->save();
                    $ids[] = $seed->id;
                }
            }
        }
        // if somebody is calling set_entries_detail() and wants fields returned...
        if ($select_fields !== FALSE) {
            $ret_values[$count] = array();
            foreach ($select_fields as $select_field) {
                if (isset($seed->{$select_field})) {
                    $ret_values[$count][] = get_name_value($select_field, $seed->{$select_field});
                }
            }
        }
    }
    // handle returns for set_entries_detail() and set_entries()
    if ($select_fields !== FALSE) {
        return array('name_value_lists' => $ret_values, 'error' => $error->get_soap_array());
    } else {
        return array('ids' => $ids, 'error' => $error->get_soap_array());
    }
}
开发者ID:sunmo,项目名称:snowlotus,代码行数:101,代码来源:SoapSugarUsers.php

示例4: handle_set_entries


//.........这里部分代码省略.........
            if ($duplicate_id == null) {
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    //Now apply the values, since this is not a duplicate we can just pass false for the $firstSync argument
                    apply_values($seed, $dataValues, false);
                    $seed->save();
                    if ($seed->deleted == 1) {
                        $seed->mark_deleted($seed->id);
                    }
                    $ids[] = $seed->id;
                }
            } else {
                //since we found a duplicate we should set the sync flag
                if ($seed->ACLAccess('Save')) {
                    //Determine if this is a first time sync.  We find out based on whether or not a contacts_users relationship exists
                    $seed->id = $duplicate_id;
                    $seed->load_relationship("user_sync");
                    $beans = $seed->user_sync->getBeans();
                    $first_sync = empty($beans);
                    //Now apply the values and indicate whether or not this is a first time sync
                    apply_values($seed, $dataValues, $first_sync);
                    $seed->contacts_users_id = $current_user->id;
                    $seed->save();
                    $ids[] = $duplicate_id;
                    //we have a conflict
                }
            }
        } else {
            if ($module_name == 'Meetings' || $module_name == 'Calls') {
                //we are going to check if we have a meeting in the system
                //with the same outlook_id. If we do find one then we will grab that
                //id and save it
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    // Check if we're updating an old record, or creating a new
                    if (empty($seed->id)) {
                        // If it's a new one, and we have outlook_id set
                        // which means we're syncing from OPI check if it already exists
                        if (!empty($seed->outlook_id)) {
                            $GLOBALS['log']->debug('Looking for ' . $module_name . ' with outlook_id ' . $seed->outlook_id);
                            $fields = array('outlook_id' => $seed->outlook_id);
                            // Try to fetch a bean with this outlook_id
                            $temp = BeanFactory::getBean($module_name);
                            $temp = $temp->retrieve_by_string_fields($fields);
                            // If we fetched one, just copy the ID to the one we're syncing
                            if (!empty($temp)) {
                                $seed->id = $temp->id;
                            } else {
                                $GLOBALS['log']->debug('Looking for ' . $module_name . ' with name/date_start/duration_hours/duration_minutes ' . $seed->name . '/' . $seed->date_start . '/' . $seed->duration_hours . '/' . $seed->duration_minutes);
                                // If we didn't, try to find the meeting by comparing the passed
                                // Subject, start date and duration
                                $fields = array('name' => $seed->name, 'date_start' => $seed->date_start, 'duration_hours' => $seed->duration_hours, 'duration_minutes' => $seed->duration_minutes);
                                $temp = BeanFactory::getBean($module_name);
                                $temp = $temp->retrieve_by_string_fields($fields);
                                if (!empty($temp)) {
                                    $seed->id = $temp->id;
                                }
                            }
                            $GLOBALS['log']->debug($module_name . ' found: ' . !empty($seed->id));
                        }
                    }
                    if (empty($seed->reminder_time)) {
                        $seed->reminder_time = -1;
                    }
                    if ($seed->reminder_time == -1) {
                        $defaultRemindrTime = $current_user->getPreference('reminder_time');
                        if ($defaultRemindrTime != -1) {
                            $seed->reminder_checked = '1';
                            $seed->reminder_time = $defaultRemindrTime;
                        }
                    }
                    $seed->save();
                    if ($seed->deleted == 1) {
                        $seed->mark_deleted($seed->id);
                    }
                    $ids[] = $seed->id;
                }
                //fi
            } else {
                if ($seed->ACLAccess('Save') && ($seed->deleted != 1 || $seed->ACLAccess('Delete'))) {
                    $seed->save();
                    $ids[] = $seed->id;
                }
            }
        }
        // if somebody is calling set_entries_detail() and wants fields returned...
        if ($select_fields !== FALSE) {
            $ret_values[$count] = array();
            foreach ($select_fields as $select_field) {
                if (isset($seed->{$select_field})) {
                    $ret_values[$count][] = get_name_value($select_field, $seed->{$select_field});
                }
            }
        }
    }
    // handle returns for set_entries_detail() and set_entries()
    if ($select_fields !== FALSE) {
        return array('name_value_lists' => $ret_values, 'error' => $error->get_soap_array());
    } else {
        return array('ids' => $ids, 'error' => $error->get_soap_array());
    }
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:101,代码来源:SoapSugarUsers.php

示例5: array_get_name_value_list

function array_get_name_value_list($array)
{
    $list = array();
    foreach ($array as $name => $value) {
        $list[$name] = get_name_value($name, $value);
    }
    return $list;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:8,代码来源:SoapHelperFunctions.php


注:本文中的get_name_value函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。