Viewing file: Oficio.php (4.14 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
* Oficio
*
* Classe modelo para utilização do Doctrine
* @property integer $id
* @property string $descricao
* @property string $cnpj
* @property string $endereco
* @property string $bairro
* @property integer $cidadeDr
* @property string $estado
* @property string $cep
* @property string $caixaPostal
* @property string $ddd
* @property string $fone
* @property string $fax
* @property string $complEnd
* @property string $enderecoCorrespondencia
* @property string $cidadeCorrespondencia
* @property string $bairroCorrespondencia
* @property string $cepCorrespondencia
* @property string $ufCorrespondencia
* @property string $mostraLogoSN
* @property string $ativoSn
* @package app
* @subpackage model
* @author iMAXIS
*/
class Oficio 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 usr_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('oficios');
$this->hasColumn('OFI_RowID as id', 'integer', null, array(
'type' => 'integer',
'primary' => true,
));
$this->hasColumn('OFI_Descricao as descricao', 'string', 80, array(
'type' => 'string',
));
$this->hasColumn('OFI_CNPJ as cnpj', 'string', 18, array(
'type' => 'string',
));
$this->hasColumn('OFI_Endereco as endereco', 'string', 50, array(
'type' => 'string',
));
$this->hasColumn('OFI_Bairro as bairro', 'string', 25, array(
'type' => 'string',
));
$this->hasColumn('OFI_Cidades_DR as cidadeDr', 'integer', null, array(
'type' => 'integer',
));
$this->hasColumn('OFI_Estado as estado', 'string', 2, array(
'type' => 'string',
));
$this->hasColumn('OFI_Cep as cep', 'string', 10, array(
'type' => 'string',
));
$this->hasColumn('OFI_CaixaPostal as caixaPostal', 'string', 10, array(
'type' => 'string',
));
$this->hasColumn('OFI_DDD as ddd', 'string', 3, array(
'type' => 'string',
));
$this->hasColumn('OFI_Fone as fone', 'string', 10, array(
'type' => 'string',
));
$this->hasColumn('OFI_Fax as fax', 'string', 10, array(
'type' => 'string',
));
$this->hasColumn('OFI_ComplEnd as complEnd', 'string', 40, array(
'type' => 'string',
));
$this->hasColumn('OFI_EnderecoCorrespondencia as enderecoCorrespondencia', 'string', 50, array(
'type' => 'string',
));
$this->hasColumn('OFI_CidadeCorrespondencia as cidadeCorrespondencia', 'string', 30, array(
'type' => 'string',
));
$this->hasColumn('OFI_BairroCorrespondencia as bairroCorrespondencia', 'string', 20, array(
'type' => 'string',
));
$this->hasColumn('OFI_CEPCorrespondencia as cepCorrespondencia', 'string', 10, array(
'type' => 'string',
));
$this->hasColumn('OFI_UFCorrespondencia as ufCorrespondencia', 'string', 2, array(
'type' => 'string',
));
$this->hasColumn('OFI_MostraLogoSN as mostraLogoSN', 'string', 1, array(
'type' => 'string',
));
$this->hasColumn('OFI_AtivoSN as ativoSn', 'string', 1, array(
'type' => 'string',
));
}
public function setUp() {
parent::setUp();
$this->hasOne('Contato as contato', array(
'local' => 'id',
'foreign' => 'oficiosDr'));
$this->hasOne('Cidade as cidade', array(
'local' => 'OFI_Cidades_DR',
'foreign' => 'CID_RowID'));
}
}
|