Viewing file: Evento.php (3.65 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
* Evento
*
* Classe modelo para utilização do Doctrine
*
* @property int $id
* @property string $titulo
* @property integer $vagas
* @property date $inicioInscricao
* @property date $finalInscricao
* @property string $folder
* @property string $banner
* @property double precision $banner
* @property Doctrine_Collection $inscricoes
*
* @package application
* @subpackage model
* @author iMAXIS
*/
class Evento extends Doctrine_Record
{
/**
* Define os tipos de campos a serem utilizados para manutenção da tabela no banco de dados
* Para cada campo é preciso ter uma variável definida com o mesmo nome.<br>
* Ex: para o campo cli_email as email deve haver uma variável chamada $email adicionada <br>
* nas linhas iniciais da classe como @property type $email(ex)
*
* @return void
*/
public function setTableDefinition()
{
$this->setTableName('site_eventos');
$this->hasColumn('evt_id as id', 'int', null, array(
'type' => 'int',
'primary' => true,
));
$this->hasColumn('evt_titulo as titulo', 'string', 255, array(
'type' => 'string',
'length' => '100',
));
$this->hasColumn('evt_vagas as vagas', 'integer', null, array(
'type' => 'integer',
));
$this->hasColumn('evt_inicio_inscricao as inicioInscricao', 'date', null, array(
'type' => 'date',
));
$this->hasColumn('evt_final_inscricao as finalInscricao', 'date', null, array(
'type' => 'date',
));
$this->hasColumn('evt_folder as folder', 'string', 255, array(
'type' => 'string',
'length' => '255',
));
$this->hasColumn('evt_banner as banner', 'string', 255, array(
'type' => 'string',
'length' => '255',
));
$this->hasColumn('evt_valor as valor', 'double precision', null, array(
'type' => 'double precision',
));
$this->hasColumn('evt_valor_socio as valorSocio', 'double precision', null, array(
'type' => 'double precision',
));
$this->hasColumn('evt_local as local', 'string', 255, array(
'type' => 'string',
'length' => '255',
));
$this->hasColumn('evt_dataini as dataIni', 'date', null, array(
'type' => 'date',
));
$this->hasColumn('evt_datafim as dataFim', 'date', null, array(
'type' => 'date',
));
$this->hasColumn('evt_imagem as imagem', 'string', 255, array(
'type' => 'string',
));
$this->hasColumn('evt_descricao as descricao', 'text', null, array(
'type' => 'text',
));
$this->hasColumn('evt_tipo as tipo', 'string', 25, array(
'type' => 'string',
'length' => '25',
));
$this->hasColumn('evt_link as link', 'string', 250, array(
'type' => 'string',
'length' => '250',
));
$this->hasColumn('evt_exibir as exibir', 'bit', 1, array(
'type' => 'bit',
'length' => '1',
));
}
/**
* Seta os relacionamentos da classe atual
*
* @return void
*/
public function setUp()
{
parent::setUp();
$this->hasMany('Inscricao as inscricoes', array(
'local' => 'evt_id',
'foreign' => 'evt_id'));
}
}
|