private function createNestedSetNode(LifecycleEventArgs $args)
	{
		$entity = $args->getEntity();

		if ($entity instanceof EntityNodeInterface) {
			// Read entity data from the event arguments
			$em = $args->getEntityManager();
			
			// Find the repository
			$entityName = $entity->getNestedSetRepositoryClassName();
			$repository = $em->getRepository($entityName);
			
			// In case of refresh it already exists..
			$doctrineNode = $entity->getNestedSetNode();
			
			// .. create new if doesn't
			if ($doctrineNode === null) {
				// Initialize the doctrine nested set node
				$doctrineNode = new DoctrineNode($repository);
				$entity->setNestedSetNode($doctrineNode);
			}

			$doctrineNode->belongsTo($entity);
		}
	}
private function createNestedSetNode(LifecycleEventArgs $args)
	{
		$entity = $args->getEntity();

		if ($entity instanceof EntityNodeInterface) {
			// Read entity data from the event arguments
			$em = $args->getEntityManager();
			
			// Find the repository
			$entityName = $entity->getNestedSetRepositoryClassName();
			$repository = $em->getRepository($entityName);
			
			// In case of refresh it already exists..
			$doctrineNode = $entity->getNestedSetNode();
			
			// .. create new if doesn't
			if ($doctrineNode === null) {
				// Initialize the doctrine nested set node
				$doctrineNode = new DoctrineNode($repository);
				$entity->setNestedSetNode($doctrineNode);
			}

			$doctrineNode->belongsTo($entity);
		}
	}
private function createNestedSetNode ( LifecycleEventArgs $ args ) { $ entity = $ args -> getEntity ( ) ; if ( $ entity instanceof EntityNodeInterface ) { // Read entity data from the event arguments $ em = $ args -> getEntityManager ( ) ; // Find the repository $ entityName = $ entity -> getNestedSetRepositoryClassName ( ) ; $ repository = $ em -> getRepository ( $ entityName ) ; // In case of refresh it already exists.. $ doctrineNode = $ entity -> getNestedSetNode ( ) ; // .. create new if doesn't if ( $ doctrineNode === null ) { // Initialize the doctrine nested set node $ doctrineNode = new DoctrineNode ( $ repository ) ; $ entity -> setNestedSetNode ( $ doctrineNode ) ; } $ doctrineNode -> belongsTo ( $ entity ) ; } }
Creates the Doctrine nested set node
@param EntityManager $em
@param object $entity
Creates the Doctrine nested set node