@@ 183-199 (lines=17) @@ | ||
180 | /** |
|
181 | * @inheritDoc |
|
182 | */ |
|
183 | public function getSettingsByCollection($collectionName) |
|
184 | { |
|
185 | $connection = $this->container->get('connection'); |
|
186 | $acl = $this->container->get('acl'); |
|
187 | $tableGateway = new DirectusSettingsTableGateway($connection, $acl); |
|
188 | ||
189 | $data = [ |
|
190 | 'meta' => [ |
|
191 | 'table' => 'directus_settings', |
|
192 | 'type' => 'entry', |
|
193 | 'settings_collection' => $collectionName |
|
194 | ], |
|
195 | 'data' => $tableGateway->fetchCollection($collectionName) |
|
196 | ]; |
|
197 | ||
198 | return $this->createResponseFromData($data); |
|
199 | } |
|
200 | ||
201 | /** |
|
202 | * @inheritdoc |
|
@@ 512-527 (lines=16) @@ | ||
509 | return $this->createMessage($data); |
|
510 | } |
|
511 | ||
512 | public function createPrivileges(array $data) |
|
513 | { |
|
514 | $connection = $this->container->get('connection'); |
|
515 | $acl = $this->container->get('acl'); |
|
516 | $privileges = new DirectusPrivilegesTableGateway($connection, $acl); |
|
517 | ||
518 | $response = [ |
|
519 | 'meta' => [ |
|
520 | 'type' => 'item', |
|
521 | 'table' => 'directus_privileges' |
|
522 | ], |
|
523 | 'data' => $privileges->insertPrivilege($data) |
|
524 | ]; |
|
525 | ||
526 | return $this->createResponseFromData($response); |
|
527 | } |
|
528 | ||
529 | public function createTable($name, array $data = []) |
|
530 | { |
|
@@ 612-627 (lines=16) @@ | ||
609 | return $this->createResponseFromData($response); |
|
610 | } |
|
611 | ||
612 | public function getPreferences($table, $user) |
|
613 | { |
|
614 | $acl = $this->container->get('acl'); |
|
615 | $connection = $this->container->get('connection'); |
|
616 | $preferencesTableGateway = new DirectusPreferencesTableGateway($connection, $acl); |
|
617 | ||
618 | $response = [ |
|
619 | 'meta' => [ |
|
620 | 'type' => 'item', |
|
621 | 'table' => 'directus_preferences' |
|
622 | ], |
|
623 | 'data' => $preferencesTableGateway->fetchByUserAndTableAndTitle($user, $table) |
|
624 | ]; |
|
625 | ||
626 | return $this->createResponseFromData($response); |
|
627 | } |
|
628 | ||
629 | /** |
|
630 | * @inheritdoc |