protected function proceedChangeSetsDependsOnAndNeededBy(array $changeSet)
    {
        $keysToUnset = array('id', 'number', 'revision', 'ref');

        // Take care of neededBy
        if (isset($changeSet['neededBy']) === true) {
            foreach ($changeSet['neededBy'] as $neededBy) {
                $neededByData = array(
                    'changeset' => $changeSet['id'],
                    'identifier' => $neededBy['id'],
                    'number' => $neededBy['number'],
                    'revision' => $neededBy['revision'],
                    'ref' => $neededBy['ref'],
                    'status' => Database::TMP_DEPENDS_NEEDED_STATUS_NEEDEDBY
                );
                $this->getDatabase()->insertRecord(Database::TABLE_TMP_DEPENDS_NEEDED, $neededByData);

                $neededBy = $this->unsetKeys($neededBy, $keysToUnset);
                $this->checkIfAllValuesWereProceeded($neededBy, 'neededBy');
            }

            unset($neededBy);
        }

        // Take care of dependsOn
        if (isset($changeSet['dependsOn']) === true) {

            $keysToUnset[] = 'isCurrentPatchSet';

            foreach ($changeSet['dependsOn'] as $dependsOn) {
                $dependsOnData = array(
                    'changeset' => $changeSet['id'],
                    'identifier' => $dependsOn['id'],
                    'number' => $dependsOn['number'],
                    'revision' => $dependsOn['revision'],
                    'ref' => $dependsOn['ref'],
                    'is_current_patchset' => (int) $dependsOn['isCurrentPatchSet'],
                    'status' => Database::TMP_DEPENDS_NEEDED_STATUS_DEPENDSON
                );
                $this->getDatabase()->insertRecord(Database::TABLE_TMP_DEPENDS_NEEDED, $dependsOnData);

                $dependsOn = $this->unsetKeys($dependsOn, $keysToUnset);
                $this->checkIfAllValuesWereProceeded($dependsOn, 'dependsOn');
            }

            unset($dependsOn);
        }
    }