Resolves json castable columns

@return array
338458
protected function resolveJsonCastableColumns(&$log)
    {
        foreach ($log as $name => $value) {
            if (!is_array($value)) {
                continue;
            }
            $log[$name] = json_encode($value);
        }
        return $log;
    }
897916
protected function getValuesJSON() {
		$value = $this->value;
		if($value instanceof SS_List) {
			$values = $value->column($this->idField);
		}
		else if(is_array($value)) {
			$values = array_keys($value);
		}
		else if(is_string($value)) {
			$values = explode(',', $value);
			$values = str_replace('{comma}', ',', $values);
		}

		return $this->formatJSON($this->source->filter(array(
			$this->idField => $values
		)));
	}
453624
public function jsonSerialize()
    {
        $allFields = parent::jsonSerialize();
        $compositeFields = CompositeDTOMapper::compositeFields(get_class($this));
        foreach ($compositeFields as $key) {
            if (isset($this->$key)) {
                $allFields[$key] = $this->resolveSubresource($key, $this->$key, $this->name());
            }
        }
        return $allFields;
    }
1208658
public function getColumns()
    {
        $rawColumns = substr($this->data, 64, 128);
        $columnsString = rtrim($rawColumns, "\0");
        return explode("\0", $columnsString);
    }
698951
public function attributesToArray()
    {
        if (!empty($this->json_columns)) {
            foreach ($this->json_columns as $column_name) {
                $this->attributes[$column_name] = (string) $this->json_values[$column_name];
            }
        }

        return parent::attributesToArray();
    }
83762
function jsonSerialize() {
		$array = $this->toArray();
		foreach (static::$_columns as $column_name => &$type) {
			if (!isset($array[$column_name])) {
				continue;
			}
			$value = &$array[$column_name];

			if ($type === Model::COLUMN_TYPE_BOOLEAN) {
				if (0 === $value) {
					$value = false;
				} elseif (1 === $value) {
					$value = true;
				}
			} else if (
				$type === Model::COLUMN_TYPE_TIMESTAMP
				|| $type === Model::COLUMN_TYPE_INTEGER_TIMESTAMP
			) {
				if (!$value) {
					$array[$column_name] = null;
					continue;
				}
				if (!is_int($value)) {
					$value = strtotime($value);
				}
				if (!is_int($value)) {
					throw new RuntimeException('Error parsing date "' . $array[$column_name] . '"');
				}
				$value = date('c', $value);
			}
		}
		return $array;
	}
695213
public function getArrayCopy()
    {
        $fields = $this->columns;

        foreach ($fields as $fieldName => $fieldValue) {
            if ($this->isJSON($fieldValue)) {
                $fields[ $fieldName ] = new Columns\DataJSON(json_decode($fieldValue, true));
            } elseif ($this->isSerialized($fieldValue)) {
                $fields[ $fieldName ] = new Columns\DataSerialize(unserialize($fieldValue));
            } else {
                $fields[ $fieldName ] = $fieldValue;
            }
        }

        return $fields;
    }
1327468
private function resolveElements()
    {
        foreach ($this->unresolvedColumns as $name => $info) {
            $this->columns[$name] = $this->createColumn($name, $info['type'], $info['options']);
        }
        $this->unresolvedColumns = [];

        foreach ($this->unresolvedFilters as $name => $info) {
            $this->filters[$name] = $this->createFilter($name, $info['type'], $info['options']);
        }
        $this->unresolvedFilters = [];

        foreach ($this->unresolvedActions as $name => $info) {
            $this->actions[$name] = $this->createAction($name, $info['type'], $info['options']);
        }
        $this->unresolvedActions = [];
    }
1001113
public function getColumnNames()
    {
        $columns = array();
        foreach ($this->columns as $refColumn) {
            $columns[] = $refColumn->getColumnName();
        }

        return $columns;
    }
822466
public function jsonSerialize()
    {
        // if formatting is requested, well then format baby!
        $config = $this->di->get('config');
        if ($config['application']['propertyFormatTo'] == 'none') {
            $attributes = $this->attributes;
        } else {
            $inflector = $this->di->get('inflector');
            $attributes = [];
            foreach ($this->attributes as $key => $value) {
                $attributes[$inflector->normalize($key,
                    $config['application']['propertyFormatTo'])] = $value;
            }
        }

        $result = [
            'id' => $this->id,
            'type' => $this->type,
            'attributes' => $attributes
        ];

        if ($this->relationships) {
            $result['relationships'] = $this->relationships;
        }

        return $result;
    }
260748
public function deriveColumns()
    {
        $derived = array();
        
        for ($i = 0; $i < count($this->columns); $i ++) {
            $derived[] = $this->deriveColumn($i);
        }
        
        return $derived;
    }
315300
public function getTableColumns() : array
    {
        if (!$this->isTableNameSet()) {
            return [];
        }
        
        $sql = "SHOW COLUMNS FROM `".$this->tableName."`";
        $stmt = $this->db->query($sql);
        $arrResult = $stmt->fetchAll(PDO::FETCH_ASSOC);
        return $arrResult;
    }
553280
public function jsonSerialize() {
    return array(
      'iso'  =>       $this->format(DATE_RFC2822),
      'sql'  =>       $this->format('Y-m-d H:i:s.u'),
      'tz'   =>       $this->format('T'),
      'unix' => (int) $this->format('U'),
    );
  }
993819
protected function exportableColumns(): array
    {
        if (method_exists($this->module, 'exportableColumns')) {
            return $this->module->exportableColumns();
        }

        /**
         * @var Model
         */
        $model = $this->module->model();

        return collect($model->getFillable())
            ->prepend('id')
            ->diff($model->getHidden())
            ->map(function ($column) use ($model) {
                return "{$model->getTable()}.{$column}";
            })
            ->when($model instanceof Translatable, function (Collection $collection) use ($model) {
                return $collection->merge(
                    collect($model->getTranslatedAttributes())
                        ->map(function ($column) use ($model) {
                            return "tt.{$column}";
                        })
                );
            })
            ->all();
    }
752656
public function jsonSerialize()
    {
        return [
            'draw'            => (int) $this->draw,
            'recordsTotal'    => (int) $this->recordsTotal,
            'recordsFiltered' => (int) $this->recordsFiltered,
            'data'            => $this->data,
        ];
    }
560268
public function jsonSerialize()
    {
        return array_filter(
            [
                'enable' => $this->getEnable(),
                'enable_text' => $this->getEnableText()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
616844
public static function getColumns()
    {
        $cls = get_called_class();
        if (!array_key_exists($cls, self::$_columns)) {
            return null;
        }
        return self::$_columns[$cls];
    }