You are here

public function UCXF_Field::__set in Extra Fields Checkout Pane 7

Same name and namespace in other branches
  1. 6.2 class/UCXF_Field.class.php \UCXF_Field::__set()

Setter

@access public

Parameters

string $p_sMember:

mixed $p_mValue:

Return value

boolean

1 call to UCXF_Field::__set()
UCXF_Field::from_array in class/UCXF_Field.class.php
Load an existing item from an array. @access public

File

class/UCXF_Field.class.php, line 108
Contains the UCXF_Field class.

Class

UCXF_Field
Base class for a Extra Fields Pane field

Code

public function __set($p_sMember, $p_mValue) {
  switch ($p_sMember) {
    case 'display_settings':
      if (is_string($p_mValue)) {
        $p_mValue = unserialize($p_mValue);
      }
      if (is_array($p_mValue)) {
        foreach ($p_mValue as $option_id => $display_setting) {
          $this->display_settings[$option_id] = $display_setting ? TRUE : FALSE;
        }
        return TRUE;
      }
      break;
    case 'pane_type':
      if (is_string($p_mValue)) {
        $pane_types = explode('|', $p_mValue);
        return $this
          ->__set('pane_type', $pane_types);
      }
      elseif (is_array($p_mValue)) {
        $this->pane_types = array();
        foreach ($p_mValue as $pane_type) {
          $pane_type = (string) $pane_type;
          if (!empty($pane_type)) {
            $this->pane_types[$pane_type] = $pane_type;
          }
        }
        return TRUE;
      }
    default:
      $this->{$p_sMember} = $p_mValue;
      return TRUE;
  }
  return FALSE;
}