Method to set property primary

@param   boolean $primary

@return  static  Return self to support chaining.
765618
public function primary($primary = true)
    {
        $primary = (bool) $primary;

        $this->primary = $primary;

        if ($primary) {
            $this->signed = false;
            $this->allowNull = false;
            $this->autoIncrement = true;
            $this->default = false;
        }

        return $this;
    }
710722
public function setProperty($name, $value)
    {
        if (is_null($value)) {
            unset($this->_properties[$name]);
        } else {
            $this->_properties[$name] = $value;
        }
        return $this;
    }
661541
public function setProperty($property)
    {
        $this->_properties[$property->getName()] = $property;

        //if property name is the same as the identity property
        //then set the identity property
        if (
            is_string($this->_identity_property) &&
            $property->getName() == $this->_identity_property
        ) {
            $this->setIdentityProperty($property);
        }

        return $this;
    }
130471
public function setPrimaryKey(PrimaryKey $primaryKey)
    {
        foreach ($primaryKey->getColumnNames() as $columnName) {
            $this->getColumn($columnName)->setNotNull(true);
        }

        $this->primaryKey = $primaryKey;
    }
435944
public function setPrimaryDomain(Domain $domain = null)
    {
        if ($domain === null) {
            $this->primaryDomain = null;
            return;
        }

        if (!$domain->getActive()) {
            return;
        }

        $this->primaryDomain = $domain;
        if (!$this->domains->contains($domain)) {
            $this->domains->add($domain);
        }
    }
151906
public function set($property, $value = null)
    {
        if (is_string($property) && $value != '') {
            $property = [$property => $value];
        }

        foreach ($property as $name => $value) {
            $this->properties[$name] = $value;
        }

        return $this;
    }
765954
public function setProperties(array $properties) {
		foreach ($this->properties as $prop) {
			$prop->setParent(null);
		}

		$this->properties->clear();

		foreach ($properties as $prop) {
			$this->setProperty($prop);
		}

		return $this;
	}
329312
public function set($property, $value = null)
    {
        if (is_array($property)) {
            foreach ($property as $k => $v) {
                $this->set($k, $v);
            }

            return $this;
        }

        if ($this->has($property)) {
            $method = 'set' . Str::studly($property);
            $value  = $this->sanitizeSetterValue($method, $value);

            $this->message->{$method}($value);
        }

        return $this;
    }
767792
public function setRelative($relative)
    {
        $this->relative = (bool)$relative;
        if (($this->relative) && ($this->isAbsolute())) {
            $this->setAbsolute(false);
        }
        return $this;
    }
363288
public function set(string $property, $data = null): self
    {
        $this->data[$property] = $data;

        return $this;
    }
3661
public function setPrimaryKey($name, $type = 'int') {
        $column = $this->createColumnDef($type, false);
        $column['autoIncrement'] = true;
        $column['primary'] = true;

        $this->columns[$name] = $column;

        // Add the pk index.
        $this->addIndex(Db::INDEX_PK, $name);

        return $this;
    }
899426
public function setPrimaryKey($column) : Table
    {
        if (!is_array($column)) {
            $column = [ $column ];
        }
        $this->data['primary'] = $column;
        return $this;
    }
1284964
function set($key, $value = null)
    {
        if ($key !== $hash = $this->_normalizeKey($key)) {
            $propObj = $key;
            $key = $hash;
            ## store object map
            $this->__mapedPropObjects[$key] = $propObj;
        }


        $properties = &$this->_referDataArrayReference();
        $properties[$key] = $value;

        return $this;
    }
476305
public function findOne($primary)
    {
        $item = $this->getRegistry()->get($primary);
        if (!$item) {
            $all = $this->getRegistry()->get("all");
            if ($all) {
                $item = $all[$primary];
            }
            if (!$item) {
                $params['where'][] = ["`{$this->getTable()}`.`{$this->getPrimaryKey()}` = ?", $primary];
                $item = $this->findOneByParams($params);
                if ($item) {
                    $this->getRegistry()->set($primary, $item);
                }

                return $item;
            }
        }

        return $item;
    }
360297
public function setDomain($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->domain !== $v) {
            $this->domain = $v;
            $this->modifiedColumns[] = RemoteAppPeer::DOMAIN;
        }


        return $this;
    }
939535
def set_primary(self, **params):
        """"""
        data = self.api_client.set_primary_account(self.id, **params)
        self.update(data)
        return data
1139638
public function assign($user, bool $primary = false): bool
    {
        if ($this->limitExceeded()) {
            return false;
        }

        $this->users()->attach($user);

        // Set user's primary group
        if ($primary) {
            // Get user's model name
            $userModel = config('auth.providers.users.model');

            // In case $user is an integer, find the relevant model record
            if (is_int($user)) {
                $user = $userModel::find($user);
            }

            $user->primary_group_id = $this->id;
            $user->save();
        }

        return true;
    }