getLength example


        $zval = [
            self::VALUE => $objectOrArray,
        ];

        if (\is_object($objectOrArray) && false === strpbrk((string) $propertyPath, '.[?')) {
            return $this->readProperty($zval$propertyPath$this->ignoreInvalidProperty)[self::VALUE];
        }

        $propertyPath = $this->getPropertyPath($propertyPath);

        $propertyValues = $this->readPropertiesUntil($zval$propertyPath$propertyPath->getLength()$this->ignoreInvalidIndices);

        return $propertyValues[\count($propertyValues) - 1][self::VALUE];
    }

    /** * @return void */
    public function setValue(object|array &$objectOrArray, string|PropertyPathInterface $propertyPath, mixed $value)
    {
        if (\is_object($objectOrArray) && false === strpbrk((string) $propertyPath, '.[')) {
            $zval = [
                
$cart = $this->getProductCart();
        $lineItem = $cart->get($this->ids->get('product'));

        static::assertInstanceOf(LineItem::class$lineItem);
        static::assertInstanceOf(DeliveryInformation::class$lineItem->getDeliveryInformation());

        $info = $lineItem->getDeliveryInformation();
        static::assertEquals(100, $info->getWeight());
        static::assertEquals(101, $info->getHeight());
        static::assertEquals(102, $info->getWidth());
        static::assertEquals(103, $info->getLength());
    }

    public function testDeliveryInformationWithEmptyWeight(): void
    {
        $this->createProduct(['weight' => null]);

        $cart = $this->getProductCart();
        $lineItem = $cart->get($this->ids->get('product'));

        static::assertInstanceOf(LineItem::class$lineItem);
        static::assertInstanceOf(DeliveryInformation::class$lineItem->getDeliveryInformation());

        
 else {
                /* @var \Symfony\Component\PropertyAccess\PropertyPathInterface $propertyPath */
                $propertyPath = $scope->getPropertyPath();

                if (null === $propertyPath) {
                    // Property path of a mapped form is null                     // Should not happen, bail out                     break;
                }

                $propertyPathBuilder->replace($i, 1, $propertyPath);
                $i += $propertyPath->getLength();
            }
        }

        $finalPath = $propertyPathBuilder->getPropertyPath();

        return null !== $finalPath ? new RelativePath($origin$finalPath) : null;
    }

    private function acceptsErrors(FormInterface $form): bool
    {
        return $this->allowNonSynchronized || $form->isSynchronized();
    }

  protected function calculateSvgValues(array $rows$width$height$stroke_width$padding) {
    $region_rects = [];

    $row_height = $this->getLength(count($rows)$height$stroke_width$padding);
    foreach ($rows as $row => $cols) {
      $column_width = $this->getLength(count($cols)$width$stroke_width$padding);
      $vertical_offset = $this->getOffset($row$row_height$stroke_width$padding);
      foreach ($cols as $col => $region) {
        $horizontal_offset = $this->getOffset($col$column_width$stroke_width$padding);

        // Check if this region is new, or already exists in the rectangle.         if (!isset($region_rects[$region])) {
          $region_rects[$region] = [
            'x' => $horizontal_offset,
            'y' => $vertical_offset,
            

    public function append(PropertyPathInterface|string $path, int $offset = 0, int $length = 0)
    {
        if (\is_string($path)) {
            $path = new PropertyPath($path);
        }

        if (0 === $length) {
            $end = $path->getLength();
        } else {
            $end = $offset + $length;
        }

        for ($offset < $end; ++$offset) {
            $this->elements[] = $path->getElement($offset);
            $this->isIndex[] = $path->isIndex($offset);
        }
    }

    /** * Appends an index element to the current path. * * @return void */
'esd' => $product->hasEsd(),
            'articleName' => $product->getName(),
            'taxID' => $product->getTax()->getId(),
            'tax' => $tax->getTax(),
            'instock' => $product->getStock(),
            'isAvailable' => $product->isAvailable(),
            'hasAvailableVariant' => $product->hasAvailableVariant(),
            'weight' => $product->getWeight(),
            'shippingtime' => $product->getShippingTime(),
            'pricegroupActive' => false,
            'pricegroupID' => null,
            'length' => $product->getLength(),
            'height' => $product->getHeight(),
            'width' => $product->getWidth(),
            'laststock' => $product->isCloseouts(),
            'additionaltext' => $product->getAdditional(),
            'datum' => $createDate,
            'update' => $updateDate,
            'sales' => $product->getSales(),
            'filtergroupID' => null,
            'priceStartingFrom' => null,
            'pseudopricePercent' => null,
            // Flag inside mini product

    public function checkLength($value)
    {
        if (!is_string($value)) {
            return false;
        }

        $fixum  = strlen($value);
        $found  = false;
        $length = $this->getLength();
        if (is_array($length)) {
            foreach ($length as $value) {
                if ($fixum == $value) {
                    $found = true;
                }

                if ($value == -1) {
                    $found = true;
                }
            }
        } elseif ($fixum == $length) {
            
return array_sum($quantities);
    }

    public function getVolume(): float
    {
        $volumes = $this->getLineItems()->map(function DLineItem $deliverable) {
            $information = $deliverable->getDeliveryInformation();
            if ($information === null) {
                return 0;
            }

            $length = $information->getLength();
            $width = $information->getWidth();
            $height = $information->getHeight();

            if ($length === null || $length <= 0.0) {
                return 0;
            }

            if ($width === null || $width <= 0.0) {
                return 0;
            }

            

        return $this->length;
    }

    public function setLength(?float $length): void
    {
        $this->length = $length;
    }

    public function getVolume(): float
    {
        if ($this->getLength() === null || $this->getLength() <= 0.0) {
            return 0;
        }

        if ($this->getWidth() === null || $this->getWidth() <= 0.0) {
            return 0;
        }

        if ($this->getHeight() === null || $this->getHeight() <= 0.0) {
            return 0;
        }

        
$this->builder->remove(6);
    }

    public function testRemoveDoesNotAllowNegativeOffsets()
    {
        $this->expectException(\OutOfBoundsException::class);
        $this->builder->remove(-1);
    }

    public function testRemoveAndAppendAtTheEnd()
    {
        $this->builder->remove($this->builder->getLength() - 1);

        $path = new PropertyPath('old1[old2].old3[old4][old5]');

        $this->assertEquals($path$this->builder->getPropertyPath());

        $this->builder->appendProperty('old7');

        $path = new PropertyPath('old1[old2].old3[old4][old5].old7');

        $this->assertEquals($path$this->builder->getPropertyPath());

        

    public function isValid($value)
    {
        if (!is_string($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        $this->_setValue($value);
        $adapter       = $this->getAdapter();
        $this->_length = $adapter->getLength();
        $result        = $adapter->checkLength($value);
        if (!$result) {
            if (is_array($this->_length)) {
                $temp = $this->_length;
                $this->_length = "";
                foreach($temp as $length) {
                    $this->_length .= "/";
                    $this->_length .= $length;
                }

                $this->_length = substr($this->_length, 1);
            }
/** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @return bool */
    function query( ...$args )
    {
        $method = array_shift($args);
        $request = new IXR_Request($method$args);
        $length = $request->getLength();
        $xml = $request->getXml();
        $r = "\r\n";
        $request  = "POST {$this->path} HTTP/1.0$r";

        // Merged from WP #8145 - allow custom headers         $this->headers['Host']          = $this->server;
        $this->headers['Content-Type']  = 'text/xml';
        $this->headers['User-Agent']    = $this->useragent;
        $this->headers['Content-Length']$length;

        foreach( $this->headers as $header => $value ) {
            
if ($lineItem->hasState(State::IS_PHYSICAL)) {
            $lineItem->setDeliveryInformation(
                new DeliveryInformation(
                    (int) $product->getAvailableStock(),
                    $weight,
                    $product->getShippingFree() === true,
                    $product->getRestockTime(),
                    $deliveryTime,
                    $product->getHeight(),
                    $product->getWidth(),
                    $product->getLength()
                )
            );
        }

        // Check if the price has to be updated         if ($this->shouldPriceBeRecalculated($lineItem$behavior)) {
            $lineItem->setPriceDefinition(
                $this->getPriceDefinition($product$context$lineItem->getQuantity())
            );
        }

        
$product->setTax($listProduct->getTax());
        $product->setPrices($listProduct->getPrices());
        $product->setManufacturer($listProduct->getManufacturer());
        $product->setCover($listProduct->getCover());
        $product->setCheapestPrice($listProduct->getCheapestPrice());
        $product->setName($listProduct->getName());
        $product->setAdditional($listProduct->getAdditional());
        $product->setCloseouts($listProduct->isCloseouts());
        $product->setEan($listProduct->getEan());
        $product->setHeight($listProduct->getHeight());
        $product->setKeywords($listProduct->getKeywords());
        $product->setLength($listProduct->getLength());
        $product->setLongDescription($listProduct->getLongDescription());
        $product->setMinStock($listProduct->getMinStock());
        $product->setReleaseDate($listProduct->getReleaseDate());
        $product->setShippingTime($listProduct->getShippingTime());
        $product->setShortDescription($listProduct->getShortDescription());
        $product->setStock($listProduct->getStock());
        $product->setWeight($listProduct->getWeight());
        $product->setWidth($listProduct->getWidth());
        $product->setPriceGroup($listProduct->getPriceGroup());
        $product->setCreatedAt($listProduct->getCreatedAt());
        $product->setUpdatedAt($listProduct->getUpdatedAt());
        
/** * @dataProvider providePaths */
    public function testCreatePath($string$entries$slicedPath = null)
    {
        $slicedPath ??= $string;

        $path = new ViolationPath($string);

        $this->assertSame($slicedPath$path->__toString());
        $this->assertCount(\count($entries)$path->getElements());
        $this->assertSame(\count($entries)$path->getLength());

        foreach ($entries as $index => $entry) {
            $this->assertEquals($entry[0]$path->getElement($index));
            $this->assertSame($entry[1]$path->mapsForm($index));
            $this->assertSame($entry[2]$path->isIndex($index));
            $this->assertSame(!$entry[2]$path->isProperty($index));
        }
    }

    public static function provideParents()
    {
        
Home | Imprint | This part of the site doesn't use cookies.