xref: /plugin/struct/_test/mock/AccessTable.php (revision 0ceefd5c55d49dcf9a9f59c8e57e60eaeea1c187)
1<?php
2
3namespace dokuwiki\plugin\struct\test\mock;
4
5use dokuwiki\plugin\struct\meta;
6use dokuwiki\plugin\struct\meta\Schema;
7
8abstract class AccessTable extends meta\AccessTable {
9
10    /**
11     * @param Schema $schema
12     * @param int|string $pid
13     * @param int $ts
14     * @return meta\AccessTableLookup|AccessTableData
15     */
16    public static function bySchema(Schema $schema, $pid, $ts = 0) {
17        // FIXME will we still need that?
18//        if($schema->isLookup()) {
19//            return new meta\AccessTableLookup($schema, $pid, $ts); // FIXME not mocked, yet
20//        } else {
21//        }
22        return new AccessTableData($schema, $pid, $ts);
23    }
24
25    public static function byTableName($tablename, $pid, $ts = 0) {
26        $schema = new Schema($tablename, $ts);
27        return self::bySchema($schema, $pid, $ts); // becuse we have a static call here we can not rely on inheritance
28    }
29
30}
31