‪TYPO3CMS  9.5
EntityContext.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
26 {
30  protected ‪$workspaceId = 0;
31 
35  protected ‪$languageId = 0;
36 
40  public function ‪getWorkspaceId(): int
41  {
42  return ‪$this->workspaceId;
43  }
44 
49  public function ‪withWorkspaceId(int ‪$workspaceId): self
50  {
51  if ($this->workspaceId === ‪$workspaceId) {
52  return $this;
53  }
54  $target = clone $this;
55  $target->workspaceId = ‪$workspaceId;
56  return $target;
57  }
58 
62  public function ‪getLanguageId(): int
63  {
64  return ‪$this->languageId;
65  }
66 
71  public function ‪withLanguageId(int ‪$languageId): self
72  {
73  if ($this->languageId === ‪$languageId) {
74  return $this;
75  }
76  $target = clone $this;
77  $target->languageId = ‪$languageId;
78  return $target;
79  }
80 }
‪TYPO3\CMS\Core\DataHandling\Model\EntityContext
Definition: EntityContext.php:26
‪TYPO3\CMS\Core\DataHandling\Model\EntityContext\$languageId
‪int $languageId
Definition: EntityContext.php:33
‪TYPO3\CMS\Core\DataHandling\Model\EntityContext\withWorkspaceId
‪static withWorkspaceId(int $workspaceId)
Definition: EntityContext.php:47
‪TYPO3\CMS\Core\DataHandling\Model\EntityContext\getLanguageId
‪int getLanguageId()
Definition: EntityContext.php:60
‪TYPO3\CMS\Core\DataHandling\Model
Definition: EntityContext.php:4
‪TYPO3\CMS\Core\DataHandling\Model\EntityContext\$workspaceId
‪int $workspaceId
Definition: EntityContext.php:29
‪TYPO3\CMS\Core\DataHandling\Model\EntityContext\withLanguageId
‪static withLanguageId(int $languageId)
Definition: EntityContext.php:69
‪TYPO3\CMS\Core\DataHandling\Model\EntityContext\getWorkspaceId
‪int getWorkspaceId()
Definition: EntityContext.php:38