Example #1
0
 /**
  * Get the name of the field to order the table data by
  * can be overwritten in plugin class - but not currently done so
  *
  * @return string column to order by tablename___elementname and yes you can use aliases in the order by clause
  */
 public function getOrderByName()
 {
     $params = $this->getParams();
     $join = $this->getJoin();
     $joinTable = $join->table_join_alias;
     $joinVal = $this->getLabelOrConcatVal();
     if (!strstr($joinVal, 'CONCAT')) {
         $return = strstr($joinVal, '___') ? FabrikString::safeColName($joinVal) : $joinTable . '.' . $joinVal;
     } else {
         $return = $joinVal;
     }
     // If storing in join table then we should use the alias created from the CONCAT select subquery
     if ($return == '.' || $this->isJoin()) {
         $return = parent::getOrderByName();
     }
     return $return;
 }