Import members.

@param \Cortex\Auth\Models\Member                           $member
@param \Cortex\Foundation\DataTables\ImportRecordsDataTable $importRecordsDataTable

@return \Illuminate\View\View
495290
public function import(Member $member, ImportRecordsDataTable $importRecordsDataTable)
    {
        return $importRecordsDataTable->with([
            'resource' => $member,
            'tabs' => 'adminarea.attributes.tabs',
            'url' => route('adminarea.members.stash'),
            'id' => "adminarea-attributes-{$member->getRouteKey()}-import-table",
        ])->render('cortex/foundation::adminarea.pages.datatable-dropzone');
    }
943463
public function canTranslate($member, $locale)
    {
        if ($locale && !i18n::validate_locale($locale)) {
            throw new InvalidArgumentException(sprintf('Invalid locale "%s"', $locale));
        }

        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
            $member = Member::currentUser();
        }

        // Always allow on cli and for non-logged users in dev mode
        if ((!$member && Director::isDev()) || Director::is_cli())
            return true;

        // check for locale
        $allowedLocale = (
            !is_array(Translatable::get_allowed_locales())
            || in_array($locale, Translatable::get_allowed_locales())
        );

        if (!$allowedLocale) {
            return false;
        }

        // By default, anyone who can edit a page can edit the default locale
        if ($locale == Translatable::default_locale()) {
            return true;
        }

        // check for generic translation permission
        if (Permission::checkMember($member, 'TRANSLATE_ALL')) {
            return true;
        }

        // check for locale specific translate permission
        return Permission::checkMember($member, 'TRANSLATE_' . $locale) == true;
    }
1094791
public function setMember($member)
    {
        $member = is_string($member) ? [$member] : $member;
        $this->setParameter('MemberToDel_Account', $member);
        return $this;
    }
563504
public function addMember($member)
    {
        $member = ($member instanceof Model ? $member->getDn() : $member);

        if (is_null($member)) {
            throw new InvalidArgumentException(
                'Cannot add member to group. The members distinguished name cannot be null.'
            );
        }

        $mod = $this->newBatchModification(
            $this->schema->member(),
            LDAP_MODIFY_BATCH_ADD,
            [$member]
        );

        return $this->addModification($mod)->save();
    }
365889
public function transform(Member $member)
    {
        return [
            'createdAt' => $member->created_at->toW3cString(),
            'memberCategoryId' => $member->member_category_id,
            'memberCategoryName' => !empty($member->member_category) ? $member->member_category->name : null,
            'memberName' => $member->user->name,
            'id' => $member->id,
            'role' => $member->role,
            'status' => $member->status,
            'preference' => $member->preference,
            'updatedAt' => $member->updated_at->toW3cString(),
            'userId' => $member->user_id,
        ];
    }
17078
public function sismembers($key, $member) {
        try {
            return $this->getRedis()->sIsMember($key, $member);
        } catch (RedisException $ex) {
            throw new ConnectException();
        }
    }
832179
public function importProductMeasurementSalesUnitStore(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->getProductMeasurementSalesUnitStoreDataImporter()
            ->import($dataImporterConfigurationTransfer);
    }
1081646
public function importMerchantRelationshipSalesOrderThresholds(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createMerchantRelationshipSalesOrderThresholdDataImport()->import($dataImporterConfigurationTransfer);
    }
620608
protected function getDataTablesWrapper(DataTablesProviderInterface $dtProvider) {

        $url = $this->getDataTablesURL($dtProvider);

        $dtWrapper = DataTablesFactory::newWrapper($url, $dtProvider, $this->getKernelEventListener()->getUser());

        foreach ($dtProvider->getColumns() as $dtColumn) {

            $this->getLogger()->debug(sprintf("DataTables provider \"%s\" add a column \"%s\"", $dtProvider->getName(), $dtColumn->getData()));

            $dtWrapper->addColumn($dtColumn);
        }

        if (null !== $dtProvider->getOptions()) {
            $dtWrapper->setOptions($dtProvider->getOptions());
        }

        return $dtWrapper;
    }
329490
public function import(Guardian $guardian, ImportRecordsDataTable $importRecordsDataTable)
    {
        return $importRecordsDataTable->with([
            'resource' => $guardian,
            'tabs' => 'adminarea.guardians.tabs',
            'url' => route('adminarea.guardians.stash'),
            'id' => "adminarea-attributes-{$guardian->getRouteKey()}-import-table",
        ])->render('cortex/foundation::adminarea.pages.datatable-dropzone');
    }
1305482
public function importBusinessUnitUser(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->getCompanyBusinessUnitUserDataImport()->import($dataImporterConfigurationTransfer);
    }
340479
public function importProductPackagingUnits(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createProductPackagingUnitDataImport()->import($dataImporterConfigurationTransfer);
    }
518672
public function import($structure, array $data, array $resourcesCreated = [])
    {
        // Create a new Path object which will be populated with exported data
        $path = new Path();

        $pathData = $data['data']['path'];

        // Populate Path properties
        $path->setDescription($pathData['description']);
        $path->setOpenSummary($pathData['summaryDisplayed']);
        $path->setManualProgressionAllowed($pathData['manualProgressionAllowed']);

        // Create steps
        $stepData = $data['data']['steps'];
        if (!empty($stepData)) {
            $createdSteps = [];
            foreach ($stepData as $step) {
                $createdSteps = $this->importStep($path, $step, $resourcesCreated, $createdSteps);
            }
        }

        // Inject empty structure into path (will be replaced by a version with updated IDs later in the import process)
        $path->setStructure($structure);

        return $path;
    }
257450
public function view(User $user, MemberCategory $member)
    {
        return $this->allowOnTeam($user, $member->team_id);
    }
807444
protected function _importResult(Import $import, array $headers, int $rowNumber, array $data) : void
    {
        $importTable = TableRegistry::get('CsvMigrations.ImportResults');
        Assert::isInstanceOf($importTable, ImportResultsTable::class);

        $query = $importTable->find('all')
            ->enableHydration(true)
            ->where(['import_id' => $import->get('id'), 'row_number' => $rowNumber]);

        try {
            $importResult = $query->firstOrFail();
        } catch (RecordNotFoundException $e) {
            return;
        }

        Assert::isInstanceOf($importResult, ImportResult::class);

        // skip successful imports
        if ($importTable::STATUS_SUCCESS === $importResult->get('status')) {
            return;
        }

        $table = TableRegistry::get($importResult->get('model_name'));

        $data = $this->_prepareData($import, $headers, $data);
        $csvFields = FieldUtility::getCsv($table);
        $data = $this->_processData($table, $csvFields, $data);

        // skip empty processed data
        if (empty($data)) {
            $this->_importFail($importResult, ['Row has no data']);

            return;
        }

        try {
            $entity = $table->newEntity();
            $entity = $table->patchEntity($entity, $data);

            $table->save($entity) ?
                $this->_importSuccess($importResult, $entity) :
                $this->_importFail($importResult, $entity->getErrors());
        } catch (CakeException $e) {
            $this->_importFail($importResult, [$e->getMessage()]);
        } catch (PDOException $e) {
            $this->_importFail($importResult, [$e->getMessage()]);
        }
    }
1294978
public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createShipmentTableRateImporter()->import($dataImporterConfigurationTransfer);
    }
718019
public function importFromStdClass($stdClass)
    {
        $reflect = new ReflectionClass(get_called_class());
        $properties = $reflect->getDefaultProperties();
        foreach ($properties as $key => $value) {
            $this->{$key} = $stdClass->{$key};
        }
    }