| 1 | <?php |
||
| 10 | abstract class Query |
||
| 11 | { |
||
| 12 | protected $table; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Constructor. |
||
| 16 | * |
||
| 17 | * @param Table $table |
||
| 18 | */ |
||
| 19 | public function __construct(Table $table) |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Run the query and return the statement object. |
||
| 26 | * |
||
| 27 | * @return PDOStatement |
||
| 28 | */ |
||
| 29 | abstract public function __invoke(); |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Build and return the query. |
||
| 33 | * |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | abstract public function __toString(); |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Executes the query and returns true if it's ok. |
||
| 40 | * |
||
| 41 | * @return mixed |
||
| 42 | */ |
||
| 43 | public function run() |
||
| 47 | } |
||
| 48 |