Attach the given tenant(s) to the model.

@param mixed $tenants

@return void
173572
public function setTenantsAttribute($tenants): void
    {
        static::saved(function (self $model) use ($tenants) {
            $model->syncTenants($tenants);
        });
    }
846710
public function add($objects)
    {
        if (!is_array($objects))
        {
            $objects = [$objects];
        }
        $operation = new AVRelationOperation($objects, null);
        $this->targetClassName = $operation->_getTargetClass();
        $this->parent->_performOperation($this->key, $operation);
    }
1078314
public function attach($observer)
	{
		if (is_array($observer))
		{
			if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler']))
			{
				return;
			}

			// Make sure we haven't already attached this array as an observer
			foreach ($this->_observers as $check)
			{
				if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler'])
				{
					return;
				}
			}

			$this->_observers[] = $observer;
			end($this->_observers);
			$methods = array($observer['event']);
		}
		else
		{
			if (!($observer instanceof JObserver))
			{
				return;
			}

			// Make sure we haven't already attached this object as an observer
			$class = get_class($observer);

			foreach ($this->_observers as $check)
			{
				if ($check instanceof $class)
				{
					return;
				}
			}

			$this->_observers[] = $observer;
			$methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin'));
		}

		$key = key($this->_observers);

		foreach ($methods as $method)
		{
			$method = strtolower($method);

			if (!isset($this->_methods[$method]))
			{
				$this->_methods[$method] = array();
			}

			$this->_methods[$method][] = $key;
		}
	}
514172
public function setProviders($providers)
    {
        $this->guardForArrayOrTraversable($providers);

        foreach ($providers as $provider) {
            $this->addProvider($provider);
        }
    }
1546
public function createWithUsers(array $data, $users)
    {
        $role = $this->create((array) $data);

        if (! empty($users)) {
            $role->users()->attach($users);
        }
    }
853624
public function scopeWithAllTenants(Builder $builder, $tenants): Builder
    {
        $tenants = $this->prepareTenantIds($tenants);

        collect($tenants)->each(function ($tenant) use ($builder) {
            $builder->whereHas('tenants', function (Builder $builder) use ($tenant) {
                return $builder->where('id', $tenant);
            });
        });

        return $builder;
    }
934097
def set_tenant(self, tenant, include_public=True):
        
        self.set_schema(tenant.schema_name, include_public)
        self.tenant = tenant
232959
public function addProperty(Property $property): void
    {
        $this->properties[(string) $property->getFqsen()] = $property;
    }
420242
def set_tenant(self, tenant, include_public=True):
        
        self.tenant = tenant
        self.schema_name = tenant.schema_name
        self.include_public_schema = include_public
        self.set_settings_schema(self.schema_name)
        self.search_path_set = False
1043264
public function hasAllTenants($tenants): bool
    {
        $tenants = $this->prepareTenantIds($tenants);

        return collect($tenants)->diff($this->tenants->pluck('id'))->isEmpty();
    }
1273295
public function AttachObserver($listener)
	{
		if ($listener) {
			$this->_observers[] =& $listener;
			if ($this->_masterAdapter) $this->_masterAdapter->AttachObserver($listener);
		}
		
	}
1131385
protected function copyExtras($files): void
    {
        foreach ($files as $source => $target) {
            $this->copy(
                $this->vendorPath . DS . $source,
                PATH_ROOT . DS . $target
            );
        }
    }
870946
public function assignTasksRoles(array $roles)
    {
        foreach ($roles as $roles => $tasks) {
            $tasks = (array) $tasks;
            $roles = (array) $roles;

            foreach ($tasks as $task) {
                $this->builder->buildTask($task)->addRoles($roles);
            }
        }
    }
166392
public function addAttachments($attachments)
    {
        $current = $this->_attachments;
        $this->setAttachments($attachments);
        $this->_attachments = array_merge($current, $this->_attachments);

        return $this;
    }
126953
public function addRelations($relations)
	{
		if(is_numeric($relations))
		{
			
			$relations = intval($relations);
			$this->relations = $relations;
		}
		else
		{
			$relations = ( is_array($relations) ) ? $relations : explode(',', strval($relations));
			foreach ($relations as $prop)
			{
				if( ! in_array($prop, $this->relations) )
				{
					$this->relations[] = trim($prop);
				}
			}
		}

		if($this instanceof Collection)
		{
			foreach ($this->data as $model)
			{
				$model->addRelations($this->relations);
			}
		}
	}
26900
public function attached($presenter)
	{
		parent::attached($presenter);

		if ($presenter instanceof Nette\Application\UI\Presenter) {
			/**
			 * Get session
			 */
			if ($this->remember_state) {
				$this->grid_session = $presenter->getSession($this->getSessionSectionName());
			}
		}
	}
819632
public function addProperty($property)
    {
        $properties = $this->getProperties();
        array_push($properties, $property);
        $this->setProperties($properties);
    }