Skip to content

Instantly share code, notes, and snippets.

@pauletienney
Last active December 18, 2015 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauletienney/5763437 to your computer and use it in GitHub Desktop.
Save pauletienney/5763437 to your computer and use it in GitHub Desktop.
<?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