@inheritdoc

@SuppressWarnings(PHPMD.StaticAccess)
@SuppressWarnings(PHPMD.ElseExpression)
439656
protected function getSchemaByType(string $type): SchemaInterface
    {
        if ($this->hasCreatedProvider($type) === true) {
            return $this->getCreatedProvider($type);
        }

        $classNameOrCallable = $this->getProviderMapping($type);
        if (\is_string($classNameOrCallable) === true) {
            $schema = $this->createSchemaFromClassName($classNameOrCallable);
        } else {
            \assert(\is_callable($classNameOrCallable) === true);
            $schema = $this->createSchemaFromCallable($classNameOrCallable);
        }
        $this->setCreatedProvider($type, $schema);

        /** @var SchemaInterface $schema */

        $this->setResourceToJsonTypeMapping($schema->getType(), $type);

        return $schema;
    }
357173
public function apply($dbDriver, $alias, $field, $exprValue, $namedParameter = null, &$value = null)
	{
		$matches = [];
		
		if (!preg_match(self::PATTERN, $exprValue, $matches)) {
			throw new BadQueryExprException(sprintf('The query expression converter "range" does not support the following pattern "%s".', $exprValue));
		}
		
		switch (true) {
			case $matches[2] && !$matches[3]:
				return $this->createGreaterExpr($field, $matches[1], trim($matches[2]));
				
			case !$matches[2] && $matches[3]:
				return $this->createLessExpr($field, $matches[4], trim($matches[3]));
				
			case $matches[2] && $matches[3]:
				return (new \Doctrine\MongoDB\Query\Expr())->addAnd(
						$this->createGreaterExpr($field, $matches[1], trim($matches[2])), 
						$this->createLessExpr($field, $matches[4], trim($matches[3]))
					);
				
			default:
				throw new BadQueryExprException('the range query expression converter requires left or right value of range');
		}
	}
115433
static function __static()
	{
		XmlTokenizedType::$typeToCodeMap = array(
			'xs:string'					=> XmlTokenizedType::None,
			'xs:boolean'				=> XmlTokenizedType::None,
			'xs:decimal'				=> XmlTokenizedType::None,
			'xs:double'					=> XmlTokenizedType::None,
			'xs:float'					=> XmlTokenizedType::None,
			'xs:duration'				=> XmlTokenizedType::None,
			'xs:dateTime'				=> XmlTokenizedType::None,
			'xs:time'					=> XmlTokenizedType::None,
			'xs:date'					=> XmlTokenizedType::None,
			'xs:gYearMonth'				=> XmlTokenizedType::None,
			'xs:gYear'					=> XmlTokenizedType::None,
			'xs:gMonthDay'				=> XmlTokenizedType::None,
			'xs:gDay'					=> XmlTokenizedType::None,
			'xs:gMonth'					=> XmlTokenizedType::None,
			'xs:hexBinary'				=> XmlTokenizedType::None,
			'xs:base64Binary'			=> XmlTokenizedType::None,
			'xs:anyURI'					=> XmlTokenizedType::None,
			'xs:QName'					=> XmlTokenizedType::None,
			'xs:NOTATION'				=> XmlTokenizedType::NOTATION,
			'xs:normalizedString'		=> XmlTokenizedType::None,
			'xs:token'					=> XmlTokenizedType::None,
			'xs:language'				=> XmlTokenizedType::None,
			'xs:name'					=> XmlTokenizedType::None,
			'xs:NCName'					=> XmlTokenizedType::NCName,
			'xs:NMTOKEN'				=> XmlTokenizedType::NMTOKEN,
			'xs:ID'						=> XmlTokenizedType::ID,
			'xs:IDREF'					=> XmlTokenizedType::IDREF,
			'xs:ENTITY'					=> XmlTokenizedType::ENTITY,
			'xs:integer'				=> XmlTokenizedType::None,
			'xs:nonPositiveInteger'		=> XmlTokenizedType::None,
			'xs:long'					=> XmlTokenizedType::None,
			'xs:nonNegativeInteger'		=> XmlTokenizedType::None,
			'xs:negativeInteger' 		=> XmlTokenizedType::None,
			'xs:int'					=> XmlTokenizedType::None,
			'xs:short'					=> XmlTokenizedType::None,
			'xs:byte'					=> XmlTokenizedType::None,
			'xs:positiveInteger' 		=> XmlTokenizedType::None,
			'xs:unsignedLong' 			=> XmlTokenizedType::None,
			'xs:unsignedInt' 			=> XmlTokenizedType::None,
			'xs:unsignedShort'			=> XmlTokenizedType::None,
			'xs:unsignedByte'			=> XmlTokenizedType::None,
			'xs:IDREFS'					=> XmlTokenizedType::IDREFS,
			'xs:ENTITIES'				=> XmlTokenizedType::ENTITIES,
			'xs:NMTOKENS'				=> XmlTokenizedType::NMTOKENS,
			'xsd:string'				=> XmlTokenizedType::None,
			'xsd:boolean'				=> XmlTokenizedType::None,
			'xsd:decimal'				=> XmlTokenizedType::None,
			'xsd:double'				=> XmlTokenizedType::None,
			'xsd:float'					=> XmlTokenizedType::None,
			'xsd:duration'				=> XmlTokenizedType::None,
			'xsd:dateTime'				=> XmlTokenizedType::None,
			'xsd:time'					=> XmlTokenizedType::None,
			'xsd:date'					=> XmlTokenizedType::None,
			'xsd:gYearMonth'			=> XmlTokenizedType::None,
			'xsd:gYear'					=> XmlTokenizedType::None,
			'xsd:gMonthDay'				=> XmlTokenizedType::None,
			'xsd:gDay'					=> XmlTokenizedType::None,
			'xsd:gMonth'				=> XmlTokenizedType::None,
			'xsd:hexBinary'				=> XmlTokenizedType::None,
			'xsd:base64Binary'			=> XmlTokenizedType::None,
			'xsd:anyURI'				=> XmlTokenizedType::None,
			'xsd:QName'					=> XmlTokenizedType::None,
			'xsd:NOTATION'				=> XmlTokenizedType::NOTATION,
			'xsd:normalizedString'		=> XmlTokenizedType::None,
			'xsd:token'					=> XmlTokenizedType::None,
			'xsd:language'				=> XmlTokenizedType::None,
			'xsd:name'					=> XmlTokenizedType::None,
			'xsd:NCName'				=> XmlTokenizedType::NCName,
			'xsd:NMTOKEN'				=> XmlTokenizedType::NMTOKEN,
			'xsd:ID'					=> XmlTokenizedType::ID,
			'xsd:IDREF'					=> XmlTokenizedType::IDREF,
			'xsd:ENTITY'				=> XmlTokenizedType::ENTITY,
			'xsd:integer'				=> XmlTokenizedType::None,
			'xsd:nonPositiveInteger'	=> XmlTokenizedType::None,
			'xsd:long'					=> XmlTokenizedType::None,
			'xsd:nonNegativeInteger'	=> XmlTokenizedType::None,
			'xsd:negativeInteger' 		=> XmlTokenizedType::None,
			'xsd:int'					=> XmlTokenizedType::None,
			'xsd:short'					=> XmlTokenizedType::None,
			'xsd:byte'					=> XmlTokenizedType::None,
			'xsd:positiveInteger' 		=> XmlTokenizedType::None,
			'xsd:unsignedLong' 			=> XmlTokenizedType::None,
			'xsd:unsignedInt' 			=> XmlTokenizedType::None,
			'xsd:unsignedShort'			=> XmlTokenizedType::None,
			'xsd:unsignedByte'			=> XmlTokenizedType::None,
			'xsd:IDREFS'				=> XmlTokenizedType::IDREFS,
			'xsd:ENTITIES'				=> XmlTokenizedType::ENTITIES,
			'xsd:NMTOKENS'				=> XmlTokenizedType::NMTOKENS,
		);
	}
526940
function execute($m, $params=null, $paramtypes=null, $msgID=null)
		{
			if (is_object($m))
			{
				// watch out: if $m is an xmlrpcmsg obj, this will raise a warning: no id memeber...
				$methName = $m->method();
				$msgID = $m->id;
			}
			else
			{
				$methName = $m;
			}
			$sysCall = $this->allow_system_funcs && strpos($methName, "system.") === 0;
			$dmap = $sysCall ? $GLOBALS['_xmlrpcs_dmap'] : $this->dmap;

			if(!isset($dmap[$methName]['function']))
			{
				// No such method
				return new jsonrpcresp(0,
					$GLOBALS['xmlrpcerr']['unknown_method'],
					$GLOBALS['xmlrpcstr']['unknown_method']);
			}

			// Check signature
			if(isset($dmap[$methName]['signature']))
			{
				$sig = $dmap[$methName]['signature'];
				if (is_object($m))
				{
					list($ok, $errstr) = $this->verifySignature($m, $sig);
				}
				else
				{
					list($ok, $errstr) = $this->verifySignature($paramtypes, $sig);
				}
				if(!$ok)
				{
					// Didn't match.
					return new jsonrpcresp(
						0,
						$GLOBALS['xmlrpcerr']['incorrect_params'],
						$GLOBALS['xmlrpcstr']['incorrect_params'] . ": ${errstr}"
					);
				}
			}

			$func = $dmap[$methName]['function'];
			// let the 'class::function' syntax be accepted in dispatch maps
			if(is_string($func) && strpos($func, '::'))
			{
				$func = explode('::', $func);
			}
			// verify that function to be invoked is in fact callable
			if(!is_callable($func))
			{
				error_log("XML-RPC: ".__METHOD__.": function $func registered as method handler is not callable");
				return new jsonrpcresp(
					0,
					$GLOBALS['xmlrpcerr']['server_error'],
					$GLOBALS['xmlrpcstr']['server_error'] . ": no function matches method"
				);
			}

			// If debug level is 3, we should catch all errors generated during
			// processing of user function, and log them as part of response
			if($this->debug > 2)
			{
				$GLOBALS['_xmlrpcs_prev_ehandler'] = set_error_handler('_xmlrpcs_errorHandler');
			}
			try
			{
				if (is_object($m))
				{
					if($sysCall)
					{
						$r = call_user_func($func, $this, $m);
					}
					else
					{
						$r = call_user_func($func, $m);
					}
					if (!is_a($r, 'xmlrpcresp'))
					{
						error_log("XML-RPC: ".__METHOD__.": function $func registered as method handler does not return an xmlrpcresp object");
						if (is_a($r, 'xmlrpcval'))
						{
							$r = new jsonrpcresp($r);
						}
						else
						{
							$r = new jsonrpcresp(
								0,
								$GLOBALS['xmlrpcerr']['server_error'],
								$GLOBALS['xmlrpcstr']['server_error'] . ": function does not return jsonrpcresp or xmlrpcresp object"
							);
						}
					}
				}
				else
				{
					// call a 'plain php' function
					if($sysCall)
					{
						array_unshift($params, $this);
						$r = call_user_func_array($func,$params);
					}
					else
					{
						// 3rd API convention for method-handling functions: EPI-style
						if ($this->functions_parameters_type == 'epivals')
						{
							$r = call_user_func_array($func, array($methName, $params, $this->user_data));
							// mimic EPI behaviour: if we get an array that looks like an error, make it
							// an eror response
							if (is_array($r) && array_key_exists('faultCode', $r) && array_key_exists('faultString', $r))
							{
								$r = new jsonrpcresp(0, (integer)$r['faultCode'], (string)$r['faultString']);
							}
							else
							{
								// functions using EPI api should NOT return resp objects,
								// so make sure we encode the return type correctly
								$r = new jsonrpcresp(php_xmlrpc_encode($r, array('extension_api')));
							}
						}
						else
						{
							$r = call_user_func_array($func, $params);
						}
					}
					// the return type can be either an xmlrpcresp object or a plain php value...
					if (!is_a($r, 'xmlrpcresp'))
					{
						// what should we assume here about automatic encoding of datetimes
						// and php classes instances???
						$r = new jsonrpcresp(php_jsonrpc_encode($r, $this->phpvals_encoding_options));
					}
				}
				// here $r is either an xmlrpcresp or jsonrpcresp
				if (!is_a($r, 'jsonrpcresp'))
				{

					// dirty trick: user has given us back an xmlrpc response,
					// since he had an existing xmlrpc server with boatloads of code.
					// Be nice to him, and serialize the xmlrpc stuff into JSON.
					// We also override the content_type of the xmlrpc response,
					// but lack knoweledge of intented response charset...
					$r->content_type = 'application/json';
					$r->payload = serialize_jsonrpcresp($r, $msgID);
				}
				else
				{
					$r->id = $msgID;
				}
			}
			catch(Exception $e)
			{
			// (barring errors in the lib) an uncatched exception happened
				// in the called function, we wrap it in a proper error-response
				switch($this->exception_handling)
				{
					case 2:
						throw $e;
						break;
					case 1:
						$r = new jsonrpcresp(0, $e->getCode(), $e->getMessage());
						break;
					default:
						$r = new jsonrpcresp(0, $GLOBALS['xmlrpcerr']['server_error'], $GLOBALS['xmlrpcstr']['server_error']);
				}
			}
			if($this->debug > 2)
			{
				// note: restore the error handler we found before calling the
				// user func, even if it has been changed inside the func itself
				if($GLOBALS['_xmlrpcs_prev_ehandler'])
				{
					set_error_handler($GLOBALS['_xmlrpcs_prev_ehandler']);
				}
				else
				{
					restore_error_handler();
				}
			}
			return $r;
		}
991117
function xmlDefaultHandler($parser,$data)
		{
			//strip '<!--' and '-->' off comments
			$data = repl(array("&lt;!--", "--&gt;"), "", htmlspecialchars($data));
			$count = $this->xmlCount - 1;
			if(!empty($this->xmlDData[$count])) $this->xmlDData[$count] .= $data;
			else $this->xmlDData[$count] = $data;
		}
572649
public function generate()
    {
        $code = array();

        if ($this->namespace !== null) {
            $code[] = $this->getIndentation() . 'namespace ' . $this->namespace;
            $code[] = '{';
            $code[] = null;

            // Temporarily add one more level of indentation.
            $this->addIndentationLevel(1);
        }

        $code = array_merge($code, $this->renderUsesLines());

        $indentation = $this->getIndentation();

        $doc = $this->generateDocumentation();
        if ($doc !== null) {
            $code[] = $doc;
        }

        $line = $indentation . 'interface ' . $this->name;
        if (count($this->extends) > 0) {
            $line .= ' extends ' . implode(', ', $this->extends);
        }

        $code[] = $line;
        $code[] = $indentation . '{';

        // Interface constants.
        $interfaceElements = $this->generateConstantsLines();

        // Interface methods.
        foreach ($this->methods as $method) {
            if ($method->getVisibility() !== Modifiers::VISIBILITY_PUBLIC) {
                throw new RuntimeException('The visibility of methods must be public.');
            }

            $method->setIndentationString($this->getIndentationString());
            $method->setIndentationLevel($this->getIndentationLevel() + 1);

            $doc = $method->generateDocumentation();
            if ($doc !== null) {
                $interfaceElements[] = $doc;
            }

            $interfaceElements[] = $method->generateSignature() . ';';
            $interfaceElements[] = null;
        }

        if (count($interfaceElements) > 0) {
            $code[] = null;
            $code = array_merge($code, $interfaceElements);
            // Remove last empty line.
            array_pop($code);
        }

        $code[] = $indentation . '}';

        if ($this->namespace !== null) {
            // Set back the indentation.
            $this->addIndentationLevel(-1);

            $code[] = $this->getIndentation() . '}';
        }

        return implode($this->getLineFeed(), $code);
    }
1234546
private function serializeIfExpression(IfExpressionInterface $ifExpression): int
    {
        $index = $this->allocateIndex();

        $serialized = [
            static::TYPE                             => static::TYPE__IF_EXPRESSION,
            static::IF_EXPRESSION_CONDITION_CALLABLE => $ifExpression->getConditionCallable(),
        ];

        assert($ifExpression->getOnTrue() !== null || $ifExpression->getOnFalse() !== null);

        if ($ifExpression->getOnTrue() !== null) {
            $serialized[static::IF_EXPRESSION_ON_TRUE_BLOCK] = $this->addBlock($ifExpression->getOnTrue());
        }
        if ($ifExpression->getOnFalse() !== null) {
            $serialized[static::IF_EXPRESSION_ON_FALSE_BLOCK] = $this->addBlock($ifExpression->getOnFalse());
        }
        if (empty($ifExpression->getProperties()) === false) {
            $serialized[static::PROPERTIES] = $ifExpression->getProperties();
        }

        $this->serializedBlocks[$index] = $serialized;

        return $index;
    }
931568
public function execute()
	{
		$this->connect();

		if (!is_object($this->connection))
		{
			$this->log(
				Log\LogLevel::ERROR,
				'Database query failed (error #{code}): {message}',
				array('code' => $this->errorNum, 'message' => $this->errorMsg)
			);
			throw new \RuntimeException($this->errorMsg, $this->errorNum);
		}

		// Take a local copy so that we don't modify the original query and cause issues later
		$sql = $this->replacePrefix((string) $this->sql);

		if ($this->limit > 0 || $this->offset > 0)
		{
			// @TODO
			$sql .= ' LIMIT ' . $this->offset . ', ' . $this->limit;
		}

		// Increment the query counter.
		$this->count++;

		// If debugging is enabled then let's log the query.
		if ($this->debug)
		{
			// Add the query to the object queue.
			$this->log(
				Log\LogLevel::DEBUG,
				'{sql}',
				array('sql' => $sql, 'category' => 'databasequery', 'trace' => debug_backtrace())
			);
		}

		// Reset the error values.
		$this->errorNum = 0;
		$this->errorMsg = '';

		// Execute the query.
		$this->executed = false;

		if ($this->prepared instanceof \PDOStatement)
		{
			// Bind the variables:
			if ($this->sql instanceof PreparableInterface)
			{
				$bounded =& $this->sql->getBounded();

				foreach ($bounded as $key => $obj)
				{
					$this->prepared->bindParam($key, $obj->value, $obj->dataType, $obj->length, $obj->driverOptions);
				}
			}

			$this->executed = $this->prepared->execute();
		}

		// If an error occurred handle it.
		if (!$this->executed)
		{
			// Get the error number and message before we execute any more queries.
			$errorNum = (int) $this->connection->errorCode();
			$errorMsg = (string) 'SQL: ' . implode(", ", $this->connection->errorInfo());

			// Check if the server was disconnected.
			if (!$this->connected())
			{
				try
				{
					// Attempt to reconnect.
					$this->connection = null;
					$this->connect();
				}
				catch (\RuntimeException $e)
				// If connect fails, ignore that exception and throw the normal exception.
				{
					// Get the error number and message.
					$this->errorNum = (int) $this->connection->errorCode();
					$this->errorMsg = (string) 'SQL: ' . implode(", ", $this->connection->errorInfo());

					// Throw the normal query exception.
					$this->log(
						Log\LogLevel::ERROR,
						'Database query failed (error #{code}): {message}',
						array('code' => $this->errorNum, 'message' => $this->errorMsg)
					);
					throw new \RuntimeException($this->errorMsg, $this->errorNum);
				}

				// Since we were able to reconnect, run the query again.
				return $this->execute();
			}
			else
			// The server was not disconnected.
			{
				// Get the error number and message from before we tried to reconnect.
				$this->errorNum = $errorNum;
				$this->errorMsg = $errorMsg;

				// Throw the normal query exception.
				$this->log(
					Log\LogLevel::ERROR,
					'Database query failed (error #{code}): {message}',
					array('code' => $this->errorNum, 'message' => $this->errorMsg)
				);
				throw new \RuntimeException($this->errorMsg, $this->errorNum);
			}
		}

		return $this->prepared;
	}
231834
public static function __static()
    {
        self::$DOCBLOCK                     = new Docblock();
        self::$ANNOTATION                   = new InAnnotation();
        self::$ANNOTATION_NAME              = new AnnotationName();
        self::$ANNOTATION_TYPE              = new AnnotationType();
        self::$ARGUMENT                     = new AnnotationForArgument();
        self::$PARAM_NAME                   = new ParamName();
        self::$PARAM_VALUE                  = new ParamValue();
        self::$PARAM_VALUE_IN_SINGLE_QUOTES = new EnclosedParamValue();
        self::$PARAM_VALUE_IN_DOUBLE_QUOTES = new EnclosedParamValue();
        self::$DOCBLOCK->init();
        self::$ANNOTATION->init();
        self::$ANNOTATION_NAME->init();
        self::$ANNOTATION_TYPE->init();
        self::$ARGUMENT->init();
        self::$PARAM_NAME->init();
        self::$PARAM_VALUE->init();
        self::$PARAM_VALUE_IN_SINGLE_QUOTES->init("'");
        self::$PARAM_VALUE_IN_DOUBLE_QUOTES->init('"');
    }
1230977
public function setExpression($expression)
    {
        $definitions = array(
            '@yearly' => '0 0 1 1 *',
            '@annually' => '0 0 1 1 *',
            '@monthly' => '0 0 1 * *',
            '@weekly' => '0 0 * * 0',
            '@daily' => '0 0 * * *',
            '@hourly' => '0 * * * *'
        );

        if (isset($definitions[$expression])) {
            $expression = $definitions[$expression];
        }

        $expressionParts = explode(' ', $expression);

        if (count($expressionParts) < 5 || count($expressionParts) > 6) {
            throw new \InvalidArgumentException(sprintf('%s is not a valid CRON expression.', $expression));
        }

        $this->expression = $expression;
        $this->fields = array();

        foreach ($expressionParts as $position => $value) {
            $this->fields[$position] = $this->getField($position, $value);
        }
    }
247299
public function passExpression(array $expression)
    {
        switch ($expression['type']) {
            case 'bool':
            case 'double':
            case 'int':
            case 'uint':
            case 'long':
            case 'ulong':
            case 'string':
            case 'istring':
            case 'null':
            case 'char':
            case 'uchar':
            case 'empty-array':
            case 'variable':
            case 'constant':
            case 'static-constant-access':
            case 'closure':
            case 'closure-arrow':
            case 'reference':
                break;

            case 'sub':
            case 'add':
            case 'div':
            case 'mul':
            case 'mod':
            case 'and':
            case 'or':
            case 'concat':
            case 'equals':
            case 'identical':
            case 'not-identical':
            case 'not-equals':
            case 'less':
            case 'greater':
            case 'greater-equal':
            case 'less-equal':
            case 'bitwise_and':
            case 'bitwise_or':
            case 'bitwise_xor':
            case 'bitwise_shiftleft':
            case 'bitwise_shiftright':
            case 'irange':
            case 'erange':
                $this->passExpression($expression['left']);
                $this->passExpression($expression['right']);
                break;

            case 'typeof':
            case 'not':
                $this->passExpression($expression['left']);
                break;

            case 'mcall':
            case 'fcall':
            case 'scall':
                $this->passCall($expression);
                break;

            case 'array':
                $this->passArray($expression);
                break;

            case 'new':
                $this->passNew($expression);
                break;

            case 'property-access':
            case 'property-dynamic-access':
            case 'property-string-access':
            case 'static-property-access':
            case 'array-access':
                $this->passExpression($expression['left']);
                break;

            case 'isset':
            case 'empty':
            case 'instanceof':
            case 'require':
            case 'clone':
            case 'likely':
            case 'unlikely':
            case 'ternary':
                /* do special pass later */
                $this->passExpression($expression['left']);
                break;

            case 'fetch':
                $this->increaseMutations($expression['left']['value']);
                $this->passExpression($expression['right']);
                break;

            case 'minus':
                $this->passExpression($expression['left']);
                break;

            case 'list':
                $this->passExpression($expression['left']);
                break;

            case 'cast':
            case 'type-hint':
                $this->passExpression($expression['right']);
                break;

            default:
                echo 'MutateGathererPassType=', $expression['type'], PHP_EOL;
                break;
        }
    }
1303642
function _buildTree(&$rootDoc, &$class, $depth = NULL) {
        if ($depth === NULL) {
            $start = TRUE;
            $depth = 0;
        } else {
            $start = FALSE;
        }
        $output = "";
        $undefinedClass = FALSE;
        if ($class->superclass()) {
            $superclass = & $rootDoc->classNamed($class->superclass());
            if ($superclass) {
                $result = $this->_buildTree($rootDoc, $superclass, $depth);
                $output .= $result[0];
                $depth = ++$result[1];
            } else {
                $output .= $class->superclass();
                $output .= " &gt; ";
                $depth++;
                $undefinedClass = TRUE;
            }
        }
        if ($depth > 0 && !$undefinedClass) {
            $output .= " &gt; ";
        }
        if ($start) {
            $output .= "**" . $class->name() . "**\n";
        } else {
            $output .= "<a href=\"" . $this->_asURL($class) . "\">" . $class->name() . "</a>\n";
        }
        return array($output, $depth);
    }
763145
public function staticMapUrl(array $options = []) {
		$mapUrl = $this->_protocol() . static::STATIC_API;
		/*
		$params = array(
			'mobile' => 'false',
			'format' => 'png',
			//'center' => false
		);

		if (!empty($options['mobile'])) {
			$params['mobile'] = 'true';
		}
		*/

		$defaults = $this->_config['staticMap'] + $this->_config;

		$mapOptions = $options + $defaults;

		$params = array_intersect_key($mapOptions, [
			'mobile' => null,
			'format' => null,
			'size' => null,
			//'zoom' => null,
			//'lat' => null,
			//'lng' => null,
			//'visible' => null,
			//'type' => null,
		]);

		// add API key to parameters.
		if ($this->_runtimeConfig['key']) {
			$params['key'] = $this->_runtimeConfig['key'];
		}

		// do we want zoom to auto-correct itself?
		if (!isset($options['zoom']) && !empty($mapOptions['markers']) || !empty($mapOptions['paths']) || !empty($mapOptions['visible'])) {
			$options['zoom'] = 'auto';
		}

		// a position on the map that is supposed to stay visible at all cost
		if (!empty($mapOptions['visible'])) {
			$params['visible'] = urlencode($mapOptions['visible']);
		}

		// center and zoom are not necessary if path, visible or markers are given
		if (!isset($options['center']) || $options['center'] === false) {
			// dont use it
		} elseif ($options['center'] === true && $mapOptions['lat'] !== null && $mapOptions['lng'] !== null) {
			$params['center'] = urlencode((string)$mapOptions['lat'] . ',' . (string)$mapOptions['lng']);
		} elseif (!empty($options['center'])) {
			$params['center'] = urlencode($options['center']);
		} /*else {
			// try to read from markers array???
			if (isset($options['markers']) && count($options['markers']) == 1) {
				//pr ($options['markers']);
			}
		}*/

		if (!isset($options['zoom']) || $options['zoom'] === false) {
			// dont use it
		} else {
			if ($options['zoom'] === 'auto') {
				if (!empty($options['markers']) && strpos($options['zoom'], '|') !== false) {
					// let google find the best zoom value itself
				} else {
					// do something here?
				}
			} else {
				$params['zoom'] = $options['zoom'];
			}
		}

		if (array_key_exists($mapOptions['type'], $this->types)) {
			$params['maptype'] = $this->types[$mapOptions['type']];
		} else {
			$params['maptype'] = $mapOptions['type'];
		}
		$params['maptype'] = strtolower($params['maptype']);

		// old: {latitude},{longitude},{color}{alpha-character}
		// new: @see staticMarkers()
		if (!empty($options['markers'])) {
			$params['markers'] = $options['markers'];
		}

		if (!empty($options['paths'])) {
			$params['path'] = $options['paths'];
		}

		// valXval
		if (!empty($options['size'])) {
			$params['size'] = $options['size'];
		}

		$pieces = [];
		foreach ($params as $key => $value) {
			if (is_array($value)) {
				$value = implode('&' . $key . '=', $value);
			} elseif ($value === true) {
				$value = 'true';
			} elseif ($value === false) {
				$value = 'false';
			} elseif ($value === null) {
				continue;
			}
			$pieces[] = $key . '=' . $value;
		}

		$options += [
			'escape' => true,
		];
		$query = implode('&', $pieces);
		if ($options['escape']) {
			$query = h($query);
		}

		return $mapUrl . '?' . $query;
	}
285299
protected function query($value)
    {
        $conditions = [$this->field => $value];
        /** @var MapperInterface $mapper */
        $mapper = $this->mapperManager->get($this->getEntity());
        if (!empty($this->exclude)) {
            $field = $this->exclude['field'] ?? '';
            $excludedValue = $this->exclude['value'] ?? '';
            $operator = $this->exclude['operator'] ?? '!=';

            if (!empty($field) && !empty($excludedValue)) {
                $conditions[] = $mapper->quoteIdentifier($field) . $operator . $mapper->quoteValue($excludedValue);
            }
        }
        $result = $mapper->find('all', [
            'conditions' => $conditions
        ]);

        return $result;
    }
695156
function execute() {

        if ( isset( $this->rows ) ) return $this;

        if ( $this->parent_ ) {

            // restrict to parent
            $this->where[] = $this->db->is( $this->key, $this->parent_->getGlobalKeys( $this->parentKey ) );

        }

        $root = $this->getRoot();
        $definition = $this->getDefinition();

        $cached = $root->getCache( $definition );

        if ( !$cached ) {

            // fetch all rows
            $statement = $this->db->select( $this->table, array(
                'expr' => $this->select,
                'where' => $this->where,
                'orderBy' => $this->orderBy,
                'limitCount' => $this->limitCount,
                'limitOffset' => $this->limitOffset,
                'params' => $this->whereParams
            ) );

            $rows = $statement->fetchAll();
            $cached = array();

            // build row objects
            foreach ( $rows as $row ) {

                $row = $this->createRow( $row );
                $row->setClean();

                $cached[] = $row;

            }

            $root->setCache( $definition, $cached );

        }

        $this->globalRows = $cached;

        if ( !$this->parent_ ) {

            $this->rows = $cached;

        } else {

            $this->rows = array();
            $keys = $this->parent_->getLocalKeys( $this->parentKey );

            foreach ( $cached as $row ) {

                if ( in_array( $row->__get( $this->key ), $keys ) ) {

                    $this->rows[] = $row;

                }

            }

        }

        return $this;

    }
74893
public function setValue($value)
    {
        if (is_array($value)) {
            foreach ($value as $childKey => $childValue) {
                $this->children[$childKey] = new static($childValue);
            }
            $this->value = null;
        } else {
            $this->value = $value;
            $this->children = array();
        }
        return $this;
    }
673579
public function find($expression)
    {
        $tokens = $this->parseTokens($expression);

        $collectionData = [$this->data];

        foreach ($tokens as $token) {
            $filter = $token->buildFilter($this->options);

            $filteredData = [];

            foreach ($collectionData as $value) {
                if (AccessHelper::isCollectionType($value)) {
                    $filteredValue = $filter->filter($value);
                    $filteredData = array_merge($filteredData, $filteredValue);
                }
            }

            $collectionData = $filteredData;
        }


        return new static($collectionData, $this->options);
    }