Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php final class AlmanacNamespaceQuery extends AlmanacQuery { private $ids; priva..

Decoded Output download

<?php

final class AlmanacNamespaceQuery
  extends AlmanacQuery {

  private $ids;
  private $phids;
  private $names;

  public function withIDs(array $ids) {
    $this->ids = $ids;
    return $this;
  }

  public function withPHIDs(array $phids) {
    $this->phids = $phids;
    return $this;
  }

  public function withNames(array $names) {
    $this->names = $names;
    return $this;
  }

  public function withNameNgrams($ngrams) {
    return $this->withNgramsConstraint(
      new AlmanacNamespaceNameNgrams(),
      $ngrams);
  }

  public function newResultObject() {
    return new AlmanacNamespace();
  }

  protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
    $where = parent::buildWhereClauseParts($conn);

    if ($this->ids !== null) {
      $where[] = qsprintf(
        $conn,
        'namespace.id IN (%Ld)',
        $this->ids);
    }

    if ($this->phids !== null) {
      $where[] = qsprintf(
        $conn,
        'namespace.phid IN (%Ls)',
        $this->phids);
    }

    if ($this->names !== null) {
      $where[] = qsprintf(
        $conn,
        'namespace.name IN (%Ls)',
        $this->names);
    }

    return $where;
  }

  protected function getPrimaryTableAlias() {
    return 'namespace';
  }

  public function getOrderableColumns() {
    return parent::getOrderableColumns() + array(
      'name' => array(
        'table' => $this->getPrimaryTableAlias(),
        'column' => 'name',
        'type' => 'string',
        'unique' => true,
        'reverse' => true,
      ),
    );
  }

  protected function newPagingMapFromPartialObject($object) {
    return array(
      'id' => (int)$object->getID(),
      'name' => $object->getName(),
    );
  }

  public function getBuiltinOrders() {
    return array(
      'name' => array(
        'vector' => array('name'),
        'name' => pht('Namespace Name'),
      ),
    ) + parent::getBuiltinOrders();
  }

  public function getQueryApplicationClass() {
    return 'PhabricatorAlmanacApplication';
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class AlmanacNamespaceQuery
  extends AlmanacQuery {

  private $ids;
  private $phids;
  private $names;

  public function withIDs(array $ids) {
    $this->ids = $ids;
    return $this;
  }

  public function withPHIDs(array $phids) {
    $this->phids = $phids;
    return $this;
  }

  public function withNames(array $names) {
    $this->names = $names;
    return $this;
  }

  public function withNameNgrams($ngrams) {
    return $this->withNgramsConstraint(
      new AlmanacNamespaceNameNgrams(),
      $ngrams);
  }

  public function newResultObject() {
    return new AlmanacNamespace();
  }

  protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
    $where = parent::buildWhereClauseParts($conn);

    if ($this->ids !== null) {
      $where[] = qsprintf(
        $conn,
        'namespace.id IN (%Ld)',
        $this->ids);
    }

    if ($this->phids !== null) {
      $where[] = qsprintf(
        $conn,
        'namespace.phid IN (%Ls)',
        $this->phids);
    }

    if ($this->names !== null) {
      $where[] = qsprintf(
        $conn,
        'namespace.name IN (%Ls)',
        $this->names);
    }

    return $where;
  }

  protected function getPrimaryTableAlias() {
    return 'namespace';
  }

  public function getOrderableColumns() {
    return parent::getOrderableColumns() + array(
      'name' => array(
        'table' => $this->getPrimaryTableAlias(),
        'column' => 'name',
        'type' => 'string',
        'unique' => true,
        'reverse' => true,
      ),
    );
  }

  protected function newPagingMapFromPartialObject($object) {
    return array(
      'id' => (int)$object->getID(),
      'name' => $object->getName(),
    );
  }

  public function getBuiltinOrders() {
    return array(
      'name' => array(
        'vector' => array('name'),
        'name' => pht('Namespace Name'),
      ),
    ) + parent::getBuiltinOrders();
  }

  public function getQueryApplicationClass() {
    return 'PhabricatorAlmanacApplication';
  }

}

Function Calls

None

Variables

None

Stats

MD5 055eba5e5a19ad834084aac03ae1b808
Eval Count 0
Decode Time 131 ms