Skip to content

Expand Ratings Entity Interface#3739

Merged
demiankatz merged 3 commits intovufind-org:devfrom
padmasreegade:ratings-entity-interface
Jun 3, 2024
Merged

Expand Ratings Entity Interface#3739
demiankatz merged 3 commits intovufind-org:devfrom
padmasreegade:ratings-entity-interface

Conversation

@padmasreegade
Copy link
Contributor

Implemented setter and getter methods for RatingsEntityInterface.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @padmasreegade -- just a few minor points in need of adjusting.

*
* @return RatingsEntityInterface
*/
public function setRating(string $rating): RatingsEntityInterface;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be int rather than string.

*/
public function setResource(ResourceEntityInterface $resource_id): RatingsEntityInterface
{
$this->resource_id = $resource_id?->getId();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to use the nullsafe operator (?->) here since the incoming value is not allowed to be null. I would also call the argument $resource instead of $resource_id since it is a full object, not just an ID.

*
* @return RatingsEntityInterface
*/
public function setRating(string $rating): RatingsEntityInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above -- when interface is changed, this will have to match.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, @padmasreegade, I just noticed one more small thing that I missed on my first review!

* @property int $id
* @property string $user_id
* @property string $resource_id
* @property string $rating
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an int as well.

@demiankatz demiankatz added this to the 10.0 milestone Jun 3, 2024
@demiankatz demiankatz added the architecture pull requests that involve significant refactoring / architectural changes label Jun 3, 2024
@padmasreegade padmasreegade deleted the ratings-entity-interface branch June 3, 2024 18:17
@padmasreegade padmasreegade restored the ratings-entity-interface branch June 3, 2024 18:17
@padmasreegade padmasreegade reopened this Jun 3, 2024
Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @padmasreegade!

@demiankatz demiankatz merged commit 29ad1eb into vufind-org:dev Jun 3, 2024
@padmasreegade padmasreegade deleted the ratings-entity-interface branch June 3, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architecture pull requests that involve significant refactoring / architectural changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants