Gets the customField, null if the key does not exist.

@param object $owningEntity
@param string $key

@return CustomFieldBase|null
2345
public static function getField($owningEntity, $key)
    {
        $entity = $owningEntity->getNonemptyCustomFields()->get($key);

        if (!$entity) {
            self::checkCustomFieldExists($owningEntity, $key);
        }

        return $entity;
    }
516820
public static function getPrimaryKeyNameWithoutMapping($oEntity)
	{
		$aEntitieSetup = array();

		$oReflectionClass = new \ReflectionClass($oEntity);
		$oProperties   = $oReflectionClass->getProperties();

		foreach ($oProperties as $oProperty) {

			$sDoc = $oProperty->getDocComment();

			if (strstr($sDoc, '@primary_key')) {

		    	$aEntitieSetup[] = $oProperty->getName();
		    }
		}

		if (count($aEntitieSetup) == 0) { return false; }
		else if (count($aEntitieSetup) == 1) { return $aEntitieSetup[0]; }
		else { return $aEntitieSetup; }
	}
100809
protected function initializeField($field)
    {
        $field->setParentContext($this);
        $this->getFieldManager()->pushField($field);
        return $field;
    }
1023130
public function getOwningTraitFqn(string $hasType, string $ownedEntityFqn): string
    {
        return $this->namespaceHelper->getOwningTraitFqn(
            $hasType,
            $ownedEntityFqn,
            $this->projectRootNamespace,
            $this->srcSubFolderName
        );
    }
61745
public function hasCustomField($key)
    {
        if($key !== 'customFields' && !array_key_exists($key, $this->getAttributes())) {
            if(isset($this->customFields->$key)) {
                return true;
            }
        }
        return false;
    }
191315
public function getPrimaryKeyName($rootEntity)
    {
        $connection = $this->queryBuilder->getConnection();
        $databasePlatformName = $connection->getDatabasePlatform()->getName();
        $query = null;
        switch ($databasePlatformName) {
            case 'postgresql':
                /** @noinspection SpellCheckingInspection */
                $query = sprintf(
                    "%s %s %s",
                    "SELECT a.attname FROM pg_index i",
                    "JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey)",
                    "WHERE  i.indrelid = ?::regclass AND i.indisprimary"
                );
                $stmt = $connection->executeQuery($query, [$rootEntity], [\PDO::PARAM_STR]);

                return $stmt->fetchColumn();
            case 'mysql':
                $query = sprintf(
                    "%s %s %s %s",
                    "SELECT k.column_name FROM information_schema.table_constraints t",
                    "JOIN information_schema.key_column_usage k USING(constraint_name,table_schema,table_name)",
                    "WHERE t.constraint_type='PRIMARY KEY' AND t.table_schema=?",
                    "AND t.table_name=?;"
                );
                $stmt = $connection->executeQuery(
                    $query,
                    [$rootEntity, $connection->getDatabase()],
                    [\PDO::PARAM_STR, \PDO::PARAM_STR]
                );

                return $stmt->fetchColumn();
            case 'sqlite':
                $query = "PRAGMA table_info(".$rootEntity.")";
                $stmt = $connection->executeQuery($query);
                while ($row = $stmt->fetch()) {
                    if ($row['pk']) {
                        return $row['name'];
                    }
                }
        }

        return null;
    }
938823
@Override
    public IEntity getEntity(String key, Class type, String svcName) throws GroupsException {
        IIndividualGroupService svc = null;
        if (svcName == null) {
            svc = getDefaultService();
        } else {
            try {
                Name n = GroupService.parseServiceName(svcName);
                svc = getComponentService(n);
            } catch (InvalidNameException ine) {
                throw new GroupsException("Invalid service name.");
            }
        }
        return (svc == null) ? null : svc.getEntity(key, type);
    }
326679
final function KeyField()
    {
        if (!$this->keyField)
        {
            $fieldMappers = $this->FieldMappers();
            foreach ($fieldMappers as $name=>$mapper)
            {
                $keyInfo = $mapper->FieldInfo()->KeyInfo();
                if ($keyInfo && $keyInfo->IsPrimary())
                {
                    $this->keyField = $name;
                    break;
                }
            }
            if (!$this->keyField)
            {
                throw new \Exception('No (primary) key field found in ' . $this->TableName());
            }
        }
        return $this->keyField;
    }
771614
private Entity getTargetEntity(ImportedKey importedKey, ColumnConfig cc) {
        if (cc.hasTargetEntityName()) {
            return topLevelCfg.getProject().getEntityByName(cc.lookupTargetEntityName());
        } else {
            return topLevelCfg.getProject().getEntityBySchemaAndTableName(importedKey.getPkTableSchema(), importedKey.getPkTableName());
        }
    }
1034406
public function getField($key)
    {
        if (!$this->hasField($key)) {
            throw new FieldNotAvailableException("Content field $key not available. If it is provided by a component, please check if this component is installed.");
        }

        $field = $this->fields[$key];

        return new $field();
    }
894387
public function getCustomValue($key)
    {
        if (!array_key_exists($key, $this->customValues)) {
            throw InvalidPayloadException::notExistingCustomValue($key);
        }

        return $this->customValues[$key];
    }
190119
function getEntityObjectFromProperties (entityId, j, root) {
  return root
    .find(j.Property, {
      key: {
        type: 'Literal',
        value: getEntityKeyRegexFn(entityId)
      }
    })
    .map(node => node.get('value'))
}
726404
private function findFieldInstanceFor($entityType, $entityInfo, $property)
    {
        $instances = $this->findFieldInstances($entityType, $entityInfo);

        if (isset($instances[$property])) {
            return $instances[$property];
        }
    }
1216184
public function getPropertyValue($entity, $field, $default = null)
    {
        $this->assertEntity($entity);

        if (is_array($entity) || $entity instanceof \ArrayAccess) {
            return isset($entity[$field]) ? $entity[$field] : $default;
        }

        $ref = $this->getReflection($entity);
        if (!$ref->hasProperty($field)) {
            return isset($entity->{$field}) ? $entity->{$field} : $default;
        }

        return $this->getProperty($ref, $field)->getValue($entity);
    }
1267416
public function getEntityAttributeValue($field)
    {
        if ($field) {
            $functionName = 'get'.ucfirst($field);

            // Avoid error when the widget refer to a property that has been removed
            if (!method_exists($this, $functionName)) {
                return;
            }

            $fieldValue = $this->{$functionName}();
        } else {
            $fieldValue = null;
        }

        return $fieldValue;
    }
164660
public function getFieldFromParent($name)
    {
        $value = null;
        
        if ($this->owner->hasMethod('getParent')) {
            
            $parent = $this->owner->getParent();
            
            while ($parent && !$value) {
                $value  = $parent->{$name};
                $parent = $parent->hasMethod('getParent') ? $parent->getParent() : null;
            }
            
        }
        
        return $value;
    }
1000203
public Entity getWeak(Field field) {
        for (Entity entity : getWeaks()) {
            if (entity.getOwner().getEntityProperty().equals(field.getProperty())) {
                return entity;
            }
        }
        return null;
    }