/** * Push all tables in the given page tree. * * @param Tx_Contentstage_Domain_Repository_ContentRepository $fromRepository Repository to push from. * @param Tx_Contentstage_Domain_Repository_ContentRepository $toRepository Repository to push to. * @param int $root The root id of the page tree. * @return void */ protected function _pushTables(Tx_Contentstage_Domain_Repository_ContentRepository $fromRepository, Tx_Contentstage_Domain_Repository_ContentRepository $toRepository, $root = 0) { $tables = $fromRepository->getTables(); foreach ($tables as $table => &$data) { if (substr($table, -3) === '_mm' || $this->ignoreSyncTables[$table] || !$this->tca->isValidTca($table)) { $this->log->log('ignored: ' . $table, Tx_CabagExtbase_Utility_Logging::INFORMATION); continue; } // check if the page changes should be pushed if ($this->review->getPushPageChanges()) { // usual case, push everything from a page and it's dependicies $resource = $fromRepository->findInPageTree($root, $table); } else { $resource = $fromRepository->findReviewRecords($this->review, $table); } $this->pushTable($resource, $toRepository); } $this->pushDependencies($fromRepository, $toRepository); }
/** * Resolves the table => array of uids array. * * @param Tx_Contentstage_Domain_Repository_ContentRepository $repository The repository to get the data from. * @param array $uidsByTable The array with table => uids pairs. * @param string $returnField The field to return into the value. * @return string The string representation of the resolved field. */ protected function resolveTables(Tx_Contentstage_Domain_Repository_ContentRepository $repository, &$uidsByTable, $returnField = null) { foreach ($uidsByTable as $table => &$uidData) { if (substr($table, 0, 2) === '__') { continue; } $labelField = $this->getLabelField($table) ?: 'uid'; $resource = $repository->findInPageTree(0, $table, ($returnField !== null ? $returnField . ', ' : '') . $labelField, 'uid IN (' . implode(',', $uidData) . ')', '', 'uid ASC'); $uidData = $resource->all($returnField ?: $labelField); } }