@param string $entityClass class name like Entity::class
@param int|null $attributeGroupId
@param int|null $attributeId

@return array|\SphereMall\MS\Lib\Collection
@throws \GuzzleHttp\Exception\GuzzleException
@throws \ReflectionException
326231
public function belong(string $entityClass, int $attributeGroupId = null, int $attributeId = null)
    {
        $uriAppend = '/belong/' . strtolower((new \ReflectionClass($entityClass))->getShortName()) . "s";
        $params    = $this->getQueryParams();
        if (!is_null($attributeGroupId)) {
            $uriAppend .= "/$attributeGroupId";
            if (!is_null($attributeId)) {
                $uriAppend .= "/$attributeId";
            }
        }

        $response = $this->handler->handle('GET', false, $uriAppend, $params);

        return $this->make($response);
    }
518716
public function retrieveGroup($groupId)
    {
        $query = $this->newGroupQuery($groupId);
        //$query->setGroupId($groupId);

        try {
            $group = $this->getGroupEntry($query);
        } catch (Zend_Gdata_Gapps_ServiceException $e) {
            // Set the group to null if not found
            if ($e->hasError(Zend_Gdata_Gapps_Error::ENTITY_DOES_NOT_EXIST)) {
                $group = null;
            } else {
                throw $e;
            }
        }
        return $group;
    }
1274992
public function getNodeInformation(
    $entityClass = '',
        $parentEntity = null
    )
    {
        if ($entityClass === '') {
            throw new Exception('messages.error.classNameNotProvided');
        }
        return $this->repository->getNodeInformation($entityClass, $parentEntity);
    }
396000
public function getDataMapperForEntity($entityClass)
    {
        Assertion::keyIsset($this->entityDataMapperMap, $entityClass, sprintf(
            "Could not find data mapper service name for entity class '%s'",
            $entityClass
        ));

        $entityDMServiceName = $this->entityDataMapperMap[$entityClass];

        $dataMapper = $this->get($entityDMServiceName);

        if (! is_a($dataMapper->getEntityClass(), $entityClass, true)) {
            throw new Exception\RuntimeException(sprintf(
                '"%s" entity class mismatch: expected "%s", got "%s"',
                $entityDMServiceName,
                $entityClass,
                $dataMapper->getEntityClass()
            ));
        }

        return $dataMapper;
    }
1064333
private function findAttributeCodeById($attributeId, $attributeMapper)
    {
        foreach ($attributeMapper as $attributeCode => $attributeCodeId) {
            if ($attributeId == $attributeCodeId) {
                return $attributeCode;
            }
        }

        return '';
    }
970843
protected function formatAttributes($entityClass, array $attributes, $format = Attribute::FORMAT_PUT)
    {
        $entityClass = $this->getEntityClass($entityClass);
        $formatted = array();

        $mappings = $entityClass::getDataTypeMappings();
        foreach ($attributes as $attribute => $value) {
            if (isset($mappings[$attribute])) {
                $dataType = $mappings[$attribute];
                if (Attribute::FORMAT_PUT == $format) {
                    $formatted[$attribute] = array($dataType => $value);
                } else {
                    $formatted[$attribute] = array('Value' => array($dataType => $value));
                }
            } else {
                $formatted[$attribute] = Attribute::factory($value)->getFormatted($format);
            }
        }

        return $formatted;
    }
571825
public function getEntityClass()
    {
        if ($this->entityClass === null) {
            $class = get_class($this);
            $method = 'get' . substr($class, strrpos($class, '\\')+1) . 'EntityClass';
            $this->setEntityClass($this->getOptions()->$method());
        }
        return $this->entityClass;
    }
1002566
private function createRepository($entityClass)
    {
        $repository = new EntityRepository();
        $repository->setAdapter(
            $this->adapters->get($this->getAdapterAlias($entityClass))
        )
            ->setEntityMapper($this->getMapperFor($entityClass))
            ->setEntityDescriptor(
                EntityDescriptorRegistry::getInstance()
                    ->getDescriptorFor($entityClass)
            );
        $this->repositories->set($entityClass, $repository);
        return $repository;
    }
562601
public function getRelationEntityClass() {
    if ($this->type instanceof PersistentCollectionType) {
      return $this->type->getType()->getGClass();
    } elseif ($this->type instanceof EntityType) {
      return $this->type->getGClass();
    }
  }
969867
@Override
    public java.util.Iterator findEntitiesForGroup(IEntityGroup group) throws GroupsException {
        if (log.isDebugEnabled())
            log.debug(
                    DEBUG_CLASS_NAME
                            + ".findEntitiesForGroup(): retrieving entities for group "
                            + group);

        Collection entities = null;
        File f = getFile(group);
        if (f.isDirectory()) {
            entities = Collections.EMPTY_LIST;
        } else {
            entities = getEntitiesFromFile(f);
        }

        return entities.iterator();
    }
16622
public String[] getEntityClass(Object obj, String name, Siren4JEntity entityAnno) {
        Class<?> clazz = obj.getClass();
        String[] compClass = entityAnno == null ? null : entityAnno.entityClass();
        //If entity class specified then use it.
        if (compClass != null && !ArrayUtils.isEmpty(compClass)) {
            return compClass;
        }
        //Else use name or class.
        List<String> entityClass = new ArrayList<String>();
        entityClass.add(StringUtils.defaultString(name, clazz.getName()));
        if (obj instanceof CollectionResource) {
            String tag = getCollectionClassTag();
            if (StringUtils.isNotBlank(tag)) {
                entityClass.add(tag);
            }
        }
        return entityClass.toArray(new String[]{});
    }
84214
protected function findAccountsForGroupUsingAccountAttribute(Entity\GroupNode $group)
    {
        $findValue = $group->getDn();

        switch ($this->getConfiguration()->getAccountMembershipAttribute()) {
            case Enum\AccountMembershipMappingType::NAME:
                $findValue = $group->getName();
                break;
        }

        return $this->searchNodes(
            $this->buildFilter(
                new Filter\StringFilter($this->getConfiguration()->getAccountMembershipAttribute() . '=' . Filter\AbstractFilter::escapeValue($findValue))
            )
        );
    }
349068
public function getGroup ($groupID)
    {
        $groups = $this->getAllGroups();
        
        foreach ($groups as $group) {
            if ($group->getID() == $groupID) {
                return $group;
            }
        }
        
        return null;
    }
609950
public function normalize($data, $attributes = null, $groups = null, $entityMethods = null)
    {
        $context = $this->getNormalizeContext($this->normalizeContext, $attributes, $groups);

        $dataNormalized = $this->serializer->normalize($data, null, $context);

        if ($entityMethods && count($entityMethods) > 0) {
            $dataNormalized = $this->mergeEntitiesMethods($data, $dataNormalized, $entityMethods);
        }

        return $dataNormalized;
    }
28416
public function getEntityListColumnType($columnTypeClass)
    {
        if (isset($this->columnTypes[$columnTypeClass])) {
            return $this->columnTypes[$columnTypeClass];
        }
        elseif (class_exists($columnTypeClass)) {
            return new $columnTypeClass();
        }
    }
1249834
public function getCustomerAddressAttributesByEntityId($entityId)
    {

        // initialize the array for the attributes
        $attributes = array();

        // load the datetime attributes
        foreach ($this->customerAddressDatetimeRepository->findAllByEntityId($entityId) as $attribute) {
            $attributes[$attribute[MemberNames::ATTRIBUTE_ID]] = $attribute;
        }

        // load the decimal attributes
        foreach ($this->customerAddressDecimalRepository->findAllByEntityId($entityId) as $attribute) {
            $attributes[$attribute[MemberNames::ATTRIBUTE_ID]] = $attribute;
        }

        // load the integer attributes
        foreach ($this->customerAddressIntRepository->findAllByEntityId($entityId) as $attribute) {
            $attributes[$attribute[MemberNames::ATTRIBUTE_ID]] = $attribute;
        }

        // load the text attributes
        foreach ($this->customerAddressTextRepository->findAllByEntityId($entityId) as $attribute) {
            $attributes[$attribute[MemberNames::ATTRIBUTE_ID]] = $attribute;
        }

        // load the varchar attributes
        foreach ($this->customerAddressVarcharRepository->findAllByEntityId($entityId) as $attribute) {
            $attributes[$attribute[MemberNames::ATTRIBUTE_ID]] = $attribute;
        }

        // return the array with the attributes
        return $attributes;
    }
1036833
public function loadObjectStateGroupData($groupId)
    {
        try {
            return $this->innerGateway->loadObjectStateGroupData($groupId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }