Piwik\DataTable::setMetadata PHP 메소드

setMetadata() 공개 메소드

Sets a metadata value by name.
public setMetadata ( string $name, mixed $value )
$name string The metadata name.
$value mixed
    public function setMetadata($name, $value)
    {
        $this->metadata[$name] = $value;
    }

Usage Example

예제 #1
0
 /**
  * See {@link Limit}.
  *
  * @param DataTable $table
  */
 public function filter($table)
 {
     $table->setMetadata(DataTable::TOTAL_ROWS_BEFORE_LIMIT_METADATA_NAME, $table->getRowsCount());
     if ($this->keepSummaryRow) {
         $summaryRow = $table->getRowFromId(DataTable::ID_SUMMARY_ROW);
     }
     // we delete from 0 to offset
     if ($this->offset > 0) {
         $table->deleteRowsOffset(0, $this->offset);
     }
     // at this point the array has offset less elements. We delete from limit to the end
     if ($this->limit >= 0) {
         $table->deleteRowsOffset($this->limit);
     }
     if ($this->keepSummaryRow && !empty($summaryRow)) {
         $table->addSummaryRow($summaryRow);
     }
 }
All Usage Examples Of Piwik\DataTable::setMetadata