Values are returned as a PodioCollection of PodioItem objects:
Setting values
Setting a single value can be done by setting values to a single PodioItem object or by passing in an associative array of the item structure. The following are identical:
When setting multiple values you can use a PodioCollection or an array of associative arrays. The following are identical:
Calculation field
Getting values
Value is provided as a string with four decimals. It’s often nicer to use humanized_value() which formats the number:
Calculation fields are read-only. It’s not possible to modify the value.
Category field
Getting values
Category and Question fields function in the same manner. Values are provided as an array of options.
Setting values
Set a single value by using the option_id. You can also add a value with add_value()
Use an array to set multiple values
Contact field
Getting values
Values are returned as a PodioCollection of PodioContact objects:
Setting values
Setting a single value can be done by setting values to a single PodioContact object or by passing in an associative array of the contact structure. The following are identical:
When setting multiple values you can use a PodioCollection or an array of associative arrays. The following are identical:
Date field
Getting values
Date field values have two components: The start date and the end date. You can access these through special properties, both are PHP DateTime objects. You can also access date and time sections individually. This is often preferred as the time component will be null for events without time.
Setting values
You can simply assign values to the special properties to modify the field value. Both DateTime objects and strings are accepted. DateTime objects can be provided in any timezone and will be converted to UTC. String values must be provided as UTC values.
Duration field
Getting values
Progress fields return a simple integer representing the duration in seconds. Often you will want to use humanized_value() for a formatted display. You can use hours(), minutes() and seconds() to avoid doing your own math.
Setting values
Simply assign a new integer to set the value
Image field
Getting values
Values are returned as a PodioCollection of PodioFile objects:
You can download the files as usual
Setting values
Setting a single value can be done by setting values to a single PodioFile object or by passing in an associative array of the file structure. You have to upload a file to get a file_id to use. The following are identical:
When setting multiple values you can use a PodioCollection or an array of associative arrays. The following are identical:
Link/Embed field
Getting values
Values are returned as a PodioCollection of PodioEmbed objects:
Setting values
Setting a single value can be done by setting values to a single PodioEmbed object or by passing in an associative array of the embed structure. You will need to create the embed first. The following are identical:
When setting multiple values you can use a PodioCollection or an array of associative arrays. The following are identical:
Location/Google Maps field
Getting values
Location fields returns an array with location data
Setting values
Set values using an array of location data
Money field
Getting values
Money field values have two components: The amount and the currency. You can access these through special properties. The amount is a string in order to support very large numbers. Often you’ll use humanized_value() which provides a formatted value.
Setting values
You can simply assign values to currency and amount properties to modify the value.
Number field
Getting values
The value of a number field is a string in order to support very large numbers. Use humanized_value() to get a formatted string.
Setting values
Simply assign a new string to set the value. Use a period “.” as the decimal point
Progress field
Getting values
Progress fields return a simple integer between 0 and 100.