25 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Meirza
4937a1fd1c MDL-77350 favourites: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

// Removed test_add_malformed_favourite()
PHPUnit version >= 9.5 no longer converts PHP deprecations to exceptions by default.
To comply with PHP 8.2, which will deprecate the dynamic properties,
we need to remove test_add_malformed_favourite()
because the test will raise a warning for dynamic property deprecations.
2023-05-16 01:03:01 +07:00
Sara Arjona
1147a9fe9d MDL-72350 mod: Remove mod_assignment
The Assignment 2.2 activity module was disabled in 2012 but kept to
enable pre-2.2 backups to be restored and have the assignments
auto-converted to new assignments. After almost 10 years, it's time
to remove it from Moodle core.
2023-03-30 09:00:10 +08:00
Peter
b3b2d72c1e MDL-68019 course: Performance improvement with component favourites
Add the ability to get all/select itemtypes within a component
2020-02-28 11:28:15 +08:00
Jake Dallimore
a0523b826e MDL-65313 core_favourites: component scoped deletion now requires itemid
This now requires itemid, which cannot be null. This is safer. The
context can still be passed in as an optional parameter.
2019-05-07 16:26:46 +08:00
Jake Dallimore
f962859b56 MDL-65313 core_favourite: add component-scoped favourite service class
Added a new type of service which can be used to interact with the
all favourites for a given component, not just those owned by a a
specific user. As such, objects of this type are scoped to a component.
2019-05-06 14:01:34 +08:00
Jake Dallimore
92bea7db2a MDL-64057 core_favourites: add get_join_sql_by_type() to service layer
This provides a way for external queries to include information about
favourited items.
2018-11-23 11:02:18 +08:00
Andrew Nicols
08cd15658a Merge branch 'MDL-63692-master' of git://github.com/sarjona/moodle 2018-11-20 07:51:40 +08:00
Sara Arjona
16913e60b3 MDL-63692 core_message: Add favourite conversations to Privacy API 2018-11-19 22:09:13 +01:00
Andrew Nicols
18b947671b Merge branch 'MDL-63969-master-4' of git://github.com/mihailges/moodle 2018-11-19 12:27:37 +08:00
Mihail Geshoski
61fafe8127 MDL-63969 core_favourites: Add support for removal of context users 2018-11-16 12:18:22 +08:00
Ryan Wyllie
9e189a914d MDL-63303 core_favourites: add get and count functions 2018-11-15 14:40:11 +08:00
Jake Dallimore
b81722e22f MDL-63058 core_favourites: add existence checks to the service layer
This allows someone using the user_favourite_service to check whether
an item is already marked as a favourite.
2018-10-20 12:19:10 +02:00
Jake Dallimore
21b50ebe19 MDL-63658 core_favourites: fix errors discovered on oracle db
- Assuming 1 would be a record that didn't exist. should be using 0.
- Missing space before AND in sql in provider.
2018-10-18 17:11:07 +08:00
Jake Dallimore
68eaa3150e MDL-63658 core_favourites: properly define interface methods and cleanup
This gets rid of specific repo functions which were unused, and makes
sure the following methods are defined on the interface, implemented
and tested:
- exists_by($criteria)
- find_by($criteria)
- delete_by($crtieria)
Also, added missing tests for find_favourite() repo method.
2018-10-18 15:39:57 +08:00
Jake Dallimore
8d9cd27b02 MDL-63658 core_favourites: let service object use get_component_names
This was using a helper, but now we have the function in core to achieve
the same thing, so use this instead.
2018-10-18 08:22:08 +08:00
Jake Dallimore
b7a3ec6f8d MDL-63658 core_favourites: consolidate interfaces and rename
Let's worry about reuse of the crud code later, when that requirement
arises, so moved that into the ifavourite_repository interface, and then
renamed it favourite_repository_interface.
2018-10-18 08:22:07 +08:00
Jake Dallimore
0551ed3569 MDL-63658 core_favourites: rename user_favourites_service and services
Now: user_favourite_service (singular) and service_factory
2018-10-18 08:22:07 +08:00
Jake Dallimore
cb90b549b6 MDL-63658 core_favourites: singularise the repository class types
Instead of favourites_repository we now have favourite_repository,
which is more in line with other implementations of this pattern.
2018-10-18 08:22:07 +08:00
Jake Dallimore
cfaf86b059 MDL-63658 core_favourites: make favourite a first class object
This patch adds several things:
- favourite entity class under local/entity
- refactoring of repository and service to use the new class instead
of stdClass.
- update repository unit tests to use the object instead of stdClass.
- update service_test so that the mock repo requires the object for
the add operation.
- remove unnecessary constructor from favourites_repository class.
2018-10-18 08:22:07 +08:00
Jake Dallimore
8ffbe9c163 MDL-63658 core_favourites: adding paging support to the service layer 2018-10-18 08:22:07 +08:00
Jake Dallimore
ac9138db1c MDL-63658 core_favourites: implement privacy API for favourites 2018-10-18 08:22:06 +08:00
Jake Dallimore
4a02aae5f5 MDL-63658 core_favourites: namespace the repositories and services 2018-10-18 08:22:06 +08:00
Jake Dallimore
771051325b MDL-63658 core_favourites: add business logic aware service layer 2018-10-18 08:22:06 +08:00
Jake Dallimore
d4e98ee580 MDL-63658 core_favourites: add a user favourites repository 2018-10-18 08:22:06 +08:00