Creates a new DoctrineListBuilder for the given entity name and returns it.

@param $entityName

@return DoctrineListBuilder
190742
public function create($entityName)
    {
        return new DoctrineListBuilder($this->em, $entityName, $this->eventDispatcher, $this->permissions);
    }
695864
private function getEntityByClass($className)
    {
        if (!isset($this->entities[ $className ])) {
            $entity                       = new Entity($this, $className);
            $this->entities[ $className ] = $entity;

            $this->metadataDriver->readEntityMetadata($entity);
        }

        return $this->entities[ $className ];
    }
893038
private function generateRepository($className) {
		$table = EntityReflexion::getTable($className);
		if ($table === NULL) {
			throw new RepositoryException("Entity \"" . $className . " has no annotation \"table\"");
		} else {
			$genClassName = $this->generateRepositoryName($className);
			if (!class_exists($genClassName)) {
				$class = $this->cache->load($genClassName);
				if ($class) {
					$repository = $class;
				} else {
					$repository = new ClassType($genClassName);
					$repository->addExtend('\slimORM\BaseRepository');
					$repository->setFinal(TRUE);
					$repository->addComment($genClassName);
					$repository->addComment("@generated");
					$repository->addProperty("connection")
						->setVisibility("protected")
						->addComment('@var \Nette\Database\Context');
					$repository->addProperty("entityManager")
						->setVisibility("protected")
						->addComment('@var \slimORM\EntityManager');
					$parameter = new Parameter("connection");
					$parameter->setTypeHint('\Nette\Database\Context');
					$parameter2 = new Parameter("entityManager");
					$parameter2->setTypeHint('\slimORM\EntityManager');
					$entity = EntityManager::PREFIX . str_replace("\\", "", $className) . "Entity";
					$repository->addMethod("__construct")
						->addComment($genClassName . " constructor")
						->addComment('@param \Nette\Database\Context $connection')
						->addComment('@param \slimORM\EntityManager $entityManager')
						->setParameters(array($parameter, $parameter2))
						->setBody("\$this->connection = \$connection;\n\$this->entityManager = \$entityManager;\nparent::__construct(\$connection, \"$table\", \"$entity\");");
					$parameter = new Parameter("key");
					$repository->addMethod("get")
						->addComment("Find item by primary key")
						->addComment("@param int \$key")
						->addComment("@return $entity|null")
						->setParameters(array($parameter))
						->setBody("return parent::get(\$key);");

					//FileSystem::write(WWW_DIR . '/temp/' . $genClassName . ".php", "<?php\n" . $repository);
					$this->cache->save($genClassName, $repository, array(
						Cache::FILES => EntityReflexion::getFile($className), // lze uvést i pole souborů
					));
				}
				$res = eval('?><?php ' . $repository);
				if ($res === FALSE && ($error = error_get_last()) && $error['type'] === E_PARSE) {
					throw new \ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']);
				}
				$this->repositories[$genClassName] = new $genClassName($this->connection, $this);
			} else if (!isset($this->repositories[$genClassName])) {
				$this->repositories[$genClassName] = new $genClassName($this->connection, $this);
			}
		}
	}
586575
public function getMetadataFor($entityName, array $parentName = array())
    {
        return $this->hydrateDataObject(
            $this->entityManager->getMetadataFactory()->getMetadataFor($entityName),
            $parentName
        );
    }
753691
public function to(string $entityType, string $tableName = null) : RelationDefiner
    {
        return new RelationDefiner($this->callback, function () use ($entityType, $tableName) {
            return $this->orm->getEntityMapper($entityType, $tableName);
        });
    }
447979
private function generateEntity($className)	{
		$genClassName = EntityManager::PREFIX . str_replace("\\", "", $className) . "Entity";
		$table = EntityReflexion::getTable($className);
		if ($table === NULL) {
			throw new RepositoryException("Entity \"" . $className . " has no annotation \"table\"");
		} else {
			if (in_array($genClassName, $this->entities) || class_exists($genClassName)) {
				return;
			} else {
				$this->entities[$genClassName] = $genClassName;
				$class = $this->cache->load($genClassName);
				if ($class) {
					$repository = $class;
					$references = $this->getReferences($className);
					$this->generateReferences($references);
				} else {
					$repository = new ClassType($genClassName);
					$repository->addExtend($className);
					$repository->setFinal(TRUE);
					$repository->addComment($genClassName);
					$repository->addComment("@table " . $table);

					$columns = $this->getColumns($className);
					$this->generateGetters($columns, $repository);

					$references = $this->getReferences($className);
					$this->generateReferences($references, $repository);
					$this->generateAddMethods($references, $repository);
					$this->generateOverrides($repository);

					//FileSystem::write(WWW_DIR . '/temp/' . $genClassName . ".php", "<?php\n" . $repository);
					$this->cache->save($genClassName, $repository, array(
						Cache::FILES => EntityReflexion::getFile($className), // lze uvést i pole souborů
					));
				}
				if (!class_exists($genClassName)) {
					$res = eval('?><?php ' . $repository);
					if ($res === FALSE && ($error = error_get_last()) && $error['type'] === E_PARSE) {
						throw new \ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']);
					}
				}
			}
		}
	}
996590
private function getFieldDescriptors($entityName, $id)
    {
        if (null === $this->fieldDescriptors) {
            $this->initFieldDescriptors($entityName, $id);
        }

        return $this->fieldDescriptors;
    }
374201
protected function getListingService()
    {
        if (null == $this->listingService) {
            $this->listingService = new EntityListingService(
                $this->getEntityClassName()
            );
        }
        return $this->listingService;
    }
1162208
public function read($entityName)
    {
        return new ReadQuery(
            $this->connection,
            $this->models->get($entityName),
            $this->factory,
            $this->accessor,
            $this->dispatcher
        );
    }
1362088
public static function createQueryBuilder() {
		if(self::$entity_manager == null)
			self::initialize();

		return call_user_func_array(array(self::$entity_manager, "createQueryBuilder"), func_get_args());
	}
1127845
public function getTable($tableName)
    {
        if (is_array($tableName)) {
            list($tableName, $entitySuffix) = $tableName;
        } else {
            $entitySuffix = null;
        }

        if ($entitySuffix !== null) {
            $tableName .= '_' . $entitySuffix;
        }

        if (!isset($this->_tables[$tableName])) {
            $this->_tables[$tableName] = $this->_resources->getTableName(
                $tableName,
                ResourceConnection::DEFAULT_CONNECTION
            );
        }

        return $this->_tables[$tableName];
    }
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);
    }
156556
public function getNewBuilder(Table $table, $classname)
    {
        /** @var DataModelBuilder $builder */
        $builder = new $classname($table);
        $builder->setGeneratorConfig($this);

        return $builder;
    }
267941
public function validate($entity, $entityName = null)
    {
        $entityName = $entityName ?: 'root';

        // Validate root type
        $this->validateType($entity, $this->schema, $entityName);

        return $this;
    }
1224572
public function getRepository($entityName)
    {
        $resolvedEntityName = $this->getEntityManager()->getEntityClassByInterface($entityName);
        $objectManager = $this->getObjectManagerAutoDetector()->getObjectManagerByClassName($resolvedEntityName);
        return $objectManager->getRepository($resolvedEntityName);
    }
701182
public function getRepository($entityName)
    {
        if (isset($this->repositories[$entityName])) {
            return $this->repositories[$entityName];
        }

        $metadata = $this->getClassMetadata($entityName);
        $repository = new EntityRepository($this, $metadata);
        $this->repositories[$entityName] = $repository;

        return $repository;
    }
1299093
public function getRepository($entityName)
    {
        $entityName = ltrim($entityName, '\\');
        if (isset($this->repositories[$entityName])) {
            return $this->repositories[$entityName];
        }

        $metadata = $this->getClassMetadata($entityName);
        $customRepositoryClassName = $metadata->customRepositoryClassName;

        if ($customRepositoryClassName !== null) {
            $repository = new $customRepositoryClassName($this, $metadata);
        } else {
            $repository = new XmlEntityRepository($this, $metadata);
        }

        $this->repositories[$entityName] = $repository;

        return $repository;
    }