PodsField_Pick::display PHP Method

display() public method

Change the way the value of the field is displayed with Pods::get
Since: 2.0
public display ( mixed $value = null, string $name = null, array $options = null, array $pod = null, integer $id = null )
$value mixed
$name string
$options array
$pod array
$id integer
    public function display($value = null, $name = null, $options = null, $pod = null, $id = null)
    {
        $fields = null;
        if (is_object($pod) && isset($pod->fields)) {
            $fields = $pod->fields;
            if (!empty($pod->pod_data['object_fields'])) {
                $fields = array_merge($fields, $pod->pod_data['object_fields']);
            }
        } elseif (is_array($pod) && isset($pod['fields'])) {
            $fields = $pod['fields'];
            if (!empty($pod['object_fields'])) {
                $fields = array_merge($fields, $pod['object_fields']);
            }
        }
        return pods_serial_comma($value, array('field' => $name, 'fields' => $fields));
    }