Piwik\DataTable\Row::hasColumn PHP Méthode

hasColumn() public méthode

Returns true if a column having the given name is already registered. The value will not be evaluated, it will just check whether a column exists independent of its value.
public hasColumn ( string $name ) : boolean
$name string
Résultat boolean
    public function hasColumn($name)
    {
        return $this->offsetExists($name);
    }

Usage Example

 /**
  * Sets the column to be used for Excluding low population
  *
  * @param DataTable\Row $row
  * @return int
  */
 private function selectColumnToExclude($columnToFilter, $row)
 {
     if ($row->hasColumn($columnToFilter)) {
         return $columnToFilter;
     }
     // filter_excludelowpop=nb_visits but the column name is still Metrics::INDEX_NB_VISITS in the table
     $columnIdToName = Metrics::getMappingFromNameToId();
     if (isset($columnIdToName[$columnToFilter])) {
         $column = $columnIdToName[$columnToFilter];
         if ($row->hasColumn($column)) {
             return $column;
         }
     }
     return $columnToFilter;
 }
All Usage Examples Of Piwik\DataTable\Row::hasColumn