| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- declare(strict_types=1);
- namespace OpenMind\System;
- use DB\SQL\Mapper;
- /**
- * Persistent role catalog mapper.
- *
- * @property int $id
- * @property string $name
- * @property string $description
- */
- class Role extends Mapper
- {
- private const TABLE_NAME = 'roles';
- /**
- * Initialize the role mapper and optionally load a matching record.
- *
- * @param string|array|null $where Optional mapper load condition.
- * @side-effects Connects the mapper to the configured database and may load a role.
- */
- public function __construct($where = null)
- {
- global $f3;
- parent::__construct($f3->get('DB'), self::TABLE_NAME);
- if ($where !== null) {
- $this->load($where);
- }
- }
- }
|