-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathFlow.php
More file actions
24 lines (22 loc) · 766 Bytes
/
Flow.php
File metadata and controls
24 lines (22 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
namespace Vectorface\MySQLite\MySQL;
/**
* Provides Flow Control MySQL compatibility functions for SQLite.
*
* http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html
*/
trait Flow
{
/**
* IF - If/else construct
*
* @param bool $condition The boolean condition which determines which result should be returned.
* @param mixed $onTrue The result to be returned if the condition is true.
* @param mixed $onFalse The condition to be returned if the condition is false.
* @return mixed Either the onTrue or onFalse result is returned, depending on the value of the condition.
*/
public static function mysql_if($condition, $onTrue, $onFalse)
{
return $condition ? $onTrue : $onFalse;
}
}