Searches the Projects for a given member and returns the corresponding object array
if successful.
@param MemberIdentifier $member
@return array<Project> The relative project object to the given member.
961860
public static final function searchRelativeProject(MemberIdentifier $member) {
        $result = array();
        foreach (self::$REGISTERED_PRROJECT_INSTANCES as $project) {
            /* @var $project Project */
            $members = $project->getAllMembers();
            if (isset($members[$member->getMemberId()])) {
                array_push($result, $project);
            }
        }
        return $result;
    }
1095462
public function timelineMember($member, $token = null, $number = null)
    {
        $params = array();

        // handle token parameter
        if (!is_null($token)) {
            $params['token'] = $token;
        }

        // handle number parameter
        if (!is_null($number)) {
            if (!ctype_digit((string)$number) || (0 === $number) || (100 < $number)) {
                throw new \InvalidArgumentException('Invalid number parameter');
            }
            $params['number'] = $number;
        }

        return $this->query('timeline/member/' . $member . '.json', $params);
    }
453789
public function getMemberForm($identifier, $instance, $member, $td, $part) {
		$editMemberParams = $this->getEditMemberParams_ ( $part );

		$form = $this->jquery->semantic ()->dataForm ( $identifier, $instance );
		$form->on ( "dblclick", "", true, true );
		$form->setProperty ( "onsubmit", "return false;" );
		$form->addClass ( "_memberForm" );
		$className = \get_class ( $instance );
		$fields = [ "id",$member ];
		$relFields = OrmUtils::getFieldsInRelations_ ( $className );
		$hasRelations = $this->setFormFields_ ( $fields, $relFields );
		$form->setFields ( $fields );
		$fieldTypes = OrmUtils::getFieldTypes ( $className );
		$form->fieldAsHidden ( 0 );
		$this->setMemberFormFieldsComponent ( $form, $fieldTypes );
		if ($hasRelations) {
			$this->relationMembersInForm ( $form, $instance, $className, $fields, $relFields );
		}
		$form->setCaptions ( [ "","" ] );
		$form->onGenerateField ( function (HtmlFormField $f, $nb) use ($identifier, $editMemberParams) {
			if ($nb == 1) {
				$f->setSize ( "mini" );
				if ($editMemberParams->getHasButtons ()) {
					$btO = HtmlButton::icon ( "btO", "check" )->addClass ( "green mini compact" )->onClick ( "\$('#" . $identifier . "').trigger('validate');", true, true );
					$btC = HtmlButton::icon ( "btC", "close" )->addClass ( "mini compact" )->onClick ( "\$('#" . $identifier . "').trigger('endEdit');" );
					$f->wrap ( "<div class='fields' style='margin:0;'>", [ $btO,$btC,"</div>" ] );
					if (! $editMemberParams->getHasPopup ()) {
						$f->setWidth ( 16 )->setProperty ( "style", "padding-left:0;" );
					}
				}
				$f->on ( "keydown", "if(event.which == 13) {\$('#" . $identifier . "').trigger('validate');}if(event.keyCode===27) {\$('#" . $identifier . "').trigger('endEdit');}" );
				$f->onClick ( "return false;", true, true );
			} else {
				$f->setProperty ( "style", "display: none;" );
			}
		} );
		$form->setSubmitParams ( $this->controller->_getBaseRoute () . "/updateMember/" . $member . "/" . $editMemberParams->getUpdateCallback (), "#" . $td, [ "attr" => "","hasLoader" => false,"jsCallback" => "$(self).remove();","jqueryDone" => "html" ] );
		if ($editMemberParams->getHasPopup ()) {
			$endEdit = "\$('#" . $identifier . "').html();\$('.popup').hide();\$('#" . $td . "').popup('destroy');";
			$validate = $endEdit;
		} else {
			$endEdit = "let td=\$('#" . $td . "');td.html(td.data('originalText'));";
			$validate = "";
		}
		$form->on ( "endEdit", $endEdit );
		$form->on ( "validate", "\$('#" . $identifier . "').form('submit');" . $validate );
		$this->jquery->execAtLast ( "$('form').find('input[type=text],textarea,select').filter(':visible:first').focus();" );
		return $form;
	}
1353659
protected function getAllowedRelations($class, $member = null)
    {
        $allowedRelations = [];
        $obj = singleton($class);
        $relations = (array)$obj->hasOne() + (array)$obj->hasMany() + (array)$obj->manyMany();
        if ($relations) {
            foreach ($relations as $relName => $relClass) {
                $relClass = static::parseRelationClass($relClass);

                //remove dot notation from relation names
                $parts = explode('.', $relClass);
                $relClass = array_shift($parts);
                if (Config::inst()->get($relClass, 'api_access')) {
                    $allowedRelations[] = $relName;
                }
            }
        }
        return $allowedRelations;
    }
124153
private String memberName(Member member) {
        if (member instanceof Constructor)
            return member.getDeclaringClass().getSimpleName();
        else
            return member.getName();
    }
646093
private function getMembershipTypeName(\stdClass $membership_type) {
    $map = [
      [
        'needle' => '*Program Member',
        'replace' => 'Program Member',
      ],
      [
        'needle' => '1 Adult (30-64)',
        'replace' => '1 Adult',
      ],
      [
        'needle' => '1 Adult with Kids',
        'replace' => '1 Adult with Kids',
      ],
      [
        'needle' => '2 Adults (30-64)',
        'replace' => '2 Adults',
      ],
      [
        'needle' => '2 Adults with Kids',
        'replace' => '2 Adults with Kids',
      ],
      [
        'needle' => 'College Student',
        'replace' => 'College Student',
      ],
      [
        'needle' => 'Complimentary',
        'replace' => 'Complimentary',
      ],
      [
        'needle' => 'Military Adult',
        'replace' => 'Military Adult',
      ],
      [
        'needle' => 'Military Family',
        'replace' => 'Military Family',
      ],
      [
        'needle' => 'Senior 1 Adult',
        'replace' => '1 Senior',
      ],
      [
        'needle' => 'Senior 2 Adults',
        'replace' => '2 Seniors',
      ],
      [
        'needle' => 'Student',
        'replace' => 'Student',
      ],
      [
        'needle' => 'Young Adult',
        'replace' => 'Young Adult',
      ],
    ];

    foreach ($map as $item) {
      if (strpos($membership_type->name, $item['needle']) !== FALSE) {
        return $item['replace'];
      }
    }

    throw new \Exception(sprintf('Failed to get membership type name for type "%s"', $membership_type->name));
  }
592541
public function removeMember($member)
    {
        $member = ($member instanceof Model ? $member->getDn() : $member);

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

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

        return $this->addModification($mod)->save();
    }
999470
public function detachMemberTagMember(User $user, Member $member)
    {
        return $user->selected_context->id === $member->id;
    }
612896
public function RoleOf($member)
    {
        if (is_numeric($member)) {
            $member = Member::get()->byId($member);
        }

        if (!$member) {
            return null;
        }

        if ($this->isEditor($member)) {
            return _t(__CLASS__ . '.EDITOR', 'Editor');
        }

        if ($this->isWriter($member)) {
            return _t(__CLASS__ . '.WRITER', 'Writer');
        }

        if ($this->isContributor($member)) {
            return _t(__CLASS__ . '.CONTRIBUTOR', 'Contributor');
        }

        return null;
    }
1238192
public function onSkipRegistration(Member $member)
    {
        $this->getAuditLogger()->info(sprintf(
            '"%s" (ID: %s) skipped MFA registration',
            $member->Email ?: $member->Title,
            $member->ID
        ));
    }
1311004
private function findSubclassMappings(IObjectMapper $mapper, NestedMember $member) : array
    {
        /** @var ObjectType $type */
        $type  = $member->getParts()[0]->getSourceType();
        $class = $type->getClass();

        $subclassMappings = [];

        $this->walkSubclassMappings($subclassMappings, $mapper->getMapping(), $class);

        return $subclassMappings;
    }
1177781
protected function form(Request $request, Member $member)
    {
        $countries = collect(countries())->map(function ($country, $code) {
            return [
                'id' => $code,
                'text' => $country['name'],
                'emoji' => $country['emoji'],
            ];
        })->values();

        $tags = app('rinvex.tags.tag')->pluck('name', 'id');
        $languages = collect(languages())->pluck('name', 'iso_639_1');
        $genders = ['male' => trans('cortex/auth::common.male'), 'female' => trans('cortex/auth::common.female')];
        $abilities = $request->user($this->getGuard())->getManagedAbilities();
        $roles = $request->user($this->getGuard())->getManagedRoles();

        return view('cortex/auth::managerarea.pages.member', compact('member', 'abilities', 'roles', 'countries', 'languages', 'genders', 'tags'));
    }
742047
public function hasScope(string $name, Member $member): bool
    {
        return $member->Groups()->filter([
            'Scopes.Name' => $name
        ])->count() > 0;
    }
316543
public function friendsList(DataObject $member) {
		if (!$member) {
			return;
		}
		$list = DataList::create('Friendship')->filter(array('InitiatorID' => $member->ID));
		return $list;
	}
770401
private function getSubresource(string $rootClass, array $rootResolvedFields, array $rootIdentifiers, string $rootProperty, string $subresourceClass, bool $isCollection, array $normalizationContext)
    {
        $identifiers = [];
        $resolvedIdentifiers = [];
        foreach ($rootIdentifiers as $rootIdentifier) {
            if (isset($rootResolvedFields[$rootIdentifier])) {
                $identifiers[$rootIdentifier] = $rootResolvedFields[$rootIdentifier];
            }

            $resolvedIdentifiers[] = [$rootIdentifier, $rootClass];
        }

        return $this->subresourceDataProvider->getSubresource($subresourceClass, $identifiers, $normalizationContext + [
            'property' => $rootProperty,
            'identifiers' => $resolvedIdentifiers,
            'collection' => $isCollection,
        ]);
    }
525818
public function contains($member): bool
    {
        return $member instanceof Resource && $member->uri &&
            $this->findURI($member->uri) >= 0;
    }
772609
def system_find_project_members(input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/system/findProjectMembers', input_params, always_retry=always_retry, **kwargs)