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