public function persist(PersistableInterface $persistable, $remember = false)
    {
        try
        {
            if ($this->single)
            {
                $this->flush($persistable);
            }

            $code = $persistable->generatePersistenceCode();

            $this->session->put($code);

            if ($remember === true) {
                $this->cookie->put($code);
            }

            $persistence = $this->create($persistable, $code);

            $entityManager = $this->getEntityManager();
            $entityManager->persist($persistence);
            $entityManager->flush();

            return true;
        }
        catch (\Exception $e)
        {
            return false;
        }
    }