Breaking: Extended JobRepository method signatures
Description
To support the new Show hidden records plugin option,
\FGTCLB\ changed one method
and gained two:
find. The optional parameterBy Job Type (int $job Type, bool $include Hidden = false): Query Result Interface $includewas appended.Hidden findis new. The job list calls it without a job type instead of the inheritedAll Jobs (bool $include Hidden = false): Query Result Interface find, so the option is honoured there as well.All () findis new. It returns the uids of the given jobs whose record in the default language is hidden, which the job list uses to leave those jobs unlinked.Uids With Hidden Default Record (array $uids): array
With
$include set to
true
, the query ignores only the
hidden flag of the jobs. Deleted records, start and end time and frontend user
groups still apply.
Impact
Calls of the repository keep working: the new parameter has a default value.
A class that extends
Job and overrides
find
with the old signature fails with a PHP fatal error, because the method of the
subclass no longer accepts every parameter of the parent method. A subclass that
already declares a method
find or
find with another signature fails the same
way.
Affected Installations
Installations that extend
\FGTCLB\ and override
find, or declare one of the two new methods. All other
installations are unaffected.
Migration
Add the parameter to the overriding method and pass it on:
public function findByJobType(int $jobType, bool $includeHidden = false): QueryResultInterface
{
// ...
return parent::findByJobType($jobType, $includeHidden);
}
Rename a method of the subclass that collides with one of the new methods.