Set menu parameters from this token

@param \Gems_Menu_ParameterSource $source
@return \Gems_Tracker_RespondentTrack (continuation pattern)
323940
public function applyToMenuSource(\Gems_Menu_ParameterSource $source)
    {
        $source->setRespondentTrackId($this->_respTrackId);
        $source->offsetSet(
                'gr2t_active',
                (isset($this->_respTrackData['gr2t_active']) ? $this->_respTrackData['gr2t_active'] : 0)
                );
        $source->offsetSet('can_edit', $this->hasSuccesCode() ? 1 : 0);
        $source->offsetSet('track_can_be_created', 0);

        $this->getRespondent()->applyToMenuSource($source);
        $this->getTrackEngine()->applyToMenuSource($source);

        return $this;
    }
1312188
public function setSource( $source )
	{
		if( !file_exists( $source ) )
			throw new InvalidArgumentException( 'Image File "'.$source.'" is not existing.' );
		$size = @getimagesize( $source );
		if( !$size )
			throw new Exception( 'Source File "'.$source.'" is not a supported Image.' );
		$this->size		= $size;
		$this->source	= $source;
	}
1356700
public function prune($source = null)
    {
        if ($source) {
            $this->addUsingAlias(SourceTableMap::COL_ID, $source->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
1151059
protected function _toNavigationArray(\Gems_Menu_ParameterCollector $source)
    {
        $this->sortByOrder();
        $lastParams = null;
        $pageIdx    = 0;
        $pages      = array();
        foreach ($this->_subItems as $item) {
            // Skip button_only items
            if ($item->get('button_only')) {
                continue;
            }
            $page = $item->_toNavigationArray($source);

            if (($this instanceof \Gems_Menu_SubMenuItem) &&
                    (!$this->notSet('controller', 'action')) &&
                    isset($page['params'])) {

                $params = $page['params'];
                unset($params['reset']); // Ignore this setting

                $class = [];
                if (isset($page['class'])) {
                    $class[] = $page['class'];
                }
                if (empty($params)) {
                    $class[] = 'noParameters';
                }
                if ((null !== $lastParams) && ($lastParams !== $params)) {
                    $class[] = 'breakBefore';
                }

                if (!empty($class)) {
                    $page['class'] = join(' ', $class);
                }
                $lastParams = $params;
            }
            $pages[$pageIdx] = $page;
            $pageIdx++;
        }

        return $pages;
    }
707702
public function match($source)
    {
        $this->factory->setType(Token::START);

        return parent::match($source);
    }
822282
private function sourceOptions(Source $source): array
    {
        $name = strip_tags($source->fullName());

        return [
            'only'   => strip_tags($source->fullName()),
            'linked' => I18N::translate('%s and the individuals that reference it.', $name),
        ];
    }
904833
public static function setSource($source = null)
    {
        if (! is_resource($source) && ! is_null($source)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid source provided; must be a null or an resource, "%s" given.',
                is_object($source) ? get_class($source) : gettype($source)
            ));
        }
        static::$source = $source;
    }
1087071
protected function redirect($source, array $parameters = array(), $code = 307)
    {
        if ($source instanceof Url) {
            $url = $source->toString();
        } elseif (filter_var($source, FILTER_VALIDATE_URL)) {
            $url = $source;
        } else {
            $url = $this->reverseRouter->getUrl($source, $parameters);
        }

        if ($code == 301) {
            throw new StatusCode\MovedPermanentlyException($url);
        } elseif ($code == 302) {
            throw new StatusCode\FoundException($url);
        } elseif ($code == 307) {
            throw new StatusCode\TemporaryRedirectException($url);
        } else {
            throw new RuntimeException('Invalid redirect status code');
        }
    }
1309661
public function setDataSource($data)
    {
        if ($data instanceof DataSource\DataSourceInterface) {
            $this->dataSource = $data;
        } elseif (is_array($data)) {
            $this->dataSource = new DataSource\PhpArray($data);
        } elseif ($data instanceof QueryBuilder) {
            $this->dataSource = new DataSource\Doctrine2($data);
        } elseif ($data instanceof ZendSelect) {
            $args = func_get_args();
            if (count($args) === 1 ||
                (! $args[1] instanceof \Zend\Db\Adapter\Adapter && ! $args[1] instanceof \Zend\Db\Sql\Sql)
            ) {
                throw new \InvalidArgumentException(
                    'For "Zend\Db\Sql\Select" also a "Zend\Db\Adapter\Sql" or "Zend\Db\Sql\Sql" is needed.'
                );
            }
            $this->dataSource = new DataSource\ZendSelect($data);
            $this->dataSource->setAdapter($args[1]);
        } elseif ($data instanceof Collection) {
            $args = func_get_args();
            if (count($args) === 1 || ! $args[1] instanceof \Doctrine\ORM\EntityManager) {
                throw new \InvalidArgumentException(
                    'If providing a Collection, also the Doctrine\ORM\EntityManager is needed as a second parameter'
                );
            }
            $this->dataSource = new DataSource\Doctrine2Collection($data);
            $this->dataSource->setEntityManager($args[1]);
        } else {
            throw new \InvalidArgumentException(
                '$data must implement the interface ZfcDatagrid\DataSource\DataSourceInterface'
            );
        }
    }
1137423
protected function setSourceOrder()
    {
        $this->source = Registry::getInstance()->create('\Magento\Sales\Model\Order');
        /** @noinspection PhpDeprecationInspection http://magento.stackexchange.com/questions/114929/deprecated-save-and-load-methods-in-abstract-model */
        $this->source->load($this->id);
    }
608856
protected function _sourceUsesSurvey($source)
    {
        switch ($source) {
            case self::APPOINTMENT_TABLE:
            case self::NO_TABLE:
            case self::RESPONDENT_TRACK_TABLE:
                return false;

            default:
                return true;
        }
    }
798957
public function addSource(Source $source)
    {
        $sources = array_map('strval', $this->sources->toArray());
        if (!in_array($source->getUrl(), $sources)) {
            $this->sources->add($source);
            $source->setItem($this);
        }

        return $this;
    }
935387
public function setSource($key, $value)
    {
        if ($key !== 'pointer' && $key !== 'parameter') {
            throw new \InvalidArgumentException('Key must be "pointer" or "parameter".');
        }
        $this->source = [(string) $key => (string) $value];
    }
787086
protected function setInvoiceSource($source)
    {
        parent::setInvoiceSource($source);
        switch ($this->invoiceSource->getType()) {
            case Source::Order:
                $this->order = $this->invoiceSource->getSource();
                $this->creditNote = null;
                break;
            case Source::CreditNote:
                $this->creditNote = $this->invoiceSource->getSource();
                $this->order = $this->creditNote->getOrder();
                break;
        }
        $this->shopInvoices = $this->order->getInvoiceCollection();
        $this->shopInvoice = count($this->shopInvoices) > 0 ? $this->shopInvoices->getFirstItem() : null;
    }
158471
public function getSourceChildPropertiesToBeConverted($source) {
		if (is_string($source)) {
			$source = [
				'payload' => [
					'__identity' => $source,
				]
			];
		} elseif (isset($source['__identity'])) {
			$source['payload'] = [
				'__identity' => $source['__identity'],
			];
			unset($source['__identity']);
		} elseif (!isset($source['payload'])) {
			$source['payload'] = [];
		}
		$source = parent::getSourceChildPropertiesToBeConverted($source);
		return $source;
	}
1304394
public function setSource($source): void
    {
        if (!\is_string($source)) {
            throw new Grid\GridException('Source of `SqlSource` should be string with SQL query');
        }
        parent::setSource($source);
    }
217359
public function SetSource( $source, $source_charset='utf-8', $target_charset='utf-8' )
    {
        $this->sourceCharSet = strtolower($source_charset);
        $this->targetCharSet = strtolower($target_charset);
        $this->simpleResult = array();
        $this->finallyResult = array();
        $this->finallyIndex = array();
        if( $source != '' )
        {
            $rs = true;
            if( preg_match("/^utf/", $source_charset) ) {
                $this->sourceString = iconv('utf-8', UCS2, $source);
            }
            else if( preg_match("/^gb/", $source_charset) ) {
                $this->sourceString = iconv('utf-8', UCS2, iconv('gb18030', 'utf-8', $source));
            }
            else if( preg_match("/^big/", $source_charset) ) {
                $this->sourceString = iconv('utf-8', UCS2, iconv('big5', 'utf-8', $source));
            }
            else {
                $rs = false;
            }
        }
        else
        {
           $rs = false;
        }
        return $rs;
    }