コード例 #1
0
ファイル: Answer.php プロジェクト: advOpk/pwm
 /**
  * Returns the value
  *
  * @return mixed $value
  */
 public function getValue()
 {
     $value = $this->value;
     // if serialized, change to array
     if (Div::isJsonArray($this->value)) {
         // only if type multivalue or upload
         if ($this->getValueType() === 1 || $this->getValueType() === 3) {
             $value = json_decode($value);
         }
     }
     // if type date
     if ($this->getValueType() === 2 && is_numeric($value) && $this->getField() !== NULL) {
         $value = date(LocalizationUtility::translate('datepicker_format_' . $this->getField()->getDatepickerSettings(), 'powermail'), $value);
     }
     // if multitext or upload force array
     if (($this->getValueType() === 1 || $this->getValueType() === 3) && !is_array($value)) {
         $value = empty($value) ? array() : array(strval($value));
     }
     return $value;
 }
コード例 #2
0
ファイル: Mail.php プロジェクト: advOpk/pwm
 /**
  * @return array
  */
 public function getMarketingPageFunnel()
 {
     if (\In2code\Powermail\Utility\Div::isJsonArray($this->marketingPageFunnel)) {
         return json_decode($this->marketingPageFunnel);
     }
     return (array) $this->marketingPageFunnel;
 }