@param string $entity

@return string An FQCN that implements \LaravelDoctrine\Fluent\Mapping
@throws \InvalidArgumentException
504252
private function getMapping($entity)
    {
        if (!array_key_exists($entity, $this->mappings)) {
            throw new \InvalidArgumentException("'$entity' is not a valid mapping key. One of [".implode(', ', array_keys($this->mappings)).'] is expected.');
        }

        return $this->mappings[$entity];
    }
630801
private function getEntityEncryptedReflectionProperties($entity)
    {
        return DoctrineHelper::getPropertiesByAnnotation($this->getClassName($entity), Encrypted::class, $this->getReader());
    }
1092237
public function eql($entity)
    {
        if ($entity instanceof AnDomainEntityProxy) {
            $object = $entity->getObject();
        } elseif ($entity instanceof AnMixinAbstract) {
            $object = $entity->getMixer();
        } else {
            $object = $entity;
        }

        return $this === $object;
    }
274098
protected function registerEntity($entity)
    {
        Orm::getRepository($this->getParentEntity())
            ->getIdentityMap()
            ->set($entity);

        return $entity;
    }
1318950
private function getDrupalEntityPath($type, $entity)
    {
        $uri = entity_uri($type, $entity);

        if (!$uri) {
            throw new \InvalidArgumentException(sprintf("%s: entity type is not supported yet"));
        }

        return $uri['path'];
    }
673646
public function removeFromIdentityMap($entity)
    {
        $oid = spl_object_hash($entity);
        $classMetadata = $this->xem->getClassMetadata(get_class($entity));
        $id = $this->entityIdentifiers[$oid];
        if ($id === '') {
            throw new InvalidArgumentException("The given entity has no identity.");
        }
        $className = $classMetadata->rootXmlEntityName;
        if (isset($this->identityMap[$className][$id])) {
            unset($this->identityMap[$className][$id]);
            //$this->entityStates[$oid] = self::STATE_DETACHED;
            return true;
        }

        return false;
    }
1049834
public function findByEntityInstance($entity)
    {
        $businessEntity = null;
        $class = new \ReflectionClass($entity);
        while (!$businessEntity && $class && $class->name !== null) {
            $businessEntity = $this->findByEntityClassname($class->name);
            $class = $class->getParentClass();
        }

        return $businessEntity;
    }
1322532
private function resolve($entity)
    {
        foreach ($this->namespaces as $namespace) {
            $className = $namespace . '\\' . ucfirst($entity);
            if (class_exists($className)) {
                return $className;
            }
        }
        return null;
    }
138561
public function getModelName($entity) {
        $classRef = new \ReflectionClass($entity);
        $classModelAnnotation = $this->annoReader->getClassAnnotation($classRef, 'Tpg\ExtjsBundle\Annotation\Model');
        if ($classModelAnnotation !== null) {
            if ($classModelAnnotation->name) {
                return $classModelAnnotation->name;
            } else {
                return str_replace("\\", ".", $classRef->getName());
            }
        }
        return null;
    }
900681
protected function singleEntity($entity)
    {
        if (empty($entity)) {
            return null;
        }

        $singleEntity = $entity;

        if (is_array($entity)) {
            if (count($entity) > 1) {
                throw RuntimeException::multipleResultsFound();
            }

            $singleEntity = reset($entity);
        }

        $entityClass = $this->getEntityName();

        if (!$singleEntity instanceof $entityClass) {
            throw InvalidArgumentException::invalidEntityType(
                $this->getEntityName(),
                $singleEntity
            );
        }

        return $singleEntity;
    }
983650
private function hashEntity($entity)
    {
        $class = ClassUtils::getClass($entity);

        $ids = $this->em->getClassMetadata($class)->getIdentifierValues($entity);

        return $class.spl_object_hash($entity).reset($ids);
    }
1316052
public function transform($entity)
    {
        if (null === $entity || '' === $entity) {
            return null;
        }

        if (!is_object($entity)) {
            throw new UnexpectedTypeException($entity, 'object');
        }

        //Here, do not put the result in the cache because we must check the value in
        //reverseTransform (by QueryBuilder)

        return $this->accessor->getValue($entity, $this->identifier);
    }
466297
public function get($entity)
    {
        $key = $this->mapping['fieldname'];
        $valueMethod = 'get' . ucfirst($key);
        $value = $entity->$valueMethod();

        return $value;
    }
862456
public function transform($entity)
    {
        $data = array();
        if (empty($entity)) {
            return $data;
        }

        $text = is_null($this->textProperty)
            ? (string) $entity
            : $this->accessor->getValue($entity, $this->textProperty);

        if ($this->em->contains($entity)) {
            $value = (string) $this->accessor->getValue($entity, $this->primaryKey);
        } else {
            $value = $this->newTagPrefix . $text;
            $text = $text.$this->newTagText;
        }

        $data[$value] = $text;

        return $data;
    }
523286
public function transform($entity) {
    if ($entity === NULL) {
      return NULL;
    }

    $getter = 'get'.ucfirst($this->identifierName);

    return array(
      '__class' => $this->entityClass, // just for verbose
      $this->identifierName => $entity->$getter()
    );
  }
280649
public static function createGetter($entity, $property)
    {
        $prefixes = ['get', 'is', 'has'];
        foreach ($prefixes as $prefix) {
            $getter = $prefix . ucfirst($property);
            if (is_callable([$entity, $getter])) {
                return $getter;
            }
        }

        if (is_callable([$entity, $property])) {
            return $property;
        }

        throw new \InvalidArgumentException(
            sprintf('No getter found for property %s in class %s', $property, get_class($entity))
        );
    }
1356531
public function createUseCaseDiagrammFor($entity)
    {
        if (is_int($entity)) {
            $entity = $this->getById($entity);
        } elseif (!$entity instanceof UseCaseEntity) {
            throw new \InvalidArgumentException('Unkown entity data type "' . gettype($entity) . '"');
        }

        $diagrammService = $this->getDiagrammService();

        return $diagrammService->createDiagrammFromNodes(array($entity), UseCaseDiagramm::TYPE_USE_CASE);
    }