Set a given member's initials
@link https://trello.com/docs/api/member/#put-1-members-idmember-or-username-initials

@param string $id       the member's id or username
@param string $initials the initials

@return array
355848
public function setInitials($id, $initials)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/initials', array('value' => $initials));
    }
655424
public function setId( $id )
	{
		if ( $id === null ) {
			$this->_modified = true;
		}

		$this->_values['id'] = $id;
	}
989040
public function createAutoLoginTokenAndCookie(int $id)
    {
        $authtok = new AuthToken($this->db);
        $authtok->setId($id);
        $authtok->setExpires($this->expires_after);

        setcookie($this->cookie_name, $authtok->generate(), $authtok->getExpiresTimestamp(), '/');
    }
195643
protected function instantiate($id)
    {
        $this->instances[$id] = call_user_func($this->callbacks[$id], $this);
    }
538359
public static function fromId($id)
    {
        $salt = md5(uniqid().$id);
        $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $slug = with(new Hashids($salt, $length = 8, $alphabet))->encode($id);

        return new Slug($slug);
    }
868916
public function actionAssign($id)
    {
        $model = Yii::createObject([
            'class'   => Assignment::className(),
            'user_id' => $id,
        ]);

        if ($model->load(\Yii::$app->request->post()) && $model->updateAssignments()) {
        }

        return \matacms\rbac\widgets\Assignments::widget([
            'model' => $model,
        ]);
        /*$model = Yii::createObject([
            'class'   => Assignment::className(),
            'user_id' => $id,
        ]);

        if ($model->load(Yii::$app->request->post()) && $model->updateAssignments()) {

        }

        return $this->render('assign', [
            'model' => $model,
        ]);*/
    }
47285
public function actionAssign($id)
    {
        $post = Yii::$app->getRequest()->post();
        $action = $post['action'];
        $roles = $post['roles'];
        $manager = Yii::$app->getAuthManager();
        $parent = $this->type === Item::TYPE_ROLE ? $manager->getRole($id) : $manager->getPermission($id);

        $error = [];
        if ($action == 'assign') {
            foreach ($roles as $role) {
                $child = $manager->getPermission($role);
                if ($this->type === Item::TYPE_ROLE && $child === null) {
                    $child = $manager->getRole($role);
                }
                try {
                    $manager->addChild($parent, $child);
                } catch (\Exception $e) {
                    $error[] = $e->getMessage();
                }
            }
        } else {
            foreach ($roles as $role) {
                $child = $manager->getPermission($role);
                if ($this->type === Item::TYPE_ROLE && $child === null) {
                    $child = $manager->getRole($role);
                }
                try {
                    $manager->removeChild($parent, $child);
                } catch (\Exception $e) {
                    $error[] = $e->getMessage();
                }
            }
        }
        Helper::invalidate();
        Yii::$app->getResponse()->format = 'json';
        return $this->getItems($id);
    }
171042
public function setID($identity)
    {
        $idAttribute = $this->idAttribute;
        return (is_string($idAttribute) && !empty($idAttribute)) ? $this->$idAttribute = $identity : null;
    }
755780
public function setId($id)
    {
        $id = (string)$id;

        if(!isset($this->__flywheelInitialId)) {
            $this->__flywheelInitialId = $id;
        }

        $this->__flywheelDocId = $id;

        return $id;
    }
502156
public function setId($id = null)
    {
        if ($id !== null) {
            $id = preg_replace("/[^a-z0-9_\\\d]/i", '_', $id);

            $this->id = (string) $id;
        }
    }
691025
public function setId(int $id): Email
    {
        Assert::greaterThan($id, 0);

        $this->id = $id;

        return $this;
    }
380166
public function setId($id)
    {
        if ($this->status != self::STATUS_NEW) {
            throw new \RuntimeException('Cannot set worker id after worker has started working');
        }

        $this->id = $id;
    }
763800
public final function create($id) {
        $method = 'create'.ucfirst($id);
        if (method_exists($this, $method)) {
            return $this->$method();
        }
        throw new Garp_Browsebox_Exception('No initialization method for id "'.$id.'"');
    }
1177435
public function setOrganization($id, $organizationId)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/idOrganization/'.rawurlencode($organizationId));
    }
803624
public function actionAssign($id)
    {
        $post = Yii::$app->getRequest()->post();
        $action = $post['action'];
        $roles = $post['roles'];
        $manager = Yii::$app->getAuthManager();
        $error = [];
        if ($action == 'assign') {
            foreach ($roles as $name) {
                try {
                    $item = $manager->getRole($name);
                    $item = $item ? : $manager->getPermission($name);
                    $manager->assign($item, $id);
                } catch (\Exception $exc) {
                    $error[] = $exc->getMessage();
                }
            }
        } else {
            foreach ($roles as $name) {
                try {
                    $item = $manager->getRole($name);
                    $item = $item ? : $manager->getPermission($name);
                    $manager->revoke($item, $id);
                } catch (\Exception $exc) {
                    $error[] = $exc->getMessage();
                }
            }
        }
        Helper::invalidate();
        Yii::$app->response->format = 'json';
        return array_merge($this->getItems($id), ['errors' => $error]);
    }
865760
def extend_initials(with_first, for_last)
      rename_if :first => with_first do |name|
        if name.last == for_last
          mine = name.initials.split(/\.[^[:alpha:]]*/)
          other = initials(with_first).split(/\.[^[:alpha:]]*/)

          mine == other || mine.length < other.length && mine == other[0, mine.length]
        end
      end
    end
1346772
public function setRelatedId( $id )
	{
		if ( $id === $this->getRelatedId() ) { return; }
		$id = (int) $id;
		$this->_values['relatedid'] = $id;
		$this->setModified();
	}