Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
core\dml\sql_join Class Reference

Public Member Functions

 __construct ($joins='', $wheres='', $params=array(), $cannotmatchanyrows=false)
 Create an object that contains sql join fragments. More...
 

Public Attributes

bool $cannotmatchanyrows
 if true this join is guaranteed to never match any rows. More...
 
string $joins
 joins.
 
array $params
 params.
 
string $wheres
 wheres.
 

Constructor & Destructor Documentation

◆ __construct()

core\dml\sql_join::__construct (   $joins = '',
  $wheres = '',
  $params = array(),
  $cannotmatchanyrows = false 
)

Create an object that contains sql join fragments.

Note, even if you set $cannotmatchanyrows to true, it is important to also set the other fields because the calling code is not required to check it. For example new core\dml\sql_join('', '1 = 2', [], true);

Parameters
string$joinsThe join sql fragment.
string$wheresThe where sql fragment.
array$paramsAny parameter values.
bool$cannotmatchanyrowsIf true, this join is guaranteed to match no rows. See comment on the field above.

Member Data Documentation

◆ $cannotmatchanyrows

bool core\dml\sql_join::$cannotmatchanyrows

if true this join is guaranteed to never match any rows.

In this case, the calling code may be able to completely skip doing the database query.

Since
Moodle 3.9/3.8.3/3.7.6.

The documentation for this class was generated from the following file: