TYPO3 CMS  TYPO3_8-7
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 
96  public function setTable($table)
97  {
98  $this->table = $table;
99  }
100 
106  public function getLiveRecord()
107  {
108  return $this->liveRecord;
109  }
110 
117  {
118  $this->liveRecord = $liveRecord;
119  }
120 
126  public function getVersionRecord()
127  {
128  return $this->versionRecord;
129  }
130 
137  {
138  $this->versionRecord = $versionRecord;
139  }
140 
146  public function getLiveId()
147  {
148  return $this->getLiveRecord()->getUid();
149  }
150 
156  public function getVersiondId()
157  {
158  return $this->getVersionRecord()->getUid();
159  }
160 }
static createFromArrays($table, array $liveRow, array $versionRow)
setVersionRecord(DatabaseRecord $versionRecord)
__construct($table, DatabaseRecord $liveRecord, DatabaseRecord $versionRecord)
static create($table, $liveId, $versionId)