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 TDBArrowStep.php

Documentation is available at TDBArrowStep.php

  1. <?php
  2.  
  3. use Adianti\Database\TCriteria;
  4. use Adianti\Widget\Wrapper\AdiantiDatabaseWidgetTrait;
  5.  
  6. /**
  7.  * Database Arrow Step
  8.  *
  9.  * @version    7.4
  10.  * @package    widget
  11.  * @subpackage util
  12.  * @author     Lucas Tomasi
  13.  * @author     Matheus Agnes Dias
  14.  * @author     Pablo Dall'Oglio
  15.  * @copyright  Copyright (c) 2006-2014 Adianti Solutions Ltd. (http://www.adianti.com.br)
  16.  * @license    http://www.adianti.com.br/framework-license
  17.  */
  18. class TDBArrowStep extends TArrowStep
  19. {
  20.     protected $items// array containing the combobox options
  21.     
  22.     private $database;
  23.     private $model;
  24.     private $key;
  25.     private $value;
  26.     private $ordercolumn;
  27.     private $colorcolumn;
  28.     private $criteria;
  29.  
  30.     use AdiantiDatabaseWidgetTrait;
  31.     
  32.     /**
  33.      * Class Constructor
  34.      * @param  $name     widget's name
  35.      * @param  $database database name
  36.      * @param  $model    model class name
  37.      * @param  $key      table field to be used as key in the combo
  38.      * @param  $value    table field to be listed in the combo
  39.      * @param  $ordercolumn column to order the fields (optional)
  40.      * @param  $criteria criteria (TCriteria object) to filter the model (optional)
  41.      */
  42.     public function __construct($name$database$model$key$value$ordercolumn NULLTCriteria $criteria NULL)
  43.     {
  44.         // executes the parent class constructor
  45.         parent::__construct($name);
  46.  
  47.         $this->database $database;
  48.         $this->model $model;
  49.         $this->key $key;
  50.         $this->value $value;
  51.         $this->ordercolumn $ordercolumn;
  52.         $this->criteria $criteria;
  53.     }
  54.  
  55.     public function setColorColumn($colorcolumn)
  56.     {
  57.         $this->colorcolumn $colorcolumn;
  58.     }
  59.  
  60.     public function show()
  61.     {
  62.         parent::setItemsself::getItemsFromModel($this->database$this->model$this->key$this->value$this->ordercolumn$this->criteria) );
  63.  
  64.         if ($this->colorcolumn)
  65.         {
  66.             parent::setColorItemsself::getItemsFromModel($this->database$this->model$this->key$this->colorcolumn$this->ordercolumn$this->criteria) );
  67.         }
  68.  
  69.         parent::show();
  70.     }
  71. }