forked from ezsystems/ezpublish-spi
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
5 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace eZ\Publish\SPI\Persistence\UserPreference; | ||
|
||
interface Handler | ||
{ | ||
/** | ||
* Store UserPreference ValueObject in persistent storage. | ||
* | ||
* @param \eZ\Publish\SPI\Persistence\UserPreference\UserPreferenceSetStruct $setStruct | ||
* | ||
* @return \eZ\Publish\SPI\Persistence\UserPreference\UserPreference | ||
*/ | ||
public function setUserPreference(UserPreferenceSetStruct $setStruct): UserPreference; | ||
|
||
/** | ||
* Get UserPreference by its user ID and name. | ||
* | ||
* @param int $userId | ||
* @param string $name | ||
* | ||
* @return \eZ\Publish\SPI\Persistence\UserPreference\UserPreference | ||
*/ | ||
public function getUserPreferenceByUserIdAndName(int $userId, string $name): UserPreference; | ||
|
||
/** | ||
* @param int $userId | ||
* @param int $offset | ||
* @param int $limit | ||
* | ||
* @return \eZ\Publish\SPI\Persistence\UserPreference\UserPreference[] | ||
*/ | ||
public function loadUserPreferences(int $userId, int $offset, int $limit): array; | ||
|
||
/** | ||
* @param int $userId | ||
* | ||
* @return int | ||
*/ | ||
public function countUserPreferences(int $userId): int; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace eZ\Publish\SPI\Persistence\UserPreference; | ||
|
||
use eZ\Publish\SPI\Persistence\ValueObject; | ||
|
||
class UserPreference extends ValueObject | ||
{ | ||
/** | ||
* ID of the user preference. | ||
* | ||
* @var int | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* The ID of the user this user preference belongs to. | ||
* | ||
* @var int | ||
*/ | ||
public $userId; | ||
|
||
/** | ||
* Name of user preference. | ||
* | ||
* Eg: timezone | ||
* | ||
* @var string | ||
*/ | ||
public $name; | ||
|
||
/** | ||
* Value of user preference. | ||
* | ||
* Eg: America/New_York | ||
* | ||
* @var string | ||
*/ | ||
public $value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace eZ\Publish\SPI\Persistence\UserPreference; | ||
|
||
use eZ\Publish\SPI\Persistence\ValueObject; | ||
|
||
class UserPreferenceSetStruct extends ValueObject | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
public $userId; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $name; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters