summaryBasics example

      $this->base_alias = $this->query->addField($this->tableAlias, $this->realField);
      $this->query->setCountField($this->tableAlias, $this->realField);
    }
    else {
      // Add the field.       $formula = $this->getFormula();
      $this->base_alias = $this->query->addField(NULL, $formula$this->field . '_truncated');
      $this->query->setCountField(NULL, $formula$this->field, $this->field . '_truncated');
    }

    $this->summaryNameField();
    return $this->summaryBasics(FALSE);
  }

  /** * Get the formula for this argument. * * $this->ensureMyTable() MUST have been called prior to this. */
  public function getFormula() {
    $formula = "SUBSTRING($this->tableAlias.$this->realField, 1, " . intval($this->options['limit']) . ")";

    if ($this->options['case'] != 'none') {
      

  protected function summaryQuery() {
    $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->addField(NULL, $formula$this->field);
    $this->query->setCountField(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 = [
      

  protected function summaryQuery() {
    $this->ensureMyTable();
    // Add the field.     $this->base_alias = $this->query->addField($this->tableAlias, $this->realField);

    $this->summaryNameField();
    $this->summaryBasics();
  }

  /** * Adds the name field, which is the field displayed in summary queries. * * This is often used when the argument is numeric. */
  protected function summaryNameField() {
    // Add the 'name' field. For example, if this is a uid argument, the     // name field would be 'name' (i.e, the username).
    
$this->tableAlias = $this->query->ensureTable($this->table, $this->relationship, $join);
    }
    else {
      $this->tableAlias = $this->helper->summaryJoin();
    }

    // Add the field.     $this->base_alias = $this->query->addField($this->tableAlias, $this->realField);

    $this->summaryNameField();

    return $this->summaryBasics();
  }

  public function summaryArgument($data) {
    $value = $data->{$this->base_alias};
    if (empty($value)) {
      $value = 0;
    }

    return $value;
  }

  
Home | Imprint | This part of the site doesn't use cookies.