Ejemplo n.º 1
0
 /**
  * Returns the value
  *
  * @return mixed $value
  */
 public function getValue()
 {
     $value = $this->value;
     // if serialized, change to array
     if (ArrayUtility::isJsonArray($this->value)) {
         // only if type multivalue or upload
         if ($this->getValueType() === 1 || $this->getValueType() === 3) {
             $value = json_decode($value, true);
         }
     }
     if ($this->isTypeDateForTimestamp($value)) {
         $value = date(LocalizationUtility::translate('datepicker_format_' . $this->getField()->getDatepickerSettings()), $value);
     }
     if ($this->isTypeMultiple($value)) {
         $value = empty($value) ? [] : [strval($value)];
     }
     return $value;
 }
Ejemplo n.º 2
0
 /**
  * Returns the value
  *
  * @return mixed $value
  */
 public function getValue()
 {
     $value = $this->value;
     // if serialized, change to array
     if (ArrayUtility::isJsonArray($this->value)) {
         // only if type multivalue or upload
         if ($this->getValueType() === 1 || $this->getValueType() === 3) {
             $value = json_decode($value, true);
         }
     }
     // if type date
     if ($this->getValueType() === 2 && is_numeric($value) && $this->getField() !== null) {
         $value = date(LocalizationUtility::translate('datepicker_format_' . $this->getField()->getDatepickerSettings()), $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;
 }
Ejemplo n.º 3
0
 /**
  * @return array
  */
 public function getMarketingPageFunnel()
 {
     if (ArrayUtility::isJsonArray($this->marketingPageFunnel)) {
         return json_decode($this->marketingPageFunnel);
     }
     return (array) $this->marketingPageFunnel;
 }
 /**
  * isJsonArray Test
  *
  * @param string $value
  * @param bool $expectedResult
  * @dataProvider isJsonArrayReturnsBoolDataProvider
  * @return void
  * @test
  */
 public function isJsonArrayReturnsBool($value, $expectedResult)
 {
     $this->assertSame($expectedResult, ArrayUtility::isJsonArray($value));
 }