/**
  * Get the DatabaseQuerySelect to perform the load operation of items
  *
  * @param WireArray $items
  * @param Selectors|string|null $selectors Selectors or a selector string to find, or NULL to load all. 
  * @return DatabaseQuerySelect
  *
  */
 protected function getLoadQuery($selectors = null)
 {
     $query = parent::getLoadQuery($selectors);
     $table = $this->getTable();
     $lookupTable = $this->getLookupTable();
     $query->select("{$lookupTable}." . $this->getLookupField());
     $query->leftjoin("{$lookupTable} ON {$lookupTable}.{$table}_id={$table}.id ")->orderby("sort");
     return $query;
 }
 /**
  * Get the DatabaseQuerySelect to perform the load operation of items
  *
  * @param Selectors|string|null $selectors Selectors or a selector string to find, or NULL to load all. 
  * @return DatabaseQuerySelect
  *
  */
 protected function getLoadQuery($selectors = null)
 {
     $query = parent::getLoadQuery($selectors);
     $database = $this->wire('database');
     $table = $database->escapeTable($this->getTable());
     $lookupTable = $database->escapeTable($this->getLookupTable());
     $lookupField = $database->escapeCol($this->getLookupField());
     $query->select("{$lookupTable}.{$lookupField}");
     // QA
     $query->leftjoin("{$lookupTable} ON {$lookupTable}.{$table}_id={$table}.id ")->orderby("sort");
     // QA
     return $query;
 }