definition['formula'])) { $this->formula = $this->definition['formula']; } } public function getFormula() { return str_replace('***table***', $this->tableAlias, $this->formula); } /** * Build the summary query based on a formula */ function summary_query() { $this->ensureMyTable(); // Now that our table is secure, get our formula. $formula = $this->getFormula(); // Add the field. $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field); $this->query->set_count_field(NULL, $formula, $this->field); return $this->summaryBasics(FALSE); } /** * Build the query based upon the formula */ public function query($group_by = FALSE) { $this->ensureMyTable(); // Now that our table is secure, get our formula. $placeholder = $this->placeholder(); $formula = $this->getFormula() .' = ' . $placeholder; $placeholders = array( $placeholder => $this->argument, ); $this->query->add_where(0, $formula, $placeholders, 'formula'); } }