Last active
December 18, 2015 09:39
-
-
Save pauletienney/5763437 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Sise\DesignBundle\Controller; | |
use Symfony\Component\HttpFoundation\Response, | |
Symfony\Bundle\FrameworkBundle\Controller\Controller, | |
eZ\Publish\Core\MVC\Symfony\Controller\Content\ViewController as APIViewController; | |
class UsersController extends APIViewController { | |
function makeGhostAccount($email, $lastName, $firstName) { | |
// This does not work | |
if ($this->hasNewEmailAddress($email)) { | |
} | |
return new Response(); | |
} | |
function hasNewEmailAddress($email) { | |
$user = $this->getLegacyKernel()->runCallback( | |
function () use ( $email ) { | |
return eZUser::fetchByEmail( $email ); | |
} | |
); | |
if ( $user instanceof eZUser ) { | |
return false; | |
} else { | |
return true; | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment