CrudKit\Data\SQL\SQLColumn::prepareForClient PHP Метод

prepareForClient() публичный Метод

public prepareForClient ( $value )
    public function prepareForClient($value)
    {
        switch ($this->typeName) {
            case "number":
                return "" . floatval($value);
                break;
            case "string":
                return "" . $value;
                break;
            case "datetime":
                $timezone = isset($this->options['timezone']) ? $this->options['timezone'] : "UTC";
                $timeObject = Carbon::parse($value, $timezone);
                // Convert that into UTC
                $timeObject->setTimezone("UTC");
                return $timeObject->getTimestamp();
                break;
            case "date":
                $date = date_create($value);
                $date = date_format($date, 'm-d-Y');
                return $date;
                break;
            default:
                throw new \Exception("Unknown type {$this->typeName}");
        }
    }