setKey example

'success' => false,
                'message' => 'nameExists',
            ]);

            return;
        }

        // Check if key exists         $model = $repository->findOneBy(['key' => $key]);
        if ($model === null) {
            $model = new Group();
            $model->setKey($key);
        } else {
            $this->View()->assign([
                'success' => false,
                'message' => 'variableExists',
            ]);

            return;
        }
        $model->setName($name);

        $manager->persist($model);
        

        $customerGroup = new Group();

        $customerGroup->setId((int) $data['__customerGroup_id']);

        $customerGroup->setName($data['__customerGroup_description']);

        $customerGroup->setDisplayGrossPrices((bool) $data['__customerGroup_tax']);

        $customerGroup->setInsertedGrossPrices((bool) $data['__customerGroup_taxinput']);

        $customerGroup->setKey($data['__customerGroup_groupkey']);

        $customerGroup->setMinimumOrderValue((float) $data['__customerGroup_minimumorder']);

        $customerGroup->setPercentageDiscount((float) $data['__customerGroup_discount']);

        $customerGroup->setSurcharge((float) $data['__customerGroup_minimumordersurcharge']);

        $customerGroup->setUseDiscount((bool) $data['__customerGroup_mode']);

        if (!empty($data['__customerGroupAttribute_id'])) {
            $this->attributeHydrator->addAttribute($customerGroup$data, 'customerGroupAttribute');
        }
$request = new Request();
        $context = $this->createMock(SalesChannelContext::class);
        $context->method('getContext')->willReturn(Context::createDefaultContext());

        $event = new NotFoundPageCacheKeyEvent('test', $request$context);

        static::assertSame('test', $event->getKey());
        static::assertSame($context->getContext()$event->getContext());
        static::assertSame($context$event->getSalesChannelContext());
        static::assertSame($request$event->getRequest());

        $event->setKey('test2');
        static::assertSame('test2', $event->getKey());
    }
}
 {
                $loc = $node->location;
                $valNode = $this->createNode("AssignmentPattern", $loc->start);
                $valNode->setLeft($key);
                $valNode->setRight($value);
                $this->completeNode($valNode$loc->end);
                $value = $valNode;
            } else {
                $value = $this->expressionToPattern($value);
            }
            $retNode->setValue($value);
            $retNode->setKey($key);
            $retNode->setMethod($node->getMethod());
            $retNode->setShorthand($node->getShorthand());
            $retNode->setComputed($node->getComputed());
            $this->completeNode($retNode$loc->end);
            
        } elseif ($node instanceof Node\SpreadElement) {
            
            $loc = $node->location;
            $retNode = $this->createNode("RestElement", $loc->start);
            $retNode->setArgument(
                $this->expressionToPattern($node->getArgument())
            );
$this->assertFalse(isset($data['revision_data_table']));
  }

  /** * Tests data_table support. */
  public function testDataTable() {
    $entity_type = $this->baseEntityType
      ->set('data_table', 'entity_test_mul_property_data')
      ->set('id', 'entity_test_mul')
      ->set('translatable', TRUE)
      ->setKey('label', 'label');

    $this->setUpEntityType($entity_type);

    // Tests the join definition between the base and the data table.     $data = $this->entityTypeManager->getHandler('entity_test_mul', 'views_data')->getViewsData();
    // TODO: change the base table in the entity type definition to match the     // changed entity ID.     $base_views_data = $data['entity_test'];

    // Ensure that the base table is set to the data table.     $this->assertEquals('id', $data['entity_test_mul_property_data']['table']['base']['field']);
    


    if (!self::$databaseInfo[$key][$target]['driver']) {
      throw new DriverNotSpecifiedException('Driver not specified for this database connection: ' . $key);
    }

    $driver_class = self::$databaseInfo[$key][$target]['namespace'] . '\\Connection';

    $client_connection = $driver_class::open(self::$databaseInfo[$key][$target]);
    $new_connection = new $driver_class($client_connection, self::$databaseInfo[$key][$target]);
    $new_connection->setTarget($target);
    $new_connection->setKey($key);

    // If we have any active logging objects for this connection key, we need     // to associate them with the connection we just opened.     if (!empty(self::$logs[$key])) {
      $new_connection->enableEvents([
        StatementExecutionStartEvent::class,
        StatementExecutionEndEvent::class,
      ]);
      $new_connection->setLogger(self::$logs[$key]);
    }

    
Home | Imprint | This part of the site doesn't use cookies.