Does this dataType reference a normality entity?
@param string $entityName
@return bool
975516
public function isNormalityEntity( &$entity = null )
    {
        if( $this->getEntity() === 'normality' ){
            $entity = $this->data['normality'];
            return true;
        }
        $entity = null;
        return false;
    }
781154
protected function isFixRequired(EntityManager $em, $output, $entityName)
	{
		$repository = $em->getRepository($entityName);

		if (! $repository instanceof RepositoryInterface) {
			$output->writeln('<error>The entity name isn\'t configured to be in nested set');
			return false;
		}

		$nestedRepository = $repository->getNestedSetRepository();
		$filter = $nestedRepository->createSearchCondition();
		$order = $nestedRepository->createSelectOrderRule();

		// Order by left index
		$order->byLeftAscending();

		/* @var $nestedRepository DoctrineRepository */

		$qb = $nestedRepository->createSearchQueryBuilder($filter, $order);

		$qb->select('e');
		
		$query = $qb->getQuery();
			
		$query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true);
		$query->setHydrationMode(Query::HYDRATE_SIMPLEOBJECT);

		$records = $query->getResult();

		// Keeps pile of current parents
		$parents = array();

		$arrayRepository = new ArrayRepository();

		$nodes = array();
		/* @var $nodes ValidationArrayNode[] */

		foreach ($records as $record) {

			if (! $record instanceof EntityNodeInterface) {
				throw new \UnexpectedValueException(sprintf(
					'Expecting DoctrineNode, [%s] received.',
					get_class($record)
				));
			}

			$level = $record->getLevel();

			$node = new ValidationArrayNode($record);
			$nodes[] = $node;
			$arrayRepository->add($node);

			// Fixing strongly relies on the level
			if ($level > 0) {
				$parent = null;

				if (isset($parents[$level - 1])) {
					$parent = $parents[$level - 1];
				}  else {
					// Too fast level drop, takes the deepest parent
					$parent = end($parents);
				}

				if ( ! empty($parent)) {
					$parent->addChild($node);
				}
			}

			$newLevel = $node->getLevel();

			// Removing historical parents deeper than the current node
			$parents = array_slice($parents, 0, $newLevel);
			$parents[$newLevel] = $node;
		}

		$fixRequired = false;

		foreach ($nodes as $node) {
			if (! $node->isOk()) {

				// Output index changes suggested
				$output->writeln("Node " . $node->getNodeTitle());

				$dbEntity = $em->find($entityName, $node->getId());
				/* @var $dbEntity EntityNodeInterface */

				if ( ! $node->isLeaf() && $node->isOriginallyWithLeafInterface() ) {

					$children = $node->getChildren();
					foreach ($children as $child) {
						
						if (! $node->isOk()) {
							$child->moveAsNextSiblingOf($node);
						} else {
							$child->moveAsPrevSiblingOf($node);
						}
					}
					
				} else {
					// Overwrite the indices
					$dbEntity->setLeftValue($node->getLeftValue());
					$dbEntity->setRightValue($node->getRightValue());

					$dbEntity->setLevel($node->getLevel());
				}

				$fixRequired = true;
			}
		}

		// Flushing, commit or rollback done later
		if ($fixRequired) {
			$em->flush();
		}

		return $fixRequired;
	}
551783
private function _checkEntityAlternativeNames(GeneralNames $san): bool
    {
        // only directory names supported for now
        $name = $this->_entityName->firstDN();
        foreach ($san->allOf(GeneralName::TAG_DIRECTORY_NAME) as $dn) {
            if ($dn instanceof DirectoryName && $dn->dn()->equals($name)) {
                return true;
            }
        }
        return false;
    }
499326
final public function hasDatabase($databaseName)
    {
        if (empty($this->queriesResultCache[ 'databaseNames' ])) {
            $this->getDatabases();
        }

        return (bool)in_array($databaseName, $this->queriesResultCache[ 'databaseNames' ]);
    }
251972
protected function tableExists($tableName) {
		if(isset($this->nonExistingTables[$tableName]))
			return false;
		if(isset($this->existingTables[$tableName]))
			return true;
		$exists = $this->schemaManager->tablesExist(array(
			$tableName 
		));
		if(!$exists) {
			$this->nonExistingTables[$tableName] = 1;
		} else {
			$this->existingTables[$tableName] = 1;
		}
		return $exists;
	}
191242
public function getXmlEntityPersister($entityName)
    {
        if ( ! isset($this->persisters[$entityName])) {
            $class = $this->xem->getClassMetadata($entityName);
            $this->persisters[$entityName] = new Persisters\RootXmlEntityPersister($this->xem, $class);
        }
        return $this->persisters[$entityName];
    }
1370213
public function tableExists( $tablename )
	{
		$sql = "
			SELECT TABLE_NAME
			FROM INFORMATION_SCHEMA.TABLES
			WHERE TABLE_TYPE = 'BASE TABLE'
				AND TABLE_SCHEMA = ?
				AND TABLE_NAME = ?
		";

		$stmt = $this->_conn->create( $sql );
		$stmt->bind( 1, $this->_dbname );
		$stmt->bind( 2, $tablename );
		$result = $stmt->execute();

		if( $result->fetch() !== false ) {
			return true;
		}

		return false;
	}
488948
public function isManagedByDoctrine($entity)
    {
        $cacheKey  = 'managed';
        $entity    = $this->toString($entity);
        $isManaged = $this->getFromCache($entity, $cacheKey, null);

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

        try {
            $this->managed = $isManaged = (bool) $this->entityManager->getReference($entity, 0);
            $entity = $this->getEntityClassFull($entity);
        } catch (\Exception $e) {
            $isManaged = false;
        }

        $this->cache[$entity][$cacheKey] = $isManaged;

        return $isManaged;
    }
758455
public function getUserForUsername($username)
    {
        if (!$this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username)) {
            return false;
        }
        
        // Get the access entity
        $accessEntity = $this->accessControlManager->getAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username);

        if ($accessEntity === false) {
            return false;
        }
        
        return $accessEntity;
    }
147380
public function one(Entity $entity)
    {
        $data = $entity->getCustomRepositoryCollection();
        $query = $entity->getQuery();

        return $data->first(function(Record $record) use ($query) {
            $where = $query->getWhere();
            if (!$where) {
                return true;
            }

            $children = $where->getChildren();
            $binds = $query->getBinds('where');

            foreach ($children as $i => $child) {
                if (!is_string($child)) {
                    continue;
                }

                if (preg_match('/^`[a-z]*` = \?$/', $child, $matches)) {
                    $field = substr($child, 1, strpos($child, '`', 1) - 1);
                    $value = $binds[$i];
                    
                    return $record->{$field} == $value;
                } else {
                    return false;
                }
            }

            return true;
        });
    }
121608
protected function checkTypeNumber($entity, $schema, $entityName)
    {
        $this->checkMinimum($entity, $schema, $entityName);
        $this->checkMaximum($entity, $schema, $entityName);
        $this->checkExclusiveMinimum($entity, $schema, $entityName);
        $this->checkExclusiveMaximum($entity, $schema, $entityName);
        $this->checkFormat($entity, $schema, $entityName);
        $this->checkEnum($entity, $schema, $entityName);
        $this->checkDisallow($entity, $schema, $entityName);
        $this->checkDivisibleBy($entity, $schema, $entityName);

        return $this;
    }
62287
public function has($key)
    {
        $result = $this->get($key);

        //an empty EntityCollection means no related entities
        if ($result instanceof EntityCollection && count($result) === 0) {
            return false;
        }

        return $result ? true : false;
    }
777911
protected function getEntityParams($entityName = null, $isOrmEntityDefs = false, $returns = null)
    {
        if (!isset($entityName)) {
            $entityName = $this->getEntityName();
        }

        $entityDefs = $this->getDefs($isOrmEntityDefs);

        if (isset($entityDefs[$entityName])) {
            return $entityDefs[$entityName];
        }

        return $returns;
    }
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;
    }
777453
public function entityTo(string $propertyName)
    {
        $idString = implode(':', [$this->definition->getClassName(), __CLASS__, $this->relationCount++]);
        $this->readDefinition->relation($propertyName)
            ->asCustom(new EmbeddedObjectRelation($idString, new EmbeddedMapperProxy($this->mapper)));
    }
270493
public function TableExists($TableName = NULL) {
      if($this->_TableExists === NULL || $TableName !== NULL) {
         if ($TableName === NULL)
            $TableName = $this->TableName();

         if(strlen($TableName) > 0) {
            $Tables = $this->Database->SQL()->FetchTables(':_'.$TableName);
            $Result = count($Tables) > 0;
         } else {
            $Result = FALSE;
         }
         if ($TableName == $this->TableName())
            $this->_TableExists = $Result;
         return $Result;
      }
      return $this->_TableExists;
   }
1150821
protected function getTableName($entityName)
    {
        $tableName = $entityName;
        preg_match_all('/[A-Z][a-z]+/', $entityName, $matches);
        if (!empty($matches[0])) {
            $tableName = implode('_', $matches[0]);
        }
        return strtolower($tableName);
    }