Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:controller:gdprapicontroller

This is an old revision of the document!


GdprApiController

Layer: Controller · Source: lib/controller/api/GdprApiController.php:26 (lines 26–160)


class GdprApiController extends ApiController

GDPR API Controller

Handles GDPR-related API endpoints including consent management

Docblock Metadata

^ Tag ^ Value ^
| ''@category'' | Controller Class |
| ''@author'' | Scriptlog |
| ''@license'' | MIT |
| ''@version'' | 1.0 |
| ''@since'' | Since Release 1.0 |

Inheritance

^ Relation ^ Type ^ Meaning ^
| extends | [[scriptlog:lib:controller:apicontroller|''ApiController'']] | parent class/interface |

Constants (0)

None.

Properties (0)

None declared.

Methods (4)

^ Visibility ^ Method ^ Summary ^ Line ^
| public | ''__construct()'' | Constructor | 48 |
| public | ''consent()'' | Process cookie consent | 71 |
| public | ''getConsentStatus()'' | Get consent status | 118 |
| private | ''getClientIp()'' | Get client IP address | 152 |

__construct()

public function __construct()

lines 48–62 (15)

Constructor

Takes no parameters.

consent()

public function consent($_params = [])

lines 71–109 (39)

Process cookie consent

POST /api/v1/gdpr/consent

^ Parameter ^ Type ^ Default ^ Description ^
| ''$_params'' | ''(untyped)'' | ''[]'' | //none// |

Returns: (none declared)

getConsentStatus()

public function getConsentStatus($_params = [])

lines 118–142 (25)

Get consent status

GET /api/v1/gdpr/consent

^ Parameter ^ Type ^ Default ^ Description ^
| ''$_params'' | ''(untyped)'' | ''[]'' | //none// |

Returns: (none declared)

getClientIp()

private function getClientIp()

lines 152–159 (8)

Get client IP address

Delegates to the shared get_ip_address() helper so proxy headers are only trusted when the request actually came through Cloudflare.

Takes no parameters.

Returns: (none declared) — string

Imports

^ Alias ^ Fully-qualified name ^
| ''ApiController'' | [[scriptlog:lib:controller:apicontroller|''Scriptlog\Controller\ApiController'']] |
| ''ApiHateoas'' | [[scriptlog:lib:core:apihateoas|''Scriptlog\Core\ApiHateoas'']] |
| ''ApiResponse'' | [[scriptlog:lib:core:apiresponse|''Scriptlog\Core\ApiResponse'']] |
| ''ConsentDao'' | [[scriptlog:lib:dao:consentdao|''Scriptlog\Dao\ConsentDao'']] |
| ''ConsentService'' | [[scriptlog:lib:service:consentservice|''Scriptlog\Service\ConsentService'']] |

This page is generated from source by 'tools/gendoc'. Edits will be overwritten.

scriptlog/lib/controller/gdprapicontroller.1790413760.txt.gz · Last modified: by admin