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