getComment example

        if ($template === 'sCANCELEDQUESTION') {
            // 'Frage gesendet' marks an order, when its customer got an "Ask Reason" mail             // Compatible with Shopware 3
            $orderRepository = $this->get('models')->getRepository(Order::class);
            $model = $orderRepository->find($orderId);
            $model->setComment('Frage gesendet');
            $this->get('models')->flush();
        } else {
            $orderRepository = $this->get('models')->getRepository(Order::class);
            $model = $orderRepository->find($orderId);
            $model->setComment($model->getComment() . ' Gutschein gesendet');
            $this->get('models')->flush();
        }

        $this->View()->assign(['success' => true]);
    }

    /** * Get data for the statistics view * * @return void */
    
/** * Tests schema API for the MySQL driver. * * @group Database */
class SchemaTest extends DriverSpecificSchemaTestBase {

  /** * {@inheritdoc} */
  public function checkSchemaComment(string $description, string $table, string $column = NULL): void {
    $comment = $this->schema->getComment($table$column);
    $max_length = $column ? 255 : 60;
    $description = Unicode::truncate($description$max_length, TRUE, TRUE);
    $this->assertSame($description$comment, 'The comment matches the schema description.');
  }

  /** * {@inheritdoc} */
  protected function assertCollation(): void {
    // Make sure that varchar fields have the correct collations.     $columns = $this->connection->query('SHOW FULL COLUMNS FROM {test_table}');
    

    }

    private function handleArrayNode(ArrayNode $node, ClassBuilder $class, string $namespace): void
    {
        $childClass = new ClassBuilder($namespace$node->getName());
        $childClass->setAllowExtraKeys($node->shouldIgnoreExtraKeys());
        $class->addRequire($childClass);
        $this->classes[] = $childClass;

        $hasNormalizationClosures = $this->hasNormalizationClosures($node);
        $comment = $this->getComment($node);
        if ($hasNormalizationClosures) {
            $comment = sprintf(" * @template TValue\n * @param TValue \$value\n%s", $comment);
            $comment .= sprintf(' * @return %s|$this'."\n", $childClass->getFqcn());
            $comment .= sprintf(' * @psalm-return (TValue is array ? %s : static)'."\n ", $childClass->getFqcn());
        }
        if ('' !== $comment) {
            $comment = "/**\n$comment*/\n";
        }

        $property = $class->addProperty(
            $node->getName(),
            
$platform = $this->connection->getDatabasePlatform();
        if (!$platform instanceof AbstractPlatform) {
            throw new \RuntimeException('Database platform can not be detected');
        }

        return $platform;
    }

    private function cleanup(Schema $schema): void
    {
        foreach ($schema->getTables() as $table) {
            if ($table->getComment() === self::COMMENT) {
                $schema->dropTable($table->getName());

                continue;
            }

            foreach ($table->getForeignKeys() as $foreignKey) {
                if (\str_starts_with($foreignKey->getName(), 'fk_ce_')) {
                    $table->removeForeignKey($foreignKey->getName());
                }
            }

            
/** * Tests schema API for the PostgreSQL driver. * * @group Database */
class SchemaTest extends DriverSpecificSchemaTestBase {

  /** * {@inheritdoc} */
  public function checkSchemaComment(string $description, string $table, string $column = NULL): void {
    $this->assertSame($description$this->schema->getComment($table$column), 'The comment matches the schema description.');
  }

  /** * {@inheritdoc} */
  protected function checkSequenceRenaming(string $tableName): void {
    // For PostgreSQL, we also need to check that the sequence has been renamed.     // The initial name of the sequence has been generated automatically by     // PostgreSQL when the table was created, however, on subsequent table     // renames the name is generated by Drupal and can not be easily     // re-constructed. Hence we can only check that we still have a sequence on


    /** * @return array */
    public function convertVoteStruct(Vote $vote)
    {
        $data = [
            'id' => $vote->getId(),
            'name' => $vote->getName(),
            'headline' => $vote->getHeadline(),
            'comment' => $vote->getComment(),
            'points' => $vote->getPoints(),
            'active' => true,
            'email' => $vote->getEmail(),
            'answer' => $vote->getAnswer(),
            'datum' => '0000-00-00 00:00:00',
            'answer_date' => '0000-00-00 00:00:00',
            'attributes' => $vote->getAttributes(),
        ];

        if ($vote->hasAttribute('core')) {
            $data['attribute'] = $vote->getAttribute('core');
        }
$customEntity = [
            'name' => 'custom_entity_extension',
            'fields' => '[{"name":"product","reference":"product","onDelete":"set-null","inherited":true,"type":"one-to-one"}]',
        ];

        $updater = new SchemaUpdater();
        $updater->applyCustomEntities($schema[$customEntity]);

        $this->assertColumns($schema, 'product', ['customentityextensionproduct']);

        $productTable = $schema->getTable('product');
        $columnComment = $productTable->getColumn('customentityextensionproduct')->getComment();
        static::assertSame('custom-entity-element', $columnComment);
    }

    public function testBlogExample(): void
    {
        $entities = [
            [
                'name' => 'custom_entity_blog',
                'fields' => '[{"name":"position","storeApiAware":true,"type":"int","required":false},{"name":"rating","storeApiAware":true,"type":"float","required":false},{"name":"title","storeApiAware":true,"type":"string","translatable":true,"required":true},{"name":"content","storeApiAware":true,"allowHtml":true,"type":"text","translatable":true,"required":false},{"name":"products","storeApiAware":true,"reference":"product","inherited":false,"onDelete":"cascade","type":"many-to-many"},{"name":"top_seller","storeApiAware":true,"reference":"product","inherited":false,"onDelete":"set-null","type":"many-to-one","required":false},{"name":"comments","storeApiAware":true,"reference":"custom_entity_blog_comment","inherited":false,"onDelete":"set-null","type":"one-to-many","reverseRequired":false},{"name":"author","storeApiAware":false,"reference":"user","inherited":false,"onDelete":"set-null","type":"one-to-one","required":false}]',
            ],
            [
                
Home | Imprint | This part of the site doesn't use cookies.