protected function get() { if ($this->canGet()) { $id = $this->getRequest()->id; $aluno = new clsPmieducarAluno(); $aluno->cod_aluno = $id; $aluno = $aluno->detalhe(); $attrs = array('cod_aluno' => 'id', 'ref_cod_aluno_beneficio' => 'beneficio_id', 'ref_cod_religiao' => 'religiao_id', 'ref_idpes' => 'pessoa_id', 'tipo_responsavel' => 'tipo_responsavel', 'ref_usuario_exc' => 'destroyed_by', 'data_exclusao' => 'destroyed_at', 'analfabeto', 'ativo', 'aluno_estado_id'); $aluno = Portabilis_Array_Utils::filter($aluno, $attrs); $aluno['nome'] = $this->loadNomeAluno($id); $aluno['tipo_transporte'] = $this->loadTransporte($id); $aluno['tipo_responsavel'] = $this->tipoResponsavel($aluno); $aluno['aluno_inep_id'] = $this->loadAlunoInepId($id); $aluno['ativo'] = $aluno['ativo'] == 1; $aluno['aluno_estado_id'] = Portabilis_String_Utils::toUtf8($aluno['aluno_estado_id']); $aluno['alfabetizado'] = $aluno['analfabeto'] == 0; unset($aluno['analfabeto']); // destroyed_by username $dataMapper = $this->getDataMapperFor('usuario', 'funcionario'); $entity = $this->tryGetEntityOf($dataMapper, $aluno['destroyed_by']); $aluno['destroyed_by'] = is_null($entity) ? null : $entity->get('matricula'); $aluno['destroyed_at'] = Portabilis_Date_Utils::pgSQLToBr($aluno['destroyed_at']); $objFichaMedica = new clsModulesFichaMedicaAluno($id); if ($objFichaMedica->existe()) { $objFichaMedica = $objFichaMedica->detalhe(); foreach ($objFichaMedica as $chave => $value) { $objFichaMedica[$chave] = Portabilis_String_Utils::toUtf8($value); } $aluno = Portabilis_Array_Utils::merge($objFichaMedica, $aluno); } $objUniforme = new clsModulesUniformeAluno($id); if ($objUniforme->existe()) { $objUniforme = $objUniforme->detalhe(); foreach ($objUniforme as $chave => $value) { $objUniforme[$chave] = Portabilis_String_Utils::toUtf8($value); } $aluno = Portabilis_Array_Utils::merge($objUniforme, $aluno); } $objMoradia = new clsModulesMoradiaAluno($id); if ($objMoradia->existe()) { $objMoradia = $objMoradia->detalhe(); foreach ($objMoradia as $chave => $value) { $objMoradia[$chave] = Portabilis_String_Utils::toUtf8($value); } $aluno = Portabilis_Array_Utils::merge($objMoradia, $aluno); } $sql = "select sus from cadastro.fisica where idpes = \$1"; $aluno['sus'] = Portabilis_String_Utils::toUtf8($this->fetchPreparedQuery($sql, $aluno['pessoa_id'], false, 'first-field')); return $aluno; } }
protected function mergeInputOptions($inputOptions = array(), $helperOptions = array()) { if (!empty($inputOptions) && isset($helperOptions['options'])) { throw new Exception("Don't send \$inputOptions and \$helperOptions['options'] at the same time!"); } $defaultOptions = array('options' => $inputOptions); $options = Portabilis_Array_Utils::merge($helperOptions, $defaultOptions); //foreach($helperOptions as $k => $v) { // $options[$k] = $v; //} return $options; }
protected static function mergeOptions($options, $defaultOptions) { return Portabilis_Array_Utils::merge($options, $defaultOptions); }
protected function get() { $pessoa = array(); if ($this->canGet()) { if ($this->getRequest()->id) { $pessoa = $this->loadPessoa($this->getRequest()->id); } else { $pessoa = $this->loadPessoaByCpf($this->getRequest()->cpf); } $attrs = array('id', 'nome'); $pessoa = Portabilis_Array_Utils::filter($pessoa, $attrs); $details = $this->loadDetails($this->getRequest()->id); $pessoa = Portabilis_Array_Utils::merge($pessoa, $details); $pessoa['deficiencias'] = $this->loadDeficiencias($this->getRequest()->id); } return $pessoa; }