Code Duplication    Length = 12-12 lines in 2 locations

src/Entity/Category.php 1 location

@@ 172-183 (lines=12) @@
169
        $this->segments = new ArrayCollection();
170
    }
171
172
    public function hydrate(array $data, bool $useConversions = false, $scalarsOnly = true)
173
    {
174
        if ($data['createdDate']) {
175
            $data['createdDate'] = $this->getDateTimeFromJson($data['createdDate']);
176
        }
177
178
        if ($data['editedDate']) {
179
            $data['editedDate'] = $this->getDateTimeFromJson($data['editedDate']);
180
        }
181
182
        parent::hydrate($data, $useConversions, $scalarsOnly);
183
    }
184
185
    /*
186
     * Collection methods

src/Entity/Product.php 1 location

@@ 378-389 (lines=12) @@
375
        $this->variantGroups = new ArrayCollection();
376
    }
377
378
    public function hydrate(array $data, bool $useConversions = false, $scalarsOnly = true)
379
    {
380
        if ($data['created']) {
381
            $data['created'] = $this->getDateTimeFromJson($data['created']);
382
        }
383
384
        if ($data['updated']) {
385
            $data['updated'] = $this->getDateTimeFromJson($data['updated']);
386
        }
387
388
        parent::hydrate($data, $useConversions, $scalarsOnly);
389
    }
390
391
    /*
392
     * Collection/relation methods