Lançado Adianti Framework 7.6!
Clique aqui para saber mais
Problema com TDBCheckGroup Bom dia a todos. Tenho um formulário de cadastro que não está carregando os dados do TDBCheckGroup na tela de edição de cadastro (Todos os outros dados são cadastrados menos o do TDBCheckGroup), não consigo encontrar o erro alguem pode me ajudar? Desde já agradeço. CÓDIGO DO FORM ...
ET
Problema com TDBCheckGroup  
Bom dia a todos.
Tenho um formulário de cadastro que não está carregando os dados do TDBCheckGroup na tela de edição de cadastro (Todos os outros dados são cadastrados menos o do TDBCheckGroup), não consigo encontrar o erro alguem pode me ajudar?
Desde já agradeço.

CÓDIGO DO FORM



  1. <?php
  2. /**
  3.  * AlunoForm Form
  4.  * @author  <your name here>
  5.  */
  6. class AlunoForm extends TPage
  7. {
  8.     protected $form// form
  9.     
  10.     /**
  11.      * Form constructor
  12.      * @param $param Request
  13.      */
  14.     public function __construct$param )
  15.     {
  16.         parent::__construct();
  17.         
  18.         
  19.         // creates the form
  20.         $this->form = new BootstrapFormBuilder('form_Aluno');
  21.         $this->form->setFormTitle('Cadastro de Aluno');
  22.         
  23.         // create the form fields
  24.         $id = new TEntry('id');
  25.         $nome = new TEntry('nome');
  26.         $serie_id = new TDBCombo('serie_id''farolerp''Serie''id''descricao');
  27.         $dt_nascimento = new TDate('dt_nascimento');
  28.         $municipio_id = new TDBUniqueSearch('municipio_id''farolerp''Municipio''id''nome');
  29.         $estado_id = new TDBCombo('estado_id''farolerp''Estado''id''nome');
  30.         $n_documento = new TEntry('n_documento');
  31.         $tipo_documento = new TEntry('tipo_documento');
  32.         $nome_pai = new TEntry('nome_pai');
  33.         $profissao_pai = new TEntry('profissao_pai');
  34.         $nome_mae = new TEntry('nome_mae');
  35.         $profissao_mae = new TEntry('profissao_mae');
  36.         $endereco = new TEntry('endereco');
  37.         $cidade = new TDBUniqueSearch('cidade''farolerp''Municipio''id''nome');
  38.         $telefone = new TEntry('telefone');
  39.         $celular = new TEntry('celular');
  40.         $local_origem_aluno_id = new TDBRadioGroup('local_origem_aluno_id''farolerp''LocalOrigemAluno''id''nome');
  41.         $rede_origem_aluno_id = new TDBRadioGroup('rede_origem_aluno_id''farolerp''RedeOrigemAluno''id''nome');
  42.         $frequencia_ano_anterior_id = new TDBRadioGroup('frequencia_ano_anterior_id''farolerp''FrequenciaAnoAnterior''id''descricao');
  43.         $nivel_ensino_origem_aluno_id = new TDBRadioGroup('nivel_ensino_origem_aluno_id''farolerp''NivelEnsinoOrigemAluno''id''descricao');
  44.         $situacao_ingresso_id = new TDBRadioGroup('situacao_ingresso_id''farolerp''SituacaoIngresso''id''descricao');
  45.         $educacao_especial_id = new TDBCheckGroup('educacao_especial_id''farolerp''EducacaoEspecial''id''descricao');
  46.         $tipo_sanguineo = new TEntry('tipo_sanguineo');
  47.         $necessidades_especiais_id = new TDBCheckGroup('necessidades_especiais_id''farolerp''NecessidadesEspeciais''id''descricao');
  48.         $problemas_alergicos = new TCombo('problemas_alergicos');
  49.         $descricao_alergia = new TText('descricao_alergia');
  50.         $outros = new TText('outros');
  51.         
  52.         // add the combo filds problemas_alergicos
  53.         $problemas_alergicos->addItems(array('SIM'=>'SIM',
  54.         'NÃO'=>'NÃO'
  55.         ));
  56.         
  57.         //Rádio Goups
  58.         //local_origem_aluno_id
  59.         $local_origem_aluno_id->setLayout('horizontal');
  60.         if ($local_origem_aluno_id->getLabels())
  61.         {
  62.             foreach ($local_origem_aluno_id->getLabels() as $label)
  63.             {
  64.                 $label->setSize(200);
  65.             }
  66.         }
  67.         
  68.         //rede_origem_aluno_id
  69.         $rede_origem_aluno_id->setLayout('horizontal');
  70.         if ($rede_origem_aluno_id->getLabels())
  71.         {
  72.             foreach ($rede_origem_aluno_id->getLabels() as $label)
  73.             {
  74.                 $label->setSize(200);
  75.             }
  76.         }
  77.         
  78.         //frequencia_ano_anterior_id
  79.         $frequencia_ano_anterior_id->setLayout('horizontal');
  80.         if ($frequencia_ano_anterior_id->getLabels())
  81.         {
  82.             foreach ($frequencia_ano_anterior_id->getLabels() as $label)
  83.             {
  84.                 $label->setSize(200);
  85.             }
  86.         }
  87.         
  88.         //nivel_ensino_origem_aluno_id
  89.         $nivel_ensino_origem_aluno_id->setLayout('horizontal');
  90.         if ($nivel_ensino_origem_aluno_id->getLabels())
  91.         {
  92.             foreach ($nivel_ensino_origem_aluno_id->getLabels() as $label)
  93.             {
  94.                 $label->setSize(400);
  95.             }
  96.         }
  97.         
  98.         //educacao_especial_id
  99.         $educacao_especial_id->setLayout('horizontal');
  100.         if ($educacao_especial_id->getLabels())
  101.         {
  102.             foreach ($educacao_especial_id->getLabels() as $label)
  103.             {
  104.                 $label->setSize(200);
  105.             }
  106.         }
  107.         
  108.         //necessidades_especiais_id
  109.         $necessidades_especiais_id->setLayout('horizontal');
  110.         if ($necessidades_especiais_id->getLabels())
  111.         {
  112.             foreach ($necessidades_especiais_id->getLabels() as $label)
  113.             {
  114.                 $label->setSize(400);
  115.             }
  116.         }
  117.         
  118.         // Formatação de datas
  119.         $dt_nascimento->setDatabaseMask('yyyy/mm/dd');
  120.         
  121.         $dt_nascimento->setMask('dd/mm/yyyy');
  122.         
  123.         $nome->setMaxLength(100);
  124.         $n_documento->setMaxLength(40);
  125.         $tipo_documento->setMaxLength(100);
  126.         $nome_pai->setMaxLength(100);
  127.         $profissao_pai->setMaxLength(100);
  128.         $nome_mae->setMaxLength(100);
  129.         $profissao_mae->setMaxLength(100);
  130.         $endereco->setMaxLength(100);
  131.         
  132.         $telefone->setMask('(99)9999-9999');
  133.         $celular->setMask('(99)9.9999-9999');
  134.         $tipo_sanguineo->setMaxLength(2);
  135.         
  136.         // add the fields
  137.         $this->form->addContent( [new TFormSeparator('<b>Identificação do aluno</b>')]);
  138.         $this->form->addFields( [ new TLabel('Código') ], [ $id ] );
  139.         $this->form->addFields( [ new TLabel('Nome''#ff0000') ], [ $nome ] );
  140.         $this->form->addFields( [ new TLabel('Série') ], [ $serie_id ], [ new TLabel('Data Nascimento') ], [ $dt_nascimento ] );
  141.         $this->form->addFields( [ new TLabel('Municipio') ], [ $municipio_id ], [ new TLabel('Estado') ], [ $estado_id ] );
  142.         $this->form->addFields( [ new TLabel('Nº do Documento') ], [ $n_documento ], [ new TLabel('Tipo de Documento') ], [ $tipo_documento ] );
  143.         $this->form->addFields( [ new TLabel('Nome do Pai') ], [ $nome_pai ], [ new TLabel('Profissão do Pai') ], [ $profissao_pai ] );
  144.         $this->form->addFields( [ new TLabel('Nome Mãe') ], [ $nome_mae ], [ new TLabel('Profissão da Mãe') ], [ $profissao_mae ] );
  145.         $this->form->addFields( [ new TLabel('Endereço') ], [ $endereco ], [ new TLabel('Cidade') ], [ $cidade ]  );
  146.         $this->form->addFields( [ new TLabel('Telefone') ], [ $telefone ], [ new TLabel('Celular') ], [ $celular ] );
  147.         $this->form->addContent( [new TFormSeparator('<b>Local de origem do aluno</b>')]);
  148.         $this->form->addFields( [ new TLabel('') ],[ $local_origem_aluno_id ] );
  149.         $this->form->addContent( [new TFormSeparator('<b>Rede de origem do aluno</b>')]);
  150.         $this->form->addFields( [ new TLabel('') ], [ $rede_origem_aluno_id ] );
  151.         $this->form->addContent( [new TFormSeparator('<b>Frequência á escola em relação ao ano anterior</b>')]);
  152.         $this->form->addFields( [ new TLabel('') ], [ $frequencia_ano_anterior_id ] );
  153.         $this->form->addContent( [new TFormSeparator('<b>Nivel de ensino de origem do aluno</b>')]);
  154.         $this->form->addFields( [ new TLabel('') ], [ $nivel_ensino_origem_aluno_id ] );
  155.         $this->form->addContent( [new TFormSeparator('<b>Situacao do aluno na série que está ingressando</b>')]);
  156.         $this->form->addFields( [ new TLabel('') ], [ $situacao_ingresso_id ] );
  157.         $this->form->addContent( [new TFormSeparator('<b>Educação Especial</b>')]);
  158.         $this->form->addFields( [ new TLabel('') ], [ $educacao_especial_id ] );
  159.         $this->form->addFields( [ new TLabel('Tipo Sanguíneo') ], [ $tipo_sanguineo ] );
  160.         $this->form->addContent( [new TFormSeparator('<b>Aluno de necessidades especiais</b>')]);
  161.         $this->form->addFields( [ new TLabel('') ], [ $necessidades_especiais_id ] );
  162.         $this->form->addFields( [ new TLabel('Problemas Alérgicos') ], [ $problemas_alergicos ] );
  163.         $this->form->addFields( [ new TLabel('Descrição da Alergia') ], [ $descricao_alergia ] );
  164.         $this->form->addFields( [ new TLabel('Outros') ], [ $outros ] );
  165.         $nome->addValidation('Nome', new TRequiredValidator);
  166.         // set sizes
  167.         $id->setSize('100');
  168.         $nome->setSize('100%');
  169.         $serie_id->setSize('100%');
  170.         $dt_nascimento->setSize('100%');
  171.         $municipio_id->setSize('100%');
  172.         $estado_id->setSize('100%');
  173.         $n_documento->setSize('100%');
  174.         $tipo_documento->setSize('100%');
  175.         $nome_pai->setSize('100%');
  176.         $profissao_pai->setSize('100%');
  177.         $nome_mae->setSize('100%');
  178.         $profissao_mae->setSize('100%');
  179.         $endereco->setSize('100%');
  180.         $cidade->setSize('100%');
  181.         $telefone->setSize('100%');
  182.         $celular->setSize('100%');
  183.         $local_origem_aluno_id->setSize('100%');
  184.         $rede_origem_aluno_id->setSize('100%');
  185.         $frequencia_ano_anterior_id->setSize('100%');
  186.         $nivel_ensino_origem_aluno_id->setSize('100%');
  187.         $situacao_ingresso_id->setSize('100%');
  188.         $educacao_especial_id->setSize('100%');
  189.         $tipo_sanguineo->setSize('38%');
  190.         $necessidades_especiais_id->setSize('100%');
  191.         $problemas_alergicos->setSize('38%');
  192.         $descricao_alergia->setSize('100%');
  193.         $outros->setSize('100%');
  194.         if (!empty($id))
  195.         {
  196.             $id->setEditable(FALSE);
  197.         }
  198.         
  199.         /** samples
  200.          $fieldX->addValidation( 'Field X', new TRequiredValidator ); // add validation
  201.          $fieldX->setSize( '100%' ); // set size
  202.          **/
  203.          
  204.         // create the form actions
  205.         $btn $this->form->addAction(_t('Save'), new TAction([$this'onSave']), 'fa:save');
  206.         $btn->class 'btn btn-sm btn-primary';
  207.         $this->form->addActionLink(_t('New'),  new TAction([$this'onEdit']), 'fa:eraser red');
  208.         
  209.         // vertical box container
  210.         $container = new TVBox;
  211.         $container->style 'width: 100%';
  212.         // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
  213.         $container->add($this->form);
  214.         
  215.         parent::add($container);
  216.     }
  217.     /**
  218.      * Save form data
  219.      * @param $param Request
  220.      */
  221.     public function onSave$param )
  222.     {
  223.         try
  224.         {
  225.             TTransaction::open('farolerp'); // open a transaction
  226.             
  227.             /**
  228.             // Enable Debug logger for SQL operations inside the transaction
  229.             TTransaction::setLogger(new TLoggerSTD); // standard output
  230.             TTransaction::setLogger(new TLoggerTXT('log.txt')); // file
  231.             **/
  232.             
  233.             $this->form->validate(); // validate form data
  234.             $data $this->form->getData(); // get form data as array
  235.             
  236.             $object = new Aluno;  // create an empty object
  237.             $object->fromArray( (array) $data); // load the object with data
  238.             $object->store(); // save the object
  239.             
  240.             // get the generated id
  241.             $data->id $object->id;
  242.             
  243.             $this->form->setData($data); // fill form data
  244.             TTransaction::close(); // close the transaction
  245.             
  246.             new TMessage('info'AdiantiCoreTranslator::translate('Record saved'));
  247.         }
  248.         catch (Exception $e// in case of exception
  249.         {
  250.             new TMessage('error'$e->getMessage()); // shows the exception error message
  251.             $this->form->setData$this->form->getData() ); // keep form data
  252.             TTransaction::rollback(); // undo all pending operations
  253.         }
  254.     }
  255.     
  256.     /**
  257.      * Clear form data
  258.      * @param $param Request
  259.      */
  260.     public function onClear$param )
  261.     {
  262.         $this->form->clear(TRUE);
  263.     }
  264.     
  265.     /**
  266.      * Load object to form data
  267.      * @param $param Request
  268.      */
  269.     public function onEdit$param )
  270.     {
  271.         try
  272.         {
  273.             if (isset($param['key']))
  274.             {
  275.                 $key $param['key'];  // get the parameter $key
  276.                 TTransaction::open('farolerp'); // open a transaction
  277.                 $object = new Aluno($key); // instantiates the Active Record
  278.                 $this->form->setData($object); // fill the form
  279.                 TTransaction::close(); // close the transaction
  280.             }
  281.             else
  282.             {
  283.                 $this->form->clear(TRUE);
  284.             }
  285.         }
  286.         catch (Exception $e// in case of exception
  287.         {
  288.             new TMessage('error'$e->getMessage()); // shows the exception error message
  289.             TTransaction::rollback(); // undo all pending operations
  290.         }
  291.     }
  292. }
  293. ?>


MODEL


  1. <?php
  2. /**
  3.  * Aluno Active Record
  4.  * @author  <your-name-here>
  5.  */
  6. class Aluno extends TRecord
  7. {
  8.     const TABLENAME 'aluno';
  9.     const PRIMARYKEY'id';
  10.     const IDPOLICY =  'serial'// {max, serial}
  11.     
  12.     
  13.     private $serie;
  14.     private $municipio;
  15.     private $rede_origem_aluno;
  16.     private $estado;
  17.     private $situacao_ingresso;
  18.     private $local_origem_aluno;
  19.     private $frequencia_ano_anterior;
  20.     private $nivel_ensino_origem_aluno;
  21.     private $educacao_especial;
  22.     private $necessidades_especiais;
  23.     /**
  24.      * Constructor method
  25.      */
  26.     public function __construct($id NULL$callObjectLoad TRUE)
  27.     {
  28.         parent::__construct($id$callObjectLoad);
  29.         parent::addAttribute('nome');
  30.         parent::addAttribute('serie_id');
  31.         parent::addAttribute('dt_nascimento');
  32.         parent::addAttribute('municipio_id');
  33.         parent::addAttribute('estado_id');
  34.         parent::addAttribute('n_documento');
  35.         parent::addAttribute('tipo_documento');
  36.         parent::addAttribute('nome_pai');
  37.         parent::addAttribute('profissao_pai');
  38.         parent::addAttribute('nome_mae');
  39.         parent::addAttribute('profissao_mae');
  40.         parent::addAttribute('endereco');
  41.         parent::addAttribute('cidade');
  42.         parent::addAttribute('telefone');
  43.         parent::addAttribute('celular');
  44.         parent::addAttribute('local_origem_aluno_id');
  45.         parent::addAttribute('rede_origem_aluno_id');
  46.         parent::addAttribute('frequencia_ano_anterior_id');
  47.         parent::addAttribute('nivel_ensino_origem_aluno_id');
  48.         parent::addAttribute('situacao_ingresso_id');
  49.         parent::addAttribute('educacao_especial_id');
  50.         parent::addAttribute('tipo_sanguineo');
  51.         parent::addAttribute('necessidades_especiais_id');
  52.         parent::addAttribute('problemas_alergicos');
  53.         parent::addAttribute('descricao_alergia');
  54.         parent::addAttribute('outros');
  55.     }
  56.     
  57.     /**
  58.      * Method set_serie
  59.      * Sample of usage: $aluno->serie = $object;
  60.      * @param $object Instance of Serie
  61.      */
  62.     public function set_serie(Serie $object)
  63.     {
  64.         $this->serie $object;
  65.         $this->serie_id $object->id;
  66.     }
  67.     
  68.     /**
  69.      * Method get_serie
  70.      * Sample of usage: $aluno->serie->attribute;
  71.      * @returns Serie instance
  72.      */
  73.     public function get_serie()
  74.     {
  75.         // loads the associated object
  76.         if (empty($this->serie))
  77.             $this->serie = new Serie($this->serie_id);
  78.     
  79.         // returns the associated object
  80.         return $this->serie;
  81.     }
  82.     
  83.     
  84.     /**
  85.      * Method set_municipio
  86.      * Sample of usage: $aluno->municipio = $object;
  87.      * @param $object Instance of Municipio
  88.      */
  89.     public function set_municipio(Municipio $object)
  90.     {
  91.         $this->municipio $object;
  92.         $this->municipio_id $object->id;
  93.     }
  94.     
  95.     /**
  96.      * Method get_municipio
  97.      * Sample of usage: $aluno->municipio->attribute;
  98.      * @returns Municipio instance
  99.      */
  100.     public function get_municipio()
  101.     {
  102.         // loads the associated object
  103.         if (empty($this->municipio))
  104.             $this->municipio = new Municipio($this->municipio_id);
  105.     
  106.         // returns the associated object
  107.         return $this->municipio;
  108.     }
  109.     
  110.     
  111.     /**
  112.      * Method set_rede_origem_aluno
  113.      * Sample of usage: $aluno->rede_origem_aluno = $object;
  114.      * @param $object Instance of RedeOrigemAluno
  115.      */
  116.     public function set_rede_origem_aluno(RedeOrigemAluno $object)
  117.     {
  118.         $this->rede_origem_aluno $object;
  119.         $this->rede_origem_aluno_id $object->id;
  120.     }
  121.     
  122.     /**
  123.      * Method get_rede_origem_aluno
  124.      * Sample of usage: $aluno->rede_origem_aluno->attribute;
  125.      * @returns RedeOrigemAluno instance
  126.      */
  127.     public function get_rede_origem_aluno()
  128.     {
  129.         // loads the associated object
  130.         if (empty($this->rede_origem_aluno))
  131.             $this->rede_origem_aluno = new RedeOrigemAluno($this->rede_origem_aluno_id);
  132.     
  133.         // returns the associated object
  134.         return $this->rede_origem_aluno;
  135.     }
  136.     
  137.     
  138.     /**
  139.      * Method set_estado
  140.      * Sample of usage: $aluno->estado = $object;
  141.      * @param $object Instance of Estado
  142.      */
  143.     public function set_estado(Estado $object)
  144.     {
  145.         $this->estado $object;
  146.         $this->estado_id $object->id;
  147.     }
  148.     
  149.     /**
  150.      * Method get_estado
  151.      * Sample of usage: $aluno->estado->attribute;
  152.      * @returns Estado instance
  153.      */
  154.     public function get_estado()
  155.     {
  156.         // loads the associated object
  157.         if (empty($this->estado))
  158.             $this->estado = new Estado($this->estado_id);
  159.     
  160.         // returns the associated object
  161.         return $this->estado;
  162.     }
  163.     
  164.     
  165.     /**
  166.      * Method set_situacao_ingresso
  167.      * Sample of usage: $aluno->situacao_ingresso = $object;
  168.      * @param $object Instance of SituacaoIngresso
  169.      */
  170.     public function set_situacao_ingresso(SituacaoIngresso $object)
  171.     {
  172.         $this->situacao_ingresso $object;
  173.         $this->situacao_ingresso_id $object->id;
  174.     }
  175.     
  176.     /**
  177.      * Method get_situacao_ingresso
  178.      * Sample of usage: $aluno->situacao_ingresso->attribute;
  179.      * @returns SituacaoIngresso instance
  180.      */
  181.     public function get_situacao_ingresso()
  182.     {
  183.         // loads the associated object
  184.         if (empty($this->situacao_ingresso))
  185.             $this->situacao_ingresso = new SituacaoIngresso($this->situacao_ingresso_id);
  186.     
  187.         // returns the associated object
  188.         return $this->situacao_ingresso;
  189.     }
  190.     
  191.     
  192.     /**
  193.      * Method set_local_origem_aluno
  194.      * Sample of usage: $aluno->local_origem_aluno = $object;
  195.      * @param $object Instance of LocalOrigemAluno
  196.      */
  197.     public function set_local_origem_aluno(LocalOrigemAluno $object)
  198.     {
  199.         $this->local_origem_aluno $object;
  200.         $this->local_origem_aluno_id $object->id;
  201.     }
  202.     
  203.     /**
  204.      * Method get_local_origem_aluno
  205.      * Sample of usage: $aluno->local_origem_aluno->attribute;
  206.      * @returns LocalOrigemAluno instance
  207.      */
  208.     public function get_local_origem_aluno()
  209.     {
  210.         // loads the associated object
  211.         if (empty($this->local_origem_aluno))
  212.             $this->local_origem_aluno = new LocalOrigemAluno($this->local_origem_aluno_id);
  213.     
  214.         // returns the associated object
  215.         return $this->local_origem_aluno;
  216.     }
  217.     
  218.     
  219.     /**
  220.      * Method set_frequencia_ano_anterior
  221.      * Sample of usage: $aluno->frequencia_ano_anterior = $object;
  222.      * @param $object Instance of FrequenciaAnoAnterior
  223.      */
  224.     public function set_frequencia_ano_anterior(FrequenciaAnoAnterior $object)
  225.     {
  226.         $this->frequencia_ano_anterior $object;
  227.         $this->frequencia_ano_anterior_id $object->id;
  228.     }
  229.     
  230.     /**
  231.      * Method get_frequencia_ano_anterior
  232.      * Sample of usage: $aluno->frequencia_ano_anterior->attribute;
  233.      * @returns FrequenciaAnoAnterior instance
  234.      */
  235.     public function get_frequencia_ano_anterior()
  236.     {
  237.         // loads the associated object
  238.         if (empty($this->frequencia_ano_anterior))
  239.             $this->frequencia_ano_anterior = new FrequenciaAnoAnterior($this->frequencia_ano_anterior_id);
  240.     
  241.         // returns the associated object
  242.         return $this->frequencia_ano_anterior;
  243.     }
  244.     
  245.     
  246.     /**
  247.      * Method set_nivel_ensino_origem_aluno
  248.      * Sample of usage: $aluno->nivel_ensino_origem_aluno = $object;
  249.      * @param $object Instance of NivelEnsinoOrigemAluno
  250.      */
  251.     public function set_nivel_ensino_origem_aluno(NivelEnsinoOrigemAluno $object)
  252.     {
  253.         $this->nivel_ensino_origem_aluno $object;
  254.         $this->nivel_ensino_origem_aluno_id $object->id;
  255.     }
  256.     
  257.     /**
  258.      * Method get_nivel_ensino_origem_aluno
  259.      * Sample of usage: $aluno->nivel_ensino_origem_aluno->attribute;
  260.      * @returns NivelEnsinoOrigemAluno instance
  261.      */
  262.     public function get_nivel_ensino_origem_aluno()
  263.     {
  264.         // loads the associated object
  265.         if (empty($this->nivel_ensino_origem_aluno))
  266.             $this->nivel_ensino_origem_aluno = new NivelEnsinoOrigemAluno($this->nivel_ensino_origem_aluno_id);
  267.     
  268.         // returns the associated object
  269.         return $this->nivel_ensino_origem_aluno;
  270.     }
  271.     
  272.     
  273.     /**
  274.      * Method set_educacao_especial
  275.      * Sample of usage: $aluno->educacao_especial = $object;
  276.      * @param $object Instance of EducacaoEspecial
  277.      */
  278.     public function set_educacao_especial(EducacaoEspecial $object)
  279.     {
  280.         $this->educacao_especial $object;
  281.         $this->educacao_especial_id $object->id;
  282.     }
  283.     
  284.     /**
  285.      * Method get_educacao_especial
  286.      * Sample of usage: $aluno->educacao_especial->attribute;
  287.      * @returns EducacaoEspecial instance
  288.      */
  289.     public function get_educacao_especial()
  290.     {
  291.         // loads the associated object
  292.         if (empty($this->educacao_especial))
  293.             $this->educacao_especial = new EducacaoEspecial($this->educacao_especial_id);
  294.     
  295.         // returns the associated object
  296.         return $this->educacao_especial;
  297.     }
  298.     
  299.     
  300.     /**
  301.      * Method set_necessidades_especiais
  302.      * Sample of usage: $aluno->necessidades_especiais = $object;
  303.      * @param $object Instance of NecessidadesEspeciais
  304.      */
  305.     public function set_necessidades_especiais(NecessidadesEspeciais $object)
  306.     {
  307.         $this->necessidades_especiais $object;
  308.         $this->necessidades_especiais_id $object->id;
  309.     }
  310.     
  311.     /**
  312.      * Method get_necessidades_especiais
  313.      * Sample of usage: $aluno->necessidades_especiais->attribute;
  314.      * @returns NecessidadesEspeciais instance
  315.      */
  316.     public function get_necessidades_especiais()
  317.     {
  318.         // loads the associated object
  319.         if (empty($this->necessidades_especiais))
  320.             $this->necessidades_especiais = new NecessidadesEspeciais($this->necessidades_especiais_id);
  321.     
  322.         // returns the associated object
  323.         return $this->necessidades_especiais;
  324.     }
  325.     
  326. }
  327. ?>

Pacotão Dominando o Adianti Framework 7
O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado! Versão 7.4


Dominando o Adianti 7 Quero me inscrever agora!

Comentários (0)