/** * Returns an array of column objects for the table associated * with this class. * * @return array */ public function columns() { if (empty($this->_columns)) { $this->_columns = $this->connection->columns($this->tableName(), "{$this->_className} Columns"); foreach ($this->_columns as $col) { $col->setPrimary($col->getName() == $this->_primaryKey); } } return $this->_columns; }