DBDiff\DB\Data\ArrayDiff::tag PHP Метод

tag() публичный Метод

public tag ( $table )
    public function tag($table)
    {
        foreach ($this->sourceBucket as &$entry1) {
            if (is_null($entry1)) {
                continue;
            }
            foreach ($this->targetBucket as &$entry2) {
                if (is_null($entry2)) {
                    continue;
                }
                if ($this->isKeyEqual($entry1, $entry2)) {
                    // unset the fields to ignore
                    $params = ParamsFactory::get();
                    if (isset($params->fieldsToIgnore[$table])) {
                        foreach ($params->fieldsToIgnore[$table] as $fieldToIgnore) {
                            unset($entry1[$fieldToIgnore]);
                            unset($entry2[$fieldToIgnore]);
                        }
                    }
                    $differ = new MapDiffer();
                    $diff = $differ->doDiff($entry2, $entry1);
                    if (!empty($diff)) {
                        $this->diffBucket[] = ['keys' => array_only($entry1, $this->key), 'diff' => $diff];
                    }
                    $entry1 = null;
                    $entry2 = null;
                }
            }
        }
    }