Skip to content

Commit

Permalink
Introduced dedicated getter for Content item Id
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed May 23, 2024
1 parent b2f9e93 commit aa9a7a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/contracts/Repository/Values/Content/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
*/
abstract class Content extends ValueObject
{
public function getId(): int
{
return $this->getVersionInfo()->getContentInfo()->getId();
}

public function getContentInfo(): ContentInfo
{
return $this->getVersionInfo()->getContentInfo();
}

/**
* Returns the VersionInfo for this version.
*
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Repository/Values/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ abstract class User extends Content implements UserReference
*/
public function getUserId(): int
{
return $this->id;
return $this->getId();
}
}

Expand Down

0 comments on commit aa9a7a4

Please sign in to comment.