Lançado Adianti Framework 7.6!
Clique aqui para saber mais
menu

Adianti Solutions

API

Adianti, Framework, PHP, MVC, Active record, Front controller, IDE, RAD, Web, multiplataforma, geração de código, desenvolvimento rápido, relatórios, formulários, listagens, datagrids, gráficos, banco de dados, padrões de projeto, design patterns API do Adianti Framework.
API Docs
code
Selecione a classe

Source for file TSqlStatement.php

Documentation is available at TSqlStatement.php

  1. <?php
  2. namespace Adianti\Database;
  3.  
  4. use Adianti\Database\TCriteria;
  5.  
  6. /**
  7.  * Provides an abstract Interface to create a SQL statement
  8.  *
  9.  * @version    7.4
  10.  * @package    database
  11.  * @author     Pablo Dall'Oglio
  12.  * @copyright  Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
  13.  * @license    http://www.adianti.com.br/framework-license
  14.  */
  15. abstract class TSqlStatement
  16. {
  17.     protected $sql;         // stores the SQL instruction
  18.     protected $criteria;    // stores the select criteria
  19.     protected $entity;
  20.     
  21.     /**
  22.      * defines the database entity name
  23.      * @param $entity Name of the database entity
  24.      */
  25.     final public function setEntity($entity)
  26.     {
  27.         $this->entity = $entity;
  28.     }
  29.     
  30.     /**
  31.      * Returns the database entity name
  32.      */
  33.     final public function getEntity()
  34.     {
  35.         return $this->entity;
  36.     }
  37.     
  38.     /**
  39.      * Define a select criteria
  40.      * @param $criteria  An TCriteria object, specifiyng the filters
  41.      */
  42.     public function setCriteria(TCriteria $criteria)
  43.     {
  44.         $this->criteria = $criteria;
  45.     }
  46.     
  47.     /**
  48.      * Returns a random parameter
  49.      */
  50.     protected function getRandomParameter()
  51.     {
  52.         return mt_rand(10000000001999999999);
  53.     }
  54.     
  55.     // force method rewrite in child classes
  56.     abstract function getInstruction();
  57. }