Loads the relationship options and sets the options option if load_relationships is true.

@param array $options
481655
public function loadRelationshipOptions(&$options)
    {
        //if we want all of the possible items on the other model, load them up, otherwise leave the options empty
        $items        = array();
        $model        = $this->config->getDataModel();
        $relationship = $model->{$options['field_name']}();
        $relatedModel = $relationship->getRelated();

        if ($this->validator->arrayGet($options, 'load_relationships')) {
            //if a sort field was supplied, order the results by it
            if ($optionsSortField = $this->validator->arrayGet($options, 'options_sort_field')) {
                $optionsSortDirection = $this->validator->arrayGet($options, 'options_sort_direction', $this->defaults['options_sort_direction']);

                $query = $relatedModel->orderBy($this->db->raw($optionsSortField), $optionsSortDirection);
            }
            //otherwise just pull back an unsorted list
            else {
                $query = $relatedModel->newQuery();
            }

            //run the options filter
            $options['options_filter']($query);

            //get the items
            $items = $query->get();
        }
        //otherwise if there are relationship items, we need them in the initial options list
        elseif ($relationshipItems = $relationship->get()) {
            $items = $relationshipItems;

            // if no related items exist, add default item, if set in options
            if (count($items) == 0 && array_key_exists('value', $options)) {
                $items = $relatedModel->where($relatedModel->getKeyName(), '=', $options['value'])->get();
            }
        }

        //map the options to the options property where array('id': [key], 'text': [nameField])
        $nameField          = $this->validator->arrayGet($options, 'name_field', $this->defaults['name_field']);
        $keyField           = $relatedModel->getKeyName();
        $options['options'] = $this->mapRelationshipOptions($items, $nameField, $keyField);
    }
1035022
public function setOption($options = [])
    {
        $this->options = $options;

        // IPN TEST MODEL
        if (!empty($_REQUEST['test_ipn'])) {
            $this->endpoint = $this->sandbox_endpoint;
        }
    }
143898
public function setOptions(array $options)
    {
        parent::setOptions($options);

        if ($this->hasOption('min') && $this->hasOption('max') ) {
            $this->setMessage(__('Invalid file size (minimum %1$s bytes, maximum %2$s bytes)', $this->getOption('min'), $this->getOption('max')));
        } elseif ($this->hasOption('max')) {
            $this->setMessage(__('The uploaded file is too large (maximum %s bytes)', $this->getOption('max')));
            $this->setOption('min', 0);
        } else {
            throw new common_Exception("Please set 'min' and/or 'max' options!");
        }
    }
485460
protected static function _setupOptions(&$options)
    {
        $options = self::_merge(self::$_defaults, $options);
        foreach ($options['children'] as &$child) {
            self::_setupOptions($child);
        }
    }
121699
public function setOptions(array $options = array())
    {
        foreach (static::$supportedOptions as $key) {
            if (isset($options[$key])) {
                $this->$key = $options[$key];
            }
        }
    }
496383
public function save(array $options = [])
    {
        return DB::transaction(function() use ($options) {
            $result = parent::save($options);

            foreach ($this->autofilledRelations as $relationship => $relations) {
                if (!empty($relations)) {
                    $this->$relationship()->sync((array)$this->prepForSync($relations));
                }
            }

            return $result;
        });
    }
413806
public function setPossibleOptions( $options )
	{
		if( !is_array( $options ) )														//  no Array given
			throw InvalidArgumentException( 'No array given.' );						//  throw Exception
		if( $options === $this->possibleOptions )										//  threse Options are already set
			return FALSE;																//  do nothing
		$this->possibleOptions	= $options;												//  set new Options
		return TRUE;																	//  indicate Success
	}
344588
public function options(array $options)
    {
        if (array_key_exists('enable_raw', $options)) {
            $this->fileMap->enable_raw = (bool) $options['enable_raw'];
        }
        if (array_key_exists('before', $options)) {
            $this->setBeforeFilter($options['before']);
        }
        if (array_key_exists('after', $options)) {
            $this->setAfterRelease($options['after']);
        }
        if (array_key_exists('roots', $options)) {
            foreach($options['roots'] as $root) {
                $this->setRoot($root);
            }
        }
    }
706012
protected function setDefaultOptions(array $options=[])
    {

        parent::setDefaultOptions($options);

        $this->defaultOptions['primary_key'] = $this->toModel->getKeyName();
    }
983281
protected function setOptions($options)
    {
        if (is_null($this->options)) {
            $this->preloadDefaults(true);
        }
        
        foreach ($options as $k => $v) {
            if (!isset($this->options[$k])) {
                throw new \Exception("Option $k not allowed.");
            }
            $this->options[$k] = $v;
        }
    }
1308048
public function load($relations = [])
	{
		$this->addRelations($relations);
		
		$this->clearQueue();

		$this->queueUnresolvedObjects($this->data, $this->relations);

		$this->loadQueue();
	}
46655
protected function setDefaultOptions(array $options=[])
    {
        $tables = [
            'model' => $this->model->getTable(),
            'toModel' => $this->toModel->getTable()
        ];

        asort($tables, SORT_REGULAR);
        $pivotTable = implode('_', array_map([Str::class, 'singular'], $tables));
        
        $this->defaultOptions = [
            'pivot_table' => $pivotTable,
            'foreign_key' => $this->model->getForeignKey(),
            'related_key' => $this->toModel->getForeignKey(),
            'relation' => $this->toModel->getTable()
        ];
    }
254810
protected function setOptions(array $options = []): void
    {
        $this->options = $options;
        $this->configName = empty($options['cacheConfig']) ? static::DEFAULT_CONFIG : (string)$options['cacheConfig'];
        $this->skipCache = empty($this->options['cacheSkip']) ? false : (bool)$this->options['cacheSkip'];
    }
178029
final public function initializeObject(array $options = [])
    {
        $this->objectManager = Core::get()->getObjectManager();
        $this->checkUnknownOptions($options);
        $this->checkRequiredOptions($options);
        $this->options = $this->fillOptionsWithValues($options);
    }
908431
public function setOptions(array $options)
    {
        foreach ($options as $index=>$val) {
            if (property_exists($this, $index)) {
                $this->{$index} = $val;
            }
        }
        return $this;
    }
778827
public function addOptions(array $options): void
	{
		foreach ($options as $key => $option) {
			$this->addOption($key, $option);
		}
	}
1258219
public function addOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $this->setOption($name, $value);
        }

        return $this;
    }