{@inheritdoc}

@suppress PhanParamTooManyInternal
494011
public function query($statement, $param1 = null, $param2 = null, $param3 = null)
    {
        if ($param3 !== null) {
            return parent::query($statement, $param1, $param2, $param3);
        }

        if ($param2 !== null) {
            return parent::query($statement, $param1, $param2);
        }

        if ($param1 !== null) {
            return parent::query($statement, $param1);
        }

        return parent::query($statement);
    }
244166
public function bindParam($paramNo, &$param, $type = null, $maxLength = null, $driverData = null)
    {
        $this->bindValue($paramNo, $param, $type);
        return true;
    }
493774
public function bindParam($parameter = null, & $value = null, $type = null, $maxLength = null, $driverData = null)
    {
        parent::bindParam($parameter, $value, $type);
        
        return $this;
    }
1141832
function _setParams( $params, $defaults=FALSE ) {
    if( !is_array( $params))
      $params = array();
    $input = array();
    foreach( $params as $paramKey => $paramValue ) {
      if( is_array( $paramValue )) {
        foreach( $paramValue as $pkey => $pValue ) {
          if(( '"' == substr( $pValue, 0, 1 )) && ( '"' == substr( $pValue, -1 )))
            $paramValue[$pkey] = substr( $pValue, 1, ( strlen( $pValue ) - 2 ));
        }
      }
      elseif(( '"' == substr( $paramValue, 0, 1 )) && ( '"' == substr( $paramValue, -1 )))
        $paramValue = substr( $paramValue, 1, ( strlen( $paramValue ) - 2 ));
      if( 'VALUE' == strtoupper( $paramKey ))
        $input['VALUE']                 = strtoupper( $paramValue );
      else
        $input[strtoupper( $paramKey )] = $paramValue;
    }
    if( is_array( $defaults )) {
      foreach( $defaults as $paramKey => $paramValue ) {
        if( !isset( $input[$paramKey] ))
          $input[$paramKey] = $paramValue;
      }
    }
    return (0 < count( $input )) ? $input : null;
  }
1209756
static void setParameters(PreparedStatement ps, List<Parameter> params, boolean namesAllowed)
            throws SQLException {
        for (int i = 1; i <= params.size(); i++) {
            if (params.get(i - 1).hasName() && !namesAllowed)
                throw new SQLException("named parameter found but sql does not contain names");
            Object o = params.get(i - 1).value();
            try {
                if (o == null)
                    ps.setObject(i, null);
                else if (o == Database.NULL_CLOB)
                    ps.setNull(i, Types.CLOB);
                else if (o == Database.NULL_BLOB)
                    ps.setNull(i, Types.BLOB);
                else {
                    Class<?> cls = o.getClass();
                    if (Clob.class.isAssignableFrom(cls)) {
                        setClob(ps, i, o, cls);
                    } else if (Blob.class.isAssignableFrom(cls)) {
                        setBlob(ps, i, o, cls);
                    } else if (Calendar.class.isAssignableFrom(cls)) {
                        Calendar cal = (Calendar) o;
                        Timestamp t = new java.sql.Timestamp(cal.getTimeInMillis());
                        ps.setTimestamp(i, t, cal);
                    } else if (Time.class.isAssignableFrom(cls)) {
                        Calendar cal = Calendar.getInstance();
                        ps.setTime(i, (Time) o, cal);
                    } else if (Timestamp.class.isAssignableFrom(cls)) {
                        Calendar cal = Calendar.getInstance();
                        ps.setTimestamp(i, (Timestamp) o, cal);
                    } else if (java.sql.Date.class.isAssignableFrom(cls)) {
                        Calendar cal = Calendar.getInstance();
                        ps.setDate(i, (java.sql.Date) o, cal);
                    } else if (java.util.Date.class.isAssignableFrom(cls)) {
                        Calendar cal = Calendar.getInstance();
                        java.util.Date date = (java.util.Date) o;
                        ps.setTimestamp(i, new java.sql.Timestamp(date.getTime()), cal);
                    } else
                        ps.setObject(i, o);
                }
            } catch (SQLException e) {
                log.debug("{} when setting ps.setObject({},{})", e.getMessage(), i, o);
                throw e;
            }
        }
    }
176561
public function selectNMPdo($request, $param = null)
    {
        $statement = $this->getAdapter()->query($request, ADT::QUERY_MODE_PREPARE);
        $result = $statement->execute($param);

        $resultSet = new ResultSet();

        return $resultSet->initialize($result);
    }
1070662
protected function processObject(Parameter $param, &$value)
    {
        // Ensure that the array is associative and not numerically indexed
        if (!isset($value[0]) && ($properties = $param->getProperties())) {
            $knownProperties = array();
            foreach ($properties as $property) {
                $name = $property->getName();
                $sentAs = $property->getWireName();
                $knownProperties[$name] = 1;
                if ($property->getData('xmlAttribute')) {
                    $this->processXmlAttribute($property, $value);
                } elseif (isset($value[$sentAs])) {
                    $this->recursiveProcess($property, $value[$sentAs]);
                    if ($name != $sentAs) {
                        $value[$name] = $value[$sentAs];
                        unset($value[$sentAs]);
                    }
                }
            }

            // Remove any unknown and potentially unsafe properties
            if ($param->getAdditionalProperties() === false) {
                $value = array_intersect_key($value, $knownProperties);
            }
        }
    }
1201759
private function prepare()
    {
        $constantParameters = $this->uriParser->predefinedParameters();
        array_map([$this, 'prepareConstant'], $constantParameters);

        $this->filter();
        $this->sort();

        return $this;
    }
610230
protected function fromArrayRelation($v, $p, $pn, $getter, $setter,
                                                $association, $policy,
                                                Reader $ar,
                                                PolicyResolver $pr,
                                                EntityManagerInterface $em,
                                                \ReflectionClass $refClass) {
        if($v === null) { // Sub-entity as null value
            if($association instanceof OneToMany || $association instanceof ManyToMany) {
                throw new Exceptions\FromArrayException('Field "'.$pn.'" must be a Collection');
            } else if($policy instanceof Policy\Interfaces\DenyUnsetFrom
                      && ($this->$getter() !== null)) { // cannot unset Entity with this policy
                return;
            }
            $this->$setter(null);
            return;
        }
        if(is_array($v)) {
            $idField = 'id';
            $class = static::getEntityFullName($refClass, $association->targetEntity);
            if(!is_subclass_of($class, 'Indaxia\OTR\ITransformable')) {
                throw new Exceptions\FromArrayException('Entity "'.$class.'" must implement ITransformable interface');
            }
            $subPolicy = $policy;
            if($policy instanceof Policy\Interfaces\DenyFrom) {
                $subPolicy = (new Policy\From\Auto())->insideOf($policy);
            }
            
            // sub-Entity
            if($association instanceof OneToOne || $association instanceof ManyToOne)
            {
                $this->fromArrayRelationEntity($v, $p, $pn, $getter, $setter, $association, $policy,
                                   $ar, $pr, $em, $refClass, $idField, $class, $subPolicy);
            
            // Collection
            } else if(($association instanceof OneToMany || $association instanceof ManyToMany)
                      && isset($v['__meta'])
                      && is_array($v['__meta'])
                      && isset($v['collection'])
                      && is_array($v['collection'])) { // OneToMany, ManyToMany
                $this->fromArrayRelationCollection($v, $p, $pn, $getter, $setter, $association, $policy,
                                                   $ar, $pr, $em, $refClass, $idField, $class, $subPolicy);
            }
        } else {
            throw new Exceptions\FromArrayException('Field "'.$pn.'" must be an Entity representation or contain "collection" field');
        }
    }
598850
private function convertParameters(array $parameters, $type, \DOMElement $parent, $keyAttribute = 'key')
    {
        $withKeys = array_keys($parameters) !== range(0, \count($parameters) - 1);
        foreach ($parameters as $key => $value) {
            $element = $this->document->createElement($type);
            if ($withKeys) {
                $element->setAttribute($keyAttribute, $key);
            }

            if ($value instanceof ServiceClosureArgument) {
                $value = $value->getValues()[0];
            }
            if (\is_array($tag = $value)) {
                $element->setAttribute('type', 'collection');
                $this->convertParameters($value, $type, $element, 'key');
            } elseif ($value instanceof TaggedIteratorArgument || ($value instanceof ServiceLocatorArgument && $tag = $value->getTaggedIteratorArgument())) {
                $element->setAttribute('type', $value instanceof TaggedIteratorArgument ? 'tagged' : 'tagged_locator');
                $element->setAttribute('tag', $tag->getTag());

                if (null !== $tag->getIndexAttribute()) {
                    $element->setAttribute('index-by', $tag->getIndexAttribute());

                    if (null !== $tag->getDefaultIndexMethod()) {
                        $element->setAttribute('default-index-method', $tag->getDefaultIndexMethod());
                    }
                }
            } elseif ($value instanceof IteratorArgument) {
                $element->setAttribute('type', 'iterator');
                $this->convertParameters($value->getValues(), $type, $element, 'key');
            } elseif ($value instanceof ServiceLocatorArgument) {
                $element->setAttribute('type', 'service_locator');
                $this->convertParameters($value->getValues(), $type, $element, 'key');
            } elseif ($value instanceof Reference) {
                $element->setAttribute('type', 'service');
                $element->setAttribute('id', (string) $value);
                $behavior = $value->getInvalidBehavior();
                if (ContainerInterface::NULL_ON_INVALID_REFERENCE == $behavior) {
                    $element->setAttribute('on-invalid', 'null');
                } elseif (ContainerInterface::IGNORE_ON_INVALID_REFERENCE == $behavior) {
                    $element->setAttribute('on-invalid', 'ignore');
                } elseif (ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE == $behavior) {
                    $element->setAttribute('on-invalid', 'ignore_uninitialized');
                }
            } elseif ($value instanceof Definition) {
                $element->setAttribute('type', 'service');
                $this->addService($value, null, $element);
            } elseif ($value instanceof Expression) {
                $element->setAttribute('type', 'expression');
                $text = $this->document->createTextNode(self::phpToXml((string) $value));
                $element->appendChild($text);
            } elseif (\is_string($value) && !preg_match('/^[^\x00-\x08\x0B\x0E-\x1A\x1C-\x1F\x7F]*+$/u', $value)) {
                $element->setAttribute('type', 'binary');
                $text = $this->document->createTextNode(self::phpToXml(base64_encode($value)));
                $element->appendChild($text);
            } else {
                if (\in_array($value, ['null', 'true', 'false'], true)) {
                    $element->setAttribute('type', 'string');
                }
                $text = $this->document->createTextNode(self::phpToXml($value));
                $element->appendChild($text);
            }
            $parent->appendChild($element);
        }
    }
792599
public function setNext($param1, $param2 = null)
    {
        if($this->closed)
        {
            throw new LogicException('Boundary has been already closed.');
        }

        $numberOfArgs = func_num_args();
        
        if($numberOfArgs === 2)
        {
            $point = Point::getInstance($param1, $param2);
        }
        elseif($param1 instanceof Point)
        {
            $point = $param1;
        }
        else
        {
            throw new InvalidArgumentException('Passed argument(s) should be coordinations or Point object.');
        }

        $oldNumberOfPoints = $this->numberOfPoints;
        $this->points[$oldNumberOfPoints] = $point;
        $this->numberOfPoints++;

        $diagonalPoint = $this->getDiagonalPoint();

        if(!$diagonalPoint || $diagonalPoint->compareYCoord($point) >= 0)
        {
            $this->diagonalPointYIndex = $oldNumberOfPoints;
        }
        
        if(!$diagonalPoint || $diagonalPoint->compareXCoord($point) <= 0)
        {
            $this->diagonalPointXIndex = $oldNumberOfPoints;
        }

        return $this;
    }
157978
public function persist(PersistenceContext $context, ParentChildMap $map)
    {
        /** @var Row[] $parentRows */
        $parentRows = [];
        /** @var object[] $children */
        $children = [];

        foreach ($map->getItems() as $key => $item) {
            $parentRow = $item->getParent();

            $hasChild = (bool)$item->getChild();
            if ($hasChild) {
                $parentRows[$key] = $parentRow;
                $children[$key]   = $item->getChild();
            }

            if ($this->objectIssetColumnName && !$this->isWithinValueObject) {
                $parentRow->setColumn($this->objectIssetColumnName, $hasChild);
            }
        }

        $this->disableLazyLoadingForRelations(function () use ($context, $children, $parentRows) {
            $this->mapper->persistAllToRows($context, $children, $parentRows);
        });
    }
275514
public function withParam(string $param_name, $param_value, bool $treat_name_as_path = true): ParamHolderInterface
    {
        $param_holder = clone $this;
        if ($treat_name_as_path) {
            $name_parts = array_reverse(explode('.', $param_name));
            $cur_val = &$param_holder->params;
            while (count($name_parts) > 1 && $cur_name = array_pop($name_parts)) {
                if (!isset($cur_val[$cur_name])) {
                    $cur_val[$cur_name] = [];
                }
                $cur_val = &$cur_val[$cur_name];
            }
            $cur_val[$name_parts[0]] = $param_value;
            return $param_holder;
        }

        $param_holder->params[$param_name] = $param_value;
        return $param_holder;
    }
124725
private function executeParallel($stmt, array $values = null): PromiseInterface
    {
        if (is_string($stmt)) {
            $stmt = $this->emulatePrepare((string) $stmt, $values);
        } else {
            if (!$stmt instanceof Statement) {
                throw new \InvalidArgumentException(sprintf('Expected %s object, got %s', Statement::class, get_class($stmt)));
            }
            if (!$stmt instanceof EmulatedStatement) {
                $stmt = $this->emulatePrepare((string) $stmt, $values ?? $stmt->getValues());
            } elseif (null !== $values) {
                $stmt = $stmt->withValues($values);
            }
        }
        try {
            // Clone connection (Mysqli Asynchronous queries require a different connection to work properly)
            $credentials = $this->getCredentials();
            $cnx         = self::createLink($credentials);
            if ($this->hasOption('charset')) {
                $cnx->set_charset($this->getOption('charset'));
            }
        } catch (mysqli_sql_exception $e) {
            throw new AccessDeniedException($e->getMessage(), (int) $e->getCode(), $e);
        }

        $stmt->bind();
        $promise = MysqliAsync::query($stmt->getRunnableQuery(), $cnx)->then(function ($result) use ($cnx, $stmt) {
            if (!$result instanceof mysqli_result) {
                $result = null;
            }
            return new Result($cnx, $result);
        });

        return $promise;
    }
655209
@Override
	public SqlContext clobParamIfAbsent(final String paramName, final Reader value, final int len) {
		if (!hasParam(paramName)) {
			clobParam(paramName, value, len);
		}
		return this;
	}
858421
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        $params = $functionParameters;
        switch ( $functionName )
        {
            case $this->BlockName:
            {
                $name ="";
                $menuIni = eZINI::instance( "menu.ini" );

                if ( isset( $functionParameters["name"] ) )
                {
                    $menuName = $tpl->elementValue( $functionParameters["name"], $rootNamespace, $currentNamespace, $functionPlacement );
                    if ( $menuIni->hasVariable( 'SelectedMenu', $menuName ) )
                    {
                        $menuTemplate = $menuIni->variable( 'SelectedMenu', $menuName );
                        if ( $menuTemplate != null )
                        {
                            $uri = "design:menu/$menuTemplate.tpl";
                            $tpl->processURI( $uri, true, $extraParameters, $textElements, $name, $name );
                        }
                    }
                }
            }
        }
    }
80245
private function prepareConstant($parameter)
    {
        if (!$this->uriParser->hasQueryParameter($parameter)) {
            return;
        }

        $callback = [$this, $this->setterMethodName($parameter)];
        $callbackParameter = $this->uriParser->queryParameter($parameter);

        call_user_func($callback, $callbackParameter['value']);
    }