Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
EZP-24711: Added common base for PolicyCreateStruct / PolicyUpdateStruct
Browse files Browse the repository at this point in the history
  • Loading branch information
blankse committed Jun 16, 2016
1 parent c8208b7 commit 9477509
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 33 deletions.
17 changes: 1 addition & 16 deletions eZ/Publish/API/Repository/Values/User/PolicyCreateStruct.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@

namespace eZ\Publish\API\Repository\Values\User;

use eZ\Publish\API\Repository\Values\ValueObject;

/**
* This class is used to create a policy
*/
abstract class PolicyCreateStruct extends ValueObject
abstract class PolicyCreateStruct extends PolicyStruct
{
/**
* Name of module, associated with the Policy
Expand All @@ -33,17 +31,4 @@ abstract class PolicyCreateStruct extends ValueObject
* @var string
*/
public $function;

/**
* Returns list of limitations added to policy
*
* @return \eZ\Publish\API\Repository\Values\User\Limitation[]
*/
abstract public function getLimitations();

/**
* Adds a limitation with the given identifier and list of values
* @param Limitation $limitation
*/
abstract public function addLimitation( Limitation $limitation );
}
29 changes: 29 additions & 0 deletions eZ/Publish/API/Repository/Values/User/PolicyStruct.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* This file is part of the eZ Publish Kernel package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
* @version //autogentag//
*/

namespace eZ\Publish\API\Repository\Values\User;

use eZ\Publish\API\Repository\Values\ValueObject;

abstract class PolicyStruct extends ValueObject
{
/**
* Returns list of limitations added to policy.
*
* @return \eZ\Publish\API\Repository\Values\User\Limitation[]
*/
abstract public function getLimitations();

/**
* Adds a limitation with the given identifier and list of values.
*
* @param Limitation $limitation
*/
abstract public function addLimitation( Limitation $limitation );
}
18 changes: 1 addition & 17 deletions eZ/Publish/API/Repository/Values/User/PolicyUpdateStruct.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,10 @@

namespace eZ\Publish\API\Repository\Values\User;

use eZ\Publish\API\Repository\Values\ValueObject;

/**
* This class is used for updating a policy. The limitations of the policy are replaced
* with those which are added in instances of this class
*/
abstract class PolicyUpdateStruct extends ValueObject
abstract class PolicyUpdateStruct extends PolicyStruct
{
/**
* Returns list of limitations added to policy
*
* @return \eZ\Publish\API\Repository\Values\User\Limitation[]
*/
abstract public function getLimitations();

/**
* Adds a limitation to the policy - if a Limitation exists with the same identifier
* the existing limitation is replaced
* @param \eZ\Publish\API\Repository\Values\User\Limitation $limitation
*/
abstract public function addLimitation( Limitation $limitation );

}

0 comments on commit 9477509

Please sign in to comment.