Get a mapper for a given entity.

@param string $entityName

@return Spot\Mapper

@author Ronan Chilvers <ronan@d3r.com>
965548
public function mapper($entityName)
    {
        if (!class_exists($entityName)) {
            throw new \Exception('Unable to get mapper for unknown entity class '.$entityName);
        }
        $locator = $this['spot2.locator'];

        return $locator->mapper($entityName);
    }
1351443
public function &__get($name) {
    if ($name === 'guid') {
      return $this->$name;
    }
    if ($this->isASleepingReference) {
      $this->referenceWake();
    }
    if ($name === 'cdate'
        || $name === 'mdate'
        || $name === 'tags'
      ) {
      return $this->$name;
    }
    // Unserialize.
    if (isset($this->sdata[$name])) {
      $this->data[$name] = unserialize($this->sdata[$name]);
      unset($this->sdata[$name]);
    }
    // Check for an entity first.
    if (isset($this->entityCache[$name])) {
      if ($this->data[$name][0] === 'nymph_entity_reference') {
        if ($this->entityCache[$name] === 0) {
          // The entity hasn't been loaded yet, so load it now.
          $className = $this->data[$name][2];
          if (!class_exists($className)) {
            throw new Exceptions\EntityCorruptedException(
                "Entity reference refers to a class that can't be found, ".
                "$className."
            );
          }
          $this->entityCache[$name] =
              $className::factoryReference($this->data[$name]);
          $this->entityCache[$name]->useSkipAc($this->useSkipAc);
        }
        return $this->entityCache[$name];
      } else {
        throw new Exceptions\EntityCorruptedException(
            "Entity data has become corrupt and cannot be determined."
        );
      }
    }
    // Check if it's set.
    if (!isset($this->data[$name])) {
      // Since we must return by reference, we have to use a constant here. If
      // we return $this->data[$name], an entry will be created in data.
      return $this->NULL_CONST;
    }
    // If it's not an entity, return the regular value.
    try {
      if (is_array($this->data[$name])) {
        // But, if it's an array, check all the values for entity references,
        // and change them.
        array_walk($this->data[$name], [$this, 'referenceToEntity']);
      } elseif (is_object($this->data[$name])
                && !(
                  (
                    is_a($this->data[$name], '\Nymph\Entity')
                    || is_a($this->data[$name], '\SciActive\HookOverride')
                  )
                  && is_callable([$this->data[$name], 'toReference'])
                )) {
        // Only do this for non-entity objects.
        foreach ($this->data[$name] as &$curProperty) {
          $this->referenceToEntity($curProperty, null);
        }
        unset($curProperty);
      }
    } catch (Exceptions\EntityClassNotFoundException $e) {
      throw new Exceptions\EntityCorruptedException($e->getMessage());
    }
    return $this->data[$name];
  }
394852
protected function getter($name)
    {
        $value = parent::getter($name);
        $name = $this->getProperty($name);
        if (null == $value) {
            $relMap = EntityDescriptorRegistry::getInstance()
                ->getDescriptorFor(get_class($this))
                ->getRelationsMap();
            if ($relMap->containsKey($name)) {
                $value = $relMap->get($name)->load($this);
            }
        }
        return $value;
    }
81566
public function create(string $className)
    {
        if (array_key_exists($className, $this->cache)) {
            return $this->cache[$className];
        }

        if (!class_exists($className)) {
            throw new RuntimeException("Mapper not found. Attempted to load '{$className}'.");
        }

        $instance = new $className($this->connection, $this->table);
        $this->cache[$className] = $instance;

        return $instance;
    }
1068011
private function readDefinition($entityName)
    {
        $this->getDispatcher()->dispatch('onCreateDefinition', new CreateDefinitionEvent($entityName, $this));

        $entity          = new Entity;
        $this->reflector = new EntityReflector($entity);
        $filename        = $this->locateDescription($entityName);
        $definition      = $this->parseDescription($filename, $entityName);
        $this->reflector->setDefinition($definition);
        $this->entities[$definition->class] = $entity;

        $this->alias[$definition->name] = $definition->class;

        $this->setIdAccessors($definition->class, $entity->key());

        $this->getDispatcher()->dispatch(
            'onDefinitionCreated',
            new DefinitionCreatedEvent($definition->class, $definition, $this)
        );

        return $definition->class;
    }
1269236
public function getRepository(EntityManagerInterface $entityManager, $entityName)
    {
        if (!in_array($entityName, $this->alreadyChecked) && isset($this->customEntyRepository[$entityName])) {
            $repositoryClass = $this->customEntyRepository[$entityName];
            if (!class_exists($repositoryClass)) {
                throw new \InvalidArgumentException(sprintf(
                    'Class %s does not exist. Cannot be used as %s custom repository.',
                    $repositoryClass,
                    $entityName
                ));
            }

            $metadata = $entityManager->getClassMetadata($entityName);
            $metadata->customRepositoryClassName = $repositoryClass;
        }

        $this->alreadyChecked[] = $entityName;

        return parent::getRepository($entityManager, $entityName);
    }
1188245
protected function getEntityMapInstanceFor($entity)
    {
        // First, we'll try to load the entity map from cache, to
        // save from time consuming parsing of the relationships
        $entityMap = $this->getEntityMapInstanceFromCache($entity);

        if ($entityMap !== null) {
            return $entityMap;
        }

        if (class_exists($entity.'Map')) {
            $map = $entity.'Map';
            $map = new $map();

            return $map;
        }

        if ($map = $this->getMapFromNamespaces($entity)) {
            return $map;
        }

        if ($this->strictMode) {
            throw new EntityMapNotFoundException("No Map registered for $entity");
        }

        $map = $this->getNewEntityMap();

        return $map;
    }
1062170
final static public function getMappedProperty($fieldName) {
		
		$binds = static::getBinds();
		return in_array($fieldName, $binds) ? array_search($fieldName, $binds) : NULL;
		
	}
88940
public function getNamedNativeQuery($queryName)
    {
        if ( ! isset($this->namedNativeQueries[$queryName])) {
            throw MappingException::queryNotFound($this->name, $queryName);
        }

        return $this->namedNativeQueries[$queryName];
    }
1118845
public function getMetadataFor($className)
    {
        $metadata = parent::getMetadataFor($className);
        if ($metadata) {
            return $metadata;
        }

        throw MappingException::classNotMapped($className);
    }
837702
public function getPropertyMetadata($propertyName)
    {
        if (!isset($this->propertyMetadata[$propertyName])) {
            throw MappingException::mappingNotFound($this->name, $propertyName);
        }

        return $this->propertyMetadata[$propertyName];
    }
1171255
public function getRepository(EntityManagerInterface $entityManager, $entityName)
    {
        return $this->repositorySubManager->get($this->entityRepositoryMapping->getRepositoryByEntity($entityName));
    }
18914
public function readOne($entityName)
    {
        return new ReadOneQuery(
            $this->connection,
            $this->models->get($entityName),
            $this->factory,
            $this->accessor,
            $this->dispatcher
        );
    }
1076569
public function mapEntity(Entity $entity) {
		$entity['_loc'] = $this->_table->getUrl($entity);
		$entity['_lastmod'] = $entity->{$this->_config['lastmod']};
		$entity['_changefreq'] = $this->_config['changefreq'];
		$entity['_priority'] = $this->_config['priority'];

		return $entity;
	}
338687
private function getEntityClassName($entityName)
    {
        if (!isset($this->entityClassMap[ $entityName ])) {
            $className = $entityName;
            if (!class_exists($className)) {
                $className = $this->defaultNamespace . $entityName;
                if (!class_exists($className)) {
                    //Cache that the class does not exist
                    $className = false;
                }
            }
            $this->entityClassMap[ $entityName ] = $className;
        }

        if ($this->entityClassMap[ $entityName ] === false) {
            throw new \OutOfBoundsException("Unknown entity {$entityName}");
        }

        return $this->entityClassMap[ $entityName ];
    }
346212
public function getEntityPersister($entityName)
    {
        if (isset($this->persisters[$entityName])) {
            return $this->persisters[$entityName];
        }

        $class = $this->em->getClassMetadata($entityName);

        switch (true) {
            case ($class->isInheritanceTypeNone()):
                $persister = new BasicEntityPersister($this->em, $class);
                break;

            case ($class->isInheritanceTypeSingleTable()):
                $persister = new SingleTablePersister($this->em, $class);
                break;

            case ($class->isInheritanceTypeJoined()):
                $persister = new JoinedSubclassPersister($this->em, $class);
                break;

            default:
                throw new \RuntimeException('No persister found for entity.');
        }

        if ($this->hasCache && $class->cache !== null) {
            $persister = $this->em->getConfiguration()
                ->getSecondLevelCacheConfiguration()
                ->getCacheFactory()
                ->buildCachedEntityPersister($this->em, $persister, $class);
        }

        $this->persisters[$entityName] = $persister;

        return $this->persisters[$entityName];
    }
418026
protected function getListBuilder($entityName, $fieldDescriptors)
    {
        /** @var RestHelperInterface $restHelper */
        $restHelper = $this->get('sulu_core.doctrine_rest_helper');

        /** @var DoctrineListBuilderFactory $factory */
        $factory = $this->get('sulu_core.doctrine_list_builder_factory');

        $listBuilder = $factory->create($entityName);

        $restHelper->initializeListBuilder(
            $listBuilder,
            $fieldDescriptors
        );

        return $listBuilder;
    }