1: <?php
2:
3: namespace Charcoal\Source;
4:
5: /**
6: *
7: */
8: interface DatabaseSourceInterface
9: {
10: /**
11: * Set the database's table to use.
12: *
13: * @param string $table The database table.
14: * @return DatabaseSource Chainable
15: */
16: public function setTable($table);
17:
18: /**
19: * Get the database's current table.
20: *
21: * @return string
22: */
23: public function table();
24:
25: /**
26: * Create a table from a model's metadata.
27: *
28: * @return boolean Success / Failure
29: */
30: public function createTable();
31:
32: /**
33: * Alter an existing table to match the model's metadata.
34: *
35: * @return boolean Success / Failure
36: */
37: public function alterTable();
38:
39: /**
40: * @return boolean
41: */
42: public function tableExists();
43:
44: /**
45: * Get the table columns information.
46: *
47: * @return array
48: */
49: public function tableStructure();
50:
51: /**
52: * Check wether the source table is empty (`true`) or not (`false`)
53: *
54: * @return boolean
55: */
56: public function tableIsEmpty();
57:
58: /**
59: * @return \PDO
60: */
61: public function db();
62: }
63: