Baikal\FrontendBundle\Controller\Addressbook\FormController::getSuccessFunction PHP Method

getSuccessFunction() protected method

protected getSuccessFunction ( Baikal\SystemBundle\Entity\User $user )
$user Baikal\SystemBundle\Entity\User
    protected function getSuccessFunction(User $user)
    {
        $that = $this;
        return function ($form, Addressbook $addressbook, $isNew) use($user, $that) {
            $that->get('session')->getFlashBag()->add('notice', 'Addressbook <i class="fa fa-book"></i> <strong>' . htmlspecialchars($addressbook->getDisplayname()) . '</strong> has been ' . ($isNew ? 'created' : 'updated') . '.');
            return $that->redirect($that->generateUrl('baikal_frontend_addressbook_list'));
        };
    }