public function serialize(array $unserialized = null)
    {

        // do nothing, if the passed value is empty or NULL
        if ($unserialized === null || $unserialized === '') {
            return;
        }

        // load the global configuration
        $configuration = $this->getConfiguration();

        // initializet delimiter, enclosure and escape char
        $delimiter = $this->getDelimiter() ? $this->getDelimiter() : $configuration->getDelimiter();
        $enclosure = $configuration->getEnclosure();
        $escape = $configuration->getEscape();

        // create hte callback method to enclose/escape the values
        $callback = function ($value) use ($enclosure, $escape) {
            return $enclosure . str_replace($escape, $escape . $escape, $value) . $enclosure;
        };

        // implode and return the enclosed/escaped values
        return implode($delimiter, array_map($callback, $unserialized));
    }