Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
Added specific exception for api change introduced in 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lox committed Sep 10, 2014
1 parent 94b73bd commit 6169d3d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/Pheasant/Query/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ public function orWhere($sql=null, $params=array())
*/
public function innerJoin($mixed, $criteria, $alias='')
{
if(strpos($mixed, " ") !== false) {
throw new \InvalidArgumentException(
"Invalid table name '$mixed'. Possibly use alias parameter instead?");
}

return $this->_join('INNER JOIN', $mixed, $criteria, $alias);
}

Expand All @@ -132,6 +137,11 @@ public function innerJoin($mixed, $criteria, $alias='')
*/
public function leftJoin($mixed, $criteria, $alias='')
{
if(strpos($mixed, " ") !== false) {
throw new \InvalidArgumentException(
"Invalid table name '$mixed'. Possibly use alias parameter instead?");
}

return $this->_join('LEFT JOIN', $mixed, $criteria, $alias);
}

Expand All @@ -141,6 +151,11 @@ public function leftJoin($mixed, $criteria, $alias='')
*/
public function rightJoin($mixed, $criteria, $alias='')
{
if(strpos($mixed, " ") !== false) {
throw new \InvalidArgumentException(
"Invalid table name '$mixed'. Possibly use alias parameter instead?");
}

return $this->_join('RIGHT JOIN', $mixed, $criteria, $alias);
}

Expand Down

0 comments on commit 6169d3d

Please sign in to comment.