aboutsummaryrefslogtreecommitdiff
path: root/lib/models/MvvContact.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+github@gmail.com>2023-05-08 17:08:52 +0200
committerJan-Hendrik Willms <tleilax+github@gmail.com>2023-05-08 17:08:52 +0200
commita1fda2758e9c241ac3eb980ac8716dfedbe9dd3c (patch)
tree2190f0478fb153efdb8ba48ebb574c7691f4f351 /lib/models/MvvContact.php
parent244d00ed91ad2b4b83e902a45cd6def3d7bc7e86 (diff)
let phpcsfixer fix errors according to @PSR12 rules on lib/modelsphpcsfixer
Diffstat (limited to 'lib/models/MvvContact.php')
-rw-r--r--lib/models/MvvContact.php45
1 files changed, 32 insertions, 13 deletions
diff --git a/lib/models/MvvContact.php b/lib/models/MvvContact.php
index 26ff5f0..1597e48 100644
--- a/lib/models/MvvContact.php
+++ b/lib/models/MvvContact.php
@@ -81,12 +81,20 @@ class MvvContact extends ModuleManagementModel
* @param int $offset The first object to return in a result set.
* @return object A SimpleORMapCollection of Dokument objects.
*/
- public static function getAllEnriched($sortby = 'chdate', $order = 'DESC',
- $row_count = null, $offset = null, $filter = null)
- {
+ public static function getAllEnriched(
+ $sortby = 'chdate',
+ $order = 'DESC',
+ $row_count = null,
+ $offset = null,
+ $filter = null
+ ) {
- $sortby = self::createSortStatement($sortby, $order, 'name',
- ['count_zuordnungen']);
+ $sortby = self::createSortStatement(
+ $sortby,
+ $order,
+ 'name',
+ ['count_zuordnungen']
+ );
$ids = self::getIdsFiltered($filter);
return parent::getEnrichedByQuery("
@@ -326,14 +334,23 @@ class MvvContact extends ModuleManagementModel
* @param array $filter Array of filter.
* @return array Array of found Fachbereiche.
*/
- public static function getAllAssignedInstitutes($sortby = 'name',
- $order = 'ASC', $filter = null, $row_count = null, $offset = null)
- {
+ public static function getAllAssignedInstitutes(
+ $sortby = 'name',
+ $order = 'ASC',
+ $filter = null,
+ $row_count = null,
+ $offset = null
+ ) {
$ids = self::getIdsFiltered($filter);
- $sortby = Fachbereich::createSortStatement($sortby, $order, 'name',
- ['count_objects']);
+ $sortby = Fachbereich::createSortStatement(
+ $sortby,
+ $order,
+ 'name',
+ ['count_objects']
+ );
- return Fachbereich::getEnrichedByQuery("
+ return Fachbereich::getEnrichedByQuery(
+ "
SELECT *, `Institut_id` AS `institut_id`, `Name` AS `name`, COUNT(`object_id`) AS `count_objects`
FROM
(SELECT Institute.*,
@@ -358,7 +375,9 @@ class MvvContact extends ModuleManagementModel
AND `mvv_contacts_ranges`.`category` IN (:categories)
AND `mvv_contacts_ranges`.`range_id` IN (:ranges)) tab1
GROUP BY institut_id ORDER BY " . $sortby,
- $ids, $row_count, $offset
+ $ids,
+ $row_count,
+ $offset
);
}
@@ -373,7 +392,7 @@ class MvvContact extends ModuleManagementModel
*/
public function addRange($range_id, $range_type, $contact_type, $category)
{
- if (!MvvContactRange::findOneBySQL("contact_id =? AND range_id =? AND category=?",[$this->contact_id, $range_id, $category])){
+ if (!MvvContactRange::findOneBySQL("contact_id =? AND range_id =? AND category=?", [$this->contact_id, $range_id, $category])) {
$mvv_cr = new MvvContactRange();
$mvv_cr->contact_id = $this->contact_id;
$mvv_cr->range_id = $range_id;