setCustomStorage example



  /** * Tests custom storage. * * @covers ::hasCustomStorage * @covers ::setCustomStorage */
  public function testCustomStorage() {
    $definition = BaseFieldDefinition::create($this->fieldType);
    $this->assertFalse($definition->hasCustomStorage());
    $definition->setCustomStorage(TRUE);
    $this->assertTrue($definition->hasCustomStorage());
    $definition->setCustomStorage(FALSE);
    $this->assertFalse($definition->hasCustomStorage());
  }

  /** * Tests default value callbacks. * * @covers ::setDefaultValueCallback */
  public function testDefaultValueCallback() {
    

  public static function createFromFieldStorageDefinition(FieldStorageDefinitionInterface $definition) {
    return static::create($definition->getType())
      ->setCardinality($definition->getCardinality())
      ->setConstraints($definition->getConstraints())
      ->setCustomStorage($definition->hasCustomStorage())
      ->setDescription($definition->getDescription())
      ->setLabel($definition->getLabel())
      ->setName($definition->getName())
      ->setProvider($definition->getProvider())
      ->setRevisionable($definition->isRevisionable())
      ->setSettings($definition->getSettings())
      ->setTargetEntityTypeId($definition->getTargetEntityTypeId())
      ->setTranslatable($definition->isTranslatable());
  }

  /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.