public function flatten_props($props)
    {
        foreach ($props as $property => $value) {
            if (is_object($value) && get_class($value) == 'DateTime') {
                $props[$property] = $value->format('Y-m-d H:i:s');
            } elseif (is_array($value)) {
                $props[$property] = serialize($value);
            } elseif ($value instanceof AbstractClass) {
                $props[$property] = $value->primary_key();
            }
        }

        return $props;
    }