Skip to content

Instantly share code, notes, and snippets.

@mbn18
Created October 10, 2014 11:57
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 mbn18/7ea2f627de4b2220dc18 to your computer and use it in GitHub Desktop.
Save mbn18/7ea2f627de4b2220dc18 to your computer and use it in GitHub Desktop.
unset does not effect the object which is outside the method context
<?php
/**
* Delete an entity from the global identity map and all other queues
* @param AbstractDomainEntity $entity
*/
static public function unRegister(AbstractDomainEntity $entity)
{
$instance = self::getInstance();
$instance->registerClean($entity);
unset($instance->all[$instance->globalKey($entity)]);
unset($entity);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment