getRelatedEntities example

static::assertNotNull($manifest->getCustomFields());
        static::assertCount(1, $manifest->getCustomFields()->getCustomFieldSets());

        /** @var CustomFieldSet $customFieldSet */
        $customFieldSet = $manifest->getCustomFields()->getCustomFieldSets()[0];
        static::assertEquals('custom_field_test', $customFieldSet->getName());
        static::assertEquals([
            'en-GB' => 'Custom field test',
            'de-DE' => 'Zusatzfeld Test',
        ]$customFieldSet->getLabel());
        static::assertEquals(['product', 'customer']$customFieldSet->getRelatedEntities());
        static::assertTrue($customFieldSet->getGlobal());

        static::assertCount(2, $customFieldSet->getFields());

        $fields = $customFieldSet->getFields();

        static::assertSame('bla_test', $fields[0]->getName());
        static::assertFalse($fields[0]->isAllowCustomerWrite());
        static::assertFalse($fields[0]->isAllowCartExpose());

        static::assertSame('bla_test2', $fields[1]->getName());
        
static::assertNotNull($manifest->getCustomFields());
        static::assertCount(1, $manifest->getCustomFields()->getCustomFieldSets());

        /** @var CustomFieldSet $customFieldSet */
        $customFieldSet = $manifest->getCustomFields()->getCustomFieldSets()[0];
        static::assertEquals('custom_field_test', $customFieldSet->getName());
        static::assertEquals([
            'en-GB' => 'Custom field test',
            'de-DE' => 'Zusatzfeld Test',
        ]$customFieldSet->getLabel());
        static::assertEquals(['product', 'customer']$customFieldSet->getRelatedEntities());
        static::assertTrue($customFieldSet->getGlobal());

        static::assertCount(2, $customFieldSet->getFields());

        $fields = $customFieldSet->getFields();

        static::assertSame('bla_test', $fields[0]->getName());
        static::assertFalse($fields[0]->isAllowCustomerWrite());
        static::assertFalse($fields[0]->isAllowCartExpose());

        static::assertSame('bla_test2', $fields[1]->getName());
        
Home | Imprint | This part of the site doesn't use cookies.