getTableColumns example

/** * @param string $table * @param array $data * * @throws Exception * * @return array */
    private function filter($table$data)
    {
        $columns = $this->mapping->getTableColumns($table);
        $readOnly = $this->getReadOnlyColumns($table);

        $result = [];
        foreach ($columns as $column) {
            if ($this->mapping->isIdentifierColumn($table$column->getName())) {
                continue;
            }

            if (!\array_key_exists($column->getName()$data)) {
                continue;
            }

            


    /** * {@inheritdoc} */
    public function getList($table)
    {
        if (!$this->tableMapping->isAttributeTable($table)) {
            return [];
        }

        $columns = $this->tableMapping->getTableColumns($table);
        $configuration = $this->getTableConfiguration($table);

        $items = [];
        foreach ($columns as $column) {
            $name = strtolower($column->getName());
            $default = $column->getDefault();

            if ($default === 'NULL') {
                $default = null;
            }

            
// cms-aware specific fields                 'sw_cms_page_id',
                'sw_cms_page_version_id',
                'sw_og_image_id',
                'sw_slot_config',

                // fields specific for this custom entity                 'custom_entity_string_field',
                'custom_entity_int_field',
            ],
            $this->getTableColumns(self::CUSTOM_ENTITY_NAME),
            'Exactly these columns should exist for this cms-aware custom entity'
        );

        static::assertTrue(
            $this->dbHasTable(self::CUSTOM_ENTITY_NAME . '_translation'),
            'The translation table for this custom entity should be created'
        );

        static::assertEqualsCanonicalizing(
            [
                // fields every custom entity will have
Home | Imprint | This part of the site doesn't use cookies.