Query/src/JoinType.php

40 lines
737 B
PHP
Raw Normal View History

2020-04-23 18:16:32 -04:00
<?php declare(strict_types=1);
/**
* Query
*
* SQL Query Builder / Database Abstraction Layer
*
2022-09-29 11:33:08 -04:00
* PHP version 8.1
2020-04-23 18:16:32 -04:00
*
* @package Query
2023-01-20 11:30:51 -05:00
* @author Timothy J. Warren <tim@timshome.page>
* @copyright 2012 - 2023 Timothy J. Warren
2020-04-23 18:16:32 -04:00
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link https://git.timshomepage.net/aviat/Query
2023-03-17 16:34:21 -04:00
* @version 4.1.0
2020-04-23 18:16:32 -04:00
*/
2023-03-17 15:18:33 -04:00
2020-04-23 18:16:32 -04:00
namespace Query;
/**
2023-01-13 13:14:28 -05:00
* Enum of join types
2020-04-23 18:16:32 -04:00
*/
2023-03-17 15:18:33 -04:00
enum JoinType: string
{
2023-01-13 13:14:28 -05:00
case CROSS = 'cross';
case INNER = 'inner';
case OUTER = 'outer';
case LEFT = 'left';
case RIGHT = 'right';
2023-01-20 10:33:43 -05:00
2023-01-20 15:34:02 -05:00
public static function parse(string|self $val): self
{
2023-01-20 10:33:43 -05:00
if ($val instanceof self)
{
return $val;
}
return self::from($val);
}
}