Exemplo n.º 1
0
 function testSpeciesExclude()
 {
     $t = new FilterQuery();
     $result = $t->with(["species_exclude" => [22, 23]])->fetch()->asArray();
     foreach ($result as $entry) {
         $this->assertTrue($entry['species'] != 22 || $entry['species'] != 23);
     }
 }
 /**
  * FilterSubQuery constructor.
  * @param array $values
  */
 public function __construct(array $values = [])
 {
     parent::__construct($values);
     if (isset($values['column'])) {
         $this->setColumn($values['column']);
     }
 }
Exemplo n.º 3
0
    $q = new RecentQueries();
    try {
        $json = $q->with(["id" => $csv])->fetch();
        if ($json instanceof QueryResults) {
            $json->asArray()[0]["json"];
        } else {
            throw new Exception();
        }
        $params = json_decode($json, true);
        if (isset($params["page"])) {
            unset($params["page"]);
        }
        if (isset($params["limit"])) {
            unset($params["limit"]);
        }
        $filterQuery = new FilterQuery();
        header("Content-Type: text/csv");
        header("Content-Disposition: attachment; filename=output.csv");
        header("Cache-Control: no-cache, no-store, must-revalidate");
        // HTTP 1.1
        header("Pragma: no-cache");
        // HTTP 1.0
        header("Expires: 0");
        // Proxies
        $queryResults = $filterQuery->with($params)->fetch()->asCSV();
    } catch (Exception $e) {
        error("Invalid id");
        return;
    }
} else {
    error("No id provided");
Exemplo n.º 4
0
<?php

require '../../../core.php';
$query = new FilterQuery();
$query->with(['no_of_species' => 2])->fetch()->asArray();