@param array $options

@throws OptimisticLockException
@throws \Doctrine\ORM\ORMException
772707
public function syncAll(array $options = [])
    {
        $this->logger->info('Synchronizing categories');
        $this->recursiveSync(0);

        $cache = [];

        $this->logger->info('Synchronizing parent/child relationships');

        // when all categories has been saved we iterate through them to update their parent/child relationship
        // @todo this should probably be moved to the updater
        foreach ($this->repository->iterate(['update' => true]) as $category) {
            foreach ($category->getParentIdList() as $parentNumber) {
                if (isset($cache[$parentNumber])) {
                    $parent = $this->repository->getReference($cache[$parentNumber]);
                } else {
                    // @todo if an existing relationship that has been deleted in Dandomain then it isn't updated here
                    $parent = $this->repository->findOneByNumber($parentNumber);
                    $cache[$parentNumber] = $parent->getId();
                }

                if ($parent) {
                    $category->addParentCategory($parent);
                }
            }
        }
    }
1184674
protected function setDefaultOptions(array $options=[])
	{
		$this->defaultOptions = [
			'foreign_key' => $this->model->getForeignKey(),
			'primary_key' => $this->model->getKeyName()
		];
	}
121699
public function setOptions(array $options = array())
    {
        foreach (static::$supportedOptions as $key) {
            if (isset($options[$key])) {
                $this->$key = $options[$key];
            }
        }
    }
925188
public function setOptions(array $options)
    {
        foreach ($options as $opt => $val) {
            $this->setOption($opt, $val);
        }

        return $this;
    }
1027077
protected function setOptions(array $options)
    {
        $this->options = array_merge(
            array_map(
                function ($value) {
                    return $value[0];
                },
                $this->supportedOptions
            ),
            $options
        );
    }
714304
public function syncAll(array $options = [])
    {
        $periods = \GuzzleHttp\json_decode((string) $this->api->relatedData->getPeriods()->getBody());
        foreach ($periods as $period) {
            $entity = $this->periodUpdater->updateFromApiResponse(DandomainFoundation\objectToArray($period));
            $this->repository->save($entity);
        }
    }
681563
public function setOptions(array $options)
    {
        if (isset($options['on_update'])) {
            $this->autoUpdate($options['on_update']);
        } elseif (isset($options['auto_update'])) {
            $this->autoUpdate();
        }

        return parent::setOptions($options);
    }
590227
public function setOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $method = 'set' . $name;
            if (! method_exists($this, $method)) {
                // next major: throw an exception
                @trigger_error(sprintf(
                    'The "%s" column option is not supported,' .
                    ' setting it is deprecated and will cause an error in Doctrine 3.0',
                    $name
                ), E_USER_DEPRECATED);

                continue;
            }
            $this->$method($value);
        }

        return $this;
    }
1131240
public function setOptions(array $options = []): void
    {
        $this->options = $this->shortcuts = [];
        $this->addOptions($options);
    }
984442
protected function _options(array $opts)
    {
        if (!empty($opts['targetForeignKey'])) {
            $this->setTargetForeignKey($opts['targetForeignKey']);
        }
        if (!empty($opts['joinTable'])) {
            $this->_junctionTableName($opts['joinTable']);
        }
        if (!empty($opts['through'])) {
            $this->setThrough($opts['through']);
        }
        if (!empty($opts['saveStrategy'])) {
            $this->setSaveStrategy($opts['saveStrategy']);
        }
        if (isset($opts['sort'])) {
            $this->setSort($opts['sort']);
        }
    }
1167192
protected function init(array $options = [])
    {
        if (array_key_exists(static::PERSISTENCE, $options)) {
            $this->persistence = $options[static::PERSISTENCE];
        }
        if (array_key_exists(static::PERSISTENCE_ARGS, $options)) {
            $this->persistenceArgs = $options[static::PERSISTENCE_ARGS];
        }

        if (array_key_exists(static::VARIABLE_RESOLVER, $options)) {
            $variableResolver = $options[static::VARIABLE_RESOLVER];
            if (null === $variableResolver) {
                $variableResolver = new DefaultVariableResolver();
            }
        } else {
            $variableResolver = new DefaultVariableResolver();
        }
        if (!$variableResolver instanceof VariableResolverInterface) {
            $errMsg = sprintf('Variable resolver not implements %s', VariableResolverInterface::class);
            throw new Exception\InvalidVariableResolverException($errMsg);
        }
        $this->variableResolver = $variableResolver;


        if (array_key_exists(static::WORKFLOW_FACTORY, $options)) {
            $workflowFactory = $options[static::WORKFLOW_FACTORY];
            if (null === $workflowFactory) {
                $workflowFactory = new UrlWorkflowFactory();
            }

            if (!$workflowFactory instanceof WorkflowFactoryInterface) {
                $errMsg = sprintf('Workflow factory not implements %s', WorkflowFactoryInterface::class);
                throw new Exception\InvalidWorkflowFactoryException($errMsg);
            }
            $workflowFactory->initDone();
            $this->factory = $workflowFactory;
        }
    }
538863
public function initialize(array $options)
    {
        foreach ($options as $optionName => $optionValue) {
            $methodName = 'set' . ucfirst($optionName);
            if (method_exists($this, $methodName)) {
                $this->$methodName($optionValue);
            }
        }
    }
1191580
public function setOptions(array $options)
    {
        if (count($options)) {
            foreach ($options as $method => $value) {
                $method = camelcase('set_' . $method);

                if (method_exists($this, $method)) {
                    call_user_func_array([&$this, $method], [$value]);
                }
            }
        }

        return $this;
    }
40069
public function saveIfExists(array $options = []): bool
    {
        if ($this->exists === false) {
            return false;
        }

        return $this->save($options);
    }
778827
public function addOptions(array $options): void
	{
		foreach ($options as $key => $option) {
			$this->addOption($key, $option);
		}
	}
534008
public function setOptions(array $options = [])
    {
        if ($this->isRunning()) {
            throw new LogicException('Options cannot be set while the server is running.');
        }

        $this->options = array_diff_key($this->options, $options) + $options;

        $this->swooleServer->set($this->options);
    }
106026
public function setOptions($options) 
	{
		foreach ($this->options as $key => $option) {
			if (isset($options[$key])) {
				$this->options[$key] = $options[$key];
			}
		}
	}