Ejemplo n.º 1
0
 /**
  * Make sure array values are unserialized.
  *
  * @param IsotopeProduct $product
  *
  * @return mixed
  */
 public function getValue(IsotopeProduct $product)
 {
     $value = parent::getValue($product);
     if ('checkbox' === $this->fieldType) {
         $value = deserialize($value);
     }
     return (array) $value;
 }
 /**
  * Make sure array values are unserialized and CSV values are splitted.
  *
  * @param IsotopeProduct $product
  *
  * @return mixed
  */
 public function getValue(IsotopeProduct $product)
 {
     $value = parent::getValue($product);
     if ($this->multiple) {
         if ($this->optionsSource == 'table' || $this->optionsSource == 'foreignKey') {
             $value = explode(',', $value);
         } else {
             $value = deserialize($value);
         }
     }
     return $value;
 }