Lines Matching defs:table
12 * Represents the schema of a single data table and all its properties. It defines what can be stored in
13 * the represented data table and how those contents are formatted.
32 /** @var string name of the associated table */
33 protected $table = '';
53 * @param string $table The table this schema is for
56 public function __construct($table, $ts = 0)
65 $table = self::cleanTableName($table);
66 $this->table = $table;
78 $opt = [$table, $ts];
85 $opt = [$table];
131 $table
145 return self::class . ' ' . $this->table . ' (' . $this->id . ') ';
149 * Cleans any unwanted stuff from table names
151 * @param string $table
154 public static function cleanTableName($table)
156 $table = strtolower($table);
157 $table = preg_replace('/[^a-z0-9_]+/', '', $table);
158 $table = preg_replace('/^[0-9_]+/', '', $table);
159 $table = trim($table);
160 return $table;
197 $this->sqlite->query($sql . 'data_' . $this->table);
198 $this->sqlite->query($sql . 'multi_' . $this->table);
200 $sql = "DELETE FROM schema_assignments WHERE tbl = '$this->table'";
203 $sql = "DELETE FROM schema_assignments_patterns WHERE tbl = '$this->table'";
213 $this->sqlite->query($sql, [$this->table]);
220 $this->sqlite->query($sql, [$this->table]);
223 $this->sqlite->query($sql, [$this->table]);
245 $this->sqlite->query($sql . 'data_' . $this->table);
246 $this->sqlite->query($sql . 'multi_' . $this->table);
290 return $this->getTranslatedKey('label', $this->table);
358 return $this->table;