1<?php 2 3namespace dokuwiki\plugin\struct\test\mock; 4 5use dokuwiki\plugin\struct\meta\Column; 6 7 8class AccessTableDataNoDB extends AccessTablePage 9{ 10 11 12 /** @noinspection PhpMissingParentConstructorInspection 13 * @param string $table 14 * @param string $pid 15 * @param $ts 16 */ 17 public function __construct($table, $pid, $ts) 18 { 19 20 // we do intialization by parent here, because we don't need the whole database behind the class 21 $this->schema = new SchemaNoDB($table, $ts); 22 $this->pid = $pid; 23 $this->ts = $ts; 24 } 25 26 public function buildGetDataSQL($idColumn = 'pid') 27 { 28 return parent::buildGetDataSQL($idColumn); 29 } 30 31 public function setColumns($singles, $multis) 32 { 33 $this->schema->columns = array(); 34 $sort = 0; 35 foreach ($singles as $single) { 36 $sort += 1; 37 $this->schema->columns[] = new Column($sort, new $single(), $sort); 38 } 39 foreach ($multis as $multi) { 40 $sort += 1; 41 $this->schema->columns[] = new Column($sort, new $multi(null, null, true), $sort); 42 } 43 } 44 45 protected function getLastRevisionTimestamp() 46 { 47 return $this->ts; 48 } 49 50} 51