Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:dao:privacylogdao

This is an old revision of the document!


PrivacyLogDao

Layer: DAO · Source: lib/dao/PrivacyLogDao.php:22 (lines 22–182)


class PrivacyLogDao extends Dao

PrivacyLogDao Class

Data Access Object for privacy audit logs

Docblock Metadata

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

Inheritance

^ Relation ^ Type ^ Meaning ^
| extends | [[scriptlog:lib:core:dao|''Dao'']] | parent class/interface |

Constants (0)

None.

Properties (0)

None declared.

Methods (10)

^ Visibility ^ Method ^ Summary ^ Line ^
| public | ''__construct()'' | Constructor | 27 |
| public | ''createLog()'' | Create a privacy log entry | 43 |
| public | ''getLogById()'' | Get log by ID | 63 |
| public | ''getLogsByUserId()'' | Get logs by user ID | 76 |
| public | ''getLogsByEmail()'' | Get logs by email | 92 |
| public | ''getLogsByAction()'' | Get logs by action | 108 |
| public | ''getAllLogs()'' | Get all logs | 127 |
| public | ''getRecentLogs()'' | Get recent logs | 143 |
| public | ''deleteOldLogs()'' | Delete old logs | 159 |
| public | ''totalLogRecords()'' | Total log records | 176 |

__construct()

public function __construct()

lines 27–30 (4)

Constructor

Takes no parameters.

createLog()

public function createLog($action, $type, $userId = null, $email = null, $details = null, $ipAddress = null)

lines 43–55 (13)

Create a privacy log entry

^ Parameter ^ Type ^ Default ^ Description ^
| ''$action'' | ''(untyped)'' | //required// | //none// |
| ''$type'' | ''(untyped)'' | //required// | //none// |
| ''$userId'' | ''(untyped)'' | ''null'' | //none// |
| ''$email'' | ''(untyped)'' | ''null'' | //none// |
| ''$details'' | ''(untyped)'' | ''null'' | //none// |
| ''$ipAddress'' | ''(untyped)'' | ''null'' | //none// |

Returns: (none declared) — int

getLogById()

public function getLogById($id)

lines 63–68 (6)

Get log by ID

^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — array|bool

getLogsByUserId()

public function getLogsByUserId($userId)

lines 76–84 (9)

Get logs by user ID

^ Parameter ^ Type ^ Default ^ Description ^
| ''$userId'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — array|bool

getLogsByEmail()

public function getLogsByEmail($email)

lines 92–100 (9)

Get logs by email

^ Parameter ^ Type ^ Default ^ Description ^
| ''$email'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — array|bool

getLogsByAction()

public function getLogsByAction($action)

lines 108–116 (9)

Get logs by action

^ Parameter ^ Type ^ Default ^ Description ^
| ''$action'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — array|bool

getAllLogs()

public function getAllLogs($orderBy = 'ID')

lines 127–135 (9)

Get all logs

Sort column is validated against an explicit allow-list so raw input is never interpolated into the query.

^ Parameter ^ Type ^ Default ^ Description ^
| ''$orderBy'' | ''(untyped)'' | '''ID''' | //none// |

Returns: (none declared) — array|bool

getRecentLogs()

public function getRecentLogs($limit = 50)

lines 143–151 (9)

Get recent logs

^ Parameter ^ Type ^ Default ^ Description ^
| ''$limit'' | ''(untyped)'' | ''50'' | //none// |

Returns: (none declared) — array|bool

deleteOldLogs()

public function deleteOldLogs($days = 365)

lines 159–169 (11)

Delete old logs

^ Parameter ^ Type ^ Default ^ Description ^
| ''$days'' | ''(untyped)'' | ''365'' | //none// |

Returns: (none declared) — bool

totalLogRecords()

public function totalLogRecords()

lines 176–181 (6)

Total log records

Takes no parameters.

Returns: (none declared) — int

Imports

^ Alias ^ Fully-qualified name ^
| ''Dao'' | [[scriptlog:lib:core:dao|''Scriptlog\Core\Dao'']] |

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

scriptlog/lib/dao/privacylogdao.1790413760.txt.gz · Last modified: by admin