![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mets.corals.io/wp-content/plugins/give/src/Framework/QueryBuilder/Clauses/ |
<?php namespace Give\Framework\QueryBuilder\Clauses; use Give\Framework\QueryBuilder\QueryBuilder; use Give\Framework\QueryBuilder\Types\JoinType; use InvalidArgumentException; /** * @since 2.19.0 */ class Join { /** * @var string */ public $table; /** * @var string */ public $joinType; /** * @var string|null */ public $alias; /** * @param string $table * @param string $joinType \Give\Framework\QueryBuilder\Types\JoinType * @param string|null $alias */ public function __construct($joinType, $table, $alias = null) { $this->table = QueryBuilder::prefixTable($table); $this->joinType = $this->getJoinType($joinType); $this->alias = trim($alias); } /** * @param string $type * * @return string */ private function getJoinType($type) { $type = strtoupper($type); if (array_key_exists($type, JoinType::getTypes())) { return $type; } throw new InvalidArgumentException( sprintf( 'Join type %s is not supported. Please provide one of the supported join types (%s)', $type, implode(',', JoinType::getTypes()) ) ); } }