prepareOptions

@return  array
325646
protected function prepareOptions()
    {
        $zones = [];

        foreach (\DateTimeZone::listIdentifiers() as $zone) {
            $pos = explode('/', $zone);

            if (count($pos) == 2) {
                $state = $pos[0];
                $city = $pos[1];
            } else {
                $state = $pos[0];
                $city = $pos[0];
            }

            if (!isset($zones[$state])) {
                $zones[$state] = [];
            }

            $zones[$state][] = new Option($city, $zone);
        }

        return $zones;
    }
410060
protected function getOptions(): array
    {
        $options = [];

        foreach ($this->options as $name => $value) {
            $options[] = $name . '=' . $value;
        }

        return $options;
    }
399482
private function createExecuteOptions()
    {
        $options = [];

        if (isset($this->options['session'])) {
            $options['session'] = $this->options['session'];
        }

        if (isset($this->options['writeConcern'])) {
            $options['writeConcern'] = $this->options['writeConcern'];
        }

        return $options;
    }
205514
public function prepare()
    {

        $options = $this->options->prepareOptions;

        if( $options & Options::BACKUP or true ) {

            $root = $this->options->pathRoot;
            $pathsToBackup = $this->options->getPathsToBackup();

            // make a fully qualified path relative to $root
            $anchorToRoot = function( $path ) use ($root) {
                return escapeshellarg( "." . substr( $path, strlen($root) ) );
            };

            $pathsToBackup = array_map( $anchorToRoot, $pathsToBackup );
            $pathsToBackup = implode( ' ', $pathsToBackup );

            $backupDir = $this->options->getPath('backup');
            $filename = "{$backupDir}/" . self::fileSystemFriendly(
                date( DateTime::POSTGRES_TIMESTAMP_WITHOUT_TIME_ZONE_NO_MICROSECONDS )
            ) . '.tar.gz';

            $command = sprintf(
                'cd %s; tar cszf %s --exclude=%s -C %s %s; cd -',
                escapeshellarg( $root ),
                escapeshellarg( $filename ),
                $anchorToRoot( $backupDir ),
                escapeshellarg( $root ),
                $pathsToBackup
            );

            exec( $command );

        }

        // trash _all_ previously generated entitys
        /* BROKEN - Too agressive. Doesn't consider $options['match']
        $rebuild = in_array( $option, array( self::REBUILD_AND_BACKUP, self::REBUILD_NO_BACKUP ) );
        if( $rebuild ) {
            foreach( new \DirectoryIterator( $this->paths['entity'] ) as $item ) {
                if( $item->isFile() ) {
                    // unlink( $item->getPathname() );
                }
            }
        }
         */

    }
776447
protected function generateGroupOptions() {
		
		$options = array();
		$fields = array('widgetOptions, label', 'labelOptions', 'errorOptions', 'hint', 'hintOptions', 'prepend', 'prependOptions',
			'append', 'appendOptions', 'enableAjaxValidation', 'enableClientValidation');

		foreach ($fields as $prop) {
			if (isset($this->$prop)) {
				$options[$prop] = $this->$prop;
			}
		}
		
		$options['widgetOptions']['data'] = $this->items;

		return $options;
	}
1109950
public function getOptions()
    {
        $options = array();
        foreach ($this->commandOptions as $key => $value) {
            $options[$key]=$this->$value;
        }
        return $options;
    }
1360620
protected function getOptions()
	{
		$options = array();

		foreach ($this->element->children() as $option)
		{
			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			// Set up option elements.
			$tmp = new stdClass;
			$tmp->value = (string) $option['value'];
			$tmp->text = trim((string) $option);
			$tmp->disable = ((string) $option['disabled'] == 'true');
			$tmp->class = (string) $option['class'];
			$tmp->onclick = (string) $option['onclick'];

			// Add the option object to the result set.
			$options[] = $tmp;
		}

		reset($options);

		return $options;
	}
1328774
private function getOptions()
    {
        $options = [];
        foreach($this->optionsMap as $property => $name) {
            $options[$name] = $this->options[$property];
        }
        return $options;
    }
425088
private function getCliOptions()
    {
        $validOptions = [];

        foreach ($this->getOptions() as $option) {
            $key = $option[0];
            $validOptions[$key] = $this->option($key);
        }

        return array_filter($validOptions);
    }
371722
private function prepareOptions($options, $forceOptions = [])
    {
        $optionString = '';

        foreach ($forceOptions as $option => $value) {
            if (is_numeric($option)) {
                $options[$value] = null;
            } else {
                $options[$option] = $value;
            }
        }

        foreach ($options as $option => $value) {

            if (is_null($value)) {
                $optionString .= ' ' . $option;
            } else {
                $optionString .= ' ' . $option . '=' . $value;
            }
        }

        return $optionString;
    }
210006
protected function prepareAttributes()
    {

        // load the actual option ID
        $optionId = $this->getLastOptionId();

        try {
            // load and map the parent SKU
            $parentId = $this->mapSku($this->getValue(ColumnKeys::BUNDLE_PARENT_SKU));
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::BUNDLE_PARENT_SKU), $e);
        }

        try {
            // try to load the child ID
            $childId = $this->mapSkuToEntityId($this->getValue(ColumnKeys::BUNDLE_VALUE_SKU));
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::BUNDLE_VALUE_SKU), $e);
        }

        try {
            // try to load the selection price type
            $selectionPriceType = $this->mapPriceType($this->getValue(ColumnKeys::BUNDLE_VALUE_PRICE_TYPE));
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::BUNDLE_VALUE_PRICE_TYPE), $e);
        }

        // load the default values
        $selectionCanChangeQty = 1;
        $selectionPriceValue = $this->getValue(ColumnKeys::BUNDLE_VALUE_PRICE);
        $selectionQty = $this->getValue(ColumnKeys::BUNDLE_VALUE_DEFAULT_QTY);
        $isDefault = $this->getValue(ColumnKeys::BUNDLE_VALUE_DEFAULT);

        // laod the position counter
        $position = $this->raisePositionCounter();

        // prepare the product bundle selection data
        return $this->initializeEntity(
            array(
                MemberNames::OPTION_ID                => $optionId,
                MemberNames::PARENT_PRODUCT_ID        => $parentId,
                MemberNames::PRODUCT_ID               => $childId,
                MemberNames::POSITION                 => $position,
                MemberNames::IS_DEFAULT               => $isDefault,
                MemberNames::SELECTION_PRICE_TYPE     => $selectionPriceType,
                MemberNames::SELECTION_PRICE_VALUE    => $selectionPriceValue,
                MemberNames::SELECTION_QTY            => $selectionQty,
                MemberNames::SELECTION_CAN_CHANGE_QTY => $selectionCanChangeQty
            )
        );
    }
157762
private function getPresetOptions()
    {
        $options = [];
        if($this->client->usesOAuth()) {
            $options["testmode"] = $this->mode === "test" ? true : false;
        }

        return $options;
    }
605774
public function prepareOptions(array $options)
    {
        $optionPieces = [];
        foreach ($options as $opt => $value) {
            //if it's an array of options, throw them in there as well
            if (is_array($value)) {
                foreach ($value as $optArrayValue) {
                    $optionPieces[] = '--'.$opt.'="'.addslashes($optArrayValue).'"';
                }
            } else {
                $option = null;

                //option exists with no value
                if (is_numeric($opt)) {
                    $option = $value;
                } elseif (!empty($value)) {
                    $option = $opt.'="'.addslashes($value).'"';
                }

                if (!is_null($option)) {
                    $optionPieces[] = '--'.$option;
                }
            }
        }

        return implode(' ', $optionPieces);
    }
58452
protected function prepareOwnerOptions()
    {
        $ownerOptions = ['' => '-'];
        foreach ($this->userService->getUsers() as $user) {
            /** @var User $user */
            $ownerOptions[$this->persistenceManager->getIdentifierByObject($user)] = $user->getLabel();
        }

        return $ownerOptions;
    }
907959
protected function prepareOptions()
    {
        foreach ($this->content as $name => $option) {
            // Array means it is a group
            if (is_array($option)) {
                foreach ($option as &$opt) {
                    if ($this->checkSelected($opt->getValue())) {
                        $opt['selected'] = 'selected';
                    }
                }

                $this->content[$name] = new HtmlElement('optgroup', $option, ['label' => $name]);
            } else {
                // Not array means it is an option
                if ($this->checkSelected($option->getValue())) {
                    $option['selected'] = 'selected';
                }
            }
        }
    }
1227558
public function prepareRequest()
    {
        $version = $this->versionEngine->getVersion();
        $queryConfiguration = $version->parseRequest($this->columnConfigurations);
        $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);

        return [
            'version' => $version,
            'queryConfiguration' => $queryConfiguration
        ];
    }
1040297
protected function getOptions()
    {
        $options = [
            ['package', null, InputOption::VALUE_OPTIONAL, 'The package to migrate.', null],
        ];

        return array_merge($options, parent::getOptions());
    }