Get the reverse diff for this diff

@return PropelDatabaseDiff
438329
public function getReverseDiff()
    {
        $diff = new self();
        $diff->setAddedTables($this->getRemovedTables());
        // idMethod is not set for tables build from reverse engineering
        // FIXME: this should be handled by reverse classes
        foreach ($diff->getAddedTables() as $name => $table) {
            if ($table->getIdMethod() == IDMethod::NO_ID_METHOD) {
                $table->setIdMethod(IDMethod::NATIVE);
            }
        }
        $diff->setRemovedTables($this->getAddedTables());
        $diff->setRenamedTables(array_flip($this->getRenamedTables()));
        $tableDiffs = array();
        foreach ($this->getModifiedTables() as $name => $tableDiff) {
            $tableDiffs[$name] = $tableDiff->getReverseDiff();
        }
        $diff->setModifiedTables($tableDiffs);

        return $diff;
    }
1277086
public function getMigrations($reverse = false)
    {
        $files = $this->laravel['files']->glob($this->getPath().'/*_*.php');

        // Once we have the array of files in the directory we will just remove the
        // extension and take the basename of the file which is all we need when
        // finding the migrations that haven't been run against the databases.
        if ($files === false) {
            return array();
        }

        $files = array_map(function ($file) {
            return str_replace('.php', '', basename($file));

        }, $files);

        // Once we have all of the formatted file names we will sort them and since
        // they all start with a timestamp this should give us the migrations in
        // the order they were actually created by the application developers.
        sort($files);

        if ($reverse) {
            return array_reverse($files);
        }

        return $files;
    }
672667
public function properties() {
    $props = array();

    if ($this->itemScope()) {
      $toTraverse = array($this);

      foreach ($this->itemRef() as $itemref) {
        $children = $this->ownerDocument->xpath()->query('//*[@id="'.$itemref.'"]');
        foreach($children as $child) {
          $this->traverse($child, $toTraverse, $props, $this);
        }
      }
      while (count($toTraverse)) {
        $this->traverse($toTraverse[0], $toTraverse, $props, $this);
      }
    }

    return $props;
  }
577819
public function diff(Version $againstVersion = null)
    {
        $model = $this->getModel();
        $diff  = $againstVersion ? $againstVersion->getModel() : $this->versionable()->withTrashed()->first()->currentVersion()->getModel();

        $diffArray = array_diff_assoc($diff->getAttributes(), $model->getAttributes());

        if (isset( $diffArray[ $model->getCreatedAtColumn() ] )) {
            unset( $diffArray[ $model->getCreatedAtColumn() ] );
        }
        if (isset( $diffArray[ $model->getUpdatedAtColumn() ] )) {
            unset( $diffArray[ $model->getUpdatedAtColumn() ] );
        }
        if (method_exists($model, 'getDeletedAtColumn') && isset( $diffArray[ $model->getDeletedAtColumn() ] )) {
            unset( $diffArray[ $model->getDeletedAtColumn() ] );
        }

        return $diffArray;
    }
857215
public function getDeleteDiff()
    {
        $collectionItems = $this->collection->toArray();

        return array_values(array_diff_key(
            array_combine(array_map('spl_object_id', $this->snapshot), $this->snapshot),
            array_combine(array_map('spl_object_id', $collectionItems), $collectionItems)
        ));
    }
149766
function diff( $old, $new )
    {
        $datatype = $this->dataType();
        $result = $datatype->diff( $old, $new );
        return $result;
    }
441369
public function getDepthToOriginalContainer() {
		$depth = 0;
		$ancestry = $this->getAncestry();
		foreach ($ancestry as $a) {
			$ancestor = get_entity($a);
			if ($ancestor instanceof self) {
				$depth++;
			}
		}
		return $depth;
	}
1096365
public function getChangeSet()
    {
        return [
            'attributes'    => $this->filterNotSavedProperties($this->attributes->calculateChangeSet()),
            'embedOne'      => $this->hasOneEmbeds->calculateChangeSet(),
            'embedMany'     => $this->hasManyEmbeds->calculateChangeSet(),
        ];
    }
1296138
public function getAncestry() {
		$ancestry = array();
		$container = $this;
		while ($container instanceof ElggEntity) {
			array_unshift($ancestry, $container->guid);
			$container = $container->getContainerEntity();
		}
		return $ancestry;
	}
1255227
public function getDirty()
    {
        $dirty = [];

        foreach ($this->attributes as $key => $value) {
            if (! array_key_exists($key, $this->original)) {
                $dirty[$key] = $value;
            } elseif ($value !== $this->original[$key] &&
                                 ! $this->originalIsNumericallyEquivalent($key)) {
                $dirty[$key] = $value;
            }
        }

        return $dirty;
    }
662860
public function getChangelog($diff = null)
    {
        if (!$diff) {
            return $this->data['changelog'];
        }

        $diffLog = [];
        foreach ((array)$this->data['changelog'] as $version => $changelog) {
            preg_match("/[\w\-\.]+/", $version, $cleanVersion);

            if (!$cleanVersion || version_compare($diff, $cleanVersion[0], '>=')) {
                continue;
            }

            $diffLog[$version] = $changelog;
        }

        return $diffLog;
    }
1080339
public function getReverseDiff()
    {
        $diff = new self();

        // tables
        $diff->setFromTable($this->toTable);
        $diff->setToTable($this->fromTable);

        // columns
        if ($this->hasAddedColumns()) {
            $diff->setRemovedColumns($this->addedColumns);
        }

        if ($this->hasRemovedColumns()) {
            $diff->setAddedColumns($this->removedColumns);
        }

        if ($this->hasRenamedColumns()) {
            $renamedColumns = [];
            foreach ($this->renamedColumns as $columnRenaming) {
                $renamedColumns[] = array_reverse($columnRenaming);
            }
            $diff->setRenamedColumns($renamedColumns);
        }

        if ($this->hasModifiedColumns()) {
            $columnDiffs = [];
            foreach ($this->modifiedColumns as $name => $columnDiff) {
                $columnDiffs[$name] = $columnDiff->getReverseDiff();
            }
            $diff->setModifiedColumns($columnDiffs);
        }

        // pks
        if ($this->hasRemovedPkColumns()) {
            $diff->setAddedPkColumns($this->removedPkColumns);
        }

        if ($this->hasAddedPkColumns()) {
            $diff->setRemovedPkColumns($this->addedPkColumns);
        }

        if ($this->hasRenamedPkColumns()) {
            $renamedPkColumns = [];
            foreach ($this->renamedPkColumns as $columnRenaming) {
                $renamedPkColumns[] = array_reverse($columnRenaming);
            }
            $diff->setRenamedPkColumns($renamedPkColumns);
        }

        // indices
        if ($this->hasRemovedIndices()) {
            $diff->setAddedIndices($this->removedIndices);
        }

        if ($this->hasAddedIndices()) {
            $diff->setRemovedIndices($this->addedIndices);
        }

        if ($this->hasModifiedIndices()) {
            $indexDiffs = [];
            foreach ($this->modifiedIndices as $name => $indexDiff) {
                $indexDiffs[$name] = array_reverse($indexDiff);
            }
            $diff->setModifiedIndices($indexDiffs);
        }

        // fks
        if ($this->hasAddedFks()) {
            $diff->setRemovedFks($this->addedFks);
        }

        if ($this->hasRemovedFks()) {
            $diff->setAddedFks($this->removedFks);
        }

        if ($this->hasModifiedFks()) {
            $fkDiffs = [];
            foreach ($this->modifiedFks as $name => $fkDiff) {
                $fkDiffs[$name] = array_reverse($fkDiff);
            }
            $diff->setModifiedFks($fkDiffs);
        }

        return $diff;
    }
1146402
function diff( $old, $new, $options = false )
    {
        $diff = new eZDiff();
        $diff->setDiffEngineType( $diff->engineType( 'container' ) );
        $diff->initDiffEngine();
        $diffObject = $diff->diff( $old, $new );
        return $diffObject;
    }
1062871
public function getDirty()
    {
        $dirty    = [];
        $original = $this->getCastedOriginal();

        foreach ($this->attributes as $key => $value) {
            if ($this->hasCast($key, $value)) {
                $value = $this->castAttribute($key, $value);
            }

            if (
                ! array_key_exists($key, $original) ||
                ($value !== $original[$key] && ! $this->originalIsNumericallyEquivalent($key))
            ) {
                $dirty[$key] = $value;
            }
        }

        return $dirty;
    }
395959
public function getRelativeOffset() {
		if($this->getParent()) {
			return $this->id - $this->getParent()->getID();
		}

		return $this->id;
	}
172167
public function calculateChangeSet()
    {
        $set = [];
        foreach ($this->current as $key => $current) {
            $original = isset($this->original[$key]) ? $this->original[$key] : null;
            $set[$key]['old'] = $original;
            $set[$key]['new'] = $current;
        }
        foreach ($this->remove as $key) {
            $set[$key]['old'] = $this->original[$key];
            $set[$key]['new'] = null;
        }
        ksort($set);
        return $set;
    }
585890
public function getChangelogMinDate()
    {
        $result = null;
        $asChange = 'c';
        $tblChange = $this->resource->getTableName(EChange::ENTITY_NAME);
        /* select from account */
        $query = $this->conn->select();
        $query->from([$asChange => $tblChange], [EChange::A_DATE_CHANGED]);
        /* order by */
        $query->order([$asChange . '.' . EChange::A_DATE_CHANGED . ' ASC']);
        /* perform query */
        $result = $this->conn->fetchOne($query);
        if ($result < self::DATE_MIN) {
            $result = self::DATE_MIN;
        }
        return $result;
    }