private static function convertGraphNodeDateTimesToStrings(array $data)
    {
        $date_format = 'Y-m-d H:i:s';
        $model_name = get_class(new static());
        if (property_exists($model_name, 'graph_node_date_time_to_string_format')) {
            $date_format = static::$graph_node_date_time_to_string_format;
        }

        foreach ($data as $key => $value) {
            if ($value instanceof \DateTime) {
                $data[$key] = $value->format($date_format);
            }
        }

        return $data;
    }
private static function convertGraphNodeDateTimesToStrings(array $data)
    {
        $date_format = 'Y-m-d H:i:s';
        $model_name = get_class(new static());
        if (property_exists($model_name, 'graph_node_date_time_to_string_format')) {
            $date_format = static::$graph_node_date_time_to_string_format;
        }

        foreach ($data as $key => $value) {
            if ($value instanceof \DateTime) {
                $data[$key] = $value->format($date_format);
            }
        }

        return $data;
    }
private static function convertGraphNodeDateTimesToStrings ( array $ data ) { $ date_format = 'Y-m-d H:i:s' ; $ model_name = get_class ( new static ( ) ) ; if ( property_exists ( $ model_name , 'graph_node_date_time_to_string_format' ) ) { $ date_format = static :: $ graph_node_date_time_to_string_format ; } foreach ( $ data as $ key => $ value ) { if ( $ value instanceof \ DateTime ) { $ data [ $ key ] = $ value -> format ( $ date_format ) ; } } return $ data ; }
Convert instances of \DateTime to string

@param array $data
@return array
Convert instances of \ DateTime to string