‪TYPO3CMS  ‪main
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 
38  public function ‪getWorkspaceId(): int
39  {
40  return ‪$this->workspaceId;
41  }
42 
46  public function ‪withWorkspaceId(int ‪$workspaceId): self
47  {
48  if ($this->workspaceId === ‪$workspaceId) {
49  return $this;
50  }
51  $target = clone $this;
52  $target->workspaceId = ‪$workspaceId;
53  return $target;
54  }
55 
56  public function ‪getLanguageId(): int
57  {
58  return ‪$this->languageId;
59  }
60 
64  public function ‪withLanguageId(int ‪$languageId): self
65  {
66  if ($this->languageId === ‪$languageId) {
67  return $this;
68  }
69  $target = clone $this;
70  $target->languageId = ‪$languageId;
71  return $target;
72  }
73 }
‪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:44
‪TYPO3\CMS\Core\DataHandling\Model\EntityContext\getLanguageId
‪getLanguageId()
Definition: EntityContext.php:54
‪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:62
‪TYPO3\CMS\Core\DataHandling\Model\EntityContext\getWorkspaceId
‪getWorkspaceId()
Definition: EntityContext.php:36