Code Duplication    Length = 13-13 lines in 2 locations

source/Spiral/ODM/DocumentEntity.php 1 location

@@ 445-457 (lines=13) @@
442
     */
443
    public function hasUpdates($field = null, $atomicsOnly = false)
444
    {
445
        if (empty($field)) {
446
            if (!empty($this->updates) || !empty($this->atomics)) {
447
                return true;
448
            }
449
450
            foreach ($this->fields as $field => $value) {
451
                if ($value instanceof DocumentAccessorInterface && $value->hasUpdates()) {
452
                    return true;
453
                }
454
            }
455
456
            return false;
457
        }
458
459
        foreach ($this->atomics as $operations) {
460
            if (array_key_exists($field, $operations)) {

source/Spiral/ORM/RecordEntity.php 1 location

@@ 582-594 (lines=13) @@
579
     */
580
    public function hasUpdates($field = null)
581
    {
582
        if (empty($field)) {
583
            if (!empty($this->updates)) {
584
                return true;
585
            }
586
587
            foreach ($this->fields as $field => $value) {
588
                if ($value instanceof RecordAccessorInterface && $value->hasUpdates()) {
589
                    return true;
590
                }
591
            }
592
593
            return false;
594
        }
595
596
        if (array_key_exists($field, $this->updates)) {
597
            return true;