/**
  * @param Column $column
  * @return $this
  * @throws \Exception
  */
 public function addColumn(Column $column)
 {
     if (isset($this->columns[$column->getName()])) {
         throw new \Exception(sprintf('a column with the name "%s" already exists.', $column->getName()));
     }
     $this->columns[$column->getName()] = $column;
     if ($column instanceof EntitiesCountColumn) {
         $this->hasCountColumns = true;
     } elseif ($column instanceof EntitiesScalarColumn) {
         $this->hasScalarColumns = true;
     }
     if (false !== $column->getOptions()['filter']) {
         $this->hasColumnFilter = true;
     }
     $column->setTable($this);
     return $this;
 }