TYPO3 CMS  TYPO3_7-6
CombinedRecord.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 {
25  protected $table;
26 
30  protected $versionRecord;
31 
35  protected $liveRecord;
36 
45  public static function create($table, $liveId, $versionId)
46  {
49  return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord::class, $table, $liveRecord, $versionRecord);
50  }
51 
60  public static function createFromArrays($table, array $liveRow, array $versionRow)
61  {
64  return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord::class, $table, $liveRecord, $versionRecord);
65  }
66 
75  {
76  $this->setTable($table);
77  $this->setLiveRecord($liveRecord);
78  $this->setVersionRecord($versionRecord);
79  }
80 
86  public function getTable()
87  {
88  return $this->table;
89  }
90 
97  public function setTable($table)
98  {
99  $this->table = $table;
100  }
101 
107  public function getLiveRecord()
108  {
109  return $this->liveRecord;
110  }
111 
119  {
120  $this->liveRecord = $liveRecord;
121  }
122 
128  public function getVersionRecord()
129  {
130  return $this->versionRecord;
131  }
132 
140  {
141  $this->versionRecord = $versionRecord;
142  }
143 
149  public function getLiveId()
150  {
151  return $this->getLiveRecord()->getUid();
152  }
153 
159  public function getVersiondId()
160  {
161  return $this->getVersionRecord()->getUid();
162  }
163 }
static createFromArrays($table, array $liveRow, array $versionRow)
setVersionRecord(DatabaseRecord $versionRecord)
__construct($table, DatabaseRecord $liveRecord, DatabaseRecord $versionRecord)
static create($table, $liveId, $versionId)