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