Получает пользовательские поля у объекта
Данные подготовлены для экспорта в миграцию или схему
@param bool $entityId
@return array
512241
public function exportUserTypeEntities($entityId = false) {
        $items = $this->getUserTypeEntities($entityId);
        $export = array();
        foreach ($items as $item) {
            $export[] = $this->prepareExportUserTypeEntity($item, true);
        }
        return $export;
    }
1342172
public function iGetEntityWithId($entityId)
    {
        $this->lastEntity = $this->entity;
        $this->entity = $this->repository->get($entityId);
    }
164456
public function getItemById(string $itemId, bool $getChildren = false):array
    {
        $parameters = $getChildren === true ? '$expand=Children' : '';

        return $this->get("Items({$itemId})?{$parameters}");
    }
485110
public function get($entityId)
    {
        $key = $this->getEntityDescriptor()->className();
        $key .= '::'.$entityId;
        $entity = $this->getIdentityMap()->get($key, false);
        if ($entity === false) {
            $entity = $this->load($entityId);
        }
        return $entity;
    }
501014
public static function fetchUserCapabilities(string $userId): array
    {
        $entities = [];

        if (array_key_exists($userId, static::$userCapabilities)) {
            return static::$userCapabilities[$userId];
        }

        $table = TableRegistry::get('RolesCapabilities.Capabilities');
        Assert::isInstanceOf($table, CapabilitiesTable::class);

        $userGroups = $table->getUserGroups($userId);
        if (empty($userGroups)) {
            return $entities;
        }

        $userRoles = $table->getGroupsRoles($userGroups);
        if (empty($userRoles)) {
            return $entities;
        }

        static::$userCapabilities[$userId] = $table->getUserRolesEntities($userRoles);

        return static::$userCapabilities[$userId];
    }
383996
protected function getEntityAttributesUri(string $entityId): UriInterface
    {
        $uri = $this->getEntityEndpointUri($entityId)->withPath(
            $this->getEntityEndpointUri($entityId) . '/attributes'
        );

        return $uri;
    }
131703
public function getAttributesRawData($storeId, array $entityIds, $tableName, array $attributeIds)
    {
        $select = $this->connection->select();

        // The field modelizing the link between entity table and attribute values table. Either row_id or entity_id.
        $linkField = $this->getEntityMetaData($this->getEntityTypeId())->getLinkField();

        // The legacy entity_id field.
        $entityIdField = $this->getEntityMetaData($this->getEntityTypeId())->getIdentifierField();

        $joinStoreValuesConditionClauses = [
            "t_default.$linkField = t_store.$linkField",
            't_default.attribute_id = t_store.attribute_id',
            't_store.store_id= ?',
        ];

        $joinStoreValuesCondition = $this->connection->quoteInto(
            implode(' AND ', $joinStoreValuesConditionClauses),
            $storeId
        );

        $select->from(['entity' => $this->getEntityMetaData($this->getEntityTypeId())->getEntityTable()], [$entityIdField])
            ->joinInner(
                ['t_default' => $tableName],
                new \Zend_Db_Expr("entity.{$linkField} = t_default.{$linkField}"),
                ['attribute_id']
            )
            ->joinLeft(['t_store' => $tableName], $joinStoreValuesCondition, [])
            ->where('t_default.store_id=?', 0)
            ->where('t_default.attribute_id IN (?)', $attributeIds)
            ->where("entity.{$entityIdField} IN (?)", $entityIds)
            ->columns(['value' => new \Zend_Db_Expr('COALESCE(t_store.value, t_default.value)')]);

        return $this->connection->fetchAll($select);
    }
588038
public function revertEntityId($entityId) {
        if (0 === strpos($entityId, 'HLBLOCK_')) {
            $hlblockName = substr($entityId, 8);
            $hlhelper = new HlblockHelper();
            $hlblock = $hlhelper->getHlblock($hlblockName);
            if (empty($hlblock)) {
                $this->throwException(__METHOD__, '%s not found', $entityId);
            }

            $entityId = 'HLBLOCK_' . $hlblock['ID'];
        }

        return $entityId;
    }
1096705
public function itemsAction($id) {
        $em = $this->getDoctrine()->getManager();
        $gallery = $em->getRepository('AmulenMediaBundle:Gallery')->find($id);

        if (!$gallery) {
            throw $this->createNotFoundException('Unable to find Gallery entity.');
        }

        return array(
            'gallery' => $gallery,
            'items' => $gallery->getGalleryItems(),
        );
    }
32829
public function getProfiles($accountId = false, $propertyId = false)
    {
        if (!$this->getAccountId() && !$accountId || !$this->getPropertyId() && !$propertyId) {
            return false;
        }

        // get views
        if ($accountId && $propertyId) {
            $profiles = $this->serviceHelper->getService()->management_profiles->listManagementProfiles(
                    $accountId,
                    $propertyId
                );
        } else {
            $profiles = $this->serviceHelper->getService()->management_profiles->listManagementProfiles(
                    $this->getAccountId(),
                    $this->getPropertyId()
                );
        }

        $data = array();
        if (is_array($profiles->getItems())) {
            foreach ($profiles->getItems() as $profile) {
                $data[$profile->name] = array(
                            'profileId' => $profile->id,
                            'profileName' => $profile->name,
                            'created' => $profile->created,
                        );
            }
        }
        ksort($data);

        return $data;
    }
415158
public function getEntityById($id)
    {
        return isset($this->entitiesById[$id]) ? $this->entitiesById[$id] : null;
    }
1087781
public function findOrderEntityForItemWithId($id, $returnMultipleResults = false)
    {
        try {
            return $this->orderRepository->findOrderForItemWithId($id, $returnMultipleResults);
        } catch (NoResultException $nre) {
            throw new EntityNotFoundException(static::$itemEntity, $id);
        }
    }
893032
public static function getByID($btID)
    {
        $result = null;
        $btID = (int) $btID;
        if ($btID !== 0) {
            $app = Application::getFacadeApplication();
            $em = $app->make(EntityManagerInterface::class);
            $result = $em->find(BlockTypeEntity::class, $btID);
            if ($result !== null) {
                $result->loadController();
            }
        }

        return $result;
    }
784975
public function delete($entityId)
    {
        $response = $this->client->delete(sprintf('/entities/%s', $entityId));

        return $this->decodeResponse($response);
    }
949026
protected function doCopy($entityId)
    {
        $copy = $this->find($entityId)->copy();
        $this->save($copy);

        return $copy;
    }
443665
public function getCustomerAttributesByEntityId($entityId)
    {

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

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

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

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

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

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

        // return the array with the attributes
        return $attributes;
    }
996590
private function getFieldDescriptors($entityName, $id)
    {
        if (null === $this->fieldDescriptors) {
            $this->initFieldDescriptors($entityName, $id);
        }

        return $this->fieldDescriptors;
    }