| 1 | <?php |
| 2 | |
| 3 | namespace Wikimedia\Rdbms; |
| 4 | |
| 5 | use Wikimedia\Rdbms\Database\DbQuoter; |
| 6 | |
| 7 | /** |
| 8 | * @since 1.42 |
| 9 | */ |
| 10 | interface IExpression { |
| 11 | |
| 12 | public const ACCEPTABLE_OPERATORS = [ '>', '<', '!=', '=', '>=', '<=', self::LIKE, self::NOT_LIKE ]; |
| 13 | |
| 14 | public const LIKE = 'LIKE'; |
| 15 | public const NOT_LIKE = 'NOT LIKE'; |
| 16 | |
| 17 | /** |
| 18 | * Return SQL for execution. |
| 19 | * @internal |
| 20 | */ |
| 21 | public function toSql( DbQuoter $dbQuoter ): string; |
| 22 | |
| 23 | /** |
| 24 | * Return SQL for aggregated logging. |
| 25 | * |
| 26 | * Replaces values with placeholders. |
| 27 | * |
| 28 | * @internal |
| 29 | */ |
| 30 | public function toGeneralizedSql(): string; |
| 31 | } |