Viewing file: Noticia.php (3.43 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
* Noticia
*
* Classe modelo para utilização do Doctrine
*
* @property int $id
* @property string $titulo
* @property string $gravata
* @property string $fonte
* @property string $conteudo
* @property integer $catId
* @property date $notdata
* @property date $dataExpiracao
* @property string $imagem
* @property string $url
* @property integer $sequencia
* @property string $uf
* @property Categoria $categoria
*
* @package application
* @subpackage model
* @author iMAXIS
*/
class Noticia 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_noticias');
$this->hasColumn('not_id as id', 'int', null, array(
'type' => 'int',
'primary' => true,
));
$this->hasColumn('not_titulo as titulo', 'text', null, array(
'type' => 'text',
));
$this->hasColumn('not_gravata as gravata', 'string', 255, array(
'type' => 'string',
'length' => '500',
));
$this->hasColumn('not_conteudo as conteudo', 'text', null, array(
'type' => 'string',
'length' => '500',
));
$this->hasColumn('not_data as notdata', 'date', null, array(
'type' => 'date',
));
$this->hasColumn('not_hora as hora', 'time', null, array(
'type' => 'time',
));
$this->hasColumn('not_imagem as imagem', 'string', 255, array(
'type' => 'string',
'length' => '255',
));
$this->hasColumn('not_fonte as fonte', 'string', 255, array(
'type' => 'string',
'length' => '255',
));
/*$this->hasColumn('cat_id as catId', 'integer', null, array(
'type' => 'integer',
));*/
$this->hasColumn('not_url as url', 'string', 255, array(
'type' => 'string',
'length' => '500',
));
$this->hasColumn('not_expiracao as dataExpiracao', 'date', null, array(
'type' => 'date',
));
$this->hasColumn('not_imprensa as imprensa', 'string', 1, array(
'type' => 'string',
'length' => '1',
));
$this->hasColumn('not_jurisprudencia as jurisprudencia', 'string', 1, array(
'type' => 'string',
'length' => '1',
));
$this->hasColumn('not_exibircapa as exibirCapa', 'string', 1, array(
'type' => 'string',
'length' => '1',
));
$this->hasColumn('not_acessorestrito as acessoRestrito', 'string', 1, array(
'type' => 'string',
'length' => '1',
));
}
/*
public function setUp()
{
parent::setUp();
$this->hasOne('Categoria as categoria', array(
'local' => 'catId',
'foreign' => 'id'));
}
*/
}
|