57972c52525932146d426b8efb3f28adc51895f1
3 * Test Generated example demonstrating the Contact.getfields API.
5 * Demonstrates retrieving metadata with custom field options.
10 function contact_getfields_example() {
13 'get_options' => 'custom_1',
19 $result = civicrm_api3('Contact', 'getfields', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
28 'error_message' => $errorMessage,
29 'error_code' => $errorCode,
30 'error_data' => $errorData,
38 * Function returns array of result expected from previous function.
43 function contact_getfields_expectedresult() {
45 $expectedResult = array(
53 'title' => 'Contact ID',
54 'description' => 'Unique Contact ID',
57 'where' => 'civicrm_contact.id',
58 'headerPattern' => '/internal|contact?|id$/i',
60 'table_name' => 'civicrm_contact',
61 'entity' => 'Contact',
62 'bao' => 'CRM_Contact_BAO_Contact',
63 'api.aliases' => array(
67 'contact_type' => array(
68 'name' => 'contact_type',
70 'title' => 'Contact Type',
71 'description' => 'Type of Contact.',
75 'where' => 'civicrm_contact.contact_type',
76 'table_name' => 'civicrm_contact',
77 'entity' => 'Contact',
78 'bao' => 'CRM_Contact_BAO_Contact',
84 'pseudoconstant' => array(
85 'table' => 'civicrm_contact_type',
86 'keyColumn' => 'name',
87 'labelColumn' => 'label',
88 'condition' => 'parent_id IS NULL',
92 'contact_sub_type' => array(
93 'name' => 'contact_sub_type',
95 'title' => 'Contact Subtype',
96 'description' => 'May be used to over-ride contact view and edit templates.',
100 'where' => 'civicrm_contact.contact_sub_type',
101 'headerPattern' => '/C(ontact )?(subtype|sub-type|sub type)/i',
103 'table_name' => 'civicrm_contact',
104 'entity' => 'Contact',
105 'bao' => 'CRM_Contact_BAO_Contact',
111 'pseudoconstant' => array(
112 'table' => 'civicrm_contact_type',
113 'keyColumn' => 'name',
114 'labelColumn' => 'label',
115 'condition' => 'parent_id IS NOT NULL',
118 'do_not_email' => array(
119 'name' => 'do_not_email',
121 'title' => 'Do Not Email',
123 'where' => 'civicrm_contact.do_not_email',
124 'headerPattern' => '/d(o )?(not )?(email)/i',
125 'dataPattern' => '/^\\d{1,}$/',
127 'table_name' => 'civicrm_contact',
128 'entity' => 'Contact',
129 'bao' => 'CRM_Contact_BAO_Contact',
131 'type' => 'CheckBox',
134 'do_not_phone' => array(
135 'name' => 'do_not_phone',
137 'title' => 'Do Not Phone',
139 'where' => 'civicrm_contact.do_not_phone',
140 'headerPattern' => '/d(o )?(not )?(call|phone)/i',
141 'dataPattern' => '/^\\d{1,}$/',
143 'table_name' => 'civicrm_contact',
144 'entity' => 'Contact',
145 'bao' => 'CRM_Contact_BAO_Contact',
147 'type' => 'CheckBox',
150 'do_not_mail' => array(
151 'name' => 'do_not_mail',
153 'title' => 'Do Not Mail',
155 'where' => 'civicrm_contact.do_not_mail',
156 'headerPattern' => '/^(d(o\\s)?n(ot\\s)?mail)|(\\w*)?bulk\\s?(\\w*)$/i',
157 'dataPattern' => '/^\\d{1,}$/',
159 'table_name' => 'civicrm_contact',
160 'entity' => 'Contact',
161 'bao' => 'CRM_Contact_BAO_Contact',
163 'type' => 'CheckBox',
166 'do_not_sms' => array(
167 'name' => 'do_not_sms',
169 'title' => 'Do Not Sms',
171 'where' => 'civicrm_contact.do_not_sms',
172 'headerPattern' => '/d(o )?(not )?(sms)/i',
173 'dataPattern' => '/^\\d{1,}$/',
175 'table_name' => 'civicrm_contact',
176 'entity' => 'Contact',
177 'bao' => 'CRM_Contact_BAO_Contact',
179 'type' => 'CheckBox',
182 'do_not_trade' => array(
183 'name' => 'do_not_trade',
185 'title' => 'Do Not Trade',
187 'where' => 'civicrm_contact.do_not_trade',
188 'headerPattern' => '/d(o )?(not )?(trade)/i',
189 'dataPattern' => '/^\\d{1,}$/',
191 'table_name' => 'civicrm_contact',
192 'entity' => 'Contact',
193 'bao' => 'CRM_Contact_BAO_Contact',
195 'type' => 'CheckBox',
198 'is_opt_out' => array(
199 'name' => 'is_opt_out',
201 'title' => 'No Bulk Emails (User Opt Out)',
202 'description' => 'Has the contact opted out from receiving all bulk email from the organization or site domain?',
205 'where' => 'civicrm_contact.is_opt_out',
207 'table_name' => 'civicrm_contact',
208 'entity' => 'Contact',
209 'bao' => 'CRM_Contact_BAO_Contact',
211 'type' => 'CheckBox',
214 'legal_identifier' => array(
215 'name' => 'legal_identifier',
217 'title' => 'Legal Identifier',
218 'description' => 'May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.
223 'where' => 'civicrm_contact.legal_identifier',
224 'headerPattern' => '/legal\\s?id/i',
225 'dataPattern' => '/\\w+?\\d{5,}/',
227 'table_name' => 'civicrm_contact',
228 'entity' => 'Contact',
229 'bao' => 'CRM_Contact_BAO_Contact',
236 'external_identifier' => array(
237 'name' => 'external_identifier',
239 'title' => 'External Identifier',
240 'description' => 'Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.',
244 'where' => 'civicrm_contact.external_identifier',
245 'headerPattern' => '/external\\s?id/i',
246 'dataPattern' => '/^\\d{11,}$/',
248 'table_name' => 'civicrm_contact',
249 'entity' => 'Contact',
250 'bao' => 'CRM_Contact_BAO_Contact',
257 'sort_name' => array(
258 'name' => 'sort_name',
260 'title' => 'Sort Name',
261 'description' => 'Name used for sorting different contact types',
265 'where' => 'civicrm_contact.sort_name',
266 'table_name' => 'civicrm_contact',
267 'entity' => 'Contact',
268 'bao' => 'CRM_Contact_BAO_Contact',
275 'display_name' => array(
276 'name' => 'display_name',
278 'title' => 'Display Name',
279 'description' => 'Formatted name representing preferred format for display/print/other output.',
283 'where' => 'civicrm_contact.display_name',
284 'table_name' => 'civicrm_contact',
285 'entity' => 'Contact',
286 'bao' => 'CRM_Contact_BAO_Contact',
293 'nick_name' => array(
294 'name' => 'nick_name',
296 'title' => 'Nickname',
297 'description' => 'Nickname.',
301 'where' => 'civicrm_contact.nick_name',
302 'headerPattern' => '/n(ick\\s)name|nick$/i',
303 'dataPattern' => '/^\\w+$/',
305 'table_name' => 'civicrm_contact',
306 'entity' => 'Contact',
307 'bao' => 'CRM_Contact_BAO_Contact',
314 'legal_name' => array(
315 'name' => 'legal_name',
317 'title' => 'Legal Name',
318 'description' => 'Legal Name.',
322 'where' => 'civicrm_contact.legal_name',
323 'headerPattern' => '/^legal|(l(egal\\s)?name)$/i',
325 'table_name' => 'civicrm_contact',
326 'entity' => 'Contact',
327 'bao' => 'CRM_Contact_BAO_Contact',
334 'image_URL' => array(
335 'name' => 'image_URL',
337 'title' => 'Image Url',
338 'description' => 'optional URL for preferred image (photo, logo, etc.) to display for this contact.',
340 'where' => 'civicrm_contact.image_URL',
342 'table_name' => 'civicrm_contact',
343 'entity' => 'Contact',
344 'bao' => 'CRM_Contact_BAO_Contact',
351 'preferred_communication_method' => array(
352 'name' => 'preferred_communication_method',
354 'title' => 'Preferred Communication Method',
355 'description' => 'What is the preferred mode of communication.',
359 'where' => 'civicrm_contact.preferred_communication_method',
360 'headerPattern' => '/^p(ref\\w*\\s)?c(omm\\w*)|( meth\\w*)$/i',
361 'dataPattern' => '/^\\w+$/',
363 'table_name' => 'civicrm_contact',
364 'entity' => 'Contact',
365 'bao' => 'CRM_Contact_BAO_Contact',
371 'pseudoconstant' => array(
372 'optionGroupName' => 'preferred_communication_method',
373 'optionEditPath' => 'civicrm/admin/options/preferred_communication_method',
376 'preferred_language' => array(
377 'name' => 'preferred_language',
379 'title' => 'Preferred Language',
380 'description' => 'Which language is preferred for communication. FK to languages in civicrm_option_value.',
384 'where' => 'civicrm_contact.preferred_language',
385 'headerPattern' => '/^lang/i',
387 'table_name' => 'civicrm_contact',
388 'entity' => 'Contact',
389 'bao' => 'CRM_Contact_BAO_Contact',
395 'pseudoconstant' => array(
396 'optionGroupName' => 'languages',
397 'keyColumn' => 'name',
398 'optionEditPath' => 'civicrm/admin/options/languages',
401 'preferred_mail_format' => array(
402 'name' => 'preferred_mail_format',
404 'title' => 'Preferred Mail Format',
405 'description' => 'What is the preferred mode of sending an email.',
409 'where' => 'civicrm_contact.preferred_mail_format',
410 'headerPattern' => '/^p(ref\\w*\\s)?m(ail\\s)?f(orm\\w*)$/i',
413 'table_name' => 'civicrm_contact',
414 'entity' => 'Contact',
415 'bao' => 'CRM_Contact_BAO_Contact',
421 'pseudoconstant' => array(
422 'callback' => 'CRM_Core_SelectValues::pmf',
428 'title' => 'Contact Hash',
429 'description' => 'Key for validating requests related to this contact.',
433 'where' => 'civicrm_contact.hash',
434 'table_name' => 'civicrm_contact',
435 'entity' => 'Contact',
436 'bao' => 'CRM_Contact_BAO_Contact',
441 'title' => 'Api Key',
442 'description' => 'API Key for validating requests related to this contact.',
445 'table_name' => 'civicrm_contact',
446 'entity' => 'Contact',
447 'bao' => 'CRM_Contact_BAO_Contact',
449 'first_name' => array(
450 'name' => 'first_name',
452 'title' => 'First Name',
453 'description' => 'First Name.',
457 'where' => 'civicrm_contact.first_name',
458 'headerPattern' => '/^first|(f(irst\\s)?name)$/i',
459 'dataPattern' => '/^\\w+$/',
461 'table_name' => 'civicrm_contact',
462 'entity' => 'Contact',
463 'bao' => 'CRM_Contact_BAO_Contact',
470 'middle_name' => array(
471 'name' => 'middle_name',
473 'title' => 'Middle Name',
474 'description' => 'Middle Name.',
478 'where' => 'civicrm_contact.middle_name',
479 'headerPattern' => '/^middle|(m(iddle\\s)?name)$/i',
480 'dataPattern' => '/^\\w+$/',
482 'table_name' => 'civicrm_contact',
483 'entity' => 'Contact',
484 'bao' => 'CRM_Contact_BAO_Contact',
491 'last_name' => array(
492 'name' => 'last_name',
494 'title' => 'Last Name',
495 'description' => 'Last Name.',
499 'where' => 'civicrm_contact.last_name',
500 'headerPattern' => '/^last|(l(ast\\s)?name)$/i',
501 'dataPattern' => '/^\\w+(\\s\\w+)?+$/',
503 'table_name' => 'civicrm_contact',
504 'entity' => 'Contact',
505 'bao' => 'CRM_Contact_BAO_Contact',
512 'prefix_id' => array(
513 'name' => 'prefix_id',
515 'title' => 'Individual Prefix',
516 'description' => 'Prefix or Title for name (Ms, Mr...). FK to prefix ID',
518 'where' => 'civicrm_contact.prefix_id',
519 'headerPattern' => '/^(prefix|title)/i',
520 'dataPattern' => '/^(mr|ms|mrs|sir|dr)\\.?$/i',
522 'table_name' => 'civicrm_contact',
523 'entity' => 'Contact',
524 'bao' => 'CRM_Contact_BAO_Contact',
530 'pseudoconstant' => array(
531 'optionGroupName' => 'individual_prefix',
532 'optionEditPath' => 'civicrm/admin/options/individual_prefix',
534 'api.aliases' => array(
535 '0' => 'individual_prefix',
536 '1' => 'individual_prefix_id',
539 'suffix_id' => array(
540 'name' => 'suffix_id',
542 'title' => 'Individual Suffix',
543 'description' => 'Suffix for name (Jr, Sr...). FK to suffix ID',
545 'where' => 'civicrm_contact.suffix_id',
546 'headerPattern' => '/^suffix$/i',
547 'dataPattern' => '/^(sr|jr)\\.?|i{2,}$/',
549 'table_name' => 'civicrm_contact',
550 'entity' => 'Contact',
551 'bao' => 'CRM_Contact_BAO_Contact',
557 'pseudoconstant' => array(
558 'optionGroupName' => 'individual_suffix',
559 'optionEditPath' => 'civicrm/admin/options/individual_suffix',
561 'api.aliases' => array(
562 '0' => 'individual_suffix',
563 '1' => 'individual_suffix_id',
566 'formal_title' => array(
567 'name' => 'formal_title',
569 'title' => 'Formal Title',
570 'description' => 'Formal (academic or similar) title in front of name. (Prof., Dr. etc.)',
574 'where' => 'civicrm_contact.formal_title',
575 'headerPattern' => '/^title/i',
577 'table_name' => 'civicrm_contact',
578 'entity' => 'Contact',
579 'bao' => 'CRM_Contact_BAO_Contact',
586 'communication_style_id' => array(
587 'name' => 'communication_style_id',
589 'title' => 'Communication Style',
590 'description' => 'Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.',
592 'where' => 'civicrm_contact.communication_style_id',
593 'table_name' => 'civicrm_contact',
594 'entity' => 'Contact',
595 'bao' => 'CRM_Contact_BAO_Contact',
601 'pseudoconstant' => array(
602 'optionGroupName' => 'communication_style',
603 'optionEditPath' => 'civicrm/admin/options/communication_style',
606 'email_greeting_id' => array(
607 'name' => 'email_greeting_id',
609 'title' => 'Email Greeting ID',
610 'description' => 'FK to civicrm_option_value.id, that has to be valid registered Email Greeting.',
611 'table_name' => 'civicrm_contact',
612 'entity' => 'Contact',
613 'bao' => 'CRM_Contact_BAO_Contact',
615 'email_greeting_custom' => array(
616 'name' => 'email_greeting_custom',
618 'title' => 'Email Greeting Custom',
619 'description' => 'Custom Email Greeting.',
623 'where' => 'civicrm_contact.email_greeting_custom',
624 'table_name' => 'civicrm_contact',
625 'entity' => 'Contact',
626 'bao' => 'CRM_Contact_BAO_Contact',
633 'email_greeting_display' => array(
634 'name' => 'email_greeting_display',
636 'title' => 'Email Greeting',
637 'description' => 'Cache Email Greeting.',
640 'table_name' => 'civicrm_contact',
641 'entity' => 'Contact',
642 'bao' => 'CRM_Contact_BAO_Contact',
649 'postal_greeting_id' => array(
650 'name' => 'postal_greeting_id',
652 'title' => 'Postal Greeting ID',
653 'description' => 'FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.',
654 'table_name' => 'civicrm_contact',
655 'entity' => 'Contact',
656 'bao' => 'CRM_Contact_BAO_Contact',
663 'postal_greeting_custom' => array(
664 'name' => 'postal_greeting_custom',
666 'title' => 'Postal Greeting Custom',
667 'description' => 'Custom Postal greeting.',
671 'where' => 'civicrm_contact.postal_greeting_custom',
672 'table_name' => 'civicrm_contact',
673 'entity' => 'Contact',
674 'bao' => 'CRM_Contact_BAO_Contact',
681 'postal_greeting_display' => array(
682 'name' => 'postal_greeting_display',
684 'title' => 'Postal Greeting',
685 'description' => 'Cache Postal greeting.',
688 'table_name' => 'civicrm_contact',
689 'entity' => 'Contact',
690 'bao' => 'CRM_Contact_BAO_Contact',
697 'addressee_id' => array(
698 'name' => 'addressee_id',
700 'title' => 'Addressee ID',
701 'description' => 'FK to civicrm_option_value.id, that has to be valid registered Addressee.',
702 'table_name' => 'civicrm_contact',
703 'entity' => 'Contact',
704 'bao' => 'CRM_Contact_BAO_Contact',
706 'addressee_custom' => array(
707 'name' => 'addressee_custom',
709 'title' => 'Addressee Custom',
710 'description' => 'Custom Addressee.',
714 'where' => 'civicrm_contact.addressee_custom',
715 'table_name' => 'civicrm_contact',
716 'entity' => 'Contact',
717 'bao' => 'CRM_Contact_BAO_Contact',
724 'addressee_display' => array(
725 'name' => 'addressee_display',
727 'title' => 'Addressee',
728 'description' => 'Cache Addressee.',
731 'table_name' => 'civicrm_contact',
732 'entity' => 'Contact',
733 'bao' => 'CRM_Contact_BAO_Contact',
740 'job_title' => array(
741 'name' => 'job_title',
743 'title' => 'Job Title',
744 'description' => 'Job Title',
748 'where' => 'civicrm_contact.job_title',
749 'headerPattern' => '/^job|(j(ob\\s)?title)$/i',
750 'dataPattern' => '//',
752 'table_name' => 'civicrm_contact',
753 'entity' => 'Contact',
754 'bao' => 'CRM_Contact_BAO_Contact',
761 'gender_id' => array(
762 'name' => 'gender_id',
765 'description' => 'FK to gender ID',
767 'where' => 'civicrm_contact.gender_id',
768 'headerPattern' => '/^gender$/i',
770 'table_name' => 'civicrm_contact',
771 'entity' => 'Contact',
772 'bao' => 'CRM_Contact_BAO_Contact',
778 'pseudoconstant' => array(
779 'optionGroupName' => 'gender',
780 'optionEditPath' => 'civicrm/admin/options/gender',
782 'api.aliases' => array(
786 'birth_date' => array(
787 'name' => 'birth_date',
789 'title' => 'Birth Date',
790 'description' => 'Date of birth',
792 'where' => 'civicrm_contact.birth_date',
793 'headerPattern' => '/^birth|(b(irth\\s)?date)|D(\\W*)O(\\W*)B(\\W*)$/i',
794 'dataPattern' => '/\\d{4}-?\\d{2}-?\\d{2}/',
796 'table_name' => 'civicrm_contact',
797 'entity' => 'Contact',
798 'bao' => 'CRM_Contact_BAO_Contact',
800 'type' => 'Select Date',
804 'is_deceased' => array(
805 'name' => 'is_deceased',
807 'title' => 'Deceased',
809 'where' => 'civicrm_contact.is_deceased',
810 'headerPattern' => '/i(s\\s)?d(eceased)$/i',
812 'table_name' => 'civicrm_contact',
813 'entity' => 'Contact',
814 'bao' => 'CRM_Contact_BAO_Contact',
816 'type' => 'CheckBox',
819 'deceased_date' => array(
820 'name' => 'deceased_date',
822 'title' => 'Deceased Date',
823 'description' => 'Date of deceased',
825 'where' => 'civicrm_contact.deceased_date',
826 'headerPattern' => '/^deceased|(d(eceased\\s)?date)$/i',
828 'table_name' => 'civicrm_contact',
829 'entity' => 'Contact',
830 'bao' => 'CRM_Contact_BAO_Contact',
832 'type' => 'Select Date',
836 'household_name' => array(
837 'name' => 'household_name',
839 'title' => 'Household Name',
840 'description' => 'Household Name.',
844 'where' => 'civicrm_contact.household_name',
845 'headerPattern' => '/^household|(h(ousehold\\s)?name)$/i',
846 'dataPattern' => '/^\\w+$/',
848 'table_name' => 'civicrm_contact',
849 'entity' => 'Contact',
850 'bao' => 'CRM_Contact_BAO_Contact',
857 'primary_contact_id' => array(
858 'name' => 'primary_contact_id',
860 'title' => 'Household Primary Contact ID',
861 'description' => 'Optional FK to Primary Contact for this household.',
862 'table_name' => 'civicrm_contact',
863 'entity' => 'Contact',
864 'bao' => 'CRM_Contact_BAO_Contact',
865 'FKClassName' => 'CRM_Contact_DAO_Contact',
871 'FKApiName' => 'Contact',
873 'organization_name' => array(
874 'name' => 'organization_name',
876 'title' => 'Organization Name',
877 'description' => 'Organization Name.',
881 'where' => 'civicrm_contact.organization_name',
882 'headerPattern' => '/^organization|(o(rganization\\s)?name)$/i',
883 'dataPattern' => '/^\\w+$/',
885 'table_name' => 'civicrm_contact',
886 'entity' => 'Contact',
887 'bao' => 'CRM_Contact_BAO_Contact',
895 'name' => 'sic_code',
897 'title' => 'Sic Code',
898 'description' => 'Standard Industry Classification Code.',
902 'where' => 'civicrm_contact.sic_code',
903 'headerPattern' => '/^sic|(s(ic\\s)?code)$/i',
905 'table_name' => 'civicrm_contact',
906 'entity' => 'Contact',
907 'bao' => 'CRM_Contact_BAO_Contact',
914 'user_unique_id' => array(
915 'name' => 'user_unique_id',
917 'title' => 'Unique ID (OpenID)',
918 'description' => 'the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM',
922 'where' => 'civicrm_contact.user_unique_id',
923 'headerPattern' => '/^Open\\s?ID|u(niq\\w*)?\\s?ID/i',
924 'dataPattern' => '/^[\\w\\/\\:\\.]+$/',
927 'table_name' => 'civicrm_contact',
928 'entity' => 'Contact',
929 'bao' => 'CRM_Contact_BAO_Contact',
936 'created_date' => array(
937 'name' => 'created_date',
939 'title' => 'Created Date',
940 'description' => 'When was the contact was created.',
943 'where' => 'civicrm_contact.created_date',
945 'table_name' => 'civicrm_contact',
946 'entity' => 'Contact',
947 'bao' => 'CRM_Contact_BAO_Contact',
949 'modified_date' => array(
950 'name' => 'modified_date',
952 'title' => 'Modified Date',
953 'description' => 'When was the contact (or closely related entity) was created or modified or deleted.',
956 'where' => 'civicrm_contact.modified_date',
957 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
958 'table_name' => 'civicrm_contact',
959 'entity' => 'Contact',
960 'bao' => 'CRM_Contact_BAO_Contact',
965 'title' => 'Contact Source',
966 'description' => 'where contact come from, e.g. import, donate module insert...',
970 'where' => 'civicrm_contact.source',
971 'headerPattern' => '/(C(ontact\\s)?Source)$/i',
973 'table_name' => 'civicrm_contact',
974 'entity' => 'Contact',
975 'bao' => 'CRM_Contact_BAO_Contact',
981 'uniqueName' => 'contact_source',
983 'employer_id' => array(
984 'name' => 'employer_id',
986 'title' => 'Current Employer',
987 'description' => 'OPTIONAL FK to civicrm_contact record.',
989 'where' => 'civicrm_contact.employer_id',
990 'table_name' => 'civicrm_contact',
991 'entity' => 'Contact',
992 'bao' => 'CRM_Contact_BAO_Contact',
993 'FKClassName' => 'CRM_Contact_DAO_Contact',
995 'type' => 'EntityRef',
999 'uniqueName' => 'current_employer_id',
1000 'FKApiName' => 'Contact',
1002 'is_deleted' => array(
1003 'name' => 'is_deleted',
1005 'title' => 'Contact is in Trash',
1008 'where' => 'civicrm_contact.is_deleted',
1009 'table_name' => 'civicrm_contact',
1010 'entity' => 'Contact',
1011 'bao' => 'CRM_Contact_BAO_Contact',
1013 'type' => 'CheckBox',
1015 'uniqueName' => 'contact_is_deleted',
1017 'custom_1' => array(
1018 'label' => 'Our special field',
1019 'groupTitle' => 'select_test_g',
1020 'data_type' => 'String',
1021 'html_type' => 'Select',
1022 'default_value' => '',
1023 'text_length' => '',
1024 'options_per_line' => '',
1025 'custom_group_id' => '1',
1026 'extends' => 'Contact',
1027 'is_search_range' => 0,
1028 'extends_entity_column_value' => '',
1029 'extends_entity_column_id' => '',
1032 'option_group_id' => '105',
1033 'date_format' => '',
1034 'time_format' => '',
1035 'is_required' => '1',
1036 'table_name' => 'civicrm_value_select_test_g_1',
1037 'column_name' => 'our_special_field_1',
1038 'pseudoconstant' => array(
1039 'optionGroupName' => 'our_special_field_20170207021937',
1040 'optionEditPath' => 'civicrm/admin/options/our_special_field_20170207021937',
1042 'name' => 'custom_1',
1043 'title' => 'Our special field',
1050 'current_employer' => array(
1051 'title' => 'Current Employer',
1052 'description' => 'Name of Current Employer',
1054 'name' => 'current_employer',
1056 'dupe_check' => array(
1057 'title' => 'Check for Duplicates',
1058 'description' => 'Throw error if contact create matches dedupe rule',
1060 'name' => 'dupe_check',
1065 return $expectedResult;
1069 * This example has been generated from the API test suite.
1070 * The test that created it is called "testCustomFieldCreateWithOptionValues"
1071 * and can be found at:
1072 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
1074 * You can see the outcome of the API tests at
1075 * https://test.civicrm.org/job/CiviCRM-master-git/
1077 * To Learn about the API read
1078 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
1080 * Browse the api on your own site with the api explorer
1081 * http://MYSITE.ORG/path/to/civicrm/api
1083 * Read more about testing here
1084 * http://wiki.civicrm.org/confluence/display/CRM/Testing
1086 * API Standards documentation:
1087 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards