filterFields example

$items = $this->fieldResolver->resolveFields($this->type, $items);
        }

        $result->items = $items;

        return $result;
    }

    public function save(array $data, ?int $id = null): int
    {
        $this->validateFields($data);
        $data = $this->filterFields($data);
        $data = $this->quoteFields($data);

        $data['updated_at'] = date('Y-m-d H:i:s');
        if ($id) {
            $this->connection->update($this->type->getTableName()$data['id' => $id]);
        } else {
            $data['created_at'] = date('Y-m-d H:i:s');
            $this->connection->insert($this->type->getTableName()$data);
            $id = (int) $this->connection->lastInsertId();
        }

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