Code Duplication    Length = 13-13 lines in 2 locations

source/Spiral/ODM/DocumentEntity.php 1 location

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

source/Spiral/ORM/RecordEntity.php 1 location

@@ 549-561 (lines=13) @@
546
     */
547
    public function hasUpdates($field = null)
548
    {
549
        if (empty($field)) {
550
            if (!empty($this->updates)) {
551
                return true;
552
            }
553
554
            foreach ($this->fields as $field => $value) {
555
                if ($value instanceof RecordAccessorInterface && $value->hasUpdates()) {
556
                    return true;
557
                }
558
            }
559
560
            return false;
561
        }
562
563
        if (array_key_exists($field, $this->updates)) {
564
            return true;