query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Valida os dados do arquivo
public function validarDados(IExportacaoCenso $oExportacaoCenso) { $lTodosDadosValidos = true; $oDadosEscola = $oExportacaoCenso->getDadosProcessadosEscola(); $sMensagem = ""; /** * Início da validação dos campos obrigatórios */ if( trim( $oDadosEscola->registro00->codigo_escola_inep ) == '' ) { $sMensagem = "É necessário informar o código INEP da escola."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( trim( $oDadosEscola->registro00->codigo_escola_inep ) != '' ) { if( !DBNumber::isInteger( $oDadosEscola->registro00->codigo_escola_inep ) ) { $sMensagem = "Código INEP da escola inválido. O código INEP deve conter apenas números."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( strlen( trim( $oDadosEscola->registro00->codigo_escola_inep ) ) != 8 ) { $sMensagem = "Código INEP da escola inválido. O código INEP deve conter 8 dígitos."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } if (trim($oDadosEscola->registro00->nome_escola) == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Nome da Escola não pode ser vazio", ExportacaoCensoBase::LOG_ESCOLA); } if ( trim( $oDadosEscola->registro00->nome_escola ) != '' && strlen( $oDadosEscola->registro00->nome_escola ) < 4 ) { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Nome da Escola deve conter no mínimo 4 dígitos", ExportacaoCensoBase::LOG_ESCOLA); } if ($oDadosEscola->registro00->cep == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Campo CEP é obrigatório", ExportacaoCensoBase::LOG_ESCOLA); } if( !empty( $oDadosEscola->registro00->cep ) ) { if( !DBNumber::isInteger( $oDadosEscola->registro00->cep ) ) { $sMensagem = "CEP inválido. Deve conter somente números."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if (strlen($oDadosEscola->registro00->cep) < 8) { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("CEP da escola deve conter 8 dígitos.", ExportacaoCensoBase::LOG_ESCOLA); } } if ($oDadosEscola->registro00->endereco == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Endereço da escola é obrigatório.", ExportacaoCensoBase::LOG_ESCOLA); } if ($oDadosEscola->registro00->uf == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("UF da escolas é obrigatório.", ExportacaoCensoBase::LOG_ESCOLA); } if ($oDadosEscola->registro00->municipio == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Campo Munícipio da escola é obrigatório.", ExportacaoCensoBase::LOG_ESCOLA); } if ($oDadosEscola->registro00->distrito == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Campo Distrito é obrigatório.", ExportacaoCensoBase::LOG_ESCOLA); } /** * Validações que serão executadas caso a situação de funcionamento seja igual a 1 * 1 - em atividade */ if ($oDadosEscola->registro00->situacao_funcionamento == 1) { if (trim($oDadosEscola->registro00->codigo_orgao_regional_ensino) == '' && $oDadosEscola->registro00->lOrgaoEnsinoObrigatorio) { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Orgão Regional de Ensino obrigatório.", ExportacaoCensoBase::LOG_ESCOLA); } if ($oDadosEscola->registro00->data_inicio_ano_letivo == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Campo Data de Início do Ano Letivo é obrigatório", ExportacaoCensoBase::LOG_ESCOLA); } if ($oDadosEscola->registro00->data_termino_ano_letivo == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Campo Data de Término do Ano Letivo é obrigatório", ExportacaoCensoBase::LOG_ESCOLA); } if( !empty( $oDadosEscola->registro00->data_inicio_ano_letivo ) && !empty( $oDadosEscola->registro00->data_termino_ano_letivo ) ) { $oDataInicio = new DBDate( $oDadosEscola->registro00->data_inicio_ano_letivo ); $oDataTermino = new DBDate( $oDadosEscola->registro00->data_termino_ano_letivo ); if( DBDate::calculaIntervaloEntreDatas( $oDataInicio, $oDataTermino, 'd' ) > 0 ) { $sMensagem = "A data de início do ano letivo não pode ser maior que a data de término."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $oExportacaoCenso->getDataCenso() != '' ) { $oDataCenso = new DBDate( $oExportacaoCenso->getDataCenso() ); $iAnoAnterior = $oDataCenso->getAno() - 1; if( $oDataInicio->getAno() != $oDataCenso->getAno() && $oDataInicio->getAno() != $iAnoAnterior ) { $sMensagem = "Data de início do ano letivo inválido. Ano informado: {$oDataInicio->getAno()}"; $sMensagem .= " - Anos válidos: {$iAnoAnterior} ou {$oDataCenso->getAno()}"; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( DBDate::calculaIntervaloEntreDatas( $oDataCenso, $oDataTermino, 'd' ) > 0 || $oDataTermino->getAno() != $oDataCenso->getAno() ) { $sMensagem = "Data de término do ano letivo inválido. O ano deve ser o mesmo do censo"; $sMensagem .= " ( {$oDataCenso->getAno()} ), e a data não pode ser inferior a data de referência"; $sMensagem .= " ( {$oDataCenso->getDate( DBDate::DATA_PTBR )} )."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } } /** * Validações referentes aos telefones */ for( $iContador = 0; $iContador <= 2; $iContador++ ) { $sPropriedadeTelefone = "telefone"; $sMensagemTelefone = "Telefone"; if( $iContador > 0 ) { $sPropriedadeTelefone = "telefone_publico_{$iContador}"; $sMensagemTelefone = "Telefone Público {$iContador}"; } if( $oDadosEscola->registro00->{$sPropriedadeTelefone} != '' ) { if( strlen( $oDadosEscola->registro00->{$sPropriedadeTelefone} ) < 8 ) { $sMensagem = "Campo {$sMensagemTelefone} deve conter 8 dígitos"; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ( substr($oDadosEscola->registro00->{$sPropriedadeTelefone}, 0, 1) != 9 && strlen($oDadosEscola->registro00->{$sPropriedadeTelefone}) == 9 ) { $sMensagem = "Campo {$sMensagemTelefone}, ao conter 9 dígitos, o primeiro algarismo deve ser 9."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } } if ($oDadosEscola->registro00->fax != '') { if (strlen($oDadosEscola->registro00->fax) < 8) { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Campo Fax deve conter 8 dígitos", ExportacaoCensoBase::LOG_ESCOLA); } } /** * Validações que serão executadas caso a situação de funcionamento seja igual a 1 * 1 - em atividade * e caso a opção Dependência Administrativa selecionada seja igual a 4 * 4 - privada */ if ($oDadosEscola->registro00->dependencia_administrativa == 4) { if ( empty( $oDadosEscola->registro00->categoria_escola_privada ) ) { $lTodosDadosValidos = false; $sErroMsg = "Escola de Categoria Privada.\n"; $sErroMsg .= "Deve ser selecionada uma opção no campo Categoria da Escola Privada"; $oExportacaoCenso->logErro($sErroMsg, ExportacaoCensoBase::LOG_ESCOLA); } if ($oDadosEscola->registro00->conveniada_poder_publico == '') { $sMensagem = "Deve ser selecionada uma opção no campo Conveniada Com o Poder Público"; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ( $oDadosEscola->registro00->mant_esc_privada_empresa_grupo_empresarial_pes_fis == 0 && $oDadosEscola->registro00->mant_esc_privada_sidicatos_associacoes_cooperativa == 0 && $oDadosEscola->registro00->mant_esc_privada_ong_internacional_nacional_oscip == 0 && $oDadosEscola->registro00->mant_esc_privada_instituicoes_sem_fins_lucrativos == 0 && $oDadosEscola->registro00->sistema_s_sesi_senai_sesc_outros == 0 ) { $sMensagem = "Deve ser selecionado pelo menos um campo de Mantenedora da Escola Privada"; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ($oDadosEscola->registro00->cnpj_mantenedora_principal_escola_privada == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("O CNPJ da mantenedora principal da escola deve ser informado", ExportacaoCensoBase::LOG_ESCOLA); } if( $oDadosEscola->registro00->cnpj_mantenedora_principal_escola_privada != '' && !DBNumber::isInteger( $oDadosEscola->registro00->cnpj_mantenedora_principal_escola_privada ) ) { $sMensagem = "O CNPJ da mantenedora principal deve conter somente números."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ($oDadosEscola->registro00->cnpj_escola_privada == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("O CNPJ da escola deve ser informado quando escola for privada.", ExportacaoCensoBase::LOG_ESCOLA); } } if( $oDadosEscola->registro00->regulamentacao_autorizacao_conselho_orgao == '' ) { $sMensagem = "Deve ser informada uma opção referente ao Credenciamento da escola."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } $lDadosInfraEstrutura = DadosCensoEscola::validarDadosInfraEstrutura($oExportacaoCenso); if (!$lDadosInfraEstrutura) { $lTodosDadosValidos = $lDadosInfraEstrutura; } return $lTodosDadosValidos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validarArquivo(){\n\n if (empty($this->aRegistrosRetencao)) {\n throw new Exception( _M( self::MENSAGENS . 'erro_validar_arquivo') );\n }\n\n /**\n * Verificamos os registros e caso ocorra inconsistencia populamos o array de Registros inconsistentes\n */\n foreach ($this->aRegistrosRetencao as $oRegistroRetencao) {\n\n /**\n * Validamos se existe CGM cadastrado para o cnpj TOMADOR\n */\n if (CgmFactory::getInstanceByCnpjCpf($oRegistroRetencao->q91_cnpjtomador) == false) {\n\n $this->aRegistrosInconsistentes[] = array( \"sequencial_registro\" => $oRegistroRetencao->q91_sequencialregistro,\n \"registro\" => $oRegistroRetencao->q91_cnpjtomador,\n \"erro\" => self::TOMADOR_SEM_CGM );\n }\n }\n }", "public function validar(){\n $respuesta = array();\n //verifica que el archivo no tenga ningun error\n if ($this->file[\"error\"] > 0) {\n $respuesta[\"mensaje\"] = \"El archivo contiene errores o es corrupto.\";\n $respuesta[\"resultado\"] = false;\n } else {\n //obtengo la informacion del archivo\n $info = new SplFileInfo($this->file[\"name\"]);\n //obtengo la extension del mismo\n $extencion = $info->getExtension();\n //verifico si esta dentro de los permitods\n if(in_array($extencion, $this->permitidos)) {\n //verifico si el tamanio del archivo es menor o igual al permitido\n if ($this->file[\"size\"] <= $this->maximo_kb) {\n //verifico que las dimensiones de la imagen sean las permitidas\n list($width, $height, $type) = getimagesize($this->file[\"tmp_name\"]);\n if($width == $this->height_perm && $height == $this->width_perm){\n $respuesta[\"resultado\"] = true;\n }else{\n $respuesta[\"mensaje\"] = \"Dimensiones de la imagen no permitidas, deben de ser de $this->height_perm por $this->width_perm.\";\n $respuesta[\"resultado\"] = false;\n }\n } else {\n $respuesta[\"mensaje\"] = \"El archivo sobrepasa el limite de tamaño, deben de ser $this->maximo_kb kb como máximo.\";\n $respuesta[\"resultado\"] = false;\n }\n } else {\n $respuesta[\"mensaje\"] = \"Extensión del archivo no permitida.\";\n $respuesta[\"resultado\"] = false;\n }\n }\n return $respuesta;\n }", "public function validarProcessamento() {\n\n $sWhere = \"q145_issarquivoretencao = {$this->oIssArquivoRetencao->getSequencial()}\";\n $oDaoIssArquivoRetencaoDisArq = new cl_issarquivoretencaodisarq;\n $sSqlIssArquivoRetencaoDisArq = $oDaoIssArquivoRetencaoDisArq->sql_query_file(null, \"*\", null, $sWhere);\n $rsIssArquivoRetencaoDisArq = $oDaoIssArquivoRetencaoDisArq->sql_record($sSqlIssArquivoRetencaoDisArq);\n\n if ($oDaoIssArquivoRetencaoDisArq->numrows > 0) {\n throw new BusinessException( _M( self::MENSAGENS . \"erro_arquivo_processado\") );\n }\n }", "abstract protected function validateFile() : object;", "function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}", "public function validaDatos(){\n\t\t\t\t\n\t\t\t\tif( $this->nombre == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su nombre por favor.</strong><br />\";\n\t\t\t\t\t}else if( strlen($this->nombre) > 20 ){\n\t\t\t\t\t\t$errores.= \"<strong>* Escriba un nombre con menos caracteres. (20 caracteres maximo - sin espacios)</strong><br />\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif( $this->email == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su email por favor.</strong><br />\";\n\t\t\t\t\t}else if( !preg_match($this->sintax,$this->email)){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese formato correcto de email</strong><br /> 'ej: nombre@dominio.com' .<br />\";\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $this->asunto == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su asunto por favor. </strong><br />\";\n\t\t\t\t\t}else if( strlen($this->asunto) > 20 ){\n\t\t\t\t\t\t$errores.= \"<strong>* Escriba un asunto con menos caracteres. (20 caracteres maximo - sin espacios) </strong><br />\";\n\t\t\t\t\t}\n\t\t\t\t\t\t\t \n\t\t\t\tif( $this->msj == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su mensaje por favor. </strong><br />\";\n\t\t\t\t\t}else if( strlen($this->msj) > 200 ){\n\t\t\t\t\t$this->errores.= \"<strong>* Maximo permitido 200 caracteres. </strong><br />\";\n\t\t\t\t\t}\n\t\t\t}", "function evt__validar_datos()\r\n\t{}", "function validaCamposArchivo($Archivo)\n{\n\t$ValRegreso=FALLA;\n\tif (!copy($Archivo, $Archivo.\".bak\")) {\n \techo \"Error al copiar $Archivo <br>\";\n\t\t$ValRegreso=FALLA;\n\t}\n\telse{\n\t\t$GestorArchivo = fopen($Archivo.\".bak\", \"r\");\n\t\tif ($GestorArchivo){\n\t\t while (($Registro = fgets($GestorArchivo, 4096)) !== false) \n\t\t {\n\t\t \t// 83 echo \" validaCamposArchivo >\" .substr_count($Registro, '|') .\"< <br>\";\n\t\t \tif( substr_count($Registro, '|') > 70)\n\t\t \t\t$ValRegreso=DATA_NOMINA;\n\t\t \telseif(substr_count($Registro, '|') < 70)\n\t\t \t\t$ValRegreso=DATA_NOMINA_TRAILER;\n\t\t \telse\n\t\t \t\t$ValRegreso=FALLA;\n\t \t\tbreak;\n\t\t }// fin del while\t\n\t\t fclose($GestorArchivo);\n\t\t } \n\t\t else\n\t\t \treturn FALLA;\n\t}// fin copy\n\treturn $ValRegreso;\n}", "public function validarDatos()\n\t\t{\n\t\t\treturn true;\n\t\t}", "public function validarDatos()\n\t\t{\n\t\t\treturn true;\n\t\t}", "function validate_expense_file() {\n return validate_post_file($this->input->post(\"file_name\"));\n }", "private function validate() {\n\t\tif( empty($this->header) )\n\t\t\tthrow new Exception('ACH file header record is required.');\n\n\t\tif( empty($this->batches) )\n\t\t\tthrow new Exception('ACH file requires at least 1 batch record.');\n\n\t\tif( empty($this->control))\n\t\t\tthrow new Exception('ACH file control record is required.');\t\t\t\n\t}", "protected function validarDadosInfraEstrutura(IExportacaoCenso $oExportacaoCenso) {\n\n $lTodosDadosValidos = true;\n $oDadosEscola = $oExportacaoCenso->getDadosProcessadosEscola();\n $aDadosTurma = $oExportacaoCenso->getDadosProcessadosTurma();\n\n $aEquipamentosValidacao = array(\n 0 => \"equipamentos_existentes_escola_televisao\",\n 1 => \"equipamentos_existentes_escola_videocassete\",\n 2 => \"equipamentos_existentes_escola_dvd\",\n 3 => \"equipamentos_existentes_escola_antena_parabolica\",\n 4 => \"equipamentos_existentes_escola_copiadora\",\n 5 => \"equipamentos_existentes_escola_retroprojetor\",\n 6 => \"equipamentos_existentes_escola_impressora\",\n 7 => \"equipamentos_existentes_escola_aparelho_som\",\n 8 => \"equipamentos_existentes_escola_projetor_datashow\",\n 9 => \"equipamentos_existentes_escola_fax\",\n 10 => \"equipamentos_existentes_escola_maquina_fotografica\"\n );\n\n $aEstruturaValidacao = array(\n 3000032 => \"equipamentos_existentes_escola_computador\",\n 3000003 => \"quantidade_computadores_uso_administrativo\",\n 3000024 => \"quantidade_computadores_uso_alunos\",\n 3000019 => \"numero_salas_aula_existentes_escola\",\n 3000020 => \"numero_salas_usadas_como_salas_aula\"\n );\n\n $aDependenciasEscola = array(\n \"dependencias_existentes_escola_sala_professores\",\n \"dependencias_existentes_escola_bercario\",\n \"dependencias_existentes_escola_despensa\",\n \"dependencias_existentes_escola_area_verde\",\n \"dependencias_existentes_escola_almoxarifado\",\n \"dependencias_existentes_escola_auditorio\",\n \"dependencias_existentes_escola_banheiro_alunos_def\",\n \"dependencias_existentes_escola_banheiro_chuveiro\",\n \"dependencias_existentes_escola_sala_leitura\",\n \"dependencias_existentes_escola_sala_recursos_multi\",\n \"dependencias_existentes_escola_banheiro_educ_infan\",\n \"dependencias_existentes_escola_cozinha\",\n \"dependencias_existentes_escola_alojamento_professo\",\n \"dependencias_existentes_escola_laboratorio_ciencia\",\n \"dependencias_existentes_escola_patio_coberto\",\n \"dependencias_existentes_escola_alojamento_aluno\",\n \"dependencias_existentes_escola_laboratorio_informa\",\n \"dependencias_existentes_escola_refeitorio\",\n \"dependencias_existentes_escola_parque_infantil\",\n \"dependencias_existentes_escola_banheiro_fora_predi\",\n \"dependencias_existentes_escola_quadra_esporte_desc\",\n \"dependencias_existentes_escola_sala_secretaria\",\n \"dependencias_existentes_escola_dep_vias_alunos_def\",\n \"dependencias_existentes_escola_banheiro_dentro_pre\",\n \"dependencias_existentes_escola_lavanderia\",\n \"dependencias_existentes_escola_quadra_esporte_cobe\",\n \"dependencias_existentes_escola_biblioteca\",\n \"dependencias_existentes_escola_sala_diretoria\",\n \"dependencias_existentes_escola_patio_descoberto\",\n \"dependencias_existentes_escola_nenhuma_relacionada\"\n );\n\n $aModalidadesEtapas = array(\n \"modalidade_ensino_regular\",\n \"modalidade_educacao_especial_modalidade_substutiva\",\n \"modalidade_educacao_jovens_adultos\",\n \"etapas_ensino_regular_creche\",\n \"etapas_ensino_regular_pre_escola\",\n \"etapas_ensino_regular_ensino_fundamental_8_anos\",\n \"etapas_ensino_regular_ensino_fundamental_9_anos\",\n \"etapas_ensino_regular_ensino_medio_medio\",\n \"etapas_ensino_regular_ensino_medio_integrado\",\n \"etapas_ensino_regular_ensino_medio_normal_magister\",\n \"etapas_ensino_regular_ensino_medio_profissional\",\n \"etapa_educacao_especial_creche\",\n \"etapa_educacao_especial_pre_escola\",\n \"etapa_educacao_especial_ensino_fundamental_8_anos\",\n \"etapa_educacao_especial_ensino_fundamental_9_anos\",\n \"etapa_educacao_especial_ensino_medio_medio\",\n \"etapa_educacao_especial_ensino_medio_integrado\",\n \"etapa_educacao_especial_ensino_medio_normal_magist\",\n \"etapa_educacao_especial_ensino_medio_educ_profis\",\n \"etapa_educacao_especial_eja_ensino_fundamental\",\n \"etapa_educacao_especial_eja_ensino_medio\",\n \"etapa_eja_ensino_fundamental\",\n \"etapa_eja_ensino_fundamental_projovem_urbano\",\n \"etapa_eja_ensino_medio\"\n );\n\n foreach ($aEquipamentosValidacao as $sEquipamentoValidacao) {\n\n if (!DadosCensoEscola::validarEquipamentosExistentes($oExportacaoCenso, $oDadosEscola->registro10->$sEquipamentoValidacao)) {\n $lTodosDadosValidos = false;\n }\n break;\n }\n\n $iComputadorExistentes = 0;\n foreach ($aEstruturaValidacao as $iSequencial => $sEstruturaValidacao) {\n\n if( $iSequencial == 3000032 ) {\n\n if( !empty( $oDadosEscola->registro10->$sEstruturaValidacao ) ) {\n $iComputadorExistentes = $oDadosEscola->registro10->$sEstruturaValidacao;\n }\n }\n\n if( $iSequencial == 3000003\n && $oDadosEscola->registro10->$sEstruturaValidacao != ''\n && ( $iComputadorExistentes == 0 || $iComputadorExistentes < $oDadosEscola->registro10->$sEstruturaValidacao )\n ) {\n\n $lTodosDadosValidos = false;\n $sMensagem = \"Quantidade de computadores informados para uso administrativo\";\n $sMensagem .= \" ({$oDadosEscola->registro10->$sEstruturaValidacao}), é maior que a quantidade de\";\n $sMensagem .= \" computadores existentes na escola ({$iComputadorExistentes}).\";\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $iSequencial == 3000024\n && $oDadosEscola->registro10->$sEstruturaValidacao != ''\n && ( $iComputadorExistentes == 0 || $iComputadorExistentes < $oDadosEscola->registro10->$sEstruturaValidacao )\n ) {\n\n $lTodosDadosValidos = false;\n $sMensagem = \"Quantidade de computadores informados para uso dos alunos\";\n $sMensagem .= \" ({$oDadosEscola->registro10->$sEstruturaValidacao}), é maior que a quantidade de\";\n $sMensagem .= \" computadores existentes na escola ({$iComputadorExistentes}).\";\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if (!DadosCensoEscola::validarEquipamentosGeral($oExportacaoCenso, $iSequencial, $oDadosEscola->registro10->$sEstruturaValidacao)) {\n $lTodosDadosValidos = false;\n }\n }\n\n if( $iComputadorExistentes > 0 ) {\n\n if( $oDadosEscola->registro10->acesso_internet === '' ) {\n\n $sMensagem = \"Deve ser informado se a escola possui acesso a internet ou não, pois foi informada a\";\n $sMensagem .= \" quantidade de computadores que a mesma possui.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $oDadosEscola->registro10->acesso_internet == 1 && $oDadosEscola->registro10->banda_larga == '' ) {\n\n $sMensagem = \"Deve ser informado se a escola possui banda larga, pois foi informado que a mesma\";\n $sMensagem .= \" possui acesso a internet.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n if ($oDadosEscola->registro10->numero_cpf_responsavel_gestor_responsavel == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Número do CPF do gestor é obrigatório\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if (trim($oDadosEscola->registro10->numero_cpf_responsavel_gestor_responsavel) == \"00000000191\") {\n\n $lTodosDadosValidos = false;\n $sMensagem = \"Número do CPF ({$oDadosEscola->registro10->numero_cpf_responsavel_gestor_responsavel}) do\";\n $sMensagem .= \" gestor informado é inválido.\";\n $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro10->nome_gestor == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Nome do gestor é obrigatório\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n $sExpressao = '/([a-zA-Z])\\1{3}/';\n $lValidacaoExpressao = preg_match($sExpressao, $oDadosEscola->registro10->nome_gestor) ? true : false;\n\n if ($lValidacaoExpressao) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Nome do gestor inválido. Não é possível informar mais de 4 letras repetidas em sequência.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro10->cargo_gestor_responsavel == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Cargo do gestor é obrigatório\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n /**\n * Validações que serão executadas caso a situação de funcionamento seja igual a 1\n * 1 - em atividade\n */\n if ($oDadosEscola->registro00->situacao_funcionamento == 1) {\n\n if ($oDadosEscola->registro10->local_funcionamento_escola_predio_escolar == 0 &&\n $oDadosEscola->registro10->local_funcionamento_escola_templo_igreja == 0 &&\n $oDadosEscola->registro10->local_funcionamento_escola_salas_empresas == 0 &&\n $oDadosEscola->registro10->local_funcionamento_escola_casa_professor == 0 &&\n $oDadosEscola->registro10->local_funcionamento_escola_salas_outras_escolas == 0 &&\n $oDadosEscola->registro10->local_funcionamento_escola_galpao_rancho_paiol_bar == 0 &&\n $oDadosEscola->registro10->local_funcionamento_escola_un_internacao_prisional == 0 &&\n $oDadosEscola->registro10->local_funcionamento_escola_outros == 0) {\n\n $sMensagem = \"Deve ser selecionado pelo menos um local de funcionamento da escola.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n /**\n * Validações que serão executadas caso a situação de funcionamento seja igual a 1\n * 1 - em atividade\n * e o local de funcionamento seja igual a 7\n * 7 - Prédio escolar\n */\n if ($oDadosEscola->registro10->local_funcionamento_escola_predio_escolar == 1) {\n\n if ( empty( $oDadosEscola->registro10->forma_ocupacao_predio ) ) {\n\n $sMensagem = \"Escola Ativa. Deve ser selecionada uma forma de ocupação do prédio.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ($oDadosEscola->registro10->predio_compartilhado_outra_escola == '') {\n\n $sMensagem = \"Escola Ativa. Deve ser informado se o prédio é compartilhado ou não com outra escola.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $oDadosEscola->registro10->predio_compartilhado_outra_escola == 1 ) {\n\n $iTotalCodigoVazio = 0;\n $lErroCodigoVazio = false;\n $lErroCodigoInvalido = false;\n\n for( $iContador = 1; $iContador <= 6; $iContador++ ) {\n\n $sCodigoEscolaCompartilhada = \"codigo_escola_compartilha_\" . $iContador;\n if( trim( $oDadosEscola->registro10->{$sCodigoEscolaCompartilhada} ) == '' ) {\n $iTotalCodigoVazio++;\n }\n\n if( trim( $oDadosEscola->registro10->{$sCodigoEscolaCompartilhada} ) != ''\n && strlen( trim( $oDadosEscola->registro10->{$sCodigoEscolaCompartilhada} ) ) != 8 ) {\n $lErroCodigoInvalido = true;\n }\n }\n\n if( $iTotalCodigoVazio == 6 ) {\n $lErroCodigoVazio = true;\n }\n\n if( $lErroCodigoVazio ) {\n\n $sMensagem = \"Escola com prédio compartilhado. É necessário informar ao menos o código INEP de uma\";\n $sMensagem .= \" escola que compartilhe o prédio.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $lErroCodigoInvalido ) {\n\n $sMensagem = \"Código INEP de uma das escolas que compartilham o prédio, com tamanho inválido.\";\n $sMensagem .= \" Tamanho válido: 8 dígitos.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n }\n\n if ($oDadosEscola->registro10->agua_consumida_alunos == '') {\n\n $sMensagem = \"Deve ser selecionada um tipo de água consumida pelos alunos.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ($oDadosEscola->registro10->destinacao_lixo_coleta_periodica == 0 &&\n $oDadosEscola->registro10->destinacao_lixo_queima == 0 &&\n $oDadosEscola->registro10->destinacao_lixo_joga_outra_area == 0 &&\n $oDadosEscola->registro10->destinacao_lixo_recicla == 0 &&\n $oDadosEscola->registro10->destinacao_lixo_enterra == 0 &&\n $oDadosEscola->registro10->destinacao_lixo_outros == 0) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Destinação do lixo da escola não informado.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n $lNumeroSalasExistentesValido = true;\n if( !DBNumber::isInteger( trim( $oDadosEscola->registro10->numero_salas_aula_existentes_escola ) ) ) {\n\n $lNumeroSalasExistentesValido = false;\n $sMensagem = \"Valor do 'N° de Salas de Aula Existentes na Escola' inválido. Deve ser\";\n $sMensagem .= \" informado somente números.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ( $lNumeroSalasExistentesValido\n && trim( $oDadosEscola->registro10->numero_salas_aula_existentes_escola == 0 )\n ) {\n\n $sMensagem = \"O valor do campo 'N° de Salas de Aula Existentes na Escola' deve ser maior que 0.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n $lNumeroSalasUsadasValido = true;\n if( !DBNumber::isInteger( trim( $oDadosEscola->registro10->numero_salas_usadas_como_salas_aula ) ) ) {\n\n $lNumeroSalasUsadasValido = false;\n $sMensagem = \"Valor do 'N° de Salas Utilizadas como Sala de Aula' inválido. Deve ser\";\n $sMensagem .= \" informado somente números.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ( $lNumeroSalasUsadasValido && trim( $oDadosEscola->registro10->numero_salas_usadas_como_salas_aula == 0 ) ) {\n\n $sMensagem = \"O valor do campo 'N° de Salas Utilizadas como Sala de Aula' deve ser maior de 0.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ($oDadosEscola->registro10->escola_cede_espaco_turma_brasil_alfabetizado == '') {\n\n $sMensagem = \"Informe se a escola cede espaço para turmas do Brasil Alfabetizado.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ($oDadosEscola->registro10->escola_abre_finais_semanas_comunidade == '') {\n\n $sMensagem = \"Informe se a escola abre aos finais de semana para a comunidade.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ($oDadosEscola->registro10->escola_formacao_alternancia == '') {\n\n $sMensagem = \"Informe se a escola possui proposta pedagógica de formação por alternância.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ( $oDadosEscola->registro00->dependencia_administrativa != 3\n && trim( $oDadosEscola->registro10->alimentacao_escolar_aluno ) != 1\n ) {\n\n $lTodosDadosValidos = false;\n $sMensagem = \"Campo Alimentação na aba Infra estrutura do cadastro dados da escola deve ser \";\n $sMensagem .= \"informado como Oferece, pois dependência administrativa é Municipal.\";\n $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if( $oDadosEscola->registro10->abastecimento_agua_inexistente == 1 ) {\n\n if( $oDadosEscola->registro10->abastecimento_agua_fonte_rio_igarape_riacho_correg == 1\n || $oDadosEscola->registro10->abastecimento_agua_poco_artesiano == 1\n || $oDadosEscola->registro10->abastecimento_agua_cacimba_cisterna_poco == 1\n || $oDadosEscola->registro10->abastecimento_agua_rede_publica == 1\n ) {\n\n $lTodosDadosValidos = false;\n $sMensagem = \"Informação de abastecimento de água inválida. Ao selecionar a opção 'Inexistente'\";\n $sMensagem .= \", nenhum dos tipos de abastecimento deve ser selecionado.\";\n $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA);\n }\n }\n\n if( $oDadosEscola->registro10->abastecimento_energia_eletrica_inexistente == 1 ) {\n\n if( $oDadosEscola->registro10->abastecimento_energia_eletrica_gerador == 1\n || $oDadosEscola->registro10->abastecimento_energia_eletrica_outros_alternativa == 1\n || $oDadosEscola->registro10->abastecimento_energia_eletrica_rede_publica == 1\n ) {\n\n $lTodosDadosValidos = false;\n $sMensagem = \"Informação de abastecimento de energia inválida. Ao selecionar a opção 'Inexistente'\";\n $sMensagem .= \", nenhum dos tipos de abastecimento deve ser selecionado.\";\n $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA);\n }\n }\n\n if( $oDadosEscola->registro10->esgoto_sanitario_inexistente == 1 ) {\n\n if( $oDadosEscola->registro10->esgoto_sanitario_rede_publica == 1\n || $oDadosEscola->registro10->esgoto_sanitario_fossa == 1\n ) {\n\n $lTodosDadosValidos = false;\n $sMensagem = \"Informação de esgoto sanitário inválida. Ao selecionar a opção 'Inexistente'\";\n $sMensagem .= \", nenhum dos tipos de abastecimento deve ser selecionado.\";\n $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA);\n }\n }\n\n if( $oDadosEscola->registro10->dependencias_existentes_escola_nenhuma_relacionada == 1 ) {\n\n $lSelecionouDependencia = false;\n foreach( $aDependenciasEscola as $sDependencia ) {\n\n if( $oDadosEscola->registro10->{$sDependencia} != \"dependencias_existentes_escola_nenhuma_relacionada\"\n && $oDadosEscola->registro10->{$sDependencia} == 1\n ) {\n\n $lSelecionouDependencia = true;\n break;\n }\n }\n\n if( $lSelecionouDependencia ) {\n\n $sMensagem = \"Informação das dependências da escola inválida. Ao selecionar 'Nenhuma das dependências\";\n $sMensagem .= \" relacionadas', nenhuma das outras dependências pode ser selecionada.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n\n /**\n * Variáveis para controlar o total de turmas existentes\n * 0 - Normal\n * 4 - AEE\n * 5 - AC\n */\n $iTotalTurmaNormal = 0;\n $iTotalTurmaAC = 0;\n $iTotalTurmaAEE = 0;\n\n foreach( $aDadosTurma as $oDadosTurma ) {\n\n switch( $oDadosTurma->tipo_atendimento ) {\n\n case 0:\n\n $iTotalTurmaNormal++;\n break;\n\n case 4:\n\n $iTotalTurmaAC++;\n break;\n\n case 5:\n\n $iTotalTurmaAEE++;\n break;\n }\n }\n\n /**\n * Validações referentes as opções selecionadas em relação a Atividade Complementar( AC ) e Atendimento\n * Educacional Especializado( AEE )\n * - atendimento_educacional_especializado\n * - atividade_complementar\n */\n if( $oDadosEscola->registro10->atendimento_educacional_especializado == ''\n || $oDadosEscola->registro10->atividade_complementar == ''\n ) {\n\n $sMensagem = \"É necessário marcar uma das opções referentes a Atendimento Educacional Especializado\";\n $sMensagem .= \" e Atividade Complementar( Cadastros -> Dados da Escola -> Aba Infra Estrutura ).\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $oDadosEscola->registro10->atendimento_educacional_especializado == 2 ) {\n\n if( $oDadosEscola->registro10->atividade_complementar == 2 ) {\n\n $sMensagem = \"Atendimento Educacional Especializado e Atividade Complementar foram marcados como\";\n $sMensagem .= \" 'Exclusivamente'. Ao marcar uma das opções como 'Exclusivamente', a outra deve\";\n $sMensagem .= \" ser marcada como 'Não Oferece'.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $iTotalTurmaNormal > 0 ) {\n\n $sMensagem = \"Atendimento Educacional Especializado marcado como 'Exclusivamente'. Ao marcar esta\";\n $sMensagem .= \" opção, a escola não deve turmas de Ensino Regular, EJA e/ou Educação Especial, ou\";\n $sMensagem .= \" deve ser alterada a opção marcada.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $iTotalTurmaAEE == 0 ) {\n\n $sMensagem = \"Ao selecionar Atendimento Educacional Especializado como 'Exclusivamente', deve\";\n $sMensagem .= \" existir na escola uma turma deste tipo criada e com aluno matriculado.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n if( $oDadosEscola->registro10->atividade_complementar == 2 ) {\n\n if( $iTotalTurmaNormal > 0 ) {\n\n $sMensagem = \"Atividade Complementar marcada como 'Exclusivamente'. Ao marcar esta opção, a escola\";\n $sMensagem .= \" não deve turmas de Ensino Regular, EJA e/ou Educação Especial, ou deve ser alterada\";\n $sMensagem .= \" a opção marcada.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $iTotalTurmaAC == 0 ) {\n\n $sMensagem = \"Ao selecionar Atividade Complementar como 'Exclusivamente', deve existir na escola\";\n $sMensagem .= \" uma turma deste tipo criada e com aluno matriculado.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n if( ( $oDadosEscola->registro10->atendimento_educacional_especializado == 1\n && $oDadosEscola->registro10->atividade_complementar == 2 )\n || ( $oDadosEscola->registro10->atividade_complementar == 1\n && $oDadosEscola->registro10->atendimento_educacional_especializado == 2 )\n ) {\n\n $sMensagem = \"Ao selecionar, ou Atendimento Educacional Especializado ou Atividade Complementar, como\";\n $sMensagem .= \" 'Não Exclusivamente', obrigatoriamente a outra opção não poderá ser marcada como\";\n $sMensagem .= \" 'Exclusivamente'.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $oDadosEscola->registro10->atendimento_educacional_especializado == 1 && $iTotalTurmaAEE == 0 ) {\n\n $sMensagem = \"Ao selecionar Atendimento Educacional Especializado como 'Não Exclusivamente', deve\";\n $sMensagem .= \" existir na escola uma turma deste tipo criada e com aluno matriculado.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $oDadosEscola->registro10->atividade_complementar == 1 && $iTotalTurmaAC == 0 ) {\n\n $sMensagem = \"Ao selecionar Atividade Complementar como 'Não Exclusivamente', deve\";\n $sMensagem .= \" existir na escola uma turma deste tipo criada e com aluno matriculado.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $oDadosEscola->registro10->atendimento_educacional_especializado == 0 && $iTotalTurmaAEE > 0 ) {\n\n $sMensagem = \"Atendimento Educacional Especializado marcado como 'Não Oferece', porém a escola possui\";\n $sMensagem .= \" turmas cadastradas para este tipo de atendimento.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $oDadosEscola->registro10->atividade_complementar == 0 && $iTotalTurmaAC > 0 ) {\n\n $sMensagem = \"Atividade Complementa marcado como 'Não Oferece', porém a escola possui turmas\";\n $sMensagem .= \" cadastradas para este tipo de atendimento.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n return $lTodosDadosValidos;\n }", "public function rules() {\r\n return array(\r\n array('csv_file,tipo_entidad', 'required'),\r\n array('csv_file', 'file', 'types' => 'csv'),\r\n );\r\n }", "public function validateDataInvoice(): void\n {\n $this->validarDatos($this->datos, $this->getRules('fe'));\n\n $this->validarDatosArray($this->datos->arrayOtrosTributos, 'tributos');\n\n /** @phpstan-ignore-next-line */\n if (property_exists($this->datos, 'arraySubtotalesIVA')) {\n $this->validarDatosArray((array) $this->datos->arraySubtotalesIVA, 'iva');\n }\n\n $this->validarDatosArray($this->datos->comprobantesAsociados, 'comprobantesAsociados');\n\n if ($this->ws === 'wsfe') {\n if (property_exists($this->datos, 'arrayOpcionales')) {\n $this->validarDatosArray((array) $this->datos->arrayOpcionales, 'opcionales');\n }\n } elseif ($this->ws === 'wsmtxca') {\n $this->validarDatosArray($this->datos->items, 'items');\n }\n }", "public function validate() {\n\t\t\n\t\tif(!is_dir($this->path)) {\n\t\t\tthrow new Exception('The path provided does not exist', '400');\n\t\t}\n\t\t\n\t\tif(!is_writeable($this->path)) {\n\t\t\tthrow new Exception('The path provided is not writeable', '400');\n\t\t}\n\t\t\n\t\tif(file_exists($this->path . $this->filename)) {\n\t\t\t\n\t\t\tif($this->allow_overwrite === false && $this->rename_if_exists === false) {\n\t\t\t\tthrow new Exception('The file ' . $this->filename . ' already exists', '400');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif($this->checkExtension() === false) {\n\t\t\tthrow new Exception('The file has an invalid extension', '400');\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}", "public static function validarDados( IExportacaoCenso $oExportacaoCenso ) {\n\n $lDadosValidos = true;\n $oExportacaoCenso = $oExportacaoCenso;\n $aDadosDocente = $oExportacaoCenso->getDadosProcessadosDocente();\n\n DadosCensoDocente2015::getGrauCurso();\n\n foreach( $aDadosDocente as $oDadosCensoDocente ) {\n\n $sDadosDocente = $oDadosCensoDocente->registro30->numcgm . \" - \" . $oDadosCensoDocente->registro30->nome_completo;\n $sDadosDocente .= \" - Data de Nascimento: \" . $oDadosCensoDocente->registro30->data_nascimento;\n\n $oRegistro30 = $oDadosCensoDocente->registro30;\n $oRegistro40 = $oDadosCensoDocente->registro40;\n $oRegistro50 = $oDadosCensoDocente->registro50;\n $aRegistro51 = $oDadosCensoDocente->registro51;\n\n if( !DadosCensoDocente2015::validacoesRegistro30( $sDadosDocente, $oExportacaoCenso, $oRegistro30, $oRegistro40 ) ) {\n $lDadosValidos = false;\n }\n\n if( !DadosCensoDocente2015::validacoesRegistro40( $sDadosDocente, $oExportacaoCenso, $oRegistro30, $oRegistro40 ) ) {\n $lDadosValidos = false;\n }\n\n if( !DadosCensoDocente2015::validacoesRegistro50( $sDadosDocente, $oExportacaoCenso, $oRegistro50, $oRegistro30 ) ) {\n $lDadosValidos = false;\n }\n\n if( !DadosCensoDocente2015::validacoesRegistro51( $sDadosDocente, $oExportacaoCenso, $oRegistro30, $aRegistro51 ) ) {\n $lDadosValidos = false;\n }\n }\n\n return $lDadosValidos;\n }", "public function testarCarregamentoArquivo() {\n\n\n $this->oLog->escreverLog(\"#######################################\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"Testando Registro importados do Arquivo\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"#######################################\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"\", DBLog::LOG_INFO);\n\n $oHeader = $this->oCabecalhoArquivo;\n\n $lAnoVazio = empty($oHeader->iAnoArquivo);\n $lMesVazio = empty($oHeader->iMesArquivo);\n $lDiaVazio = empty($oHeader->iDiaArquivo);\n $lNomeValido = empty($oHeader->sNomeArquivo);\n\n\n if ( $lAnoVazio || $lMesVazio || $lDiaVazio || $lNomeValido ) {\n\n $sErro = \"CABECALHO DO ARQUIVO INCONSISTENTE\";\n $this->oLog->escreverLog($sErro, DBLog::LOG_ERROR);\n\n if ( $lAnoVazio ) {\n $this->oLog->escreverLog(\" ANO VAZIO\", DBLog::LOG_ERROR);\n }\n if ( $lMesVazio ) {\n $this->oLog->escreverLog(\" MES VAZIO\", DBLog::LOG_ERROR);\n }\n if ( $lDiaVazio ) {\n $this->oLog->escreverLog(\" DIA VAZIO\", DBLog::LOG_ERROR);\n }\n if ( $lNomeValido ) {\n $this->oLog->escreverLog(\" NOME DO LOTE VAZIO OU DIFERENTE DO NOME DO ARQUIVO\", DBLog::LOG_ERROR);\n }\n return false;\n }\n\n $this->oLog->escreverLog(\"CABECALHO DO ARQUIVO SEM PROBLEMAS\", DBLog::LOG_INFO);\n\n\n /**\n * Testando Registros\n */\n $iTotalRegistros = $this->iRegistrosArquivo;\n\n if ( $this->oRodapeArquivo->iQuantidadeRegistros <> $iTotalRegistros ) {\n\n $this->oLog->escreverLog(\"Quantidade de Registros do Arquivo: {$iTotalRegistros}, Diferente da Quantidade Informada: {$this->oRodapeArquivo->iQuantidadeRegistros}\", DBLog::LOG_ERROR);\n return false;\n }\n \n \n $this->oLog->escreverLog(\"\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"Total de Registros: {$iTotalRegistros}\", DBLog::LOG_INFO);\n\n /**\n * Percorrendo registros e os validando\n */\n foreach ( $this->aRegistrosArquivo as $iCodigoRegistro => $oRegistro ) {\n\n $iLinha = $iCodigoRegistro + 2;//Linha + Linha Cabecalho + Array que começa em 0(zero)\n $sSequencial = trim( $oRegistro->sSequencial );\n $sCodigoLogradouro = trim( $oRegistro->iCodigoLogradouro );\n $sNomeLogradouro = trim( $oRegistro->sNomeLogradouro );\n\n $lSequencialVazio = empty( $sSequencial ); \n $lCodigoLogradouroVazio = empty( $sCodigoLogradouro );\n $lNomeLogradouroVazio = empty( $sNomeLogradouro );\n\n if ( $lSequencialVazio || $lCodigoLogradouroVazio || $lNomeLogradouroVazio ) {\n\n $this->oLog->escreverLog(\"[{$oHeader->sNomeArquivo}:$iLinha] - Removendo registro inconsistente da Fila de Processamento\", DBLog::LOG_NOTICE);\n if ( $lSequencialVazio ) {\n $this->oLog->escreverLog(\" Sequencial do Registro Vazio\", DBLog::LOG_NOTICE);\n }\n\n if ( $lCodigoLogradouroVazio ) {\n $this->oLog->escreverLog(\" Codigo do Logradouro Vazio \", DBLog::LOG_NOTICE);\n }\n\n if ( $lNomeLogradouroVazio ) {\n $this->oLog->escreverLog(\" Nome do Logradouro Vazio\", DBLog::LOG_NOTICE);\n }\n\n unset( $this->aRegistrosArquivo[$iCodigoRegistro] );\n continue;\n }\n\n\n /**\n * Definindo o Tipo de Logradouro atraves da Sigla\n */\n $oRegistro->iTipoLogradouro = $this->getTipoLogradouro($oRegistro->iTipoLogradouro);\n }\n $this->oLog->escreverLog(\"#######################################\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\" Teste Finalizado com Sucesso. \", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"#######################################\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"\", DBLog::LOG_INFO);\n return true;\n }", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "function fncValidaArchivo($IdEstado, $Path,$Archivo)\n{\n\t$TotalRegErr = CERO;\n \t$ContadorRegistros=UNO;\n \t\n \t$ContadorErrorDI = InicializaArray(80);\n\n \t$GestorArchivoErr = fopen($Path.$Archivo.\".err\", \"w\");\n \tif (!$GestorArchivoErr) \n\t{\n\t\techo \"Error al abrir archivo Error >>\".$Path.$Archivo.\".err\" .\"<<\";\n\t}\n\telse{\n\t\t$GestorArchivo = fopen($Path.$Archivo, \"r\");\n\t\tif ($GestorArchivo) \n\t\t{\n\t\t while (($Registro = fgets($GestorArchivo, 4096)) !== false) \n\t\t {\n\t\t \t$BanderaRegistr=0;\n\t\t // echo \"Resgistro >>\" . $Registro .\"<<\";\n\t\t $ArrRegistro = explode(\"|\",$Registro);\n\t\t $NumEmpl= $ArrRegistro[0];\n\t\t $NumFili= $ArrRegistro[1];\n\t\t $CURP= $ArrRegistro[2];\n\n\t\t $NombreEmpleado = $ArrRegistro[3];\n\t\t $BancoNvo= $ArrRegistro[SEIS];\n\t\t $NumCta = $ArrRegistro[SIETE];\n\t\t $CLABE= $ArrRegistro[OCHO];\n\t\t $CveSPC= $ArrRegistro[NUEVE];\n\t\t $UR= $ArrRegistro[14];\n\t\t $GF= $ArrRegistro[15];\n\t\t $Fun= $ArrRegistro[16];\n\t\t $SFun= $ArrRegistro[17];\n\t\t $PG= $ArrRegistro[18];\n\t\t $AI= $ArrRegistro[19];\n\t\t $PP= $ArrRegistro[20];\n\t\t $Ptda= $ArrRegistro[21];\n\t\t $Pto= $ArrRegistro[22];\n\t\t $NumPto= $ArrRegistro[23];\n\t\t $Edo= $ArrRegistro[24];\n\t\t $Mpio= $ArrRegistro[25];\n\t\t $CenRes= $ArrRegistro[26];\n\t\t $NSS= $ArrRegistro[27];\n\t\t $Pagdria= $ArrRegistro[28];\n\t\t $FteFin = $ArrRegistro[29];\n\t\t $TabPto = $ArrRegistro[30];\n\t\t $NIVEL = $ArrRegistro[31];\n\t\t $Rango = $ArrRegistro[32];\n\t\t $IndMando = $ArrRegistro[33];\n\t\t $Horario = $ArrRegistro[34];\n\t\t // el campo 36 queda libre\n\t\t $TipTra = $ArrRegistro[36];\n\t\t $NivSPC= $ArrRegistro[37];\n\t\t $IndStat= $ArrRegistro[38];\n\t\t $FecIng= $ArrRegistro[39];\n\t\t $FecIngSS= $ArrRegistro[40];\n\t\t $FecReIng= $ArrRegistro[41];\n\t\t\t\t$FecPag= $ArrRegistro[43];\n\n\t\t\t\t$PerPagIni= $ArrRegistro[44];\n\t\t\t\t$PerPagFin= $ArrRegistro[45];\n\t\t\t\t$PerAppIni= $ArrRegistro[46];\n\t\t\t\t$PerAppFin= $ArrRegistro[47];\n\n\t\t\t\t\n\n\t\t\t\t$QnaProReal= $ArrRegistro[48];\n\t\t\t\t$AnioProReal= $ArrRegistro[49];\n\n\t\t\t\t$TipoPago = $ArrRegistro[50];\n\t\t\t\t// no va (52) Instrumento de Pago Anterior (Libre) \n\t\t\t\t$IntrPagoNvo = $ArrRegistro[52];\n\t\t\t\t$Prpcns = $ArrRegistro[53];\n\t\t\t\t$Dedcns = $ArrRegistro[54];\n\t\t\t\t$Neto = $ArrRegistro[55];\n\t\t\t\t$NumTrail = $ArrRegistro[56];\n\t\t\t\t$NomProd = $ArrRegistro[58];\n\t\t\t\t$NumCtrl = $ArrRegistro[59];\n\t\t\t\t$NumCque = $ArrRegistro[60];\n\t\t\t\t// no hay regla 61\n\t\t\t\t$Jnda = $ArrRegistro[62];\n\t\t\t\t// no hay 63 Número de Días de Prima Dominical (Libre)\n\t\t\t\t$CicloFONAC = $ArrRegistro[64];\n\t\t\t\t$NumAportFONAC= $ArrRegistro[65];\n\t\t\t\t$AcumuladoFONAC= $ArrRegistro[66];\n\t\t\t\t// no hay 67 Número de faltas en la quincena (Libre)\n\t\t\t\t$LicCLUES = $ArrRegistro[68];\n\n\t\t\t\t$PorcPen1 = $ArrRegistro[69];\n\t\t\t\t$PorcPen2 = $ArrRegistro[70];\n\t\t\t\t$PorcPen3 = $ArrRegistro[71];\n\t\t\t\t$PorcPen4 = $ArrRegistro[72];\n\t\t\t\t$PorcPen5 = $ArrRegistro[73];\n\n\t\t\t\t$ElecTipRtro = $ArrRegistro[74];\t\t\t\t\n\t\t\t\t$TipUni = $ArrRegistro[75];\t\t\t\t\n\t\t\t\t$DescCR = $ArrRegistro[76];\t\t\t\t\n\n\t\t $ValidaError = fncValidaDI_1($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $NumEmpl);\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[UNO]++;\t\t \t\n\t\t\t\t}\n//break;\n\t\t\t\t$ValidaError = fncValidaDI_2($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $NumFili, $NombreEmpleado);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DOS]++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$ValidaError = fncValidaDI_3($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $CURP, $NombreEmpleado);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[TRES]++;\t\t \t\n\t\t\t\t}\n\n\n\t\t\t\t$ValidaError = fncValidaDI_4($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $NombreEmpleado);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[CUATRO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_7($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $BancoNvo);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[SIETE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_8($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $NumCta);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[OCHO]++; \t\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_9($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $CLABE);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[NUEVE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_10($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $CveSPC);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_15($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $UR);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + CINCO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_16($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $GF);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + SEIS]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_17($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $Fun);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + SIETE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_18($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $SFun);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + OCHO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_19($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $PG);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + NUEVE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_20($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $AI);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_21($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $PP);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + UNO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_22($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $Ptda);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DOS]++;\n\t\t\t\t}\n\t\t\t\t$ValidaError = fncValidaDI_23($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $Pto);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + TRES]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_24($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $NumPto);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + CUATRO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_25($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $Edo);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + CINCO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_26($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $Mpio);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + SEIS]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_27($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $CenRes);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + SIETE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_28($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $NSS);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + OCHO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_29($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $Pagdria);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + NUEVE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_30($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $FteFin);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_31($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $TabPto);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + UNO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_32($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $NIVEL);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DOS]++;\n\t\t\t\t}\n\t\t\t\t$ValidaError = fncValidaDI_33($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $Rango);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + TRES]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_34($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $IndMando);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + CUATRO]++;\n\t\t\t\t}\n\t\t\t\t$ValidaError = fncValidaDI_35($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $Horario);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + CINCO]++;\n\t\t\t\t}\n\n\t\t\t\t// campo 36 queda libre\n\n\t\t\t\t$ValidaError = fncValidaDI_37($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $TipTra);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + SIETE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_38($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $NivSPC);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + OCHO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_39($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $IndStat);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + NUEVE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_40($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $FecIng);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DIEZ]++;\n\t\t\t\t}\n\n\n\t\t\t\t$ValidaError = fncValidaDI_41($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $FecIngSS, $FecIng);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DIEZ + UNO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_42($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $FecReIng,$FecIngSS);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DIEZ+ DOS]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_44($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $FecPag);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DIEZ+ CUATRO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_45($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $PerPagIni,$PerPagFin);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DIEZ+ CINCO]++;\n\t\t\t\t}\n\n\n\t\t\t\t$ValidaError = fncValidaDI_46($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $PerPagFin, $PerPagIni);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DIEZ+ SEIS]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_47($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $PerAppIni, $PerAppFin);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DIEZ+ SIETE]++;\n\t\t\t\t}\n\n\n\t\t\t\t$ValidaError = fncValidaDI_48($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $PerAppFin, $PerAppIni);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DIEZ+ OCHO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_49($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t\t$ContadorRegistros, $QnaProReal);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ + DIEZ + DIEZ + DIEZ+ NUEVE]++;\n\t\t\t\t}\n\n\n\t\t\t\t$ValidaError = fncValidaDI_50($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $AnioProReal,$PerPagIni,$PerPagFin);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * CINCO]++;\n\t\t\t\t}\n\n\n\t\t\t\t$ValidaError = fncValidaDI_51($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $TipoPago);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * CINCO + UNO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_53($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $IntrPagoNvo);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * CINCO + TRES]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_54($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $Prpcns);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * CINCO + CUATRO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_55($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $Dedcns);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * CINCO + CINCO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_56($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $Neto);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * CINCO + SEIS]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_57($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $NumTrail);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * CINCO + SIETE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_59($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $NomProd);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * CINCO + NUEVE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_60($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $NumCtrl);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SEIS]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_61($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $NumCque);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SEIS + UNO]++;\n\t\t\t\t}\n\t\t\t\t$ValidaError = fncValidaDI_63($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $Jnda);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SEIS + TRES]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_65($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $CicloFONAC);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SEIS + CINCO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_66($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $NumAportFONAC);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SEIS + SEIS]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_67($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $AcumuladoFONAC);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SEIS + SIETE]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_69($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $LicCLUES );\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SEIS + NUEVE]++;\n\t\t\t\t}\n\n\n\t\t\t\t$ValidaError = fncValidaDI_70($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $PorcPen1 );\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SIETE ]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_71($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $PorcPen2 );\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SIETE + UNO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_72($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $PorcPen3);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SIETE + DOS]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_73($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $PorcPen4);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SIETE + TRES]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_74($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $PorcPen5);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SIETE + CUATRO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_75($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $ElecTipRtro);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SIETE + CINCO]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_76($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $TipUni);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SIETE + SEIS]++;\n\t\t\t\t}\n\n\t\t\t\t$ValidaError = fncValidaDI_77($IdEstado, $GestorArchivoErr, \n\t\t \t\t\t\t\t$ContadorRegistros, $DescCR);\t\n\t\t if($ValidaError!=0){\n\t\t\t\t\t$ContadorErrorDI[DIEZ * SIETE + SIETE]++;\n\t\t\t\t}\n\t\t\n\t\t $ContadorRegistros++;\n\t\t }\n\n\t\t foreach ($ContadorErrorDI as &$valor) {\n \t\t\t\t \t\t$TotalRegErr = $TotalRegErr + $valor ;\n\t\t\t}\n /**\n\t\t if (!feof($GestorArchivo)) {\n\t\t echo \"Error: fallo inesperado de fgets()\\n\";\n\t\t $TotalRegErr=FALLA;\n\t\t }\n\t\t **/\n\t\t fclose($GestorArchivo);\n\t\t} // fin Gestor archivo de datos\n\t} //Fin if (!$GestorArchivoErr) \n\treturn $TotalRegErr;\n}", "public function valid(): bool\n {\n return !feof($this->fp) || $this->index !== null; // Is het einde van het bestand NIET bereikt?\n }", "private function dataValidator(){\n\n $data = request()->validate([\n 'description' => 'required',\n 'file' => 'image|mimes:jpeg, png, jpg|max:4096'\n ],[\n 'description.required' => 'El contenido del mensaje es obligatorio.',\n 'file.image' => 'Solo se permiten archivos jpg, png y jpeg.',\n 'file.max' => 'El archivo no debe pesar más de 4 MB.'\n ]);\n\n return $data;\n }", "public function processarArquivo() {\n\n /**\n * Cria uma instancia de DBLayoutReader referente ao arquivo a ser processado e o layout cadastrado\n */\n $this->oLayoutReader = new DBLayoutReader($this->iCodigoArquivo, $this->sNomeArquivo, true, false);\n\n $_SESSION[\"DB_usaAccount\"] = \"1\";\n\n /**\n * Remove da base todos os registros referentes a situação a ser processada. No caso, situacao 2 - BPC\n */\n $this->removerSituacao();\n $rsArquivo = fopen($this->sNomeArquivo, 'r');\n $iLinha = 0;\n\n /**\n * Percorre o arquivo para tratamento das linhas\n */\n while (!feof($rsArquivo)) {\n\n $iLinha++;\n $sLinha = fgets($rsArquivo);\n $oLinha = $this->oLayoutReader->processarLinha($sLinha, 0, true, false, false);\n\n if (!$oLinha) {\n continue;\n }\n\n /**\n * Salva a primeira linha do arquivo por se o cabeçalho do mesmo, adicionando no arquivo de não processados\n * Ou se o nome da pessoa ou data de nascimento estiverem vazias\n */\n if ($iLinha == 1 || empty($oLinha->nome_pessoa) || empty($oLinha->data_nascimento)) {\n\n $this->escreveArquivoRegistrosNaoProcessados($sLinha);\n continue;\n }\n\n $oDataNascimento = new DBDate($oLinha->data_nascimento);\n $dtNascimento = $oDataNascimento->convertTo(DBDate::DATA_EN);\n\n /**\n * Chama o método validar, responsavel por verificar se existe algum registro com os dados passados\n * Passamos o nome da pessoa da linha atual do arquivo, e a data de nascimento, já tratada, no formato do banco\n */\n $iCadastroUnico = $this->validar($oLinha->nome_pessoa, $dtNascimento);\n\n /**\n * Caso tenha sido retornado o sequencial do cidadao na validacao, chama o metodo insereSituacao para inserir o\n * registro para o cidadao com tipo de situacao 2\n */\n if ($iCadastroUnico != null) {\n $this->insereSituacao($iCadastroUnico);\n } else {\n\n $this->escreveArquivoRegistrosNaoProcessados($sLinha);\n $this->lTemNaoProcessado = true;\n }\n\n unset($oLinha);\n unset($oDataNascimento);\n }\n\n fclose($this->fArquivoLog);\n }", "abstract public function validateData();", "public function tratarDados($especificacoes, $valor, $posicao, $config, $identifica)\n {\n $util = new Util();\n $arquivoValidacao = new ArquivoValidacao();\n\n\n if ($especificacoes[1] == 'livre') {\n return $valor;\n }\n\n switch ($especificacoes[1]) {\n\n case 'doc':\n $valorFormatado = $util->somenteNumeros($valor);\n $arquivoValidacao->validaTamanhoNum($valorFormatado, $especificacoes[0], $posicao, $identifica);\n $valor = $util->adicionarZerosEsq($valorFormatado, $especificacoes[0]);\n break;\n\n case 'num':\n $valorFormatado = $util->somenteNumeros($valor);\n $arquivoValidacao->validaTamanhoNum($valorFormatado, $especificacoes[0], $posicao, $identifica);\n $valor = $util->adicionarZerosEsq($valorFormatado, $especificacoes[0]);\n break;\n\n case 'valor':\n $valor = $util->adicionarZerosEsq($util->trataValor($valor), $especificacoes[0]);\n\n $arquivoValidacao->validaTamanhoNum($valor, $especificacoes[0], $posicao, $identifica);\n break;\n\n case 'data-Ymd': case 'data-ymd': case 'data-dmY': case 'data-dmy':\n\n if (empty($valor)) {\n $valor = $util->adicionarZerosEsq('0', $especificacoes[0]);\n } else {\n\n $valorCru = $util->somenteNumeros($valor);\n\n if (strlen($valorCru) > 8) {\n $valorCru = substr($valorCru, 0, 8);\n }\n\n $arquivoValidacao->validaData($valorCru, $posicao, $especificacoes[0], $identifica);\n\n $partes = explode('-', $especificacoes[1]);\n\n $valor = (new \\DateTime($valor))->format($partes[1]);\n }\n\n break;\n\n default :\n $case = null;\n\n if (isset($config['case'])) {\n $case = strtolower($config['case']);\n }\n\n $valorPreparado = $util->preparaTexto($valor, $case);\n\n $valor = $util->adicionarEspacosDir($valorPreparado, $especificacoes[0]);\n break;\n }\n\n\n return $valor;\n }", "public function validar_registro(){\n $data = 'usuarios.txt';\n $fLectura = fopen($data,\"r\");\n $buscaUsuario = false; \n\n while(!feof($fLectura)){ // busca si el usuario esta en el fichero de usuarios\n $line = fgets($fLectura);\n $array = explode(';', $line);\n if($array[0] == $this->username){\n $buscaUsuario = true;\n break;\n }\n }\n fclose($fLectura);\n \n if($buscaUsuario){ \n // error para si el usuario existe \n echo \"<div class=errores><i class='fas fa-times-circle'></i> <span>Este usuario ya existe, prueba con otro.</span></div>\"; \n \t}else{ \n if(strlen($this->password)<6){\n // error para comprobar el tamaño de la contraseña\n echo \"<div class=errores><i class='fas fa-times-circle'></i> <span>La contraseña debe tener al menos 6 caracteres.</span></div>\"; \n }else{\n // registro en el archivo de usuarios\n $fRegistro = fopen($data,\"a\");\n fwrite($fRegistro,$this->username.\";\".$this->password.PHP_EOL);\n fclose($fRegistro);\n header(\"location: index.php\");\n }\n }\n }", "public static function validarCampos($dados){\n\t\t$erro = array();\n\t\t\n\t\tif(isset($dados['nome'])){\n\t\t\tif(strlen($dados['nome']) < 6 || !self::isName($dados['nome'])){\n\t\t\t\t$erro['nome'] = 'Nome inválido. Deve conter somente letras com no mínimo 6 caracteres.';\n\t\t\t}\n\t\t}\n\n\t\tif(isset($dados['email'])){\n\t\t\tif(strlen($dados['email']) < 10 || !self::isEmail($dados['email'])){\n\t\t\t\t$erro['email'] = 'Email inválido.';\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($dados['login'])){\n\t\t\tif(strlen($dados['login']) < 5 || !self::isLogin($dados['login'])){\n\t\t\t\t$erro['login'] = 'Login inválido. Deve conter mais de 4 caracteres.';\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($dados['senha_atual'])){\n\t\t\tif(isset($dados['senha']) && isset($dados['confirmar_senha']) && (strlen($dados['senha']) != 0 || strlen($dados['confirmar_senha']) != 0)){\n\t\t\t\tif(strlen($dados['senha']) < 6 || $dados['senha'] != $dados['confirmar_senha']){\n\t\t\t\t\t$erro['senha'] = 'Senha inválida. Deve conter mais de 5 caracteres e devem ser iguais.';\n\t\t\t\t\t$erro['confirmar_senha'] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(isset($dados['senha']) && isset($dados['confirmar_senha'])){\n\t\t\t\tif(strlen($dados['senha']) < 6 || $dados['senha'] != $dados['confirmar_senha']){\n\t\t\t\t\t$erro['senha'] = 'Senha inválida. Deve conter mais de 5 caracteres e devem ser iguais.';\n\t\t\t\t\t$erro['confirmar_senha'] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($dados['cpf'])){\n\t\t\tif(strlen($dados['cpf']) != 11){\n\t\t\t\t$erro['cpf'] = 'CPF inválido.';\n\t\t\t}\n\t\t\telse if($dados['cpf'] == '00000000000' ||\n\t\t\t\t\t$dados['cpf'] == '11111111111' ||\n\t\t\t\t\t$dados['cpf'] == '22222222222' ||\n\t\t\t\t\t$dados['cpf'] == '33333333333' ||\n\t\t\t\t\t$dados['cpf'] == '44444444444' ||\n\t\t\t\t\t$dados['cpf'] == '55555555555' ||\n\t\t\t\t\t$dados['cpf'] == '66666666666' ||\n\t\t\t\t\t$dados['cpf'] == '77777777777' ||\n\t\t\t\t\t$dados['cpf'] == '88888888888' ||\n\t\t\t\t\t$dados['cpf'] == '99999999999'){\n\t\t\t\t$erro['cpf'] = 'CPF inválido.';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// Calcula os digitos verificadores(os dois ultimos digitos)\n\t\t\t\tfor($t = 9; $t < 11; $t++){\n\t\t\t\t\tfor($d = 0, $c = 0; $c < $t; $c++){\n\t\t\t\t\t\t$d += $dados['cpf']{$c} * (($t + 1) - $c);\n\t\t\t\t\t}\n\t\t\t\t\t$d = ((10 * $d) % 11) % 10;\n\t\t\t\t\tif($dados['cpf']{$c} != $d){\n\t\t\t\t\t\t$erro['cpf'] = 'CPF inválido.';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(isset($dados['data_nascimento'])){\n\t\t\t$tmp = explode('/', $dados['data_nascimento']);\n\t\t\tif(strlen($dados['data_nascimento']) != 10 || count($tmp) != 3 || strlen($tmp[0]) != 2 || strlen($tmp[1]) != 2 || strlen($tmp[2]) != 4){\n\t\t\t\t$erro['data_nascimento'] = 'Data inválida.';\n\t\t\t}\n\t\t\telse if((int)$tmp[2] > ((int)date('Y') - 10)){\n\t\t\t\t$erro['data_nascimento'] = 'Data inválida.';\n\t\t\t}\n\t\t}\n\n\t\tif(isset($dados['estado']) && strlen($dados['estado']) == 0){\n\t\t\t$erro['estado'] = 'Selecione um Estado.';\n\t\t}\n\n\t\tif(isset($dados['cidade']) && strlen($dados['cidade']) == 0){\n\t\t\t$erro['cidade'] = 'Selecione uma Cidade.';\n\t\t}\n\n\t\tif(isset($dados['endereco']) && strlen($dados['endereco']) < 10){\n\t\t\t$erro['endereco'] = 'Endereço inválido. Deve conter mais de 10 caracteres.';\n\t\t}\n\n\t\tif(isset($dados['cep']) && strlen($dados['cep']) != 8){\n\t\t\t$erro['cep'] = 'CEP inválido.';\n\t\t}\n\n\t\tif(isset($dados['master']) && strlen($dados['master']) == 0){\n\t\t\t$erro['master'] = 'Permissão inválido.';\n\t\t}\n\t\t\n\t\treturn $erro;\n\t}\n\t\n\t//valida o nome do jogo\n\tpublic static function isNameJogo($nome){\n\t\t$pattern = '/^[ .a-zA-ZáéíóúÁÉÍÓÚ()0-9]+$/';\n\t\tif(preg_match($pattern, $nome)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//valida o nome do usuario\n\tpublic static function isName($nome){\n\t\t$pattern = '/^[ .a-zA-ZáéíóúÁÉÍÓÚ]+$/';\n\t\tif(preg_match($pattern, $nome)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//valida o login do usuario\n\tpublic static function isLogin($login){\n\t\t$pattern = '/^[_a-zA-Z-0-9]+$/';\n\t\tif(preg_match($pattern, $login)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//valida o e-mail do usuario\n\tpublic static function isEmail($email){\n\t\t$pattern = '/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/';\n\t\tif(preg_match($pattern, $email)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n}", "private function validateImportFile($pathToImportFile)\n {\n $requiredColumns = [ 0,1,2 ];\n if (($fileHandle = fopen($pathToImportFile,\"r\")) !== FALSE)\n {\n $row = 0;\n while (($data = fgetcsv($fileHandle, 8096, \",\")) !== FALSE) {\n $row++;\n foreach ($requiredColumns as $colNumber) {\n if (trim($data[$colNumber]) == '') {\n throw new InvalidArgumentException(\"In the inventory import, column number \" . ($colNumber + 1) . \" is required, and it is empty on row $row.\");\n }\n }\n if ((count($data) % 2) !== 0)\n {\n throw new InvalidArgumentException(\"There is an odd number of columns on row \" . ($row+1) . \", which is not valid.\");\n }\n }\n }\n else\n {\n throw new InvalidArgumentException(\"Could not open import file.\");\n }\n\n return;\n }", "protected function validateFileContents() {\n\t\tif (!$this->fileName) {\n\t\t\tthrow new \\LogicException(\"Missing file's path. Looks like severe internal error.\");\n\t\t}\n\t\t$this->validateFilePath($this->fileName);\n\t\tif (!$this->sha1hash) {\n\t\t\tthrow new \\LogicException(\"Missing file's SHA1 hash. Looks like severe internal error.\");\n\t\t}\n\t\tif ($this->sha1hash !== sha1_file($this->fileName)) {\n\t\t\tthrow new IOException(\"The file on disk has changed and this \" . get_class($this) . \" class instance is no longer valid for use. Please create fresh instance.\");\n\t\t}\n\t\treturn true;\n\t}", "public function validateTestData()\n\t{\n\t\t$testDataFileName = $this->config->getTestData();\n\t\tif (!(realpath($testDataFileName) || realpath(Config::$testDataFile))){\n\t\t\t$this->errors['testData'][] = [\n\t\t\t\t'property' => 'testData',\n\t\t\t\t'message' => 'Test data file was not found.'\n\t\t\t];\n\t\t}\n\t}", "function fileIsValid($fname, $schema, $db) {\n\tglobal $maxFileAgeInDays;\n\n\t// valid if exists\n\tif (!file_exists($fname)) {\n\t\techo \"INVALID_FILE_NOT_EXIST: $fname\\r\\n\";\n\t\treturn false;\n\t}\n\n\t// valid if not too old\n\t$age = dayOld($fname);\n\tif ($age >= $maxFileAgeInDays) {\n\t\techo \"INVALID_FILE_TOO_OLD: $fname, $age day-old\\r\\n\";\n\t\treturn false;\n\t}\n\n\t// all else being equal, check for db\n\tif (isFileAlreadyImported($fname, $schema, $db)) {\n\t\techo \"INVALID_FILE_ALREADY_IMPORTED: $fname\\r\\n\";\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function Tutores(){\n if (isset($_FILES['file'])) {\n if (($gestor = fopen($_FILES['file']['tmp_name'], \"r\")) !== FALSE) {\n $coun = 0 ;\n\n while (($datos = fgetcsv($gestor, 1000, \";\")) !== FALSE) {\n if ($coun!=0) { \n $dato = explode('-',$datos['9']);\n $rut = $dato['0'];\n $dv = $dato['1'];\n $tutor=$datos['10'];\n $asignatura=$datos['11']; \n }\n $coun= $coun + 1;\n fclose($gestor);\n\n }\n $user = $this->session->userdata('logged_in');\n if(count($user['permisos']) > 0){\n if (in_array(1, $user['permisos'])) {\n redirect('Asesor_Controller/importar','refresh');\n }elseif (in_array(2, $user['permisos'])) {\n redirect('Asistente_Controller/importar','refresh');\n }\n }\n }\n }\n }", "private function dataCreateValidate()\n\t{\n\t\treturn array(\n\t\t\t'file_date' => form_error('file_date'),\n\t\t\t'type_file' => form_error('type_file')\n\t\t);\n\t}", "public function validar(){\n\t\tif($this->rest->_getRequestMethod()!= 'POST'){\n\t\t\t$this->_notAuthorized();\n\t\t}\n\n\t\t$request = json_decode(file_get_contents('php://input'), true);\n\t\t$facPgPedido = $request['factura_pagos_pedido'];\n\t\t#verificamos que el registro existe\n\t\t$this->db->where('nro_pedido', $facPgPedido['nro_pedido']);\n\t\t$this->db->where('id_factura_pagos', $facPgPedido['id_factura_pagos']);\n\t\t$this->db->where('concepto', $facPgPedido['concepto']);\n\n\t\t$this->resultDb = $this->db->get($this->controllerSPA);\n\t\tif($this->resultDb->num_rows() != null && \n\t\t\t\t\t\t\t\t\t\t\t\t$request['accion'] == 'create'){\n\t\t\t$this->responseHTTP['message'] =\n\t\t\t\t\t\t\t 'Ya existe un registro con el mismo identificador';\n\t\t\t$this->responseHTTP[\"appst\"] = 2300;\n\t\t\t$this->responseHTTP['data'] = $this->resultDb->result_array();\n\t\t\t$this->responseHTTP['lastInfo'] = $this->mymodel->lastInfo();\n\t\t\t$this->__responseHttp($this->responseHTTP, 400);\n\t\t}else{\n\t\t#validamos la informacion\n\t\t\t$status = $this->_validData( $facPgPedido );\n\t\t\tif ($status['status']){\n\n\t\t\t\t#anulamos las fechas en blanco\n\t\t\t\t$facPgPedido['fecha_inicio'] = \n\t\t\t\t(empty($facPgPedido['fecha_inicio'])) ?\tnull : \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $facPgPedido['fecha_inicio'];\n\n\t\t\t\t$facPgPedido['fecha_fin'] = (empty($facPgPedido['fecha_fin'])) ? \n\t\t\t\t\t\t\t\t\t\t\tnull : $facPgPedido['fecha_fin'];\n\n\t\t\t\tif ($request['accion'] == 'create'){\n\t\t\t\t\t$this->db->insert($this->controllerSPA, $facPgPedido);\n\t\t\t\t\t$this->responseHTTP['message'] = \n\t\t\t\t\t\t\t\t\t\t\t\t'Registro creado existosamente';\n\t\t\t\t\t$this->responseHTTP[\"appst\"] = 1200;\n\t\t\t\t\t$this->responseHTTP['lastInfo'] = \n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->mymodel->lastInfo();\n\t\t\t\t\t$this->__responseHttp($this->responseHTTP, 201);\n\t\t\t\t}else{\n\t\t\t\t\t$facPgPedido['last_update'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$this->db->where('id_factura_pagos_pedido',\n\t\t\t\t\t\t\t\t\t\t $request['id_factura_pagos_pedido']);\n\t\t\t\t\t$this->db->update($this->controllerSPA, $facPgPedido);\n\t\t\t\t\t$this->responseHTTP['appst'] = 'Registro actualizado';\n\t\t\t\t\t$this->responseHTTP[\"appst\"] = 1300;\n\t\t\t\t\t$this->__responseHttp($this->responseHTTP, 201);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->responseHTTP['message'] = 'Uno de los registros'.\n\t\t\t\t \t\t\t\t'ingresados es incorrecto, vuelva a intentar';\n\t\t\t\t$this->responseHTTP[\"appst\"] = 1400;\n\t\t\t\t$this->responseHTTP['data'] = $status;\n\t\t\t\t$this->__responseHttp($this->responseHTTP, 400);\n\t\t\t}\n\t\t}\n\n\t}", "function isDataValid() \n {\n return true;\n }", "public function valid()\n {\n return $this->fileObject->valid();\n }", "public function ValidarDatos($campo) {\n $badHeads = array(\"Content-Type:\",\n \"MIME-Version:\",\n \"Content-Transfer-Encoding:\",\n \"Return-path:\",\n \"Subject:\",\n \"From:\",\n \"Envelope-to:\",\n \"To:\",\n \"bcc:\",\n \"cc:\");\n\n //Comprobamos que entre los datos no se encuentre alguna de\n //las cadenas del array. Si se encuentra alguna cadena se\n //dirige a una página de Forbidden\n foreach ($badHeads as $valor) {\n\n if (strpos(strtolower($campo), strtolower($valor)) !== false) {\n header(\"HTTP/1.0 403 Forbidden\");\n exit;\n }\n }\n }", "function validate() {\r\n\t\t$post_ok = isset($this->params['form']['Filedata']);\r\n\t\t$upload_error = $this->params['form']['Filedata']['error'];\r\n\t\t$got_data = (is_uploaded_file($this->params['form']['Filedata']['tmp_name']));\r\n\t\t\r\n\t\tif (!$post_ok){\r\n\t\t\t$this->setError(2000, 'Validation failed.', 'Expected file upload field to be named \"Filedata.\"');\r\n\t\t}\r\n\t\tif ($upload_error){\r\n\t\t\t$this->setError(2500, 'Validation failed.', $this->getUploadErrorMessage($upload_error));\r\n\t\t}\r\n\t\treturn !$upload_error && $post_ok && $got_data;\r\n\t}", "public function rules()\n {\n return [\n [['file_id'], 'required'],\n [['file_id','ukuran'],'integer'],\n [['tgl_upload', 'tgl_proses'], 'safe'],\n [['namafile'], 'file','skipOnEmpty' => false, 'extensions' => 'xlsx', 'on' => 'create'],\n [['file_id'], 'unique'],\n ];\n }", "public function rules() {\n return array(\n // name, email, subject and body are required\n array('archivo', 'required', 'message' => '{attribute} no puede estar vac&iacute;o'),\n array('archivo', 'file', 'safe'=>true, 'types' => 'xls, xlsx', 'allowEmpty' => false),\n );\n }", "public function validateBody()\n {\n\n if (v::identical($this->col)->validate(1)) {\n\n /** Cidade ou Região **/\n\n $regiao = Tools::clean($this->cell);\n\n if (!v::stringType()->notBlank()->validate($regiao)) {\n throw new \\InvalidArgumentException(\"Atenção: Informe na tabela a Cidade ou Região corretamente.\", E_USER_WARNING);\n }\n\n $this->array[$this->row]['regiao'] = $regiao;\n\n }\n\n if (v::identical($this->col)->validate(2)) {\n\n /** Faixa CEP Inicial **/\n\n $cep_inicio = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_inicio)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Inicial \\\"{$cep_inicio}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_inicio'] = $cep_inicio;\n\n }\n\n if (v::identical($this->col)->validate(3)) {\n\n /** Faixa CEP Final **/\n\n $cep_fim = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_fim)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Final \\\"{$cep_fim}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_fim'] = $cep_fim;\n\n }\n\n if (v::identical($this->col)->validate(4)) {\n\n /** Peso Inicial **/\n\n $peso_inicial = Tools::clean($this->cell);\n\n if (v::numeric()->negative()->validate(Tools::convertToDecimal($peso_inicial))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Inicial não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$peso_inicial}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_inicial'] = $peso_inicial;\n\n }\n\n if (v::identical($this->col)->validate(5)) {\n\n /** Peso Final **/\n\n $peso_final = Tools::clean($this->cell);\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($peso_final))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Final não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$peso_final}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_final'] = $peso_final;\n\n }\n\n if (v::identical($this->col)->validate(6)) {\n\n /** Valor **/\n\n $valor = Tools::clean($this->cell);\n\n if (!v::notEmpty()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALOR do frete não pode ser vazio.\n\n Por favor, corrija o valor e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do frete não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$valor}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['valor'] = $valor;\n\n }\n\n if (v::identical($this->col)->validate(7)) {\n\n /** Prazo de Entrega **/\n\n $prazo_entrega = (int)Tools::clean($this->cell);\n\n /**\n * Verifica o prazo de entrega\n */\n if (!v::numeric()->positive()->validate($prazo_entrega)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Atenção: Informe na tabela os Prazos de Entrega corretamente.\n\n Exemplo: 7 para sete dias.\n\n Por favor, corrija o Prazo de Entrega \\\"{$prazo_entrega}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate($prazo_entrega)) {\n $prazo_entrega = null;\n }\n\n $this->array[$this->row]['prazo_entrega'] = $prazo_entrega;\n\n }\n\n if (v::identical($this->col)->validate(8)) {\n\n /** AD VALOREM **/\n\n $ad_valorem = Tools::clean($this->cell);\n\n if (!empty($ad_valorem) && !v::numeric()->positive()->validate(Tools::convertToDecimal($ad_valorem))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do AD VALOREM não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$this->cell}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($ad_valorem))) {\n $ad_valorem = null;\n }\n\n $this->array[$this->row]['ad_valorem'] = $ad_valorem;\n\n }\n\n if (v::identical($this->col)->validate(9)) {\n\n /** KG Adicional **/\n\n $kg_adicional = Tools::clean($this->cell);\n\n if (!empty($kg_adicional) && v::numeric()->negative()->validate(Tools::convertToDecimal($kg_adicional))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do KG Adicional não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$kg_adicional}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($kg_adicional))) {\n $kg_adicional = null;\n }\n\n $this->array[$this->row]['kg_adicional'] = $kg_adicional;\n\n }\n\n return $this->array;\n\n }", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "public function rules()\n {\n return [\n 'titulo' => 'required|min:3|string',\n 'data' => 'required',\n 'hora' => 'required',\n 'duracao' => 'required',\n 'foto_capa' => 'file',\n 'descricao' => 'required',\n 'conteudos' => 'required'\n ];\n }", "public function store() //POST\n\t{\n\t\t$respuesta = array();\n\t\t$respuesta['http_status'] = 200;\n\t\t$respuesta['data'] = array(\"data\"=>'');\t\n\t\t$lineasConErrorEnCampos = \"\";\n\t\t$lineasConErrorEjercicio = \"\";\n\t\t$errorNumeroCampos = 0;\n\t\t$parametros = Input::all();\n\n\t\tif (Input::hasFile('datoscsv')){\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME_TYPE); \n\t\t\t$archivoConDatos = Input::file('datoscsv');\n\t\t\t$type = finfo_file($finfo, $archivoConDatos); \n\t\t\t$idusuario = Sentry::getUser()->id;\n\t\t\t$fechahora = date(\"d\").date(\"m\").date(\"Y\").date(\"H\").date(\"i\").date(\"s\");\n\t\t\t$nombreArchivo = 'ARCHIVO'.$idusuario.$fechahora;\n\t\t\t$idInsertado ='';\n\t\t\t$numeroRegistros = '';\n\t\t\t\n\t\t\tif($type==\"text/plain\") //Si el Mime coincide con CSV\n\t\t\t{\n\t\t\t\t$row = 1;\n\t\t\t\tif (($handle = fopen($archivoConDatos, \"r\")) !== FALSE) {\n\t\t\t\t\t$ejercicio = $parametros['ejercicio'];\n\t\t\t\t\twhile (($data2 = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t\t\t\t\tif($row > 1){\n\t\t\t\t\t\t\tif(count($data2) != 19){ //Número de columnas de cada línea, para validar si todos los campos se tienen\n\t\t\t\t\t\t\t\t$lineasConErrorEnCampos = $lineasConErrorEnCampos . $row . \", \";\n\t\t\t\t\t\t\t\t$errorNumeroCampos = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(intval($data2[16]) > intval($ejercicio)){\n\t\t\t\t\t\t\t\t$lineasConErrorEjercicio = $lineasConErrorEjercicio . $row . \", \";\n\t\t\t\t\t\t\t\t$errorNumeroCampos = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$row++;\n\t\t\t\t }\n\n\t\t\t\t\tif($errorNumeroCampos == 1){\n\t\t\t\t\t\t$respuesta['http_status'] = 404;\n\t\t\t\t\t\t$errores = '';\n\t\t\t\t\t\tif($lineasConErrorEnCampos != \"\"){\n\t\t\t\t\t\t\t$errores .= \"Error en los datos, las siguientes lineas no están completas: \".$lineasConErrorEnCampos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($lineasConErrorEjercicio != \"\"){\n\t\t\t\t\t\t\t$errores .= \"Error en los datos, las siguientes lineas no corresponden al ejercicio proporcionado: \".$lineasConErrorEjercicio;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$respuesta['data'] = array(\"data\"=>$errores,'code'=>'U06');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$recurso = new BitacoraCargaEPRegion;\n\t\t\t\t\t\t$recurso->mes = $parametros['mes'];\n\t\t\t\t\t\t$recurso->ejercicio = $parametros['ejercicio'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$validarEjercicioMes = BitacoraCargaEPRegion::getModel();\n\t\t\t\t\t\t$validarEjercicioMes = $validarEjercicioMes->where('mes','=',$parametros['mes'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->where('ejercicio','=',$parametros['ejercicio'])->count();\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif($validarEjercicioMes){\n\t\t\t\t\t\t\t$respuesta['http_status'] = 404;\n\t\t\t\t\t\t\t$respuesta['data'] = array(\"data\"=>\"Ya se cuenta con la carga de datos del mes y ejercicio especificados.\",'code'=>'U06');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$resultado = Validador::validar($parametros, $this->reglas);\t\t\n\t\t\t\t\t\t\tif($resultado === true){\n\t\t\t\t\t\t\t\t$destinationPath = storage_path().'/archivoscsv/';\n\n\t\t\t\t\t\t\t\t$upload_success = Input::file('datoscsv')->move($destinationPath, $nombreArchivo.\".csv\");\n\t\t\t\t\t\t\t\t$csv = $destinationPath . $nombreArchivo.\".csv\";\n\n\t\t\t\t\t\t\t\ttry {\n\t \t\t\t\t\t\t\t\tDB::connection()->getPdo()->beginTransaction();\n\t\t\t\t\t\t\t\t\t$recurso->save();\n\t\t\t\t\t\t\t\t\t$idInsertado = $recurso->id;\n\t\t\t\t\t\t\t\t\t$query = sprintf(\"\n\t\t\t\t\t\t\t\t\t\tLOAD DATA local INFILE '%s' \n\t\t\t\t\t\t\t\t\t\tINTO TABLE cargaDatosEPRegion \n\t\t\t\t\t\t\t\t\t\tCHARACTER SET utf8 \n\t\t\t\t\t\t\t\t\t\tFIELDS TERMINATED BY ',' \n\t\t\t\t\t\t\t\t\t\tOPTIONALLY ENCLOSED BY '\\\"' \n\t\t\t\t\t\t\t\t\t\tESCAPED BY '\\\"' \n\t\t\t\t\t\t\t\t\t\tLINES TERMINATED BY '\\\\n' \n\t\t\t\t\t\t\t\t\t\tIGNORE 1 LINES \n\t\t\t\t\t\t\t\t\t\t(`UR`,`FI`,`FU`,`SF`,`SSF`,`PS`,`PP`,`OA`,`AI`,`PT`,`MPIO`,`COGC`,`OG`,`STG`,`TR`,`FF`,`SFF`,`PF`,`CP`,\n\t\t\t\t\t\t\t\t\t\t`DM`,`importe`) \n\t\t\t\t\t\t\t\t\t\tset idBitacoraCargaEPRegion='%s', mes='%s', ejercicio='%s'\n\t\t\t\t\t\t\t\t\t\t\", addslashes($csv), $idInsertado, $parametros['mes'],$parametros['ejercicio']);\n\t\t\t\t\t\t\t\t\tDB::connection()->getpdo()->exec($query);\n\n\t\t\t\t\t\t\t\t\t$conteoTotales = CargaDatosEPRegion::getModel();\n\t\t\t\t\t\t\t\t\t$conteoTotales = $conteoTotales->select(\n\t\t\t\t\t\t\t\t\t\tDB::raw('COUNT(id) AS registros'),\n\t\t\t\t\t\t\t\t\t\tDB::raw('SUM(importe) AS totalImporte')\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t$conteoTotales = $conteoTotales->where('idBitacoraCargaEPRegion','=',$idInsertado)->first();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$recurso->totalRegistros = $conteoTotales->registros;\n\t\t\t\t\t\t\t\t\t$recurso->totalImporte = $conteoTotales->totalImporte;\n\n\t\t\t\t\t\t\t\t\t$recurso->save();\n\n\t\t\t\t\t\t\t\t\tDB::connection()->getPdo()->commit();\n\n\t\t\t\t\t\t\t\t\t$respuesta['data'] = array('data'=>$recurso);\n\t\t\t\t\t\t\t\t}catch (\\PDOException $e){\n\t\t\t\t\t\t\t\t\t$respuesta['http_status'] = 404;\n\t\t\t\t\t\t\t\t\t$respuesta['data'] = array(\"data\"=>\"Ha ocurrido un error, no se pudieron cargar los datos. Verfique su conexión a Internet.\",'code'=>'U06');\n\t\t\t\t\t\t\t\t DB::connection()->getPdo()->rollBack();\n\t\t\t\t\t\t\t\t throw $e;\n\t\t\t\t\t\t\t\t}catch(Exception $e){\n\t\t\t\t\t\t\t\t\t$respuesta['http_status'] = 500;\n\t\t\t\t\t\t\t\t\t$respuesta['data'] = array(\"data\"=>\"\",'ex'=>$e->getMessage(),'line'=>$e->getLine(),'code'=>'S02');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tFile::delete($csv);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$respuesta = $resultado;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$respuesta['http_status'] = 404;\n\t\t\t\t$respuesta['data'] = array(\"data\"=>\"Formato de archivo incorrecto.\",'code'=>'U06');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$respuesta['http_status'] = 404;\n\t\t\t$respuesta['data'] = array(\"data\"=>\"No se encontró el archivo.\",'code'=>'U06');\n\t\t}\n\t\treturn Response::json($respuesta['data'],$respuesta['http_status']);\t\n\t}", "public function rules()\n {\n return [\n 'archivo'=>'required|file|between:1,14800|mimes:pdf',\n 'f_estudiante'=>'required_if:bandera,1',\n ];\n }", "function validation($data, $files) {\n\t\treturn array();\n\t\t$error=array();\n\t\t$intensidad= $data['intensidad'];\n\t\t$categoria= $data['categoria'];\n\t\tif (empty($intensidad)){\n\t\t\t$error['intensidad']=\"No existe intensidad ingresado\";\n\t\t}\n\t\telse if (empty($categoria)){\n\t\t\t$error['categoria']= \"No se ingreso la categoria\";\n\t\t}\n\t\treturn $error;\n\t}", "public function validateFile(){\n // Check uploaded errors\t\n if($this->fileError){\n if(array_key_exists($this->fileError, $this->phpFileUploadErrors)){\n $this->addError(['PHP Upload Error',$this->phpFileUploadErrors[$this->fileError]]);\n } \n }else{\n // Check if file was uploaded via the form\n if(!is_uploaded_file($this->tmpLocation)){\n $this->addError(['File Upload', \"File uploading failed. Please upload the file again.\"]);\n }\t\n // Check extension\n if(!in_array($this->fileExt, $this->allowedExtensions)){\n $allowed = implode(', ', $this->allowedExtensions);\n $this->addError(['File Extension',\"Uploading this type of file is not allowed. Allowed file extensions are \".$allowed]);\n }\n // Check size\n if($this->size > $this->maxSize){\n $this->addError(['File Size',\"The file size must be up to \".$this->maxSize]);\n }\n // Check if upload folder exists\n if(!file_exists($this->uploadPath)){\n $this->addError(['Admin Error',\"The chosen upload directory does not exist.\"]);\n }\n } \n if(!$this->_errors){\n return true;\n } \n return false;\t\n }", "private function validateFile(string $path): void\n {\n if (!file_exists($path)) {\n throw new InvalidArgumentException(sprintf('File: %s doesn\\'t exist', $path));\n }\n\n if (!$this->isCsvFile($path)) {\n throw new InvalidArgumentException(sprintf('Format of the file: %s is not csv', $path));\n }\n }", "function importar_archivo_sigep(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $tp = $this->security->xss_clean($post['tp']);\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n \n /*--------------------------------------------------------------*/\n if($tp==0){\n $lineas=$this->subir_archivo($archivotmp); /// Techo Inicial\n }\n else{\n $lineas=$this->subir_archivo_aprobado($archivotmp); /// Techo Aprobado\n }\n $this->session->set_flashdata('success','SE SUBIO CORRECTAMENTE EL ARCHIVO ('.$lineas.')');\n redirect(site_url(\"\").'/ptto_asig_poa');\n /*--------------------------------------------------------------*/\n } \n elseif (empty($file_basename)) {\n echo \"<script>alert('SELECCIONE ARCHIVO .CSV')</script>\";\n } \n elseif ($filesize > 100000000) {\n //redirect('');\n } \n else {\n $mensaje = \"Sólo estos tipos de archivo se permiten para la carga: \" . implode(', ', $allowed_file_types);\n echo '<script>alert(\"' . $mensaje . '\")</script>';\n }\n\n } else {\n show_404();\n }\n }", "private function validarPUT(){\n parse_str(file_get_contents(\"php://input\"),$post_vars);\n $IO = ValidacaoIO::getInstance();\n $es = array();\n $ps = array();\n \n # Criando variáveis dinamicamente, e removendo possiveis tags HTML, espaços em branco e valores nulos:\n foreach ($post_vars as $atributo => $valor){\n \t $ps[$atributo] = trim(strip_tags($valor));\n \t$es = $IO->validarConsisten($es, $valor);\n }\n \n # Verificando a quantidade de parametros enviados:\n $es = $IO->validarQuantParam($es, $ps, 5);\n \n # Validar status fornecido:\n $es = $IO->validarStatusAnuncio($es, $ps['status']);\n \n # Validar codigo de anuncio fornecido:\n $prestadorBPO = unserialize($_SESSION['objetoUsuario']);\n // $es = $IO->validarAnuncio($es, $ps['codigoAnuncio']);\n \n $es = $IO->validarDonoAnuncio($es, $prestadorBPO->getCodigoUsuario(), $ps['codigoAnuncio']);\n \n # Se existir algum erro, mostra o erro\n $es ? $IO->retornar400($es) : $this->retornar200($ps);\n }", "public function rules()\n {\n $ano = date('Y');\n $mes = date('m');\n $dias = cal_days_in_month(CAL_GREGORIAN, $mes, date(\"Y\")); // VER NÙMERO DE DIAS DO MÊS\n return [\n 'descricao' => 'required',\n 'valor' => 'required|regex:/^[0-9]{1,3}(.[0-9]{3})*(\\,[0-9]+)*$/',\n 'data' => 'required|date_format:d/m/Y|before_or_equal:'.$dias.'/'.$mes.'/'.$ano.'',\n 'image' => 'nullable|image|max:8192',\n ];\n\n\n }", "public function check(){\n\t\t\t//Inform the user that the file is being checked for validity\n\t\t\techo \"-->Checking for file validity.<br/>\";\n\t\t\t$allowed_extensions = array('csv','CSV');\t//Array containing valid csv extensions\t\n\t\t\t$csv_filename\t= $this->csv_file['name'];\t//Variable containing the name of the file\n\t\t\t$csv_size \t= $this->csv_file['size'];\t//Variable containing the size of the file\n\t\t\t$csv_extension \t= explode(\".\",$csv_filename);\t//Variable containing the extension of the file\n\t\t\t$max_file_size = 20; //MB\t\t\t//Variable containing the maximum allowed file size\n\t\t\t//Check if the file was posted, if it's less than 20MB, and if it has an allowed CSV extension\n\t\t\tif(empty($this->csv_file) || $csv_size > (20 * MB) || !in_array($csv_extension[1], $allowed_extensions)){\n\t\t\t\t//If the combined check fails\t\n\t\t\t\t$errors = \"\";\t//We create an error variable\n\t\t\t\tif(empty($this->csv_file)){\n\t\t\t\t\t//We check that a file was indeed selected for upload, and if not we append an error message\n\t\t\t\t\t//to the errors variable detailing the problem\n\t\t\t\t\t$errors .= \"Please make sure you select a CSV file for upload before attempting to upload.<br/>\";\n\t\t\t\t}\n\t\t\t\tif($csv_size > (20 * MB)){\n\t\t\t\t\t//We then check that the file is within the 20MB upload limit, and it it is not we append \n\t\t\t\t\t//a message detailing the problem to the error variable.\n\t\t\t\t\t$errors .= \"The maximum allowed filesize is \" . $max_file_size . \"MB, please select a smaller file.</br>\";\n\t\t\t\t}\n\t\t\t\tif(!in_array($csv_extension[1], $allowed_extensions)){\n\t\t\t\t\t//We then check that the file's extension is contained in the allowed extensions array\n\t\t\t\t\t//And if it is not, we advice the user that the extension is invalid and display the \n\t\t\t\t\t//allowed extensions for reference.\n\t\t\t\t\t$errors .= \"The file you are trying to upload has the extension '.\" . $csv_extension[1] . \"'.\";\n\t\t\t\t\t$errors .= \"The allowed extensions are:<br/>\";\n\t\t\t\t\tforeach($allowed_extensions as $ext){\n\t\t\t\t\t\t$errors .= \"<font color='orange'>.\" . $ext . \"</font><br/>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Then we display the combined error messages.\n\t\t\t\techo $errors;\n\t\t\t\t//And return false to indicate the file is invalid\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t//If the file passes all the checks, we inform the user that the file is a valid one\n\t\t\t\techo \"-->File is valid.<br/>\";\n\t\t\t\t//And return true to indicate the file is a valid one\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "function importar_archivo_sigepp(){\n if ($this->input->post()) {\n $post = $this->input->post();\n \n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n \n /*--------------------------------------------------------------*/\n $i=0;\n $nro=0;$nroo=0;\n $lineas = file($archivotmp);\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){ \n\n $datos = explode(\";\",$linea);\n //echo count($datos).\"<br>\";\n if(count($datos)==7){\n\n $da=$datos[0]; /// Da\n $ue=$datos[1]; /// Ue\n $prog=$datos[2]; /// Aper Programa\n $proy=trim($datos[3]);\n if(strlen($proy)==2){\n $proy='00'.$proy; /// Aper Proyecto\n }\n $act=trim($datos[4]); /// Aper Actividad\n if(strlen($act)==2){\n $act='0'.$act;\n }\n $cod_part=trim($datos[5]); /// Partida\n if(strlen($cod_part)==3){\n $cod_part=$cod_part.'00';\n }\n\n $importe=(float)$datos[6]; /// Monto\n\n // echo $this->gestion.\"<br>\";\n echo $prog.'- ('.strlen($prog).') -> '.$proy.' ('.strlen($proy).') -> '.$act.' ('.strlen(trim($act)).') ----'.$importe.'-- CODIGO PARTIDA '.is_numeric($cod_part).'<br>';\n if(strlen($prog)==2 & strlen($proy)==4 & strlen(trim($act))==3 & $importe!=0 & is_numeric($cod_part)){\n // echo \"INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n $nroo++;\n // echo \"string<br>\";\n $aper=$this->model_ptto_sigep->get_apertura($prog,$proy,$act);\n if(count($aper)!=0){\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n else{\n echo \"INSERTS : \".$nroo.\" -\".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*-------------------- Guardando Datos ------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => $aper[0]['aper_id'],\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n $nro++;\n }\n else{\n echo \"NO INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n /* $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }*/\n /*-------------------- Guardando Datos ------------------*/\n /* $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => 0,\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n }\n elseif(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe==0){\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES 0->VALOR : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n }\n }\n }\n\n $i++;\n }\n\n /*--------------------------------------------------------------*/\n } \n elseif (empty($file_basename)) {\n echo \"<script>alert('SELECCIONE ARCHIVO .CSV')</script>\";\n } \n elseif ($filesize > 100000000) {\n //redirect('');\n } \n else {\n $mensaje = \"Sólo estos tipos de archivo se permiten para la carga: \" . implode(', ', $allowed_file_types);\n echo '<script>alert(\"' . $mensaje . '\")</script>';\n }\n\n } else {\n show_404();\n }\n }", "function validate_file($instructor, $filename, $filewithpath, $access) {\n if (is_dir($filewithpath)) {\n return array(False, False, 1, 1, 1, '');\n }\n $today = getdate();\n $open_year = $today['year'];\n $open_month = 1;\n $open_day = 1;\n $cat_file = $filename;\n if (isset($access[basename($filewithpath)])) {\n $open_day = intval($access[basename($filewithpath)]['day']);\n $open_month = intval($access[basename($filewithpath)]['month']);\n if (isset($access[basename($filewithpath)]['year'])) {\n $open_year = intval($access[basename($filewithpath)]['year']);\n }\n } elseif (isset($access[basename($filename)])) {\n $open_day = intval($access[basename($filename)]['day']);\n $open_month = intval($access[basename($filename)]['month']);\n if (isset($access[basename($filename)]['year'])) {\n $open_year = intval($access[basename($filename)]['year']);\n }\n } else {\n $cp = array_reverse(explode('.', basename($filewithpath)));\n if (count($cp) > 3 && is_numeric($cp[1]) && is_numeric($cp[2])) {\n $open_day = intval($cp[1]);\n $open_month = intval($cp[2]);\n $cat_file = $cp[3] . '.' . $cp[0];\n } else {\n return array(True, True, 1, 1, 1, $cat_file);\n }\n }\n if ($today['year'] >= $open_year && $today['mon'] > $open_month) {\n return array(True, True, $open_year, $open_month, $open_day, $cat_file);\n } elseif ($today['year'] >= $open_year && $today['mon'] >= $open_month && $today['mday'] >= $open_day) {\n return array(True, True, $open_year, $open_month, $open_day, $cat_file);\n } elseif ($instructor) {\n return array(True, False, $open_year, $open_month, $open_day, $cat_file);\n }\n return array(False, False, $open_year, $open_month, $open_day, $cat_file);\n }", "function validarUsuario(array $usuario)\n{\n //Metodo de validação\n if(empty($usuario['codigo']) || empty($usuario['nome']) || empty($usuario['idade']))\n {\n //Message erro\n throw new Exception(\"Campos obrigatórios não foram preenchidos ! \\n\");\n }\n return true;\n}", "public function validateFields($par)\n {\n $i=0;\n foreach ($par as $key => $value){\n if(empty($value)){\n $i++;\n }\n }\n if($i==0){\n return true;\n }else{\n $this->setErro(\"Preencha todos os dados!\");\n return false;\n }\n }", "private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }", "static function validFile($name,$size,$arrayFileType){\n \n $valid = true;\n \n// //extraer el ultimo componente de la ruta(se busca el nombre del archivo)\n// $file = $dir . basename($_FILES[$name]['name']);\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n// $valFileType = strtolower(pathinfo($file,PATHINFO_EXTENSION));\n //Extraer el tamaño del archivo\n// $valsize = getimagesize($_FILES[$name][\"tmp_name\"]);\n \n // Extenciones permitidas\n //Extraer tipo de extencion del archivo y convertirlo en minuscula\n $valFileType = strtolower(pathinfo($_FILES[$name]['name'],PATHINFO_EXTENSION)); \n $true=0;\n// var_dump(count($arrayFileType));\n for($i=0; $i<=count($arrayFileType)-1; $i++){\n \n if($valFileType==$arrayFileType[$i]){\n $true=$true+1;\n } \n $stringFileType .=$arrayFileType[$i].\" \";\n \n }\n \n if($true==0){\n $valid = false;\n $msg.=\"Solo se permiten extensiones \".$stringFileType.\". \"; \n }\n \n //tamaño permitido\n if ($_FILES[$name][\"size\"] > $size) {\n $valid = false;\n $msg.=\"Operacion fallida, este archivo no puede ser mayor a \".($size/100000).\"MB. \"; \n } \n \n \n if($msg!=\"\"){\n// $msg = \"Debe darse un valor al campo: \".$msg ;\n utilities::alert($msg); \n }\n \n \n \n return ($valid); \n }", "public function filesizeValid()\n\t{\n\t\tif ($this->files['size'] > $this->max_filesize) {\n\t\t\tthrow new Exception(\"File is too big\",7);\n\t\t}\n\n\t\t//Check that the file is not too less\n\t\tif ($this->files['size'] < $this->min_filesize) {\n\t\t throw new Exception(\"File is too less than\",8);\n\t\t}\n\t\n\t}", "public function rules()\n {\n return [\n 'name_file' => 'required|file|max:10000,mimes:csv'\n ];\n }", "function validar_datos() {\n\t\t\tglobal $nombre, $mail, $apellido, $psw, $psw1, $telefono, $desc;\n\n\t\t\t$errores = 0;\n $msj = \"\"; \n\t\t\n\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t\t{\t\t\t\t\n\t\t\t\t if ($nombre == null || trim($nombre)==\"\")\n\t\t\t\t {\n\t\t\t\t\t$msj .= \"Debe ingresar un nombre\" . '\\n';\n\t\t\t\t\t$errores++;\n\t\t\t\t }\n\t\t\t\t if ($errores == 0)\n \t\treturn true;\n \t\t else\n\t\t\t\t\techo \"<script language='javascript'>alert('$msj');window.location.href='abm_marcas.php'</script>\";\n\t\t\t\t\texit; \t\t\n\t\t\t}\t\t\n\t\t}", "public function valid_document($str) {\n if (count($_FILES) == 0 || !array_key_exists('document', $_FILES)) {\n $this->form_validation->set_message('valid_document', 'CSV file is required');\n return false;\n }\n\n if ($_FILES['document']['size'] == 0) {\n $this->form_validation->set_message('valid_document', 'CSV file is required');\n return false;\n }\n\n if ($_FILES['document']['error'] != UPLOAD_ERR_OK) {\n $this->form_validation->set_message('valid_document', 'Upload of CSV failed');\n return false;\n }\n\n $validfile = array('.csv');\n $ext = strtolower(strrchr($_FILES['document']['name'], \".\"));\n if (!in_array($ext, $validfile)) {\n $this->form_validation->set_message('valid_document', 'Only .csv file allowed');\n return false;\n }\n return true;\n }", "public function validarEquipamentosGeral (IExportacaoCenso $oExportacaoCenso, $iSequencial, $sEquipamento) {\n\n $sMensagem = \"\";\n switch ($iSequencial) {\n\n case 3000002:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores: \";\n break;\n\n case 3000003:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores de Uso Administrativo: \";\n break;\n\n case 3000024:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores de Uso dos Alunos: \";\n break;\n\n case 3000019:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Número de Salas de Aula Existentes na Escola: \";\n break;\n\n case 3000020:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Número de Salas Utilizadas Como Sala de Aula - \";\n $sMensagem .= \"Dentro e Fora do Prédio: \";\n break;\n }\n\n $lTodosDadosValidos = true;\n\n if (strlen($sEquipamento) > 4) {\n\n $lTodosDadosValidos = false;\n $sMensagemTamanho = \"Quantidade de dígitos informado inválido. É permitido no máximo 4 dígitos.\";\n $oExportacaoCenso->logErro( $sMensagem.$sMensagemTamanho, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $sEquipamento != null ) {\n\n if( !DBNumber::isInteger( $sEquipamento ) ) {\n\n $lTodosDadosValidos = false;\n $sMensagemInteiro = \"Valor informado para quantidade inválido. Informe apenas números no campo de quantidade.\";\n $oExportacaoCenso->logErro( $sMensagem.$sMensagemInteiro, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n if( DBNumber::isInteger($sEquipamento) && $sEquipamento == 0 ) {\n\n $lTodosDadosValidos = false;\n $sMensagemInvalido = \"Valor informado para quantidade inválido. Deixar o campo vazio, ao invés de informar 0.\";\n $oExportacaoCenso->logErro( $sMensagem.$sMensagemInvalido, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n return $lTodosDadosValidos;\n }", "public function valida ($codFila) {\n\t\tglobal $log;\n\t\t\n\t\t#################################################################################\n\t\t## Zera os contadores de quantidade de registros\n\t\t#################################################################################\n\t\t$linha\t\t\t= 0;\n\t\t$numDetalhes\t= 0;\n\t\t\n\t\t#################################################################################\n\t\t## Alterar o status para Validando\n\t\t#################################################################################\n\t\t\\Zage\\App\\Fila::alteraStatus($codFila, 'V');\n\t\t\n\t\tforeach ($this->registros as $reg) {\n\t\t\t\n\t\t\t#################################################################################\n\t\t\t## Descobre o tipo de Registro\n\t\t\t#################################################################################\n\t\t\t\n\t\t\t$codTipoReg\t\t= $reg->getTipoRegistro();\n\t\t\tif ($codTipoReg == 3) {\n\t\t\t\t$codSegmento\t= $reg->getCodSegmento();\n\t\t\t}else{\n\t\t\t\t$codSegmento\t= \"\";\n\t\t\t}\n\t\t\t$tipoReg\t\t= $codTipoReg . $codSegmento;\n\t\t\t$linha++;\n\t\t\t\n\t\t\t#################################################################################\n\t\t\t## Alterar a linha atual\n\t\t\t#################################################################################\n\t\t\t\\Zage\\App\\Fila::alteraLinhaAtual($codFila, $linha);\n\t\t\t\n\t\t\t#################################################################################\n\t\t\t## Faz a validação do registro (tipo de dados, tamanho e etc ...)\n\t\t\t#################################################################################\n\t\t\t$valido\t= $reg->validar();\n\t\t\tif ($valido !== true)\t$this->adicionaErro(0, $reg->getLinha(), $reg->getTipoRegistro(), $valido);\n\t\t\t\n\t\t\t#################################################################################\n\t\t\t## Verifica se a primeira linha é o header\n\t\t\t#################################################################################\n\t\t\tif (($linha == 1) && ($tipoReg !== '0')) {\n\t\t\t\t$this->adicionaErro(0, $reg->getLinha(), $reg->getTipoRegistro(), 'Header não encontrado');\n\t\t\t}\n\t\t\t\n\t\t\t#################################################################################\n\t\t\t## Verifica o tipo de arquivo, para fazer a devida validação\n\t\t\t#################################################################################\n\t\t\tswitch ($tipoReg) {\n\t\t\t\t \n\t\t\t\t#################################################################################\n\t\t\t\t## Header\n\t\t\t\t#################################################################################\n\t\t\t\tcase '0':\n\t\t\t\t\t#################################################################################\n\t\t\t\t\t## Salva os campos do header\n\t\t\t\t\t#################################################################################\n\t\t\t\t\tforeach ($reg->campos as $campo) {\n\t\t\t\t\t\t$var\t= $campo->getVariavel();\n\t\t\t\t\t\tif ($var) {\n\t\t\t\t\t\t\t$this->header[$var]\t= $campo->getCleanVal();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t#################################################################################\n\t\t\t\t## Detalhes do Segmento T\n\t\t\t\t#################################################################################\n\t\t\t\tcase '3T':\n\t\t\t\t\t$numDetalhes++;\n\t\t\t\t\t\n\t\t\t\t\t#################################################################################\n\t\t\t\t\t## Salva os detalhes com as variáveis\n\t\t\t\t\t#################################################################################\n\t\t\t\t\t$i\t= sizeof($this->detalhesSegT);\n\t\t\t\t\tforeach ($reg->campos as $campo) {\n\t\t\t\t\t\t$var\t= $campo->getVariavel();\n\t\t\t\t\t\tif ($var) {\n\t\t\t\t\t\t\t$this->detalhesSegT[$i][$var]\t= $campo->getCleanVal();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t#################################################################################\n\t\t\t\t## Detalhes do Segmento U\n\t\t\t\t#################################################################################\n\t\t\t\tcase '3U':\n\t\t\t\t\t#################################################################################\n\t\t\t\t\t## Salva os detalhes com as variáveis\n\t\t\t\t\t#################################################################################\n\t\t\t\t\t$i\t= sizeof($this->detalhesSegU);\n\t\t\t\t\tforeach ($reg->campos as $campo) {\n\t\t\t\t\t\t$var\t= $campo->getVariavel();\n\t\t\t\t\t\tif ($var) {\n\t\t\t\t\t\t\t$this->detalhesSegU[$i][$var]\t= $campo->getCleanVal();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t#################################################################################\n\t\t\t\t## Trailler\n\t\t\t\t#################################################################################\n\t\t\t\tcase '9':\n\t\t\t\t\t#################################################################################\n\t\t\t\t\t## Salva os campos do trailler\n\t\t\t\t\t#################################################################################\n\t\t\t\t\tforeach ($reg->campos as $campo) {\n\t\t\t\t\t\t$var\t= $campo->getVariavel();\n\t\t\t\t\t\tif ($var) {\n\t\t\t\t\t\t\t$this->trailler[$var]\t= $campo->getCleanVal();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t#################################################################################\n\t\t## Validação geral do arquivo\n\t\t#################################################################################\n\t\tif (empty($this->header))\t\t\t$this->adicionaErro(0, 0, \"0\", 'As informações do Header não foram encontradas');\n\t\tif (empty($this->trailler))\t\t\t$this->adicionaErro(0, 0, \"9\", 'As informações do trailler não foram encontradas');\n\n\t\t#################################################################################\n\t\t## Verifica a quantidade de registros\n\t\t#################################################################################\n\t\tif (sizeof($this->detalhesSegT)\t== 0)\t$this->adicionaErro(0, 0, \"1\", 'As informações dos registros de detalhes não foram encontradas');\n\t\t\n\t\t#################################################################################\n\t\t## Verifica as variáveis obrigatórias\n\t\t#################################################################################\n\t\tif (!isset($this->header[\"AGENCIA\"]) \t\t|| empty($this->header[\"AGENCIA\"]))\t\t\t$this->adicionaErro(0, 0, \"0\", 'Variável \"Agência\" não encontrada no Header');\n\t\t//if (!isset($this->header[\"CONTA_CORRENTE\"]) || empty($this->header[\"CONTA_CORRENTE\"]))\t$this->adicionaErro(0, 0, \"0\", 'Variável \"CONTA_CORRENTE\" não encontrada no Header');\n\t\n\t}", "function validateFile($fieldname)\n{\n $error = '';\n if (!empty($_FILES[$fieldname]['error'])) {\n switch ($_FILES[$fieldname]['error']) {\n case '1':\n $error = 'Upload maximum file is 4 MB.';\n break;\n case '2':\n $error = 'File is too big, please upload with smaller size.';\n break;\n case '3':\n $error = 'File uploaded, but only halef of file.';\n break;\n case '4':\n $error = 'There is no File to upload';\n break;\n case '6':\n $error = 'Temporary folder not exists, Please try again.';\n break;\n case '7':\n $error = 'Failed to record File into disk.';\n break;\n case '8':\n $error = 'Upload file has been stop by extension.';\n break;\n case '999':\n default:\n $error = 'No error code avaiable';\n }\n } elseif (empty($_FILES[$fieldname]['tmp_name']) || $_FILES[$fieldname]['tmp_name'] == 'none') {\n $error = 'There is no File to upload.';\n } elseif ($_FILES[$fieldname]['size'] > FILE_UPLOAD_MAX_SIZE) {\n $error = 'Upload maximum file is '.number_format(FILE_UPLOAD_MAX_SIZE/1024,2).' MB.';\n } else {\n //$get_ext = substr($_FILES[$fieldname]['name'],strlen($_FILES[$fieldname]['name'])-3,3);\t\n $cekfileformat = check_file_type($_FILES[$fieldname]);\n if (!$cekfileformat) {\n $error = 'Upload File only allow (jpg, gif, png, pdf, doc, xls, xlsx, docx)';\n }\n }\n\n return $error;\n}", "public function valida_objetivos_estrategicos(){\n if ($this->input->post()) {\n $post = $this->input->post();\n\n $codigo = $this->security->xss_clean($post['codigo']);\n $descripcion = $this->security->xss_clean($post['descripcion']);\n $configuracion=$this->model_proyecto->configuracion_session();\n\n /*--------------- GUARDANDO OBJETIVO ESTRATEGICO ----------------*/\n $data_to_store = array(\n 'obj_codigo' => strtoupper($codigo),\n 'obj_descripcion' => strtoupper($descripcion),\n 'obj_gestion_inicio' => $configuracion[0]['conf_gestion_desde'],\n 'obj_gestion_fin' => $configuracion[0]['conf_gestion_hasta'],\n 'fun_id' => $this->fun_id,\n );\n $this->db->insert('_objetivos_estrategicos',$data_to_store);\n $obj_id=$this->db->insert_id();\n /*---------------------------------------------------------------*/\n\n if(count($this->model_mestrategico->get_objetivos_estrategicos($obj_id))==1){\n $this->session->set_flashdata('success','SE REGISTRO CORRECTAMENTE');\n redirect(site_url(\"\").'/me/objetivos_estrategicos');\n }\n else{\n $this->session->set_flashdata('danger','ERROR AL REGISTRAR');\n redirect(site_url(\"\").'/me/objetivos_estrategicos');\n }\n\n } else {\n show_404();\n }\n }", "public function testInvalidFileImport(): void\n {\n $this->expectException(ValidationException::class);\n $file_path = base_path('tests/data/aircraft.csv');\n $this->importSvc->importAirports($file_path);\n }", "function Photo_Uploaded_Is_Valid($Max_Size = 500000)\n{\n //sinon $_FILES n'est pas défini\n\n // 'un_fichier' est le nom sur le formulaire HTML\n if (!isset($_FILES['un_fichier'])) {\n return 'Aucune image téléversée';\n }\n\n if ($_FILES['un_fichier']['error'] != UPLOAD_ERR_OK) {\n return 'Erreur téléchargement de la photo: code='.$_FILES['un_fichier']['error'];\n }\n\n // Vérifier taille de l'image\n if ($_FILES['un_fichier']['size'] > $Max_Size) {\n return 'Fichier trop gros, taille maximum = '.$Max_Size.' Kb';\n }\n\n // Vérifier si le fichier contient une image\n $check = getimagesize($_FILES['un_fichier']['tmp_name']);\n if ($check === false) {\n return \"Ce fichier n'est pas une image\";\n }\n\n // Vérifier si extension est jpg,JPG,gif,png\n $imageFileType = pathinfo(basename($_FILES['un_fichier']['name']), PATHINFO_EXTENSION);\n if ($imageFileType != 'jpg' && $imageFileType != 'JPG' && $imageFileType != 'gif' && $imageFileType != 'png') {\n return \"L'extension du fichier est invalide. Doit être parmis: .jpg .JPG .gif .png\";\n }\n\n return 'OK';\n}", "public function validate() {\r\n if (empty($this->name)) {\r\n throw new Exception(\"Verification failed - download must have a name\");\r\n }\r\n \r\n if (!$this->Date instanceof DateTime) {\r\n $this->Date = new DateTime;\r\n }\r\n \r\n if (empty($this->filename)) {\r\n throw new Exception(\"Verification failed - download must have a filename\");\r\n }\r\n \r\n if (is_null($this->mime)) {\r\n $this->mime = \"\";\r\n }\r\n \r\n if (!filter_var($this->active, FILTER_VALIDATE_INT)) {\r\n $this->active = 1;\r\n } \r\n \r\n if (!filter_var($this->approved, FILTER_VALIDATE_INT)) {\r\n $this->approved = 0;\r\n }\r\n \r\n if (!filter_var($this->hits, FILTER_VALIDATE_INT)) {\r\n $this->hits = 0;\r\n }\r\n \r\n if ($this->Author instanceof User) {\r\n $this->user_id = $this->Author->id;\r\n }\r\n \r\n if (!filter_var($this->user_id, FILTER_VALIDATE_INT)) {\r\n throw new Exception(\"No valid owner of this download has been provided\");\r\n }\r\n \r\n return true;\r\n }", "public function anexar(){\n// var_dump($_FILES);\n// var_dump($_POST);\n if(isset($_FILES) && isset($_POST['id']) && !empty($_FILES)){\n extract($_POST);\n $extensao = $this->validaExtensao($_FILES['arquivo']['name']);\n if($_FILES['arquivo']['size'] <= 4000000 && $extensao){\n $newName = md5(time()).\".\".$extensao;\n $this->validaPasta($tipo, $id);\n $caminho = \"arquivos/$tipo/$id/$newName\";\n if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $caminho)) {\n $arquivos = new Arquivos();\n $retorno = $arquivos->insereArquivoBD($_FILES['arquivo']['name'], $id, $caminho, $tipo);\n echo json_encode('ok');\n }else{\n echo json_encode(3);\n }\n \n } else {\n echo json_encode(2);\n }\n } else {\n echo json_encode(1);\n }\n }", "public function test_validar_archivo_vacio_en_entrega_de_actividad()\n {\n $entrega=new EntregaActividad();\n $entrega->setArchivo(null);\n $this->assertTrue($entrega->validarArchivo()->fails());\n }", "private function valida_exedente(): bool|array\n {\n if (property_exists(object_or_class: 'calcula_imss', property: 'monto_uma')){\n return $this->error->error('Error no existe el campo monto_uma', $this);\n }\n\n if (property_exists(object_or_class: 'calcula_imss', property: 'sbc')){\n return $this->error->error('Error no existe el campo sbc', $this);\n }\n\n if (property_exists(object_or_class: 'calcula_imss', property: 'n_dias')){\n return $this->error->error('Error no existe el campo n_dias', $this);\n }\n\n if($this->monto_uma<=0){\n return $this->error->error('Error uma debe ser mayor a 0', $this->monto_uma);\n }\n if($this->sbc<=0){\n return $this->error->error('Error sbc debe ser mayor a 0', $this->sbc);\n }\n if($this->n_dias<=0){\n return $this->error->error('Error n_dias debe ser mayor a 0', $this->n_dias);\n }\n return true;\n }", "public function rules()\n {\n return [\n 'certificado' => 'required|file|filled',\n ];\n }", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "protected static function _validate()\n\t{\n\t\tif (!file_exists(self::$jar)) {\n\t\t\tthrow new Exception('MergeMinify_Minification:$jar(' . self::$jar . ') is not a valid file.');\n\t\t}\n\t\tif (!is_dir(self::$tmpDir) || !is_writable(self::$tmpDir)) {\n\t\t\tthrow new Exception('MergeMinify_Minification:$temp(' . self::$temp . ') is not a valid directory.');\n\t\t}\n\t}", "public function cargarLayoutParcial(Request $request){\n Validator::make($request->all(),[\n 'id_layout_parcial' => 'required|exists:layout_parcial,id_layout_parcial',\n 'tecnico' => 'required|max:45',\n 'fiscalizador_toma' => 'required|exists:usuario,id_usuario',\n 'fecha_ejecucion' => 'required|date',\n 'observacion' => 'nullable|string',\n\n 'maquinas' => 'nullable',\n 'maquinas.*.id_maquina' => 'required|integer|exists:maquina,id_maquina',\n 'maquinas.*.porcentaje_dev' => ['nullable','regex:/^\\d\\d?\\d?\\d?\\d?\\d?\\d?\\d?\\d?\\d?\\d?\\d?([,|.]\\d\\d?)?$/'],\n 'maquinas.*.denominacion' => ['nullable','string'],\n 'maquinas.*.juego.correcto' => 'required|in:true,false',\n 'maquinas.*.no_toma' => 'required|in:1,0',\n 'maquinas.*.juego.valor' => 'required|string',\n 'maquinas.*.marca.correcto' => 'required|in:true,false',\n 'maquinas.*.marca.valor' => 'required|string',\n 'maquinas.*.nro_isla.correcto' => 'required|in:true,false',\n 'maquinas.*.nro_isla.valor' => 'required|string',\n\n 'maquinas.*.progresivo' => 'nullable',\n 'maquinas.*.progresivo.id_progresivo' => 'required_with:maquinas.*.progresivo|integer|exists:progresivo,id_progresivo',\n 'maquinas.*.progresivo.maximo.correcto' => 'required_with:maquinas.*.progresivo|in:true,false',\n 'maquinas.*.progresivo.maximo.valor' => 'required_with:maquinas.*.progresivo|numeric' ,\n 'maquinas.*.progresivo.individual.valor' => 'required_with:maquinas.*.progresivo|in:INDIVIDUAL,LINKEADO',\n 'maquinas.*.progresivo.individual.correcto' => 'required_with:maquinas.*.progresivo|in:true,false',\n 'maquinas.*.progresivo.porc_recuperacion.valor' => 'required_with:maquinas.*.progresivo|string',\n 'maquinas.*.progresivo.porc_recuperacion.correcto' => 'required_with:maquinas.*.progresivo|in:true,false',\n 'maquinas.*.progresivo.nombre_progresivo.valor' => 'required_with:maquinas.*.progresivo|string',\n 'maquinas.*.progresivo.nombre_progresivo.correcto' => 'required_with:maquinas.*.progresivo|in:true,false',\n\n 'maquinas.*.niveles_progresivo' => 'nullable',\n 'maquinas.*.niveles_progresivo.*.id_nivel' => 'required',\n 'maquinas.*.niveles_progresivo.*.nombre_nivel' => 'required',\n 'maquinas.*.niveles_progresivo.*.base' => 'required',\n 'maquinas.*.niveles_progresivo.*.porc_oculto' => ['nullable','regex:/^\\d\\d?([,|.]\\d\\d?)?$/'],\n 'maquinas.*.niveles_progresivo.*.porc_visible' => ['required','regex:/^\\d\\d?([,|.]\\d\\d?\\d?)?$/'],\n\n\n ], array(), self::$atributos)->after(function($validator){\n\n // $validator->getData()\n\n })->validate();\n\n $layout_parcial = LayoutParcial::find($request->id_layout_parcial);\n\n $layout_parcial->tecnico = $request->tecnico;\n $layout_parcial->id_usuario_fiscalizador = $request->fiscalizador_toma;\n $layout_parcial->id_usuario_cargador = session('id_usuario');\n $layout_parcial->fecha_ejecucion = $request->fecha_ejecucion;\n $layout_parcial->observacion_fiscalizacion = $request->observacion;\n $detalle_layout_parcial = $layout_parcial->detalles;\n if(isset($request->maquinas)){\n //por cada renglon tengo progresivo, nivels y configuracion de maquina\n foreach ($request->maquinas as $maquina_de_layout){\n $maquina = Maquina::find($maquina_de_layout['id_maquina']);//maquina que corresponde a detalle de layout\n $bandera =1 ;\n $detalle = $layout_parcial->detalles()->where('id_maquina' , $maquina_de_layout['id_maquina'])->get();\n //valido que todos los campos esten corretos\n\n if(!(filter_var($maquina_de_layout['nro_admin']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $maquina_con_diferencia = new CampoConDiferencia;//si el nombre juego presentaba diferencia\n $maquina_con_diferencia->columna ='nro_admin';\n $maquina_con_diferencia->entidad ='maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['nro_admin']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['juego']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $maquina_con_diferencia = new CampoConDiferencia;//si el nombre juego presentaba diferencia\n $maquina_con_diferencia->columna ='nombre_juego';\n $maquina_con_diferencia->entidad ='maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['juego']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['marca']['correcto'],FILTER_VALIDATE_BOOLEAN))){//si el marca presentaba diferencia\n $maquina_con_diferencia = new CampoConDiferencia;\n $maquina_con_diferencia->columna = 'marca';\n $maquina_con_diferencia->entidad = 'maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['marca']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['nro_isla']['correcto'],FILTER_VALIDATE_BOOLEAN))){//si el numero isla presentaba diferencia\n $maquina_con_diferencia = new CampoConDiferencia;\n $maquina_con_diferencia->columna = 'nro_isla';\n $maquina_con_diferencia->entidad = 'maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['nro_isla']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['nro_serie']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $maquina_con_diferencia = new CampoConDiferencia;\n $maquina_con_diferencia->columna = 'nro_serie';\n $maquina_con_diferencia->entidad = 'maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['nro_serie']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n\n //reviso configuracion de progresivo\n if(isset($maquina_de_layout['progresivo'])){ //configuracion progresivo\n $progresivo = Progresivo::find($maquina_de_layout['progresivo']['id_progresivo']);\n $pozo= $maquina->pozo;\n\n if(!(filter_var($maquina_de_layout['progresivo']['maximo']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $progresivos_con_diferencia = new CampoConDiferencia;\n $progresivos_con_diferencia->columna ='maximo';\n $progresivos_con_diferencia->entidad ='progresivo';\n $progresivos_con_diferencia->valor = $maquina_de_layout['progresivo']['maximo']['valor'];\n $progresivos_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $progresivos_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['progresivo']['porc_recuperacion']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $progresivos_con_diferencia = new CampoConDiferencia;\n $progresivos_con_diferencia->columna ='porc_recuperacion';\n $progresivos_con_diferencia->entidad ='progresivo';\n $progresivos_con_diferencia->valor = $maquina_de_layout['progresivo']['porc_recuperacion']['valor'];\n $progresivos_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $progresivos_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['progresivo']['nombre_progresivo']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $progresivos_con_diferencia = new CampoConDiferencia;\n $progresivos_con_diferencia->columna ='nombre_progresivo';\n $progresivos_con_diferencia->entidad ='progresivo';\n $progresivos_con_diferencia->valor = $maquina_de_layout['progresivo']['nombre_progresivo']['valor'];\n $progresivos_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $progresivos_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['progresivo']['individual']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $progresivos_con_diferencia = new CampoConDiferencia;\n $progresivos_con_diferencia->columna ='individual';\n $progresivos_con_diferencia->entidad ='progresivo';\n $progresivos_con_diferencia->valor = $maquina_de_layout['progresivo']['individual']['valor'];\n $progresivos_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $progresivos_con_diferencia->save();\n $bandera=0;\n }\n\n //reviso niveles del progresivo\n if(isset($maquina_de_layout['niveles'])){\n $i=1;\n foreach ($maquina_de_layout['niveles'] as $nivel) {\n if(!(filter_var($nivel['porc_visible']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='porc_visible';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['porc_visible']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n if(!(filter_var($nivel['porc_oculto']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='porc_oculto';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['porc_oculto']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n if(!(filter_var($nivel['base']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='base';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['base']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n if(!(filter_var($nivel['nombre_nivel']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='nombre_nivel';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['nombre_nivel']['valor'];\n\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n\n if(!(filter_var($nivel['base']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='base';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['base']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n if(!(filter_var($nivel['nombre_nivel']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='nombre_nivel';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['nombre_nivel']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n $i++;\n }\n }\n }\n\n if($detalle->count() == 1 ){\n $detalle[0]->correcto=$bandera;\n $detalle[0]->denominacion = $maquina_de_layout['denominacion'];\n $detalle[0]->porcentaje_devolucion = $maquina_de_layout['porcentaje_dev'];\n $detalle[0]->save();\n }\n\n }\n }\n $estado_relevamiento = EstadoRelevamiento::where('descripcion','finalizado')->get();\n $layout_parcial->id_estado_relevamiento = $estado_relevamiento[0]->id_estado_relevamiento; //finalizado\n $layout_parcial->save();\n return ['estado' => $estado_relevamiento[0]->descripcion,\n 'codigo' => 200 ];//codigo ok, dispara boton buscar en vista\n }", "public function validate() {\n \n if (in_array($this->ext, $this->allow) !==false){\n \n if ($this->size < 10000000 ) {\n if ($this->error === 0) {\n $enc = uniqid('',true).\".\".$this->ext;\n $dest = $_SERVER['DOCUMENT_ROOT'].'/'.'tempSTR/'.$enc;\n\n move_uploaded_file($this->filetmp, $dest);\n \n } else {\n echo \"something wrong with this image\";\n }\n } else {\n echo \"Your file is to big\";\n }\n\n } else {\n echo \"You can't upload image with this exstension\";\n }\n }", "abstract public function validateData($data);", "public function rules()\n\t{\n\t\treturn [\n\t\t\t//\n\t\t\t'nama' => 'required',\n\t\t\t'file' => 'required|mimes:pdf,doc,docx|max:5120',\n\t\t];\n\t}", "public function isValid($data)\n {\n $rules = array(\n 'fechaPartido'=> 'required',\n 'fecha_id' => 'required'\n \n \n );\n \n $validator = Validator::make($data, $rules);\n \n if ($validator->passes())\n {\n return true;\n }\n \n $this->errors = $validator->errors();\n \n return false;\n }", "public function rules()\n {\n return [\n \n 'nome' => 'string|required|max:254',\n 'data' => 'required|date|after_or_equal:1910-01-01',\n 'nat_cidade'=> 'string|required|max:254',\n 'rua'=> 'string|required|max:254',\n 'bairro'=> 'string|required|max:254',\n 'cidade'=> 'string|required|max:254',\n 'estado'=> 'string|required|max:254',\n 'cep'=> 'string|required|max:254',\n 'tel' => 'required', \n 'cidade' => 'string|required|max:25',\n 'estado' => 'required',\n 'turno'=> 'required',\n 'nomef1'=> 'string|required|max:254',\n 'nomef2'=> 'string|required|max:254',\n 'dataf1'=> 'required|date|after_or_equal:1910-01-01',\n 'dataf2'=> 'required|date|after_or_equal:1910-01-01',\n 'cidadef1'=> 'string|required|max:254',\n 'cidadef2'=> 'string|required|max:254',\n 'estadof1'=> 'string|required|max:254',\n 'estadof2'=> 'string|required|max:254',\n 'documento.*' => 'required|file|mimes:jpeg,jpg,pdf,PDF|max:5000',\n 'documento_opcional.*' => 'file|mimes:jpeg,jpg,pdf,PDF|max:5000',//5MB\n ];\n }", "public static function xlsValidate()\n {\n $file = $_FILES['file']['name'];\n $file_part = pathinfo($file);\n $extension = $file_part['extension'];\n $support_extention = array('xls', 'xlsx');\n if (! in_array($extension, $support_extention)) {\n throw new PointException('FILE FORMAT NOT ACCEPTED, PLEASE USE XLS OR XLSX EXTENTION');\n }\n }", "public function validateFile()\n {\n $totalChunks = $this->getTotalChunks();\n $totalChunksSize = 0;\n\n for ($i = $totalChunks; $i >= 1; $i--) {\n $file = $this->getChunkPath($i);\n if (!file_exists($file)) {\n return false;\n }\n $totalChunksSize += filesize($file);\n }\n\n return $this->getTotalSize() == $totalChunksSize;\n }", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "function importar_requerimientos_operaciones(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $proy_id = $post['proy_id']; /// proy id\n $pfec_id = $post['pfec_id']; /// pfec id\n $com_id = $post['com_id']; /// com id\n \n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); /// DATOS DEL PROYECTO\n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// DATOS DE LA FASE ACTIVA\n\n $monto_asig=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],1);\n $monto_prog=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],2);\n $saldo=round(($monto_asig[0]['monto']-$monto_prog[0]['monto']),2);\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n\n $lineas = file($archivotmp);\n if($this->suma_monto_total($lineas)<=$saldo){\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n \n if(count($datos)==21){\n $cod_ope = (int)$datos[0]; //// Codigo Operacion\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $verif_com_ope=$this->model_producto->verif_componente_operacion($com_id,$cod_ope);\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[3])); //// descripcion\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $cantidad = (int)$datos[5]; //// Cantidad\n $unitario = (float)$datos[6]; //// Costo Unitario\n $total = (float)$datos[7]; //// Costo Total\n if(!is_numeric($unitario)){\n if($cantidad!=0){\n $unitario=round(($total/$cantidad),2); \n }\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $observacion = utf8_encode(trim($datos[20])); //// Observacion\n\n if(count($verif_com_ope)==1 & count($par_id)!=0 & $cod_partida!=0){\n $nro++;\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_unidad_medida' => strtoupper($unidad), /// Insumo Unidad de Medida\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fecha_creacion' => date(\"d/m/Y H:i:s\"),\n 'fun_id' => $this->session->userdata(\"fun_id\"), /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*----------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_com_ope[0]['prod_id'], /// act_id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n $gestion_fase=$fase[0]['pfec_fecha_inicio'];\n\n /*---------------- Recorriendo Gestiones de la Fase -----------------------*/\n for ($g=$fase[0]['pfec_fecha_inicio']; $g <=$fase[0]['pfec_fecha_fin'] ; $g++){\n $data_to_store = array( \n 'ins_id' => $ins_id, /// Id Insumo\n 'g_id' => $g, /// Gestion\n 'insg_monto_prog' => $total, /// Monto programado\n );\n $this->db->insert('insumo_gestion', $data_to_store); ///// Guardar en Tabla Insumo Gestion\n $insg_id=$this->db->insert_id();\n\n $ptto_fase_gestion = $this->model_faseetapa->fase_gestion($fase[0]['id'],$g); //// DATOS DE LA FASE GESTION\n $fuentes=$this->model_faseetapa->fase_presupuesto_id($ptto_fase_gestion[0]['ptofecg_id']);\n\n if(count($fuentes)==1){\n /*------------------- Guardando Fuente Financiamiento ------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store3 = array( \n 'insg_id' => $insg_id, /// Id Insumo gestion\n 'ifin_monto' => $total, /// Monto programado\n 'ifin_gestion' => $g, /// Gestion\n 'ffofet_id' => $fuentes[0]['ffofet_id'], /// ffotet id\n 'ff_id' => $fuentes[0]['ff_id'], /// ff id\n 'of_id' => $fuentes[0]['of_id'], /// ff id\n 'nro_if' => 1, /// Nro if\n );\n $this->db->insert('insumo_financiamiento', $data_to_store3); ///// Guardar en Tabla Insumo Financiamiento\n $ifin_id=$this->db->insert_id();\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array( \n 'ifin_id' => $ifin_id, /// Id Insumo Financiamiento\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('ifin_prog_mes', $data_to_store4); ///// Guardar en Tabla Insumo Financiamiento Programado Mes\n }\n }\n /*-----------------------------------------------------------*/ \n }\n }\n\n }\n\n }\n\n }\n $i++;\n }\n\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'');\n /*--------------------------------------------*/\n }\n else{\n $this->session->set_flashdata('danger','COSTO PROGRAMADO A SUBIR ES MAYOR AL SALDO POR PROGRAMAR. VERIFIQUE PLANTILLA A MIGRAR');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n } \n elseif (empty($file_basename)) {\n $this->session->set_flashdata('danger','POR FAVOR SELECCIONE ARCHIVO CSV');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n elseif ($filesize > 100000000) {\n $this->session->set_flashdata('danger','TAMAÑO DEL ARCHIVO');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n else {\n $mensaje = \"SOLO SE PERMITEN ESTOS ARCHIVOS : \" . implode(', ', $allowed_file_types);\n $this->session->set_flashdata('danger',$mensaje);\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n\n } else {\n show_404();\n }\n }", "public function validarColumnas($lista)\n {\n foreach ($lista as $key => $campo)\n {\n $pos=$key+1;\n if($campo!=$this->excel->sheets[0]['cells'][2][$pos])\n {\n $this->error=self::ERROR_ESTRUC;\n $this->errorComment.=\"<h5 class='nocargados'> El archivo '\".$this->nombreArchivo.\"' tiene la columna \".$this->excel->sheets[0]['cells'][2][$pos].\" en lugar de \".$campo.\"</h5> <br/>\";\n return false;\n }\n }\n $this->error=self::ERROR_NONE;\n return true;\n }", "public function isDataValid(): bool;", "public function validUpload() {\t\n\t\tif($this->file['error'] == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function uploadAction(Request $request)\n {\n $helpers = $this->get(\"app.helpers\");\n $hash = $request->get(\"authorization\", null);\n $authCheck = $helpers->authCheck($hash);\n\n if ($authCheck== true) {\n $json = $request->get(\"data\",null);\n $params = json_decode($json);\n \n $em = $this->getDoctrine()->getManager();\n $file = $request->files->get('file');\n\n if ($file->guessExtension() == 'txt') {\n $documentoName = md5(uniqid()).$file->guessExtension();\n $file->move(\n $this->getParameter('data_upload'),\n $documentoName\n ); \n\n $archivo = fopen($this->getParameter('data_upload').$documentoName , \"r\" );\n\n $batchSize = 500;\n $arrayComparendos = null;\n $transacciones = null;\n $procesados = 0;\n $errores = 0;\n $rows = 0;\n $cols = 0;\n\n //Longitud de columnas según el tipo de fuente: 1-STTDN, 2-POLCA, 3 SIMIT\n if ($params->tipoFuente == 1) {\n $length = 59;\n }elseif ($params->tipoFuente == 2) {\n $length = 57;\n }elseif ($params->tipoFuente == 3) {\n $length = 63;\n }\n\n if($params->idOrganismoTransito) {\n $organismoTransito = $em->getRepository('JHWEBConfigBundle:CfgOrganismoTransito')->find($params->idOrganismoTransito);\n }\n\n if ($archivo) {\n //Leo cada linea del archivo hasta un maximo de caracteres (0 sin limite)\n while ($datos = fgets($archivo))\n {\n $datos = explode(\";\",$datos);\n $cols = count($datos);\n\n if ($cols == $length) {\n $datos = array_map(\"utf8_encode\", $datos);\n \n $arrayComparendos[] = array(\n 'consecutivo'=>$datos[1],\n 'fecha'=>$helpers->convertDateTime($datos[2]),\n 'hora'=>$datos[3],\n 'direccion'=>$datos[4],\n 'divipoDireccion'=>$datos[5],\n 'localidad'=>$datos[6],\n 'placa'=>$datos[7],\n 'divipoMatriculado'=>$datos[8],\n 'vehiculoClase'=>$datos[9],\n 'vehiculoServicio'=>$datos[10],\n 'vehiculoRadioAccion'=>$datos[11],\n 'vehiculoModalidaTransporte'=>$datos[12],\n 'vehiculoTransportePasajeros'=>$datos[13],\n 'identificacion'=>$datos[14],\n 'idTipoIdentificacion'=>$datos[15],\n 'nombres'=>$datos[16],\n 'apellidos'=>$datos[17],\n 'infractorEdad'=>$datos[18],\n 'infractorDireccion'=>$datos[19],\n 'infractorCorreo'=>$datos[20],\n 'infractorTelefono'=>$datos[21],\n 'infractorDivipoResidencia'=>$datos[22],\n 'licenciaConduccionNumero'=>$datos[23],\n 'licenciaConduccionCategoria'=>$datos[24],\n 'licenciaConduccionDivipo'=>$datos[25],\n 'licenciaConduccionFechaVencimiento'=>$datos[26],\n 'tipoInfractor'=>$datos[27],\n 'licenciaTransitoNumero'=>$datos[28],\n 'licenciaTransitoDivipo'=>$datos[29],\n 'infraccionCodigo' => $datos[55],\n 'infraccionValor'=>$datos[56],\n 'gradoAlcoholemia'=>$datos[57],\n 'organismoTransito'=>$organismoTransito,\n 'tipoFuente'=>$params->tipoFuente,\n );\n \n if ((count($arrayComparendos) % $batchSize) == 0 && $arrayComparendos != null) {\n $transacciones[] = $this->insertBatch($arrayComparendos, $rows);\n $arrayComparendos = null;\n }\n }else{\n $fila = $rows + 1;\n $registros[] = array(\n 'title' => 'Atencion!',\n 'status' => 'warning',\n 'code' => 400,\n 'message' => \"Error! Fila:(\".$fila.\") No cumple con la longitud del formato estandar.\",\n );\n \n $transacciones[] = array(\n 'errores' => 1,\n 'registros' => $registros,\n );\n }\n\n $rows++;\n }\n\n fclose($archivo);\n\n if ($arrayComparendos) {\n $transacciones[] = $this->insertBatch($arrayComparendos, $rows);\n }\n\n $response = array(\n 'title' => 'Perfecto!',\n 'status' => 'success',\n 'code' => 200,\n 'message' => 'Se han procesado '.$rows.' líneas.', \n 'data' => $transacciones,\n );\n }else{\n $response = array(\n 'title' => 'Atención!',\n 'status' => 'warning',\n 'code' => 400,\n 'message' => \"No se pudo leer el archivo.\", \n );\n }\n } else {\n $response = array(\n 'title' => 'Atención!',\n 'status' => 'warning',\n 'code' => 400,\n 'message' => \"El formato del archivo no corresponde a .txt.\", \n );\n } \n }else{\n $response = array(\n 'title' => 'Error!',\n 'status' => 'error',\n 'code' => 400,\n 'message' => \"Autorizacion no valida\", \n );\n } \n \n return $helpers->json($response);\n }", "public function isDataValid() {\n if ($this->userExists())\n $this->_errors[] = 'username already taken';\n // username and password must match pattern\n else if (empty($this->_username) || !preg_match('/^[a-zA-Z0-9]{5,16}$/', $this->_username))\n $this->_errors[] = 'invalid username must be between 5 and 16 characters';\n else if (empty($this->_password) || !preg_match('/^[a-zA-Z0-9]{6,18}$/', $this->_password))\n $this->_errors[] = 'invalid password must be between 6 and 18 characters';\n\t\t else if (empty($this->_password) || $this->_password != $this->_password_confirm)\n $this->_errors[] = \"Password didn't match X\";\n // names must be between 2 and 22 characters\n else if (empty($this->_first_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_first_name))\n $this->_errors[] = 'invalid first name must be between 2 and 22 characters';\n else if (empty($this->_last_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_last_name))\n $this->_errors[] = 'invalid last name must be between 2 and 22 characters';\n //restricts day to 01-31, month to 01-12 and year to 1900-2099 (also allowing / - or . between the parts of the date) \n else if (empty($this->_dob) || !preg_match('/^(0?[1-9]|[12][0-9]|3[01])[\\/\\ ](0?[1-9]|1[0-2])[\\/\\ ](19|20)\\d{2}$/', $this->_dob))\n $this->_errors[] = 'invalid dod | must be DD/MM/YYYY format';\n else if (empty($this->_address))\n $this->_errors[] = 'invalid address';\n // checks if valid postal code\n else if (empty($this->_postcode) || !preg_match('/^(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})$/', $this->_postcode))\n $this->_errors[] = 'invalid postcode | must be AA11 9AA format';\n // checks is valid email using regular expression\n else if (empty($this->_email) || !preg_match('/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}$/', $this->_email))\n $this->_errors[] = 'invalid email';\n\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "public function importarAdministrativos($archivo=$this->archivo){\n $lineas = file($archivo); \n $i=0; \n foreach ($lineas as $linea_num => $linea)\n { \n if($i != 0) \n { \n $administrativos = explode(\";\",$linea);\n $dni=trim($administrativos[0]);\n $apellidos=trim($administrativos[1]);\n $nombre = trim($administrativos[2]);\n $dependencia =trim($administrativos[3]);\n $telefono = trim($administrativos[4]);\n $correo = trim($administrativos[5]);\n $categoria = trim($administrativos[6]);\n $cargo= trim($administrativos[7]); \n mysql_query(\"INSERT INTO administrativos(nombre,edad,profesion) \n VALUES('$dni,'$apellidos','$nombre','$dependencia','$telefono','$correo','$categoria','$cargo')\");\n } \n $i++;\n }\n}", "public function isValid() {\n\n foreach ($this->entity as $nameColumn => $column) {\n\n $validate = null;\n // Se for chave primaria e tiver valor, valida inteiro somente sem nenhuma outra validacao.\n if ($column['contraint'] == 'pk' && $column['value']) {\n $validate = new Zend_Validate_Digits();\n } else {\n\n//______________________________________________________________________________ VALIDANDO POR TIPO DA COLUNA NO BANCO\n // Se tiver valor comeca validacoes de acordo com o tipo.\n // Se nao pergunta se é obrigatorio, se for obrigatorio valida.\n if ($column['value']) {\n // Se for inteiro\n if ($column['type'] == 'integer' || $column['type'] == 'smallint') {\n $validate = new Zend_Validate_Digits();\n // Se for data\n } else if ($column['type'] == 'numeric') {\n $column['value'] = str_replace('.', '', $column['value']);\n $column['value'] = (float) str_replace(',', '.', $column['value']);\n $validate = new Zend_Validate_Float();\n } else if ($column['type'] == 'date') {\n\n\t\t\t\t\t\t$posBarra = strpos($column['value'], '/');\n\t\t\t\t\t\t$pos = strpos($column['value'], '-');\n\t\t\t\t\t\tif ($posBarra !== false) {\n\t\t\t\t\t\t\t$date = explode('/', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[0], $date[2])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\t$date = explode('-', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[2], $date[0])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n // Se for texto\n } else if ($column['type'] == 'character' || $column['type'] == 'character varying') {\n\n // Se for Bollean\n } else if ($column['type'] == 'boolean') {\n\n // Se for texto\n } else if ($column['type'] == 'text') {\n \n } else if ($column['type'] == 'timestamp without time zone') {\n if (strpos($column['value'], '/')) {\n\n if (strpos($column['value'], ' ')) {\n $arrDate = explode(' ', $column['value']);\n\n // Validando a data\n $date = explode('/', $arrDate[0]);\n if (!checkdate($date[1], $arrDate[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[0] . self::MSG_DATA_INVALIDA));\n }\n\n // Validando a hora\n $validateTime = new Zend_Validate_Date('hh:mm');\n $validateTime->isValid($arrDate[1]);\n if ($validateTime->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[1] . self::MSG_DATA_HORA_INVALIDA));\n }\n } else {\n // Validando a data\n $date = explode('/', trim($column['value']));\n if (!checkdate($date[1], $date[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n }\n }\n }\n }\n\n//______________________________________________________________________________ VALIDANDO POR LIMITE DA COLUNA NO BANCO\n // Validando quantidade de caracteres.\n if ($column['maximum']) {\n $validateMax = new Zend_Validate_StringLength(array('max' => $column['maximum']));\n $validateMax->isValid($column['value']);\n if ($validateMax->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => (reset($validateMax->getMessages())));\n }\n $validateMax = null;\n }\n } else {\n//______________________________________________________________________________ VALIDANDO POR NAO VAZIO DA COLUNA NO BANCO\n // Validando se nao tiver valor e ele for obrigatorio.\n if ($column['is_null'] == 'NO' && $column['contraint'] != 'pk') {\n $validate = new Zend_Validate_NotEmpty();\n }\n }\n\n//______________________________________________________________________________ VALIDANDO A CLOUNA E COLOCANDO A MENSAGEM\n if ($validate) {\n $validate->isValid($column['value']);\n if ($validate->getErrors()) {\n\t\t\t\t\t\t$msg = $validate->getMessages();\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ( reset($msg) ));\n }\n\n $validate = null;\n }\n }\n }\n\t\t\n if ($this->error)\n return false;\n else\n return true;\n }", "public function validarCadastro(){\n $valido = true;\n if(strlen($this->__get('nome')) < 3){\n $valido = false;\n }\n if(strlen($this->__get('email')) < 3){\n $valido = false;\n }\n if(strlen($this->__get('senha')) < 3){\n $valido = false;\n }\n\n return $valido;\n }", "function __validFecha($fecha){\n $test_arr = explode('/', $fecha);\n if (count($test_arr) == 3) {\n if (checkdate($test_arr[1], $test_arr[0], $test_arr[2])) {//MES / DIA / YEAR\n return true;\n }\n return false;\n }\n return false;\n }", "public function loadFile ($arquivo) {\n\t\t#################################################################################\n\t\t## Variáveis globais\n\t\t#################################################################################\n\t\tglobal $log;\n\t\t\n\t\t#################################################################################\n\t\t## Verifica se o arquivo existe\n\t\t#################################################################################\n\t\tif (!file_exists($arquivo)) \t{\n\t\t\t$this->adicionaErro(0, 0, null, 'Arquivo não encontrado ('.$arquivo.') ');\n\t\t\tthrow new \\Exception('Arquivo não encontrado ('.$arquivo.') ');\n\t\t}\n\n\t\t#################################################################################\n\t\t## Verifica se o arquivo pode ser lido\n\t\t#################################################################################\n\t\tif (!is_readable($arquivo)) \t{\n\t\t\t$this->adicionaErro(0, 0, null, 'Arquivo não pode ser lido ('.$arquivo.') ');\n\t\t\tthrow new \\Exception('Arquivo não pode ser lido ('.$arquivo.') ');\n\t\t}\n\n\t\t#################################################################################\n\t\t## Lê o arquivo\n\t\t#################################################################################\n\t\t$lines\t= file($arquivo);\n\t\t\n\t\t#################################################################################\n\t\t## Verifica se o arquivo tem informação\n\t\t#################################################################################\n\t\tif (sizeof($lines) < 2) {\n\t\t\t$this->adicionaErro(0, 0, null, 'Arquivo sem informações ('.$arquivo.') ');\n\t\t\tthrow new \\Exception('Arquivo sem informações ('.$arquivo.') ');\n\t\t}\n\t\t \n\t\t#################################################################################\n\t\t## Percorre as linhas do arquivo\n\t\t#################################################################################\n\t\tfor ($i = 0; $i < sizeof($lines); $i++) {\n\t\t\t$codTipoReg\t\t= substr($lines[$i],7 ,1);\n\t\t\t//$log->info(\"Tipo de registro encontrado: $codTipoReg\");\n\t\t\tif ($codTipoReg == 3) {\n\t\t\t\t$codSegmento\t= substr($lines[$i],13 ,1);\n\t\t\t}else{\n\t\t\t\t$codSegmento\t= \"\";\n\t\t\t}\n\t\t\t$tipoReg\t\t= \"R\".$codTipoReg.$codSegmento;\n\t\t\t$linha\t\t\t= str_replace(array(\"\\n\", \"\\r\"), '', $lines[$i]); \n\t\t\t$reg\t\t\t= $this->adicionaRegistro($tipoReg);\n\t\t\tif ($reg === null) {\n\t\t\t\tcontinue;\n\t\t//\t\t$this->adicionaErro(0, $i+1, null, \"Linha fora do padrão definido\");\n\t\t//\t\treturn;\n\t\t\t}else{\n\t\t\t\t$ok\t\t\t= $this->registros[$reg]->carregaLinha($linha);\n\t\t\t}\n\t\t\t\n\t\t\tif ($ok !== true) \t{\n\t\t\t\t$log->err(\"Erro no tipo de registro: $codTipoReg, CodSegmento: $codSegmento, mensagem: $ok\");\n\t\t\t\t$this->adicionaErro(0, $this->registros[$reg]->getLinha(), $this->registros[$reg]->getTipoRegistro(), $ok);\n\t\t\t}\n\t\t}\n\n\t}", "function importar_operaciones_requerimientos(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $com_id = $this->security->xss_clean($post['com_id']); /// com id\n $componente = $this->model_componente->get_componente_pi($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']);\n $list_oregional=$this->model_objetivoregion->list_proyecto_oregional($fase[0]['proy_id']); /// Lista de Objetivos Regionales\n $tp = $this->security->xss_clean($post['tp']); /// tipo de migracion\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n $guardado=0;\n $no_guardado=0;\n $nro_prod=count($this->model_producto->list_prod($com_id));\n if($nro_prod!=0){\n $ope_ult=$this->model_producto->ult_operacion($com_id);\n $nro_prod=$ope_ult[0]['prod_cod']+1;\n }\n else{\n $nro_prod=1;;\n }\n\n if($tp==1){ /// Actividades\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n if(count($datos)==21){\n\n $cod_or = trim($datos[0]); // Codigo Objetivo Regional\n $cod_ope = $nro_prod; // Codigo Operacion\n $descripcion = utf8_encode(trim($datos[2])); //// descripcion Operacion\n $resultado = utf8_encode(trim($datos[3])); //// descripcion Resultado\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $indicador = utf8_encode(trim($datos[5])); //// descripcion Indicador\n $lbase = utf8_encode(trim($datos[6])); //// Linea Base\n if(trim($datos[6])==''){\n $lbase = 0; //// Linea Base\n }\n\n $meta = utf8_encode(trim($datos[7])); //// Meta\n if(trim($datos[7])==''){\n $meta = 0; //// Meta\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $mverificacion = utf8_encode(trim($datos[20])); //// Medio de verificacion\n\n $ae=0;\n $or_id=0;\n if(count($list_oregional)!=0){\n $get_acc=$this->model_objetivoregion->get_alineacion_proyecto_oregional($fase[0]['proy_id'],$cod_or);\n if(count($get_acc)!=0){\n $ae=$get_acc[0]['ae'];\n $or_id=$get_acc[0]['or_id'];\n }\n }\n\n /*--- INSERTAR DATOS OPERACIONES (ACTIVIDADES 2020) ---*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array(\n 'com_id' => $com_id,\n 'prod_producto' => strtoupper($descripcion),\n 'prod_resultado' => strtoupper($resultado),\n 'indi_id' => 1,\n 'prod_indicador' => strtoupper($indicador),\n 'prod_fuente_verificacion' => strtoupper($mverificacion), \n 'prod_linea_base' => $lbase,\n 'prod_meta' => $meta,\n 'prod_unidades' => $unidad,\n 'acc_id' => $ae,\n 'prod_ppto' => 1,\n 'fecha' => date(\"d/m/Y H:i:s\"),\n 'prod_cod'=>$cod_ope,\n 'or_id'=>$or_id,\n 'fun_id' => $this->fun_id,\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('_productos', $data_to_store);\n $prod_id=$this->db->insert_id(); \n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0){\n $this->model_producto->add_prod_gest($prod_id,$this->gestion,$p,$m[$p]);\n }\n }\n\n $producto=$this->model_producto->get_producto_id($prod_id);\n if(count($producto)!=0){\n $guardado++;\n }\n else{\n $no_guardado++;\n }\n\n $nro_prod++;\n }\n }\n $i++;\n }\n \n }\n else{ /// Requerimientos\n\n foreach ($lineas as $linea_num => $linea){\n if($i != 0){\n $datos = explode(\";\",$linea);\n //echo count($datos).'<br>';\n if(count($datos)==20){\n \n $prod_cod = (int)$datos[0]; //// Codigo Actividad\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[2])); //// descripcion\n $unidad = utf8_encode(trim($datos[3])); //// Unidad\n $cantidad = (int)$datos[4]; //// Cantidad\n $unitario = $datos[5]; //// Costo Unitario\n \n $p_total=($cantidad*$unitario);\n $total = $datos[6]; //// Costo Total\n\n $var=7; $sum_temp=0;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n $sum_temp=$sum_temp+$m[$i];\n }\n\n $observacion = utf8_encode(trim($datos[19])); //// Observacion\n $verif_cod=$this->model_producto->verif_componente_operacion($com_id,$prod_cod);\n \n //echo count($verif_cod).'--'.count($par_id).'--'.$cod_partida.'--'.round($sum_temp,2).'=='.round($total,2);\n\n if(count($verif_cod)!=0 & count($par_id)!=0 & $cod_partida!=0 & round($sum_temp,2)==round($total,2)){ /// Verificando si existe Codigo de Actividad, par id, Codigo producto\n // if($verif_cod[0]['prod_ppto']==1){ /// guardando si tiene programado presupuesto en la operacion\n $guardado++;\n /*-------- INSERTAR DATOS REQUERIMIENTO ---------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_unidad_medida' => $unidad, /// Unidad de Medida\n 'ins_gestion' => $this->gestion, /// Insumo gestion\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fun_id' => $this->fun_id, /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*--------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_cod[0]['prod_id'], /// prod id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array(\n 'ins_id' => $ins_id, /// Id Insumo\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('temporalidad_prog_insumo', $data_to_store4);\n }\n }\n // }\n\n }\n \n\n } /// end dimension (22)\n } /// i!=0\n\n $i++;\n\n }\n\n /// --- ACTUALIZANDO MONEDA PARA CARGAR PRESUPUESTO\n $this->update_ptto_operaciones($com_id);\n } /// end else\n\n $this->session->set_flashdata('success','SE REGISTRARON '.$guardado.' REQUERIMIENTOS');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n else{\n $this->session->set_flashdata('danger','SELECCIONE ARCHIVO ');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n }\n else{\n echo \"Error !!\";\n }\n }", "private function valid_csv ($file_path) {\n $csv_mime_types = [ \n 'text/csv',\n 'text/plain',\n 'application/csv',\n 'text/comma-separated-values',\n 'application/excel',\n 'application/vnd.ms-excel',\n 'application/vnd.msexcel',\n 'text/anytext',\n 'application/octet-stream',\n 'application/txt',\n ];\n $finfo = finfo_open( FILEINFO_MIME_TYPE );\n $mime_type = finfo_file( $finfo, $file_path );\n\n return in_array( $mime_type, $csv_mime_types );\n }", "function validarDatosRegistro() {\r\n // Recuperar datos Enviados desde formulario_nuevo_equipo.php\r\n $datos = Array();\r\n $datos[0] = (isset($_REQUEST['marca']))?\r\n $_REQUEST['marca']:\"\";\r\n $datos[1] = (isset($_REQUEST['modelo']))?\r\n $_REQUEST['modelo']:\"\";\r\n $datos[2] = (isset($_REQUEST['matricula']))?\r\n $_REQUEST['matricula']:\"\";\r\n \r\n //-----validar ---- //\r\n $errores = Array();\r\n $errores[0] = !validarMarca($datos[0]);\r\n $errores[1] = !validarModelo($datos[1]);\r\n $errores[2] = !validarMatricula($datos[2]);\r\n \r\n // ----- Asignar a variables de Sesión ----//\r\n $_SESSION['datos'] = $datos;\r\n $_SESSION['errores'] = $errores; \r\n $_SESSION['hayErrores'] = \r\n ($errores[0] || $errores[1] ||\r\n $errores[2]);\r\n \r\n}", "function guardarDatos()\n {\n $miArchivo = \"datos.json\";\n $arreglo = array();\n\n try{\n $datosForma = array(\n 'nombreProducto'=> $_POST['nombre'],\n 'nombreCliente'=> $_POST['cliente'],\n 'precio'=> $_POST['precio'],\n 'fechaPedido'=> $_POST['fechaPedido'],\n 'fechaEntrega'=> $_POST['fechaEntrega']\n );\n\n if(file_get_contents($miArchivo) != null)\n {\n $jsondata = file_get_contents($miArchivo);\n\n $arreglo = json_decode($jsondata,true);\n }\n\n array_push($arreglo, $datosForma);\n\n $jsondata = json_encode($arreglo, JSON_PRETTY_PRINT);\n\n if(file_put_contents($miArchivo, $jsondata))\n return true;\n else\n return false;\n }catch(Exception $e)\n {\n return false;\n }\n }", "public function store(Request $request)\n {\n\t//no se resive el archivo\n\t\t$this->validate($request,[\n 'nombre'=>['required','regex:/^[A-Z][A-Z,a-z, ,ñ,á,é,í,ó,ú]+$/'],\n 'apat'=>['required','regex:/^[A-Z][A-Z,a-z, ,ñ,á,é,í,ó,ú]+$/'],\n 'amat'=>['required','regex:/^[A-Z][A-Z,a-z, ,ñ,á,é,í,ó,ú]+$/'],\n 'empresa'=>['required','regex:/^[A-Z][A-Z,a-z, ,ñ,á,é,í,ó,ú]+$/'],\n 'telefono'=>['required','regex:/^[0-9]{10}$/'],\n\t\t 'calle'=>['required','regex:/^[A-Z][A-Z,a-z, ,ñ,á,é,í,ó,ú]+$/'],\n\t\t 'no_int'=>['required','regex:/^[0-9]/'],\n\t\t 'no_ext'=>['required','regex:/^[0-9]/'],\n\t\t 'colonia'=>['required','regex:/^[A-Z][A-Z,a-z, ,ñ,á,é,í,ó,ú]+$/'],\n\t\t 'cp'=>['required','regex:/^[0-9]{5}$/'],\n 'archivo' =>'required','image|mimes:jpg,jpeg,gif,png'\n ]);\n \n $file = $request->file('archivo');\n\t\tif($file!=\"\")\n\t\t{\n\t\t\t$ldate = date('Ymd_His_');\n\t\t\t$img = $file->getClientOriginalName();\n\t\t\t$img2 = $ldate.$img;\n\t\t\t\\Storage::disk('local')->put($img2, \\File::get($file));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$img2 = \"administrador.png\";\n\t\t}\n //insert into maestros... \n $clie = new clientes;\n $clie->archivo = $img2;\n $clie->nombre = $request->nombre;\n $clie->apat = $request->apat;\n $clie->amat = $request->amat;\n $clie->empresa = $request->empresa;\n $clie->telefono = $request->telefono;\n\t\t$clie->calle = $request->calle;\n\t\t$clie->no_int = $request->no_int;\n\t\t$clie->no_ext = $request->no_ext;\n\t\t$clie->colonia = $request->colonia;\n $clie->cp = $request->cp;\n $clie->idm = $request->idm;\n $clie->idu = $request->idu;\n $clie->ide = $request->ide;\n $clie->save();\n \n return redirect ('/head');\n }" ]
[ "0.6762713", "0.6621063", "0.6404361", "0.61944443", "0.6169977", "0.6148941", "0.61008704", "0.60850894", "0.5992615", "0.5992615", "0.59621143", "0.58643585", "0.58063287", "0.57949644", "0.5784715", "0.57690436", "0.5756957", "0.5751859", "0.57293427", "0.5688629", "0.568215", "0.56798106", "0.56729776", "0.564466", "0.558921", "0.5561802", "0.5559281", "0.5537761", "0.5530928", "0.5510033", "0.5501369", "0.5496506", "0.5494339", "0.54800576", "0.5472637", "0.54681474", "0.5462381", "0.5458354", "0.54529524", "0.5452803", "0.5443443", "0.54296947", "0.5423548", "0.54229033", "0.5408309", "0.54038906", "0.53918076", "0.53890353", "0.5382495", "0.53791374", "0.5365458", "0.5342881", "0.5331475", "0.53313684", "0.5330442", "0.5330158", "0.5327225", "0.53116083", "0.53085655", "0.5305063", "0.5300862", "0.5299129", "0.52746475", "0.5268626", "0.52608836", "0.5258307", "0.5258264", "0.52384603", "0.5232854", "0.52259964", "0.5218881", "0.52169335", "0.52093667", "0.5206717", "0.5196737", "0.51937133", "0.51935077", "0.51922286", "0.5191266", "0.5190714", "0.51872426", "0.51765794", "0.5171522", "0.5168428", "0.5167414", "0.51667166", "0.51622134", "0.51596236", "0.5157976", "0.51552653", "0.5152147", "0.51501864", "0.514939", "0.5147832", "0.5145472", "0.5143876", "0.5124789", "0.51210845", "0.51204807", "0.5120227" ]
0.61623245
5
Realizada a validacao dos dados da InfraEstrutura da escola
protected function validarDadosInfraEstrutura(IExportacaoCenso $oExportacaoCenso) { $lTodosDadosValidos = true; $oDadosEscola = $oExportacaoCenso->getDadosProcessadosEscola(); $aDadosTurma = $oExportacaoCenso->getDadosProcessadosTurma(); $aEquipamentosValidacao = array( 0 => "equipamentos_existentes_escola_televisao", 1 => "equipamentos_existentes_escola_videocassete", 2 => "equipamentos_existentes_escola_dvd", 3 => "equipamentos_existentes_escola_antena_parabolica", 4 => "equipamentos_existentes_escola_copiadora", 5 => "equipamentos_existentes_escola_retroprojetor", 6 => "equipamentos_existentes_escola_impressora", 7 => "equipamentos_existentes_escola_aparelho_som", 8 => "equipamentos_existentes_escola_projetor_datashow", 9 => "equipamentos_existentes_escola_fax", 10 => "equipamentos_existentes_escola_maquina_fotografica" ); $aEstruturaValidacao = array( 3000032 => "equipamentos_existentes_escola_computador", 3000003 => "quantidade_computadores_uso_administrativo", 3000024 => "quantidade_computadores_uso_alunos", 3000019 => "numero_salas_aula_existentes_escola", 3000020 => "numero_salas_usadas_como_salas_aula" ); $aDependenciasEscola = array( "dependencias_existentes_escola_sala_professores", "dependencias_existentes_escola_bercario", "dependencias_existentes_escola_despensa", "dependencias_existentes_escola_area_verde", "dependencias_existentes_escola_almoxarifado", "dependencias_existentes_escola_auditorio", "dependencias_existentes_escola_banheiro_alunos_def", "dependencias_existentes_escola_banheiro_chuveiro", "dependencias_existentes_escola_sala_leitura", "dependencias_existentes_escola_sala_recursos_multi", "dependencias_existentes_escola_banheiro_educ_infan", "dependencias_existentes_escola_cozinha", "dependencias_existentes_escola_alojamento_professo", "dependencias_existentes_escola_laboratorio_ciencia", "dependencias_existentes_escola_patio_coberto", "dependencias_existentes_escola_alojamento_aluno", "dependencias_existentes_escola_laboratorio_informa", "dependencias_existentes_escola_refeitorio", "dependencias_existentes_escola_parque_infantil", "dependencias_existentes_escola_banheiro_fora_predi", "dependencias_existentes_escola_quadra_esporte_desc", "dependencias_existentes_escola_sala_secretaria", "dependencias_existentes_escola_dep_vias_alunos_def", "dependencias_existentes_escola_banheiro_dentro_pre", "dependencias_existentes_escola_lavanderia", "dependencias_existentes_escola_quadra_esporte_cobe", "dependencias_existentes_escola_biblioteca", "dependencias_existentes_escola_sala_diretoria", "dependencias_existentes_escola_patio_descoberto", "dependencias_existentes_escola_nenhuma_relacionada" ); $aModalidadesEtapas = array( "modalidade_ensino_regular", "modalidade_educacao_especial_modalidade_substutiva", "modalidade_educacao_jovens_adultos", "etapas_ensino_regular_creche", "etapas_ensino_regular_pre_escola", "etapas_ensino_regular_ensino_fundamental_8_anos", "etapas_ensino_regular_ensino_fundamental_9_anos", "etapas_ensino_regular_ensino_medio_medio", "etapas_ensino_regular_ensino_medio_integrado", "etapas_ensino_regular_ensino_medio_normal_magister", "etapas_ensino_regular_ensino_medio_profissional", "etapa_educacao_especial_creche", "etapa_educacao_especial_pre_escola", "etapa_educacao_especial_ensino_fundamental_8_anos", "etapa_educacao_especial_ensino_fundamental_9_anos", "etapa_educacao_especial_ensino_medio_medio", "etapa_educacao_especial_ensino_medio_integrado", "etapa_educacao_especial_ensino_medio_normal_magist", "etapa_educacao_especial_ensino_medio_educ_profis", "etapa_educacao_especial_eja_ensino_fundamental", "etapa_educacao_especial_eja_ensino_medio", "etapa_eja_ensino_fundamental", "etapa_eja_ensino_fundamental_projovem_urbano", "etapa_eja_ensino_medio" ); foreach ($aEquipamentosValidacao as $sEquipamentoValidacao) { if (!DadosCensoEscola::validarEquipamentosExistentes($oExportacaoCenso, $oDadosEscola->registro10->$sEquipamentoValidacao)) { $lTodosDadosValidos = false; } break; } $iComputadorExistentes = 0; foreach ($aEstruturaValidacao as $iSequencial => $sEstruturaValidacao) { if( $iSequencial == 3000032 ) { if( !empty( $oDadosEscola->registro10->$sEstruturaValidacao ) ) { $iComputadorExistentes = $oDadosEscola->registro10->$sEstruturaValidacao; } } if( $iSequencial == 3000003 && $oDadosEscola->registro10->$sEstruturaValidacao != '' && ( $iComputadorExistentes == 0 || $iComputadorExistentes < $oDadosEscola->registro10->$sEstruturaValidacao ) ) { $lTodosDadosValidos = false; $sMensagem = "Quantidade de computadores informados para uso administrativo"; $sMensagem .= " ({$oDadosEscola->registro10->$sEstruturaValidacao}), é maior que a quantidade de"; $sMensagem .= " computadores existentes na escola ({$iComputadorExistentes})."; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $iSequencial == 3000024 && $oDadosEscola->registro10->$sEstruturaValidacao != '' && ( $iComputadorExistentes == 0 || $iComputadorExistentes < $oDadosEscola->registro10->$sEstruturaValidacao ) ) { $lTodosDadosValidos = false; $sMensagem = "Quantidade de computadores informados para uso dos alunos"; $sMensagem .= " ({$oDadosEscola->registro10->$sEstruturaValidacao}), é maior que a quantidade de"; $sMensagem .= " computadores existentes na escola ({$iComputadorExistentes})."; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if (!DadosCensoEscola::validarEquipamentosGeral($oExportacaoCenso, $iSequencial, $oDadosEscola->registro10->$sEstruturaValidacao)) { $lTodosDadosValidos = false; } } if( $iComputadorExistentes > 0 ) { if( $oDadosEscola->registro10->acesso_internet === '' ) { $sMensagem = "Deve ser informado se a escola possui acesso a internet ou não, pois foi informada a"; $sMensagem .= " quantidade de computadores que a mesma possui."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $oDadosEscola->registro10->acesso_internet == 1 && $oDadosEscola->registro10->banda_larga == '' ) { $sMensagem = "Deve ser informado se a escola possui banda larga, pois foi informado que a mesma"; $sMensagem .= " possui acesso a internet."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } if ($oDadosEscola->registro10->numero_cpf_responsavel_gestor_responsavel == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Número do CPF do gestor é obrigatório", ExportacaoCensoBase::LOG_ESCOLA); } if (trim($oDadosEscola->registro10->numero_cpf_responsavel_gestor_responsavel) == "00000000191") { $lTodosDadosValidos = false; $sMensagem = "Número do CPF ({$oDadosEscola->registro10->numero_cpf_responsavel_gestor_responsavel}) do"; $sMensagem .= " gestor informado é inválido."; $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA); } if ($oDadosEscola->registro10->nome_gestor == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Nome do gestor é obrigatório", ExportacaoCensoBase::LOG_ESCOLA); } $sExpressao = '/([a-zA-Z])\1{3}/'; $lValidacaoExpressao = preg_match($sExpressao, $oDadosEscola->registro10->nome_gestor) ? true : false; if ($lValidacaoExpressao) { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Nome do gestor inválido. Não é possível informar mais de 4 letras repetidas em sequência.", ExportacaoCensoBase::LOG_ESCOLA); } if ($oDadosEscola->registro10->cargo_gestor_responsavel == '') { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Cargo do gestor é obrigatório", ExportacaoCensoBase::LOG_ESCOLA); } /** * Validações que serão executadas caso a situação de funcionamento seja igual a 1 * 1 - em atividade */ if ($oDadosEscola->registro00->situacao_funcionamento == 1) { if ($oDadosEscola->registro10->local_funcionamento_escola_predio_escolar == 0 && $oDadosEscola->registro10->local_funcionamento_escola_templo_igreja == 0 && $oDadosEscola->registro10->local_funcionamento_escola_salas_empresas == 0 && $oDadosEscola->registro10->local_funcionamento_escola_casa_professor == 0 && $oDadosEscola->registro10->local_funcionamento_escola_salas_outras_escolas == 0 && $oDadosEscola->registro10->local_funcionamento_escola_galpao_rancho_paiol_bar == 0 && $oDadosEscola->registro10->local_funcionamento_escola_un_internacao_prisional == 0 && $oDadosEscola->registro10->local_funcionamento_escola_outros == 0) { $sMensagem = "Deve ser selecionado pelo menos um local de funcionamento da escola."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } /** * Validações que serão executadas caso a situação de funcionamento seja igual a 1 * 1 - em atividade * e o local de funcionamento seja igual a 7 * 7 - Prédio escolar */ if ($oDadosEscola->registro10->local_funcionamento_escola_predio_escolar == 1) { if ( empty( $oDadosEscola->registro10->forma_ocupacao_predio ) ) { $sMensagem = "Escola Ativa. Deve ser selecionada uma forma de ocupação do prédio."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ($oDadosEscola->registro10->predio_compartilhado_outra_escola == '') { $sMensagem = "Escola Ativa. Deve ser informado se o prédio é compartilhado ou não com outra escola."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $oDadosEscola->registro10->predio_compartilhado_outra_escola == 1 ) { $iTotalCodigoVazio = 0; $lErroCodigoVazio = false; $lErroCodigoInvalido = false; for( $iContador = 1; $iContador <= 6; $iContador++ ) { $sCodigoEscolaCompartilhada = "codigo_escola_compartilha_" . $iContador; if( trim( $oDadosEscola->registro10->{$sCodigoEscolaCompartilhada} ) == '' ) { $iTotalCodigoVazio++; } if( trim( $oDadosEscola->registro10->{$sCodigoEscolaCompartilhada} ) != '' && strlen( trim( $oDadosEscola->registro10->{$sCodigoEscolaCompartilhada} ) ) != 8 ) { $lErroCodigoInvalido = true; } } if( $iTotalCodigoVazio == 6 ) { $lErroCodigoVazio = true; } if( $lErroCodigoVazio ) { $sMensagem = "Escola com prédio compartilhado. É necessário informar ao menos o código INEP de uma"; $sMensagem .= " escola que compartilhe o prédio."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $lErroCodigoInvalido ) { $sMensagem = "Código INEP de uma das escolas que compartilham o prédio, com tamanho inválido."; $sMensagem .= " Tamanho válido: 8 dígitos."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } } if ($oDadosEscola->registro10->agua_consumida_alunos == '') { $sMensagem = "Deve ser selecionada um tipo de água consumida pelos alunos."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ($oDadosEscola->registro10->destinacao_lixo_coleta_periodica == 0 && $oDadosEscola->registro10->destinacao_lixo_queima == 0 && $oDadosEscola->registro10->destinacao_lixo_joga_outra_area == 0 && $oDadosEscola->registro10->destinacao_lixo_recicla == 0 && $oDadosEscola->registro10->destinacao_lixo_enterra == 0 && $oDadosEscola->registro10->destinacao_lixo_outros == 0) { $lTodosDadosValidos = false; $oExportacaoCenso->logErro("Destinação do lixo da escola não informado.", ExportacaoCensoBase::LOG_ESCOLA); } $lNumeroSalasExistentesValido = true; if( !DBNumber::isInteger( trim( $oDadosEscola->registro10->numero_salas_aula_existentes_escola ) ) ) { $lNumeroSalasExistentesValido = false; $sMensagem = "Valor do 'N° de Salas de Aula Existentes na Escola' inválido. Deve ser"; $sMensagem .= " informado somente números."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ( $lNumeroSalasExistentesValido && trim( $oDadosEscola->registro10->numero_salas_aula_existentes_escola == 0 ) ) { $sMensagem = "O valor do campo 'N° de Salas de Aula Existentes na Escola' deve ser maior que 0."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } $lNumeroSalasUsadasValido = true; if( !DBNumber::isInteger( trim( $oDadosEscola->registro10->numero_salas_usadas_como_salas_aula ) ) ) { $lNumeroSalasUsadasValido = false; $sMensagem = "Valor do 'N° de Salas Utilizadas como Sala de Aula' inválido. Deve ser"; $sMensagem .= " informado somente números."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ( $lNumeroSalasUsadasValido && trim( $oDadosEscola->registro10->numero_salas_usadas_como_salas_aula == 0 ) ) { $sMensagem = "O valor do campo 'N° de Salas Utilizadas como Sala de Aula' deve ser maior de 0."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ($oDadosEscola->registro10->escola_cede_espaco_turma_brasil_alfabetizado == '') { $sMensagem = "Informe se a escola cede espaço para turmas do Brasil Alfabetizado."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ($oDadosEscola->registro10->escola_abre_finais_semanas_comunidade == '') { $sMensagem = "Informe se a escola abre aos finais de semana para a comunidade."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ($oDadosEscola->registro10->escola_formacao_alternancia == '') { $sMensagem = "Informe se a escola possui proposta pedagógica de formação por alternância."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if ( $oDadosEscola->registro00->dependencia_administrativa != 3 && trim( $oDadosEscola->registro10->alimentacao_escolar_aluno ) != 1 ) { $lTodosDadosValidos = false; $sMensagem = "Campo Alimentação na aba Infra estrutura do cadastro dados da escola deve ser "; $sMensagem .= "informado como Oferece, pois dependência administrativa é Municipal."; $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA); } if( $oDadosEscola->registro10->abastecimento_agua_inexistente == 1 ) { if( $oDadosEscola->registro10->abastecimento_agua_fonte_rio_igarape_riacho_correg == 1 || $oDadosEscola->registro10->abastecimento_agua_poco_artesiano == 1 || $oDadosEscola->registro10->abastecimento_agua_cacimba_cisterna_poco == 1 || $oDadosEscola->registro10->abastecimento_agua_rede_publica == 1 ) { $lTodosDadosValidos = false; $sMensagem = "Informação de abastecimento de água inválida. Ao selecionar a opção 'Inexistente'"; $sMensagem .= ", nenhum dos tipos de abastecimento deve ser selecionado."; $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA); } } if( $oDadosEscola->registro10->abastecimento_energia_eletrica_inexistente == 1 ) { if( $oDadosEscola->registro10->abastecimento_energia_eletrica_gerador == 1 || $oDadosEscola->registro10->abastecimento_energia_eletrica_outros_alternativa == 1 || $oDadosEscola->registro10->abastecimento_energia_eletrica_rede_publica == 1 ) { $lTodosDadosValidos = false; $sMensagem = "Informação de abastecimento de energia inválida. Ao selecionar a opção 'Inexistente'"; $sMensagem .= ", nenhum dos tipos de abastecimento deve ser selecionado."; $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA); } } if( $oDadosEscola->registro10->esgoto_sanitario_inexistente == 1 ) { if( $oDadosEscola->registro10->esgoto_sanitario_rede_publica == 1 || $oDadosEscola->registro10->esgoto_sanitario_fossa == 1 ) { $lTodosDadosValidos = false; $sMensagem = "Informação de esgoto sanitário inválida. Ao selecionar a opção 'Inexistente'"; $sMensagem .= ", nenhum dos tipos de abastecimento deve ser selecionado."; $oExportacaoCenso->logErro($sMensagem, ExportacaoCensoBase::LOG_ESCOLA); } } if( $oDadosEscola->registro10->dependencias_existentes_escola_nenhuma_relacionada == 1 ) { $lSelecionouDependencia = false; foreach( $aDependenciasEscola as $sDependencia ) { if( $oDadosEscola->registro10->{$sDependencia} != "dependencias_existentes_escola_nenhuma_relacionada" && $oDadosEscola->registro10->{$sDependencia} == 1 ) { $lSelecionouDependencia = true; break; } } if( $lSelecionouDependencia ) { $sMensagem = "Informação das dependências da escola inválida. Ao selecionar 'Nenhuma das dependências"; $sMensagem .= " relacionadas', nenhuma das outras dependências pode ser selecionada."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } /** * Variáveis para controlar o total de turmas existentes * 0 - Normal * 4 - AEE * 5 - AC */ $iTotalTurmaNormal = 0; $iTotalTurmaAC = 0; $iTotalTurmaAEE = 0; foreach( $aDadosTurma as $oDadosTurma ) { switch( $oDadosTurma->tipo_atendimento ) { case 0: $iTotalTurmaNormal++; break; case 4: $iTotalTurmaAC++; break; case 5: $iTotalTurmaAEE++; break; } } /** * Validações referentes as opções selecionadas em relação a Atividade Complementar( AC ) e Atendimento * Educacional Especializado( AEE ) * - atendimento_educacional_especializado * - atividade_complementar */ if( $oDadosEscola->registro10->atendimento_educacional_especializado == '' || $oDadosEscola->registro10->atividade_complementar == '' ) { $sMensagem = "É necessário marcar uma das opções referentes a Atendimento Educacional Especializado"; $sMensagem .= " e Atividade Complementar( Cadastros -> Dados da Escola -> Aba Infra Estrutura )."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $oDadosEscola->registro10->atendimento_educacional_especializado == 2 ) { if( $oDadosEscola->registro10->atividade_complementar == 2 ) { $sMensagem = "Atendimento Educacional Especializado e Atividade Complementar foram marcados como"; $sMensagem .= " 'Exclusivamente'. Ao marcar uma das opções como 'Exclusivamente', a outra deve"; $sMensagem .= " ser marcada como 'Não Oferece'."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $iTotalTurmaNormal > 0 ) { $sMensagem = "Atendimento Educacional Especializado marcado como 'Exclusivamente'. Ao marcar esta"; $sMensagem .= " opção, a escola não deve turmas de Ensino Regular, EJA e/ou Educação Especial, ou"; $sMensagem .= " deve ser alterada a opção marcada."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $iTotalTurmaAEE == 0 ) { $sMensagem = "Ao selecionar Atendimento Educacional Especializado como 'Exclusivamente', deve"; $sMensagem .= " existir na escola uma turma deste tipo criada e com aluno matriculado."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } if( $oDadosEscola->registro10->atividade_complementar == 2 ) { if( $iTotalTurmaNormal > 0 ) { $sMensagem = "Atividade Complementar marcada como 'Exclusivamente'. Ao marcar esta opção, a escola"; $sMensagem .= " não deve turmas de Ensino Regular, EJA e/ou Educação Especial, ou deve ser alterada"; $sMensagem .= " a opção marcada."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $iTotalTurmaAC == 0 ) { $sMensagem = "Ao selecionar Atividade Complementar como 'Exclusivamente', deve existir na escola"; $sMensagem .= " uma turma deste tipo criada e com aluno matriculado."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } if( ( $oDadosEscola->registro10->atendimento_educacional_especializado == 1 && $oDadosEscola->registro10->atividade_complementar == 2 ) || ( $oDadosEscola->registro10->atividade_complementar == 1 && $oDadosEscola->registro10->atendimento_educacional_especializado == 2 ) ) { $sMensagem = "Ao selecionar, ou Atendimento Educacional Especializado ou Atividade Complementar, como"; $sMensagem .= " 'Não Exclusivamente', obrigatoriamente a outra opção não poderá ser marcada como"; $sMensagem .= " 'Exclusivamente'."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $oDadosEscola->registro10->atendimento_educacional_especializado == 1 && $iTotalTurmaAEE == 0 ) { $sMensagem = "Ao selecionar Atendimento Educacional Especializado como 'Não Exclusivamente', deve"; $sMensagem .= " existir na escola uma turma deste tipo criada e com aluno matriculado."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $oDadosEscola->registro10->atividade_complementar == 1 && $iTotalTurmaAC == 0 ) { $sMensagem = "Ao selecionar Atividade Complementar como 'Não Exclusivamente', deve"; $sMensagem .= " existir na escola uma turma deste tipo criada e com aluno matriculado."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $oDadosEscola->registro10->atendimento_educacional_especializado == 0 && $iTotalTurmaAEE > 0 ) { $sMensagem = "Atendimento Educacional Especializado marcado como 'Não Oferece', porém a escola possui"; $sMensagem .= " turmas cadastradas para este tipo de atendimento."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } if( $oDadosEscola->registro10->atividade_complementar == 0 && $iTotalTurmaAC > 0 ) { $sMensagem = "Atividade Complementa marcado como 'Não Oferece', porém a escola possui turmas"; $sMensagem .= " cadastradas para este tipo de atendimento."; $lTodosDadosValidos = false; $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA ); } } return $lTodosDadosValidos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evt__validar_datos()\r\n\t{}", "public function validateDataInvoice(): void\n {\n $this->validarDatos($this->datos, $this->getRules('fe'));\n\n $this->validarDatosArray($this->datos->arrayOtrosTributos, 'tributos');\n\n /** @phpstan-ignore-next-line */\n if (property_exists($this->datos, 'arraySubtotalesIVA')) {\n $this->validarDatosArray((array) $this->datos->arraySubtotalesIVA, 'iva');\n }\n\n $this->validarDatosArray($this->datos->comprobantesAsociados, 'comprobantesAsociados');\n\n if ($this->ws === 'wsfe') {\n if (property_exists($this->datos, 'arrayOpcionales')) {\n $this->validarDatosArray((array) $this->datos->arrayOpcionales, 'opcionales');\n }\n } elseif ($this->ws === 'wsmtxca') {\n $this->validarDatosArray($this->datos->items, 'items');\n }\n }", "public function validaDatos(){\n\t\t\t\t\n\t\t\t\tif( $this->nombre == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su nombre por favor.</strong><br />\";\n\t\t\t\t\t}else if( strlen($this->nombre) > 20 ){\n\t\t\t\t\t\t$errores.= \"<strong>* Escriba un nombre con menos caracteres. (20 caracteres maximo - sin espacios)</strong><br />\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif( $this->email == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su email por favor.</strong><br />\";\n\t\t\t\t\t}else if( !preg_match($this->sintax,$this->email)){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese formato correcto de email</strong><br /> 'ej: nombre@dominio.com' .<br />\";\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $this->asunto == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su asunto por favor. </strong><br />\";\n\t\t\t\t\t}else if( strlen($this->asunto) > 20 ){\n\t\t\t\t\t\t$errores.= \"<strong>* Escriba un asunto con menos caracteres. (20 caracteres maximo - sin espacios) </strong><br />\";\n\t\t\t\t\t}\n\t\t\t\t\t\t\t \n\t\t\t\tif( $this->msj == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su mensaje por favor. </strong><br />\";\n\t\t\t\t\t}else if( strlen($this->msj) > 200 ){\n\t\t\t\t\t$this->errores.= \"<strong>* Maximo permitido 200 caracteres. </strong><br />\";\n\t\t\t\t\t}\n\t\t\t}", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "abstract public function validateData();", "public function validarDatos()\n\t\t{\n\t\t\treturn true;\n\t\t}", "public function validarDatos()\n\t\t{\n\t\t\treturn true;\n\t\t}", "public function validarDados(IExportacaoCenso $oExportacaoCenso) {\n\n $lTodosDadosValidos = true;\n $oDadosEscola = $oExportacaoCenso->getDadosProcessadosEscola();\n $sMensagem = \"\";\n\n /**\n * Início da validação dos campos obrigatórios\n */\n if( trim( $oDadosEscola->registro00->codigo_escola_inep ) == '' ) {\n\n $sMensagem = \"É necessário informar o código INEP da escola.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( trim( $oDadosEscola->registro00->codigo_escola_inep ) != '' ) {\n\n if( !DBNumber::isInteger( $oDadosEscola->registro00->codigo_escola_inep ) ) {\n\n $sMensagem = \"Código INEP da escola inválido. O código INEP deve conter apenas números.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( strlen( trim( $oDadosEscola->registro00->codigo_escola_inep ) ) != 8 ) {\n\n $sMensagem = \"Código INEP da escola inválido. O código INEP deve conter 8 dígitos.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n if (trim($oDadosEscola->registro00->nome_escola) == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Nome da Escola não pode ser vazio\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ( trim( $oDadosEscola->registro00->nome_escola ) != ''\n && strlen( $oDadosEscola->registro00->nome_escola ) < 4\n ) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Nome da Escola deve conter no mínimo 4 dígitos\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->cep == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo CEP é obrigatório\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if( !empty( $oDadosEscola->registro00->cep ) ) {\n\n if( !DBNumber::isInteger( $oDadosEscola->registro00->cep ) ) {\n\n $sMensagem = \"CEP inválido. Deve conter somente números.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if (strlen($oDadosEscola->registro00->cep) < 8) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"CEP da escola deve conter 8 dígitos.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n }\n\n if ($oDadosEscola->registro00->endereco == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Endereço da escola é obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->uf == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"UF da escolas é obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->municipio == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Munícipio da escola é obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->distrito == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Distrito é obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n /**\n * Validações que serão executadas caso a situação de funcionamento seja igual a 1\n * 1 - em atividade\n */\n if ($oDadosEscola->registro00->situacao_funcionamento == 1) {\n\n\n if (trim($oDadosEscola->registro00->codigo_orgao_regional_ensino) == '' && $oDadosEscola->registro00->lOrgaoEnsinoObrigatorio) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Orgão Regional de Ensino obrigatório.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->data_inicio_ano_letivo == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Data de Início do Ano Letivo é obrigatório\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->data_termino_ano_letivo == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Data de Término do Ano Letivo é obrigatório\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if( !empty( $oDadosEscola->registro00->data_inicio_ano_letivo )\n && !empty( $oDadosEscola->registro00->data_termino_ano_letivo ) ) {\n\n $oDataInicio = new DBDate( $oDadosEscola->registro00->data_inicio_ano_letivo );\n $oDataTermino = new DBDate( $oDadosEscola->registro00->data_termino_ano_letivo );\n\n if( DBDate::calculaIntervaloEntreDatas( $oDataInicio, $oDataTermino, 'd' ) > 0 ) {\n\n $sMensagem = \"A data de início do ano letivo não pode ser maior que a data de término.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $oExportacaoCenso->getDataCenso() != '' ) {\n\n $oDataCenso = new DBDate( $oExportacaoCenso->getDataCenso() );\n $iAnoAnterior = $oDataCenso->getAno() - 1;\n if( $oDataInicio->getAno() != $oDataCenso->getAno()\n && $oDataInicio->getAno() != $iAnoAnterior\n ) {\n\n $sMensagem = \"Data de início do ano letivo inválido. Ano informado: {$oDataInicio->getAno()}\";\n $sMensagem .= \" - Anos válidos: {$iAnoAnterior} ou {$oDataCenso->getAno()}\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( DBDate::calculaIntervaloEntreDatas( $oDataCenso, $oDataTermino, 'd' ) > 0\n || $oDataTermino->getAno() != $oDataCenso->getAno()\n ) {\n\n $sMensagem = \"Data de término do ano letivo inválido. O ano deve ser o mesmo do censo\";\n $sMensagem .= \" ( {$oDataCenso->getAno()} ), e a data não pode ser inferior a data de referência\";\n $sMensagem .= \" ( {$oDataCenso->getDate( DBDate::DATA_PTBR )} ).\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n }\n\n /**\n * Validações referentes aos telefones\n */\n for( $iContador = 0; $iContador <= 2; $iContador++ ) {\n\n $sPropriedadeTelefone = \"telefone\";\n $sMensagemTelefone = \"Telefone\";\n\n if( $iContador > 0 ) {\n\n $sPropriedadeTelefone = \"telefone_publico_{$iContador}\";\n $sMensagemTelefone = \"Telefone Público {$iContador}\";\n }\n\n if( $oDadosEscola->registro00->{$sPropriedadeTelefone} != '' ) {\n\n if( strlen( $oDadosEscola->registro00->{$sPropriedadeTelefone} ) < 8 ) {\n\n $sMensagem = \"Campo {$sMensagemTelefone} deve conter 8 dígitos\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ( substr($oDadosEscola->registro00->{$sPropriedadeTelefone}, 0, 1) != 9\n && strlen($oDadosEscola->registro00->{$sPropriedadeTelefone}) == 9\n ) {\n\n $sMensagem = \"Campo {$sMensagemTelefone}, ao conter 9 dígitos, o primeiro algarismo deve ser 9.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n }\n\n if ($oDadosEscola->registro00->fax != '') {\n\n if (strlen($oDadosEscola->registro00->fax) < 8) {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"Campo Fax deve conter 8 dígitos\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n }\n\n /**\n * Validações que serão executadas caso a situação de funcionamento seja igual a 1\n * 1 - em atividade\n * e caso a opção Dependência Administrativa selecionada seja igual a 4\n * 4 - privada\n */\n if ($oDadosEscola->registro00->dependencia_administrativa == 4) {\n\n if ( empty( $oDadosEscola->registro00->categoria_escola_privada ) ) {\n\n $lTodosDadosValidos = false;\n $sErroMsg = \"Escola de Categoria Privada.\\n\";\n $sErroMsg .= \"Deve ser selecionada uma opção no campo Categoria da Escola Privada\";\n $oExportacaoCenso->logErro($sErroMsg, ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if ($oDadosEscola->registro00->conveniada_poder_publico == '') {\n\n $sMensagem = \"Deve ser selecionada uma opção no campo Conveniada Com o Poder Público\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ( $oDadosEscola->registro00->mant_esc_privada_empresa_grupo_empresarial_pes_fis == 0\n && $oDadosEscola->registro00->mant_esc_privada_sidicatos_associacoes_cooperativa == 0\n && $oDadosEscola->registro00->mant_esc_privada_ong_internacional_nacional_oscip == 0\n && $oDadosEscola->registro00->mant_esc_privada_instituicoes_sem_fins_lucrativos == 0\n && $oDadosEscola->registro00->sistema_s_sesi_senai_sesc_outros == 0\n ) {\n\n $sMensagem = \"Deve ser selecionado pelo menos um campo de Mantenedora da Escola Privada\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ($oDadosEscola->registro00->cnpj_mantenedora_principal_escola_privada == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"O CNPJ da mantenedora principal da escola deve ser informado\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n\n if( $oDadosEscola->registro00->cnpj_mantenedora_principal_escola_privada != ''\n && !DBNumber::isInteger( $oDadosEscola->registro00->cnpj_mantenedora_principal_escola_privada )\n ) {\n\n $sMensagem = \"O CNPJ da mantenedora principal deve conter somente números.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if ($oDadosEscola->registro00->cnpj_escola_privada == '') {\n\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro(\"O CNPJ da escola deve ser informado quando escola for privada.\", ExportacaoCensoBase::LOG_ESCOLA);\n }\n }\n\n if( $oDadosEscola->registro00->regulamentacao_autorizacao_conselho_orgao == '' ) {\n\n $sMensagem = \"Deve ser informada uma opção referente ao Credenciamento da escola.\";\n $lTodosDadosValidos = false;\n $oExportacaoCenso->logErro( $sMensagem, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n $lDadosInfraEstrutura = DadosCensoEscola::validarDadosInfraEstrutura($oExportacaoCenso);\n if (!$lDadosInfraEstrutura) {\n $lTodosDadosValidos = $lDadosInfraEstrutura;\n }\n\n return $lTodosDadosValidos;\n }", "private function valida_exedente(): bool|array\n {\n if (property_exists(object_or_class: 'calcula_imss', property: 'monto_uma')){\n return $this->error->error('Error no existe el campo monto_uma', $this);\n }\n\n if (property_exists(object_or_class: 'calcula_imss', property: 'sbc')){\n return $this->error->error('Error no existe el campo sbc', $this);\n }\n\n if (property_exists(object_or_class: 'calcula_imss', property: 'n_dias')){\n return $this->error->error('Error no existe el campo n_dias', $this);\n }\n\n if($this->monto_uma<=0){\n return $this->error->error('Error uma debe ser mayor a 0', $this->monto_uma);\n }\n if($this->sbc<=0){\n return $this->error->error('Error sbc debe ser mayor a 0', $this->sbc);\n }\n if($this->n_dias<=0){\n return $this->error->error('Error n_dias debe ser mayor a 0', $this->n_dias);\n }\n return true;\n }", "public function isValid() {\n\n foreach ($this->entity as $nameColumn => $column) {\n\n $validate = null;\n // Se for chave primaria e tiver valor, valida inteiro somente sem nenhuma outra validacao.\n if ($column['contraint'] == 'pk' && $column['value']) {\n $validate = new Zend_Validate_Digits();\n } else {\n\n//______________________________________________________________________________ VALIDANDO POR TIPO DA COLUNA NO BANCO\n // Se tiver valor comeca validacoes de acordo com o tipo.\n // Se nao pergunta se é obrigatorio, se for obrigatorio valida.\n if ($column['value']) {\n // Se for inteiro\n if ($column['type'] == 'integer' || $column['type'] == 'smallint') {\n $validate = new Zend_Validate_Digits();\n // Se for data\n } else if ($column['type'] == 'numeric') {\n $column['value'] = str_replace('.', '', $column['value']);\n $column['value'] = (float) str_replace(',', '.', $column['value']);\n $validate = new Zend_Validate_Float();\n } else if ($column['type'] == 'date') {\n\n\t\t\t\t\t\t$posBarra = strpos($column['value'], '/');\n\t\t\t\t\t\t$pos = strpos($column['value'], '-');\n\t\t\t\t\t\tif ($posBarra !== false) {\n\t\t\t\t\t\t\t$date = explode('/', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[0], $date[2])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\t$date = explode('-', $column['value']);\n\t\t\t\t\t\t\tif (!checkdate($date[1], $date[2], $date[0])) {\n\t\t\t\t\t\t\t\t$this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n // Se for texto\n } else if ($column['type'] == 'character' || $column['type'] == 'character varying') {\n\n // Se for Bollean\n } else if ($column['type'] == 'boolean') {\n\n // Se for texto\n } else if ($column['type'] == 'text') {\n \n } else if ($column['type'] == 'timestamp without time zone') {\n if (strpos($column['value'], '/')) {\n\n if (strpos($column['value'], ' ')) {\n $arrDate = explode(' ', $column['value']);\n\n // Validando a data\n $date = explode('/', $arrDate[0]);\n if (!checkdate($date[1], $arrDate[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[0] . self::MSG_DATA_INVALIDA));\n }\n\n // Validando a hora\n $validateTime = new Zend_Validate_Date('hh:mm');\n $validateTime->isValid($arrDate[1]);\n if ($validateTime->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($arrDate[1] . self::MSG_DATA_HORA_INVALIDA));\n }\n } else {\n // Validando a data\n $date = explode('/', trim($column['value']));\n if (!checkdate($date[1], $date[0], $date[2])) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ($column['value'] . self::MSG_DATA_INVALIDA));\n }\n }\n }\n }\n\n//______________________________________________________________________________ VALIDANDO POR LIMITE DA COLUNA NO BANCO\n // Validando quantidade de caracteres.\n if ($column['maximum']) {\n $validateMax = new Zend_Validate_StringLength(array('max' => $column['maximum']));\n $validateMax->isValid($column['value']);\n if ($validateMax->getErrors()) {\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => (reset($validateMax->getMessages())));\n }\n $validateMax = null;\n }\n } else {\n//______________________________________________________________________________ VALIDANDO POR NAO VAZIO DA COLUNA NO BANCO\n // Validando se nao tiver valor e ele for obrigatorio.\n if ($column['is_null'] == 'NO' && $column['contraint'] != 'pk') {\n $validate = new Zend_Validate_NotEmpty();\n }\n }\n\n//______________________________________________________________________________ VALIDANDO A CLOUNA E COLOCANDO A MENSAGEM\n if ($validate) {\n $validate->isValid($column['value']);\n if ($validate->getErrors()) {\n\t\t\t\t\t\t$msg = $validate->getMessages();\n $this->error[] = array(\"name\" => $nameColumn, \"msg\" => ( reset($msg) ));\n }\n\n $validate = null;\n }\n }\n }\n\t\t\n if ($this->error)\n return false;\n else\n return true;\n }", "public function validar()\n {\n foreach ($this->reglas as $campo => $listadoReglas) {\n foreach ($listadoReglas as $regla) {\n $this->aplicarValidacion($campo, $regla);\n }\n }\n }", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "public static function validarDados( IExportacaoCenso $oExportacaoCenso ) {\n\n $lDadosValidos = true;\n $oExportacaoCenso = $oExportacaoCenso;\n $aDadosDocente = $oExportacaoCenso->getDadosProcessadosDocente();\n\n DadosCensoDocente2015::getGrauCurso();\n\n foreach( $aDadosDocente as $oDadosCensoDocente ) {\n\n $sDadosDocente = $oDadosCensoDocente->registro30->numcgm . \" - \" . $oDadosCensoDocente->registro30->nome_completo;\n $sDadosDocente .= \" - Data de Nascimento: \" . $oDadosCensoDocente->registro30->data_nascimento;\n\n $oRegistro30 = $oDadosCensoDocente->registro30;\n $oRegistro40 = $oDadosCensoDocente->registro40;\n $oRegistro50 = $oDadosCensoDocente->registro50;\n $aRegistro51 = $oDadosCensoDocente->registro51;\n\n if( !DadosCensoDocente2015::validacoesRegistro30( $sDadosDocente, $oExportacaoCenso, $oRegistro30, $oRegistro40 ) ) {\n $lDadosValidos = false;\n }\n\n if( !DadosCensoDocente2015::validacoesRegistro40( $sDadosDocente, $oExportacaoCenso, $oRegistro30, $oRegistro40 ) ) {\n $lDadosValidos = false;\n }\n\n if( !DadosCensoDocente2015::validacoesRegistro50( $sDadosDocente, $oExportacaoCenso, $oRegistro50, $oRegistro30 ) ) {\n $lDadosValidos = false;\n }\n\n if( !DadosCensoDocente2015::validacoesRegistro51( $sDadosDocente, $oExportacaoCenso, $oRegistro30, $aRegistro51 ) ) {\n $lDadosValidos = false;\n }\n }\n\n return $lDadosValidos;\n }", "private function validaAll()\r\n {\r\n $this->setId(filter_input(INPUT_POST, 'id') ?? time())\r\n ->setTitle(filter_input(INPUT_POST, 'title', FILTER_SANITIZE_SPECIAL_CHARS))\r\n ->setContent(filter_input(INPUT_POST, 'content', FILTER_SANITIZE_SPECIAL_CHARS))\r\n ->setBeginningDate(filter_input(INPUT_POST, 'beginning_date', FILTER_SANITIZE_SPECIAL_CHARS))\r\n ->setEndingDate(filter_input(INPUT_POST, 'ending_date', FILTER_SANITIZE_SPECIAL_CHARS));\r\n\r\n // Inicia a Validação dos dados\r\n $this->validaId()\r\n ->validaTitle()\r\n ->validaContent()\r\n ->validaBeginningDate()\r\n ->validaEndingDate();\r\n }", "function isDataValid() \n {\n return true;\n }", "public function validateBody()\n {\n\n if (v::identical($this->col)->validate(1)) {\n\n /** Cidade ou Região **/\n\n $regiao = Tools::clean($this->cell);\n\n if (!v::stringType()->notBlank()->validate($regiao)) {\n throw new \\InvalidArgumentException(\"Atenção: Informe na tabela a Cidade ou Região corretamente.\", E_USER_WARNING);\n }\n\n $this->array[$this->row]['regiao'] = $regiao;\n\n }\n\n if (v::identical($this->col)->validate(2)) {\n\n /** Faixa CEP Inicial **/\n\n $cep_inicio = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_inicio)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Inicial \\\"{$cep_inicio}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_inicio'] = $cep_inicio;\n\n }\n\n if (v::identical($this->col)->validate(3)) {\n\n /** Faixa CEP Final **/\n\n $cep_fim = Tools::clean($this->cell);\n\n if (!v::postalCode('BR')->validate($cep_fim)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Informe na tabela as faixas de CEP no formato correto.\n\n Ex.: 09999-999\n\n Por favor, corrija o CEP Final \\\"{$cep_fim}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['cep_fim'] = $cep_fim;\n\n }\n\n if (v::identical($this->col)->validate(4)) {\n\n /** Peso Inicial **/\n\n $peso_inicial = Tools::clean($this->cell);\n\n if (v::numeric()->negative()->validate(Tools::convertToDecimal($peso_inicial))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Inicial não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$peso_inicial}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_inicial'] = $peso_inicial;\n\n }\n\n if (v::identical($this->col)->validate(5)) {\n\n /** Peso Final **/\n\n $peso_final = Tools::clean($this->cell);\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($peso_final))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do Peso Final não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$peso_final}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['peso_final'] = $peso_final;\n\n }\n\n if (v::identical($this->col)->validate(6)) {\n\n /** Valor **/\n\n $valor = Tools::clean($this->cell);\n\n if (!v::notEmpty()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALOR do frete não pode ser vazio.\n\n Por favor, corrija o valor e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->positive()->validate(Tools::convertToDecimal($valor))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do frete não pode ser menor ou igual a Zero.\n\n Por favor, corrija o valor \\\"{$valor}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n $this->array[$this->row]['valor'] = $valor;\n\n }\n\n if (v::identical($this->col)->validate(7)) {\n\n /** Prazo de Entrega **/\n\n $prazo_entrega = (int)Tools::clean($this->cell);\n\n /**\n * Verifica o prazo de entrega\n */\n if (!v::numeric()->positive()->validate($prazo_entrega)) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, Atenção: Informe na tabela os Prazos de Entrega corretamente.\n\n Exemplo: 7 para sete dias.\n\n Por favor, corrija o Prazo de Entrega \\\"{$prazo_entrega}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate($prazo_entrega)) {\n $prazo_entrega = null;\n }\n\n $this->array[$this->row]['prazo_entrega'] = $prazo_entrega;\n\n }\n\n if (v::identical($this->col)->validate(8)) {\n\n /** AD VALOREM **/\n\n $ad_valorem = Tools::clean($this->cell);\n\n if (!empty($ad_valorem) && !v::numeric()->positive()->validate(Tools::convertToDecimal($ad_valorem))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do AD VALOREM não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$this->cell}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($ad_valorem))) {\n $ad_valorem = null;\n }\n\n $this->array[$this->row]['ad_valorem'] = $ad_valorem;\n\n }\n\n if (v::identical($this->col)->validate(9)) {\n\n /** KG Adicional **/\n\n $kg_adicional = Tools::clean($this->cell);\n\n if (!empty($kg_adicional) && v::numeric()->negative()->validate(Tools::convertToDecimal($kg_adicional))) {\n\n throw new \\InvalidArgumentException(\"ATENÇÃO: Erro na linha {$this->row}, os VALORES do KG Adicional não pode conter numeros negativos.\n\n Por favor, corrija o valor \\\"{$kg_adicional}\\\" e envie o arquivo novamente.\", E_USER_WARNING);\n\n }\n\n if (!v::numeric()->notBlank()->validate(Tools::convertToDecimal($kg_adicional))) {\n $kg_adicional = null;\n }\n\n $this->array[$this->row]['kg_adicional'] = $kg_adicional;\n\n }\n\n return $this->array;\n\n }", "function geraClasseValidadorFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.ValidadorFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoValidaFormularioCadastro.tpl');\n\n # abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n $aModeloFinal = array();\n \n # varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode((string)$aTabela['NOME']));\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n $objetoClasse = \"\\$o$nomeClasse\";\n\n # ==== varre a estrutura dos campos da tabela em questao ====\n $camposForm = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n # processa nome original da tabela estrangeira\n $nomeFKClasse = (string)$oCampo->FKTABELA;\n $objetoFKClasse = \"\\$o$nomeFKClasse\";\n\n $nomeCampo = $nomeCampoOriginal;\n //$nomeCampo = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n $label = ($nomeFKClasse != '') ? ucfirst(strtolower($nomeFKClasse)) : ucfirst(str_replace($nomeClasse,\"\",$nomeCampoOriginal));;\t\t\t\t\t\n $camposForm[] = ((int)$oCampo->CHAVE == 1) ? \"if(\\$acao == 2){\\n\\t\\t\\tif(\\$$nomeCampoOriginal == ''){\\n\\t\\t\\t\\t\\$this->msg = \\\"$label invalido!\\\";\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t}\" : \"if(\\$$nomeCampoOriginal == ''){\\n\\t\\t\\t\\$this->msg = \\\"$label invalido!\\\";\\n\\t\\t\\treturn false;\\n\\t\\t}\\t\";\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis já processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) mkdir($dir);\n\n $fp = fopen(\"$dir/class.ValidadorFormulario.php\",\"w\"); fputs($fp, $modeloFinal); fclose($fp);\n\n return true;\t\n }", "protected function _validate() {\n\t}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function Validate_Data($sorce){\r\n\r\n // Create connection with database\r\n $this->_db = DB::get_Instance();\r\n\r\n // Set validation flag as true\r\n $this->_flag = true;\r\n\r\n ### Nick Validation ###\r\n\r\n self::Nick_Register_Validation($sorce);\r\n\r\n ### E-mail Validation ###\r\n\r\n self::Email_Register_Validation($sorce);\r\n\r\n ### Password Validation ###\r\n\r\n self::Password_Register_Validation($sorce);\r\n\r\n ### Check checkbox ###\r\n\r\n self::check_Check_Box($sorce);\r\n\r\n ### Check reCAPTCHA ###\r\n\r\n self::check_ReCAPTCHA($sorce);\r\n\r\n ### Check first name ###\r\n self::FName_Register_Validation($sorce);\r\n\r\n ### Check last name ###\r\n self::LName_Register_Validation($sorce);\r\n }", "public function validarEquipamentosGeral (IExportacaoCenso $oExportacaoCenso, $iSequencial, $sEquipamento) {\n\n $sMensagem = \"\";\n switch ($iSequencial) {\n\n case 3000002:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores: \";\n break;\n\n case 3000003:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores de Uso Administrativo: \";\n break;\n\n case 3000024:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores de Uso dos Alunos: \";\n break;\n\n case 3000019:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Número de Salas de Aula Existentes na Escola: \";\n break;\n\n case 3000020:\n\n $sMensagem = \"Dados de Infra Estrutura da escola -> Campo Número de Salas Utilizadas Como Sala de Aula - \";\n $sMensagem .= \"Dentro e Fora do Prédio: \";\n break;\n }\n\n $lTodosDadosValidos = true;\n\n if (strlen($sEquipamento) > 4) {\n\n $lTodosDadosValidos = false;\n $sMensagemTamanho = \"Quantidade de dígitos informado inválido. É permitido no máximo 4 dígitos.\";\n $oExportacaoCenso->logErro( $sMensagem.$sMensagemTamanho, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n if( $sEquipamento != null ) {\n\n if( !DBNumber::isInteger( $sEquipamento ) ) {\n\n $lTodosDadosValidos = false;\n $sMensagemInteiro = \"Valor informado para quantidade inválido. Informe apenas números no campo de quantidade.\";\n $oExportacaoCenso->logErro( $sMensagem.$sMensagemInteiro, ExportacaoCensoBase::LOG_ESCOLA );\n }\n }\n\n if( DBNumber::isInteger($sEquipamento) && $sEquipamento == 0 ) {\n\n $lTodosDadosValidos = false;\n $sMensagemInvalido = \"Valor informado para quantidade inválido. Deixar o campo vazio, ao invés de informar 0.\";\n $oExportacaoCenso->logErro( $sMensagem.$sMensagemInvalido, ExportacaoCensoBase::LOG_ESCOLA );\n }\n\n return $lTodosDadosValidos;\n }", "public function validate()\n {\n // FUTURE FIXME: no se deberia retornar un simple true/false, sino que \n // si una condicion no se cumple deberia devolverse un mensaje \n // indicando qué no se ha cumplido, posiblemente usando una excepcion \n // para cada caso, para que el controlador la capture y muestre el \n // mensaje adecuado a la vista y no un simple mensaje de error \n // generico.\n\n // name solo puede tener letras, números y guiones\n if (!filter_var($this->name, FILTER_VALIDATE_REGEXP, [\"options\" => [\"regexp\" => \"/[a-zA-Z0-9\\-]+/\"]]))\n return false;\n\n // descrpicion debe limpiarse para prevenir ataques XSS\n $this->description = filter_var($this->description, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);\n\n // nombre debe tener como minimo 4 caracteres y como maximo 255\n if (strlen($this->name) <4 || strlen($this->name) > 255)\n return false;\n\n // estado debe ser \"pendiente\", \"subasta\" o \"venta\" exclusivamente\n if ($this ->state !== \"pendiente\" && $this->state !== \"subasta\" && $this->state !== \"venta\")\n return false;\n\n // el propietario debe existir como usuario en la BD\n $user = new User($this->owner);\n if (!$user->fill()) return false;\n\n // todas las condiciones se han cumplido, retorna true\n return true;\n }", "protected function prepareValidations() {}", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "protected function validate_input() {\n\t\tif (is_null($this->table_name)) {\n\t\t\t$this->table_name = \"\";\n\t\t}\n\t\tif (!is_string($this->table_name)) {\n\t\t\tthrow new Exception(\"table_name must be a string\");\n\t\t}\n\n\t\tif ($this->state !== null && !($this->state instanceof DataFormState)) {\n\t\t\tthrow new Exception(\"state must be instance of DataFormState\");\n\t\t}\n\n\t\tif ($this->settings !== null && !($this->settings instanceof DataTableSettings)) {\n\t\t\tthrow new Exception(\"settings must be DataTableSettings\");\n\t\t}\n\n\t\tif ($this->pagination_info !== null && !($this->pagination_info instanceof IPaginationInfo)) {\n\t\t\tthrow new Exception(\"pagination_info must be instance of IPaginationInfo\");\n\t\t}\n\n\t\tif (!is_array($this->sql_tree)) {\n\t\t\tthrow new Exception(\"sql_tree has not been defined\");\n\t\t}\n\t\tif (array_key_exists(\"LIMIT\", $this->sql_tree) && $this->settings && $this->settings->uses_pagination()) {\n\t\t\tthrow new Exception(\"The LIMIT clause is added automatically when paginating so it shouldn't be present in statement yet\");\n\t\t}\n\n\t\tif (is_null($this->pagination_transform)) {\n\t\t\t$this->pagination_transform = new LimitPaginationTreeTransform();\n\t\t}\n\t\tif (!($this->pagination_transform instanceof ISQLTreeTransformWithCount)) {\n\t\t\tthrow new Exception(\"Pagination transform must be instance of ISQLTreeTransformWithCount\");\n\t\t}\n\n\t\tif (is_null($this->count_transform)) {\n\t\t\t$this->count_transform = new CountTreeTransform();\n\t\t}\n\t\tif (!($this->count_transform instanceof ISQLTreeTransform)) {\n\t\t\tthrow new Exception(\"Count transform must be instance of ISQLTreeTransform\");\n\t\t}\n\n\t\tif (is_null($this->sort_transform)) {\n\t\t\t$this->sort_transform = new SortTreeTransform();\n\t\t}\n\t\tif (!($this->sort_transform instanceof ISQLTreeTransform)) {\n\t\t\tthrow new Exception(\"Sort transform must be instance of ISQLTreeTransform\");\n\t\t}\n\n\t\tif (is_null($this->filter_transform)) {\n\t\t\t$this->filter_transform = new FilterTreeTransform();\n\t\t}\n\t\tif (!($this->filter_transform instanceof ISQLTreeTransform)) {\n\t\t\tthrow new Exception(\"Filter transform must be instance of ISQLTreeTransform\");\n\t\t}\n\n\t\tif ($this->ignore_pagination === null) {\n\t\t\t$this->ignore_pagination = false;\n\t\t}\n\t\tif (!is_bool($this->ignore_pagination)) {\n\t\t\tthrow new Exception(\"ignore_pagination must be a bool\");\n\t\t}\n\n\t\tif ($this->ignore_filtering === null) {\n\t\t\t$this->ignore_filtering = false;\n\t\t}\n\t\tif (!is_bool($this->ignore_filtering)) {\n\t\t\tthrow new Exception(\"ignore_filtering must be a bool\");\n\t\t}\n\t}", "public function validateData(){\n return true;\n }", "function validarRegistro()\n {\n $mensaje=\"\";\n $adicionado=\"\";\n $idSolicitud=(isset($_REQUEST['idSolicitud'])?$_REQUEST['idSolicitud']:'');\n \n if(is_numeric($idSolicitud) && $idSolicitud){\n $this->solicitud= $this->consultarDetalleSolicitud($idSolicitud);\n\n $datosRegistro=array('solicitante'=>$this->solicitud[0]['SOL_NRO_IDEN_SOLICITANTE'],\n 'identificacion'=>$this->solicitud[0]['SOL_CODIGO'],\n 'correo'=>$this->solicitud[0]['CORREO_ELECTRONICO'],\n 'tipo_documento'=>$this->solicitud[0]['UWD_TIPO_IDEN'],\n 'tipo_contrato'=>$this->solicitud[0]['SOL_TIPO_VINCULACION'],\n 'fecha_inicio'=>$this->solicitud[0]['SOL_FECHA_INICIO'],\n 'fecha_fin'=>(isset($this->solicitud[0]['SOL_FECHA_FIN'])?$this->solicitud[0]['SOL_FECHA_FIN']:''),\n 'tipo_cuenta'=> $this->solicitud[0]['SOL_USUWEBTIPO'],\n 'tipo_usuario'=> $this->solicitud[0]['TIPO_USUARIO'],\n 'estado_usuario'=> 'A',\n 'secuencia'=>1,\n 'anexo'=>''\n );\n //busca si existe registro ya de usuario para rescatar la clave \n $registro = $this->buscarRegistroUsuario($datosRegistro['identificacion']);\n if(is_array($registro)){\n $datosRegistro['clave']=$registro[0]['CLA_CLAVE'];\n \n }else{\n $datosRegistro['clave']=$this->asignarClave();\n $datosRegistro['asigna_clave']='ok';\n }\n \n $datosRegistro = $this->asignarDependencia($datosRegistro);\n if(is_array($datosRegistro)){\n $usuario_existe = $this->buscarRegistroUsuarioYaExiste($datosRegistro[0]);\n \n if(is_array($usuario_existe) && $usuario_existe){\n $adicionado=$this->actualizarUsuario($datosRegistro[0]);\n $adicionadoMysql=$this->actualizarCuentaUsuarioMysql($datosRegistro[0]);\n \n }else{\n $adicionado=$this->adicionarCuentaUsuario($datosRegistro[0]);\n $adicionadoMysql=$this->adicionarCuentaUsuarioMysql($datosRegistro[0]);\n }\n\n foreach ($datosRegistro as $key => $registroUsuario) {\n \n $usuarioWeb = $this->buscarRegistroUsuarioWeb($registroUsuario['identificacion'], $registroUsuario['tipo_cuenta'], $registroUsuario['dependencia']);\n \n if(is_array($usuarioWeb)){\n $actualizadoweb[$key]=$this->actualizarCuentaUsuarioWeb($registroUsuario);\n \n }else{\n $adicionadoweb[$key]=$this->adicionarCuentaUsuarioWeb($registroUsuario);\n \n }\n }\n }\n var_dump($adicionado);\n var_dump($adicionadoMysql);\n if($adicionado && $adicionadoMysql){\n $modificado=$this->actualizarEstadoSolicitud($idSolicitud,3);\n \n $mensaje='Usuario creado con exito';\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'66',\n 'descripcion'=>'Registro de usuario '.$datosRegistro[0]['identificacion'],\n 'registro'=>\" id_solicitud->\".$idSolicitud.\", usuario-> \".$datosRegistro[0]['identificacion'],\n 'afectado'=>$datosRegistro[0]['identificacion']);\n\n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n if((isset($datosRegistro[0]['asigna_clave'])?$datosRegistro[0]['asigna_clave']:'')=='ok'){\n $variable=\"pagina=registro_aprobarSolicitudUsuario\";\n $variable.=\"&opcion=enlace\";\n $variable.=\"&mail=\".$datosRegistro[0]['correo'];\n $variable.=\"&usu=\".$datosRegistro[0]['identificacion'];\n $variable.=\"&tipoUsu=\".$datosRegistro[0]['tipo_usuario'];\n }else{\n $variable=\"pagina=admin_consultarSolicitudesUsuario\";\n $variable.=\"&opcion=consultar\";\n }\n \n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n \n $this->retornar($pagina,$variable,$variablesRegistro,$mensaje);\n }else{\n $mensaje='Error al crear Usuario. '.$this->mensaje;\n\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'66',\n 'descripcion'=>'Error al registrar usuario -'.$mensaje,\n 'registro'=>\" id_solicitud->\".$idSolicitud.\", usuario-> \".$this->solicitud[0]['SOL_CODIGO'],\n 'afectado'=>$this->solicitud[0]['SOL_CODIGO']);\n\n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $variable=\"pagina=admin_consultarSolicitudesUsuario\";\n $variable.=\"&opcion=consultar\";\n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n\n $this->retornar($pagina,$variable,$variablesRegistro,$mensaje);\n }\n }\n }", "abstract public function valid();", "public function validar(){\n\t\tif($this->rest->_getRequestMethod()!= 'POST'){\n\t\t\t$this->_notAuthorized();\n\t\t}\n\n\t\t$request = json_decode(file_get_contents('php://input'), true);\n\t\t$facPgPedido = $request['factura_pagos_pedido'];\n\t\t#verificamos que el registro existe\n\t\t$this->db->where('nro_pedido', $facPgPedido['nro_pedido']);\n\t\t$this->db->where('id_factura_pagos', $facPgPedido['id_factura_pagos']);\n\t\t$this->db->where('concepto', $facPgPedido['concepto']);\n\n\t\t$this->resultDb = $this->db->get($this->controllerSPA);\n\t\tif($this->resultDb->num_rows() != null && \n\t\t\t\t\t\t\t\t\t\t\t\t$request['accion'] == 'create'){\n\t\t\t$this->responseHTTP['message'] =\n\t\t\t\t\t\t\t 'Ya existe un registro con el mismo identificador';\n\t\t\t$this->responseHTTP[\"appst\"] = 2300;\n\t\t\t$this->responseHTTP['data'] = $this->resultDb->result_array();\n\t\t\t$this->responseHTTP['lastInfo'] = $this->mymodel->lastInfo();\n\t\t\t$this->__responseHttp($this->responseHTTP, 400);\n\t\t}else{\n\t\t#validamos la informacion\n\t\t\t$status = $this->_validData( $facPgPedido );\n\t\t\tif ($status['status']){\n\n\t\t\t\t#anulamos las fechas en blanco\n\t\t\t\t$facPgPedido['fecha_inicio'] = \n\t\t\t\t(empty($facPgPedido['fecha_inicio'])) ?\tnull : \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $facPgPedido['fecha_inicio'];\n\n\t\t\t\t$facPgPedido['fecha_fin'] = (empty($facPgPedido['fecha_fin'])) ? \n\t\t\t\t\t\t\t\t\t\t\tnull : $facPgPedido['fecha_fin'];\n\n\t\t\t\tif ($request['accion'] == 'create'){\n\t\t\t\t\t$this->db->insert($this->controllerSPA, $facPgPedido);\n\t\t\t\t\t$this->responseHTTP['message'] = \n\t\t\t\t\t\t\t\t\t\t\t\t'Registro creado existosamente';\n\t\t\t\t\t$this->responseHTTP[\"appst\"] = 1200;\n\t\t\t\t\t$this->responseHTTP['lastInfo'] = \n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->mymodel->lastInfo();\n\t\t\t\t\t$this->__responseHttp($this->responseHTTP, 201);\n\t\t\t\t}else{\n\t\t\t\t\t$facPgPedido['last_update'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$this->db->where('id_factura_pagos_pedido',\n\t\t\t\t\t\t\t\t\t\t $request['id_factura_pagos_pedido']);\n\t\t\t\t\t$this->db->update($this->controllerSPA, $facPgPedido);\n\t\t\t\t\t$this->responseHTTP['appst'] = 'Registro actualizado';\n\t\t\t\t\t$this->responseHTTP[\"appst\"] = 1300;\n\t\t\t\t\t$this->__responseHttp($this->responseHTTP, 201);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->responseHTTP['message'] = 'Uno de los registros'.\n\t\t\t\t \t\t\t\t'ingresados es incorrecto, vuelva a intentar';\n\t\t\t\t$this->responseHTTP[\"appst\"] = 1400;\n\t\t\t\t$this->responseHTTP['data'] = $status;\n\t\t\t\t$this->__responseHttp($this->responseHTTP, 400);\n\t\t\t}\n\t\t}\n\n\t}", "public static function validate() {}", "protected function validate()\n {\n// echo static::class;\n if (!isset($this->getProperty('raw_data')['_'])) {\n throw new InvalidEntity('Invalid entity data given: ' . json_encode($this->getRawData(), JSON_PRETTY_PRINT));\n }\n }", "public function trataDados()\r\n {\r\n // trata os campos do form\r\n if ($this->form->isSubmitted() && $this->form->isValid()) {\r\n $this->data = $this->form->getData();\r\n\r\n // não filtra campo em branco\r\n foreach ($this->data as $k => $v){\r\n if(empty($v)){\r\n unset($this->data[$k]);\r\n }\r\n }\r\n }\r\n $this->trataObjetos();\r\n }", "public function validarArquivo(){\n\n if (empty($this->aRegistrosRetencao)) {\n throw new Exception( _M( self::MENSAGENS . 'erro_validar_arquivo') );\n }\n\n /**\n * Verificamos os registros e caso ocorra inconsistencia populamos o array de Registros inconsistentes\n */\n foreach ($this->aRegistrosRetencao as $oRegistroRetencao) {\n\n /**\n * Validamos se existe CGM cadastrado para o cnpj TOMADOR\n */\n if (CgmFactory::getInstanceByCnpjCpf($oRegistroRetencao->q91_cnpjtomador) == false) {\n\n $this->aRegistrosInconsistentes[] = array( \"sequencial_registro\" => $oRegistroRetencao->q91_sequencialregistro,\n \"registro\" => $oRegistroRetencao->q91_cnpjtomador,\n \"erro\" => self::TOMADOR_SEM_CGM );\n }\n }\n }", "public function isDataValid() {\n if ($this->userExists())\n $this->_errors[] = 'username already taken';\n // username and password must match pattern\n else if (empty($this->_username) || !preg_match('/^[a-zA-Z0-9]{5,16}$/', $this->_username))\n $this->_errors[] = 'invalid username must be between 5 and 16 characters';\n else if (empty($this->_password) || !preg_match('/^[a-zA-Z0-9]{6,18}$/', $this->_password))\n $this->_errors[] = 'invalid password must be between 6 and 18 characters';\n\t\t else if (empty($this->_password) || $this->_password != $this->_password_confirm)\n $this->_errors[] = \"Password didn't match X\";\n // names must be between 2 and 22 characters\n else if (empty($this->_first_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_first_name))\n $this->_errors[] = 'invalid first name must be between 2 and 22 characters';\n else if (empty($this->_last_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_last_name))\n $this->_errors[] = 'invalid last name must be between 2 and 22 characters';\n //restricts day to 01-31, month to 01-12 and year to 1900-2099 (also allowing / - or . between the parts of the date) \n else if (empty($this->_dob) || !preg_match('/^(0?[1-9]|[12][0-9]|3[01])[\\/\\ ](0?[1-9]|1[0-2])[\\/\\ ](19|20)\\d{2}$/', $this->_dob))\n $this->_errors[] = 'invalid dod | must be DD/MM/YYYY format';\n else if (empty($this->_address))\n $this->_errors[] = 'invalid address';\n // checks if valid postal code\n else if (empty($this->_postcode) || !preg_match('/^(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})$/', $this->_postcode))\n $this->_errors[] = 'invalid postcode | must be AA11 9AA format';\n // checks is valid email using regular expression\n else if (empty($this->_email) || !preg_match('/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}$/', $this->_email))\n $this->_errors[] = 'invalid email';\n\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "abstract public function validateData($data);", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "public function valid(){ }", "abstract public function validate();", "abstract public function validate();", "function ValidarFormularioNuevaReserva($DatosFotmulario = array()){\n\t\t$resultado = array();\n\n\t\t//Creaar un objeto de validacion\n\t\t$campo1 = new stdClass();\n\t\t$campo1->estado = false;\n\t\t$campo1->valor = '';\n\n\t\t$campo2 = new stdClass();\n\t\t$campo2->estado = false;\n\t\t$campo2->valor = '';\n\n\t\t$campo3 = new stdClass();\n\t\t$campo3->estado = false;\n\t\t$campo3->valor = '';\n\n\t\t$campo4 = new stdClass();\n\t\t$campo4->estado = false;\n\t\t$campo4->valor = '';\n\n\t\t$campo5 = new stdClass();\n\t\t$campo5->estado = false;\n\t\t$campo5->valor = '';\n\n\t\t$campo6 = new stdClass();\n\t\t$campo6->estado = false;\n\t\t$campo6->valor = '';\n\n\t\t$campo7 = new stdClass();\n\t\t$campo7->estado = false;\n\t\t$campo7->valor = '';\n\t\n\n\t\t//fechaInicio\n\t\tif($DatosFotmulario['fechaInicio'] != '')\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$campo1->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo1->valor = $DatosFotmulario['fechaInicio'];\n\t\t\t\t$resultado['fechaInicio'] = $campo1; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo1->estado = false; //ok\n\t\t\t\t$campo1->valor = $DatosFotmulario['fechaInicio']; //guarda el valor vacio \n\t\t\t\t$resultado['fechaInicio'] = $campo1; \n\t\t\t}\n\n\n\t\t//fechaFin\n\t\tif($DatosFotmulario['fechaFin'] != '')\n\t\t\t{\n\t\t\t\t$campo2->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo2->valor = $DatosFotmulario['fechaFin'];\n\t\t\t\t$resultado['fechaFin'] = $campo2; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo2->estado = false; //ok\n\t\t\t\t$campo2->valor = $DatosFotmulario['fechaFin']; //guarda el valor vacio \n\t\t\t\t$resultado['fechaFin'] = $campo2; \n\t\t\t}\t\n\t\t\t \n\n\t\t//cantPersonas\n\t\tif($DatosFotmulario['cantPersonas'] != '')\n\t\t\t{\n\t\t\t\t$campo3->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo3->valor = $DatosFotmulario['cantPersonas'];\n\t\t\t\t$resultado['cantPersonas'] = $campo3; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo3->estado = false; //ok\n\t\t\t\t$campo3->valor = $DatosFotmulario['cantPersonas']; //guarda el valor vacio \n\t\t\t\t$resultado['cantPersonas'] = $campo3; \n\t\t\t}\n\n\t\t//nombreT\n\t\tif($DatosFotmulario['nombreT'] != '')\n\t\t\t{\n\t\t\t\t$campo4->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo4->valor = $DatosFotmulario['nombreT'];\n\t\t\t\t$resultado['nombreT'] = $campo4; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo4->estado = false; //ok\n\t\t\t\t$campo4->valor = $DatosFotmulario['nombreT']; //guarda el valor vacio \n\t\t\t\t$resultado['nombreT'] = $campo4; \n\t\t\t}\n\n\t\t//numHab\n\t\tif($DatosFotmulario['numHab'] != '')\n\t\t\t{\n\t\t\t\t$campo5->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo5->valor = $DatosFotmulario['numHab'];\n\t\t\t\t$resultado['numHab'] = $campo5; \n\t\t\t}\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$campo5->estado = false; //ok\n\t\t\t\t$campo5->valor = $DatosFotmulario['numHab']; //guarda el valor vacio \n\t\t\t\t$resultado['numHab'] = $campo5; \n\t\t\t}\n\n\t\t//precioPorNoche\n\n\t\t\t\n\t\tif($DatosFotmulario['precioPorNoche'] != '' )\n\t\t\t{\n\t\t\t\t$campo6->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo6->valor = $DatosFotmulario['precioPorNoche'];\n\t\t\t\t$resultado['precioPorNoche'] = $campo6; \t\t\t\t\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$campo6->estado6 = false; //ok\n\t\t\t\t$campo6->valor6 = $DatosFotmulario['precioPorNoche']; //guarda el valor vacio \n\t\t\t\t$resultado['precioPorNoche'] = $campo6; \n\t\t\t}\n\n\t\t//documento\n\t\tif($DatosFotmulario['documento'] != '')\n\t\t\t{\n\t\t\t\t$campo7->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo7->valor = $DatosFotmulario['documento'];\n\t\t\t\t$resultado['documento'] = $campo7; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo7->estado = false; //ok\n\t\t\t\t$campo7->valor = $DatosFotmulario['documento']; //guarda el valor vacio \n\t\t\t\t$resultado['documento'] = $campo7; \n\t\t\t}\n\t\t\t\n $cont = 0;\n foreach ($resultado as $e){ \n if ($e->estado == false)\n $cont++;\n }\n\n if ($cont > 0) //Faltan campos\n return $resultado;\n else\n return array(); // Formulario OK \t\t\t\n\t}", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "public function valid()\n {\n\n if ($this->container['salutation'] === null) {\n return false;\n }\n $allowedValues = $this->getSalutationAllowableValues();\n if (!in_array($this->container['salutation'], $allowedValues)) {\n return false;\n }\n if ($this->container['givenName'] === null) {\n return false;\n }\n if ($this->container['familyName'] === null) {\n return false;\n }\n if ($this->container['email'] === null) {\n return false;\n }\n if ($this->container['phoneNumber'] === null) {\n return false;\n }\n if (!preg_match(\"/[0-9 \\/-]/\", $this->container['phoneNumber'])) {\n return false;\n }\n if (!preg_match(\"/[0-9 \\/-]/\", $this->container['phoneNumber2'])) {\n return false;\n }\n if ($this->container['zip'] === null) {\n return false;\n }\n if (strlen($this->container['zip']) > 5) {\n return false;\n }\n if (strlen($this->container['zip']) < 4) {\n return false;\n }\n if (!preg_match(\"/[0-9]{4,5}/\", $this->container['zip'])) {\n return false;\n }\n if ($this->container['city'] === null) {\n return false;\n }\n if ($this->container['liftType'] === null) {\n return false;\n }\n $allowedValues = $this->getLiftTypeAllowableValues();\n if (!in_array($this->container['liftType'], $allowedValues)) {\n return false;\n }\n if ($this->container['mountingLocation'] === null) {\n return false;\n }\n $allowedValues = $this->getMountingLocationAllowableValues();\n if (!in_array($this->container['mountingLocation'], $allowedValues)) {\n return false;\n }\n if ($this->container['obstacle'] === null) {\n return false;\n }\n $allowedValues = $this->getObstacleAllowableValues();\n if (!in_array($this->container['obstacle'], $allowedValues)) {\n return false;\n }\n if ($this->container['floor'] === null) {\n return false;\n }\n $allowedValues = $this->getFloorAllowableValues();\n if (!in_array($this->container['floor'], $allowedValues)) {\n return false;\n }\n if ($this->container['livingSituation'] === null) {\n return false;\n }\n $allowedValues = $this->getLivingSituationAllowableValues();\n if (!in_array($this->container['livingSituation'], $allowedValues)) {\n return false;\n }\n if ($this->container['careLevelState'] === null) {\n return false;\n }\n $allowedValues = $this->getCareLevelStateAllowableValues();\n if (!in_array($this->container['careLevelState'], $allowedValues)) {\n return false;\n }\n if ($this->container['carePersonWeight'] === null) {\n return false;\n }\n $allowedValues = $this->getCarePersonWeightAllowableValues();\n if (!in_array($this->container['carePersonWeight'], $allowedValues)) {\n return false;\n }\n if ($this->container['targetPerson'] === null) {\n return false;\n }\n $allowedValues = $this->getTargetPersonAllowableValues();\n if (!in_array($this->container['targetPerson'], $allowedValues)) {\n return false;\n }\n if ($this->container['pageUrl'] === null) {\n return false;\n }\n return true;\n }", "public function validate_fields() {\n \n\t\t//...\n \n }", "public function valida_objetivos_estrategicos(){\n if ($this->input->post()) {\n $post = $this->input->post();\n\n $codigo = $this->security->xss_clean($post['codigo']);\n $descripcion = $this->security->xss_clean($post['descripcion']);\n $configuracion=$this->model_proyecto->configuracion_session();\n\n /*--------------- GUARDANDO OBJETIVO ESTRATEGICO ----------------*/\n $data_to_store = array(\n 'obj_codigo' => strtoupper($codigo),\n 'obj_descripcion' => strtoupper($descripcion),\n 'obj_gestion_inicio' => $configuracion[0]['conf_gestion_desde'],\n 'obj_gestion_fin' => $configuracion[0]['conf_gestion_hasta'],\n 'fun_id' => $this->fun_id,\n );\n $this->db->insert('_objetivos_estrategicos',$data_to_store);\n $obj_id=$this->db->insert_id();\n /*---------------------------------------------------------------*/\n\n if(count($this->model_mestrategico->get_objetivos_estrategicos($obj_id))==1){\n $this->session->set_flashdata('success','SE REGISTRO CORRECTAMENTE');\n redirect(site_url(\"\").'/me/objetivos_estrategicos');\n }\n else{\n $this->session->set_flashdata('danger','ERROR AL REGISTRAR');\n redirect(site_url(\"\").'/me/objetivos_estrategicos');\n }\n\n } else {\n show_404();\n }\n }", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "private function validateData ($data){\n if(isset($data[\"nombres\"]) && !preg_match('/^[a-zA-ZáéíóúÁÉÍÓÚñÑ ]+$/',$data[\"nombres\"])){\n $json = array(\"status\"=>404, \"detalles\"=>\"Error, no se permiten numeros en el nombre del usuario\");\n print json_encode($json, true);\n return false;\n }\n if(isset($data[\"apellidos\"]) && !preg_match('/^[a-zA-ZáéíóúÁÉÍÓÚñÑ ]+$/',$data[\"apellidos\"])){\n $json = array(\"status\"=>404, \"detalles\"=>\"Error, no se permiten numeros en el apellido del usuario\");\n print json_encode($json, true);\n return false;\n }\n if(isset($data[\"email\"]) && !preg_match('/^(([^<>()\\[\\]\\\\.,;:\\s@”]+(\\.[^<>()\\[\\]\\\\.,;:\\s@”]+)*)|(“.+”))@((\\[[0–9]{1,3}\\.[0–9]{1,3}\\.[0–9]{1,3}\\.[0–9]{1,3}])|(([a-zA-Z\\-0–9]+\\.)+[a-zA-Z]{2,}))$/',$data[\"email\"])){\n $json = array(\"status\"=>404, \"detalles\"=>\"Error, el email no es valido\");\n print json_encode($json, true);\n return false;\n \n }\n if(isset($data[\"email\"])){\n $conn = clientesModels::validateEmail('clientes',$data[\"email\"]);\n if($conn != 0){\n $json = array(\"status\"=>404, \"detalles\"=>\"Error, El email {$data[\"email\"]} ya esta registrado\");\n print json_encode($json, true);\n return false;\n }\n }\n \n \n return true;\n }", "public abstract function validation();", "public function isValid()\n\t{\n\t\tif (empty($this->titre)) $this->titre = \"TITRE A REMPLACER\";\n\t\telse $this->titre = trim (preg_replace('/\\s+/', ' ', $this->titre) ); // Suppression des espaces\n\t\tif (!empty($this->contenu)) $this->contenu = trim (preg_replace('/\\s+/', ' ', $this->contenu) ); // Suppression des espaces\n\t\tif (empty($this->statut)) $this->statut = 0;\n\t\tif (empty($this->id_type)) $this->id_type = 1;\n\t\tif (empty($this->id_membre)) $this->id_membre = 0;\n\t}", "private function validarPUT(){\n parse_str(file_get_contents(\"php://input\"),$post_vars);\n $IO = ValidacaoIO::getInstance();\n $es = array();\n $ps = array();\n \n # Criando variáveis dinamicamente, e removendo possiveis tags HTML, espaços em branco e valores nulos:\n foreach ($post_vars as $atributo => $valor){\n \t $ps[$atributo] = trim(strip_tags($valor));\n \t$es = $IO->validarConsisten($es, $valor);\n }\n \n # Verificando a quantidade de parametros enviados:\n $es = $IO->validarQuantParam($es, $ps, 5);\n \n # Validar status fornecido:\n $es = $IO->validarStatusAnuncio($es, $ps['status']);\n \n # Validar codigo de anuncio fornecido:\n $prestadorBPO = unserialize($_SESSION['objetoUsuario']);\n // $es = $IO->validarAnuncio($es, $ps['codigoAnuncio']);\n \n $es = $IO->validarDonoAnuncio($es, $prestadorBPO->getCodigoUsuario(), $ps['codigoAnuncio']);\n \n # Se existir algum erro, mostra o erro\n $es ? $IO->retornar400($es) : $this->retornar200($ps);\n }", "public function validation();", "public function validarProcessamento() {\n\n $sWhere = \"q145_issarquivoretencao = {$this->oIssArquivoRetencao->getSequencial()}\";\n $oDaoIssArquivoRetencaoDisArq = new cl_issarquivoretencaodisarq;\n $sSqlIssArquivoRetencaoDisArq = $oDaoIssArquivoRetencaoDisArq->sql_query_file(null, \"*\", null, $sWhere);\n $rsIssArquivoRetencaoDisArq = $oDaoIssArquivoRetencaoDisArq->sql_record($sSqlIssArquivoRetencaoDisArq);\n\n if ($oDaoIssArquivoRetencaoDisArq->numrows > 0) {\n throw new BusinessException( _M( self::MENSAGENS . \"erro_arquivo_processado\") );\n }\n }", "public function validate(){\r\n $userInfo = wbUser::getSession();\r\n \r\n if ($this->actionType == 'CREATE'){\r\n // TODO : Write your validation for CREATE here\r\n $this->record['wilayah_creation_date'] = date('Y-m-d');\r\n $this->record['wilayah_creation_by'] = $userInfo['user_name'];\r\n \r\n $this->record['wilayah_updated_date'] = date('Y-m-d');\r\n $this->record['wilayah_updated_by'] = $userInfo['user_name'];\r\n \r\n if(!isset($this->record['wilayah_pid'])) {\r\n //do nothing \r\n }else {\r\n $itemParent = $this->get( $this->record['wilayah_pid'] );\r\n if( strlen($this->record['wilayah_kode']) <= strlen($itemParent['wilayah_kode']) ) {\r\n throw new Exception(\"Jumlah Karakter Kode Wilayah(\".$this->record['wilayah_kode'].\") Harus Melebihi Jumlah Karakter Kode Parent(\".$itemParent['wilayah_kode'].\") \"); \r\n }\r\n\r\n if( substr($this->record['wilayah_kode'], 0, strlen($itemParent['wilayah_kode'])) !== $itemParent['wilayah_kode'] ) {\r\n throw new Exception(\"Prefix Kode Wilayah Harus Sama Dengan Kode Parent '\".$itemParent['wilayah_kode'].\"'\");\r\n }\r\n }\r\n \r\n }else if ($this->actionType == 'UPDATE'){\r\n // TODO : Write your validation for UPDATE here\r\n $this->record['wilayah_updated_date'] = date('Y-m-d');\r\n $this->record['wilayah_updated_by'] = $userInfo['user_name'];\r\n \r\n if(!isset($this->record['wilayah_kode'])) {\r\n //do nothing\r\n }else{\r\n $item = $this->get( $this->record['wilayah_id'] );\r\n $itemParent = $this->get( $item['wilayah_pid'] );\r\n \r\n if( strlen($this->record['wilayah_kode']) <= strlen($itemParent['wilayah_kode']) ) {\r\n throw new Exception(\"Jumlah Karakter Kode Wilayah(\".$this->record['wilayah_kode'].\") Harus Melebihi Jumlah Karakter Kode Parent(\".$itemParent['wilayah_kode'].\") \"); \r\n }\r\n \r\n if( substr($this->record['wilayah_kode'], 0, strlen($itemParent['wilayah_kode'])) !== $itemParent['wilayah_kode'] ) {\r\n throw new Exception(\"Prefix Kode Wilayah Harus Sama Dengan Kode Parent '\".$itemParent['wilayah_kode'].\"'\");\r\n }\r\n \r\n }\r\n }\r\n \r\n return true;\r\n }", "public function isDataValid(): bool;", "public function generalValidation()\n {\n \t// Validamos que los dos campos esten llenos o estén vacios al mismo tiempo.\n \tif (is_null($this->error) ^ is_null($this->read_at)) {\n \t\treturn false;\n \t}\n\n \treturn true;\n }", "function validarUsuario(array $usuario)\n{\n //Metodo de validação\n if(empty($usuario['codigo']) || empty($usuario['nome']) || empty($usuario['idade']))\n {\n //Message erro\n throw new Exception(\"Campos obrigatórios não foram preenchidos ! \\n\");\n }\n return true;\n}", "protected function localValidation()\n\t\t{\n\t\t}", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validarCadastro(){\n $valido = true;\n if(strlen($this->__get('nome')) < 3){\n $valido = false;\n }\n if(strlen($this->__get('email')) < 3){\n $valido = false;\n }\n if(strlen($this->__get('senha')) < 3){\n $valido = false;\n }\n\n return $valido;\n }", "public static function validarCampos($dados){\n\t\t$erro = array();\n\t\t\n\t\tif(isset($dados['nome'])){\n\t\t\tif(strlen($dados['nome']) < 6 || !self::isName($dados['nome'])){\n\t\t\t\t$erro['nome'] = 'Nome inválido. Deve conter somente letras com no mínimo 6 caracteres.';\n\t\t\t}\n\t\t}\n\n\t\tif(isset($dados['email'])){\n\t\t\tif(strlen($dados['email']) < 10 || !self::isEmail($dados['email'])){\n\t\t\t\t$erro['email'] = 'Email inválido.';\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($dados['login'])){\n\t\t\tif(strlen($dados['login']) < 5 || !self::isLogin($dados['login'])){\n\t\t\t\t$erro['login'] = 'Login inválido. Deve conter mais de 4 caracteres.';\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($dados['senha_atual'])){\n\t\t\tif(isset($dados['senha']) && isset($dados['confirmar_senha']) && (strlen($dados['senha']) != 0 || strlen($dados['confirmar_senha']) != 0)){\n\t\t\t\tif(strlen($dados['senha']) < 6 || $dados['senha'] != $dados['confirmar_senha']){\n\t\t\t\t\t$erro['senha'] = 'Senha inválida. Deve conter mais de 5 caracteres e devem ser iguais.';\n\t\t\t\t\t$erro['confirmar_senha'] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(isset($dados['senha']) && isset($dados['confirmar_senha'])){\n\t\t\t\tif(strlen($dados['senha']) < 6 || $dados['senha'] != $dados['confirmar_senha']){\n\t\t\t\t\t$erro['senha'] = 'Senha inválida. Deve conter mais de 5 caracteres e devem ser iguais.';\n\t\t\t\t\t$erro['confirmar_senha'] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(isset($dados['cpf'])){\n\t\t\tif(strlen($dados['cpf']) != 11){\n\t\t\t\t$erro['cpf'] = 'CPF inválido.';\n\t\t\t}\n\t\t\telse if($dados['cpf'] == '00000000000' ||\n\t\t\t\t\t$dados['cpf'] == '11111111111' ||\n\t\t\t\t\t$dados['cpf'] == '22222222222' ||\n\t\t\t\t\t$dados['cpf'] == '33333333333' ||\n\t\t\t\t\t$dados['cpf'] == '44444444444' ||\n\t\t\t\t\t$dados['cpf'] == '55555555555' ||\n\t\t\t\t\t$dados['cpf'] == '66666666666' ||\n\t\t\t\t\t$dados['cpf'] == '77777777777' ||\n\t\t\t\t\t$dados['cpf'] == '88888888888' ||\n\t\t\t\t\t$dados['cpf'] == '99999999999'){\n\t\t\t\t$erro['cpf'] = 'CPF inválido.';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// Calcula os digitos verificadores(os dois ultimos digitos)\n\t\t\t\tfor($t = 9; $t < 11; $t++){\n\t\t\t\t\tfor($d = 0, $c = 0; $c < $t; $c++){\n\t\t\t\t\t\t$d += $dados['cpf']{$c} * (($t + 1) - $c);\n\t\t\t\t\t}\n\t\t\t\t\t$d = ((10 * $d) % 11) % 10;\n\t\t\t\t\tif($dados['cpf']{$c} != $d){\n\t\t\t\t\t\t$erro['cpf'] = 'CPF inválido.';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(isset($dados['data_nascimento'])){\n\t\t\t$tmp = explode('/', $dados['data_nascimento']);\n\t\t\tif(strlen($dados['data_nascimento']) != 10 || count($tmp) != 3 || strlen($tmp[0]) != 2 || strlen($tmp[1]) != 2 || strlen($tmp[2]) != 4){\n\t\t\t\t$erro['data_nascimento'] = 'Data inválida.';\n\t\t\t}\n\t\t\telse if((int)$tmp[2] > ((int)date('Y') - 10)){\n\t\t\t\t$erro['data_nascimento'] = 'Data inválida.';\n\t\t\t}\n\t\t}\n\n\t\tif(isset($dados['estado']) && strlen($dados['estado']) == 0){\n\t\t\t$erro['estado'] = 'Selecione um Estado.';\n\t\t}\n\n\t\tif(isset($dados['cidade']) && strlen($dados['cidade']) == 0){\n\t\t\t$erro['cidade'] = 'Selecione uma Cidade.';\n\t\t}\n\n\t\tif(isset($dados['endereco']) && strlen($dados['endereco']) < 10){\n\t\t\t$erro['endereco'] = 'Endereço inválido. Deve conter mais de 10 caracteres.';\n\t\t}\n\n\t\tif(isset($dados['cep']) && strlen($dados['cep']) != 8){\n\t\t\t$erro['cep'] = 'CEP inválido.';\n\t\t}\n\n\t\tif(isset($dados['master']) && strlen($dados['master']) == 0){\n\t\t\t$erro['master'] = 'Permissão inválido.';\n\t\t}\n\t\t\n\t\treturn $erro;\n\t}\n\t\n\t//valida o nome do jogo\n\tpublic static function isNameJogo($nome){\n\t\t$pattern = '/^[ .a-zA-ZáéíóúÁÉÍÓÚ()0-9]+$/';\n\t\tif(preg_match($pattern, $nome)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//valida o nome do usuario\n\tpublic static function isName($nome){\n\t\t$pattern = '/^[ .a-zA-ZáéíóúÁÉÍÓÚ]+$/';\n\t\tif(preg_match($pattern, $nome)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//valida o login do usuario\n\tpublic static function isLogin($login){\n\t\t$pattern = '/^[_a-zA-Z-0-9]+$/';\n\t\tif(preg_match($pattern, $login)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//valida o e-mail do usuario\n\tpublic static function isEmail($email){\n\t\t$pattern = '/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/';\n\t\tif(preg_match($pattern, $email)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n}", "function is_valid() {\n $valid = True;\n foreach(get_object_vars($this) as $name => $obj) {\n if ($obj != NULL) {\n #validacion errores genericos de los campos\n $obj->required_validate();\n $flag = $obj->is_valid(); \n if (!$flag) \n { \n $valid = False;\n echo $obj->name.\" \";\n }\n #echo $obj->name;\n }\n }\n #busca metodos de validacion definido por usuario\n foreach(get_class_methods($this) as $fname) {\n $pos = strpos($fname, \"clean_\");\n if ($pos !== False) {\n $flag = $this->$fname();\n if (!$flag) \n { \n $valid = False;\n echo $fname.\" \";\n }\n }\n }\n echo $valid;\n return $valid;\n }", "public function checkIntegrity();", "public function validate()\n\t{\n\t\t$this->errors = [];\n\n\t\t$this->validateConfig();\n\n\t\t// there is no point to continue if config is not valid against the schema\n\t\tif($this->isValid()) {\n\t\t\t$this->validateRepetitions();\n\t\t\t$this->validateMode();\n\t\t\t$this->validateClasses();\n\t\t\t$this->validateTestData();\n\t\t}\n\t}", "public function validaCadastro()\n {\n $valido = true;\n\n /*if (!filter_var($this->__get('email'), FILTER_VALIDATE_EMAIL)) {\n $valido = false;\n }*/\n\n if (strlen($this->__get('senha')) < 4) {\n $valido = false;\n }\n\n if ($this->__get('senha') != $this->__get('conf_senha')) {\n $valido = false;\n }\n\n if (strlen($this->__get('nome')) < 4) {\n $valido = false;\n }\n\n return $valido;\n }", "private function checkValid()\n\t{\n\t\tif(!$this->isValid()) {\n\t\t\tthrow new \\RuntimeException(\"TypeStruct Error: '\".get_called_class().\"' not validated to perform further operations\");\t\n\t\t}\n\t}", "public function valid()\n {\n }", "public function valid()\n {\n }", "public function valid()\n {\n }", "public function valid()\n {\n }", "public function cargarLayoutParcial(Request $request){\n Validator::make($request->all(),[\n 'id_layout_parcial' => 'required|exists:layout_parcial,id_layout_parcial',\n 'tecnico' => 'required|max:45',\n 'fiscalizador_toma' => 'required|exists:usuario,id_usuario',\n 'fecha_ejecucion' => 'required|date',\n 'observacion' => 'nullable|string',\n\n 'maquinas' => 'nullable',\n 'maquinas.*.id_maquina' => 'required|integer|exists:maquina,id_maquina',\n 'maquinas.*.porcentaje_dev' => ['nullable','regex:/^\\d\\d?\\d?\\d?\\d?\\d?\\d?\\d?\\d?\\d?\\d?\\d?([,|.]\\d\\d?)?$/'],\n 'maquinas.*.denominacion' => ['nullable','string'],\n 'maquinas.*.juego.correcto' => 'required|in:true,false',\n 'maquinas.*.no_toma' => 'required|in:1,0',\n 'maquinas.*.juego.valor' => 'required|string',\n 'maquinas.*.marca.correcto' => 'required|in:true,false',\n 'maquinas.*.marca.valor' => 'required|string',\n 'maquinas.*.nro_isla.correcto' => 'required|in:true,false',\n 'maquinas.*.nro_isla.valor' => 'required|string',\n\n 'maquinas.*.progresivo' => 'nullable',\n 'maquinas.*.progresivo.id_progresivo' => 'required_with:maquinas.*.progresivo|integer|exists:progresivo,id_progresivo',\n 'maquinas.*.progresivo.maximo.correcto' => 'required_with:maquinas.*.progresivo|in:true,false',\n 'maquinas.*.progresivo.maximo.valor' => 'required_with:maquinas.*.progresivo|numeric' ,\n 'maquinas.*.progresivo.individual.valor' => 'required_with:maquinas.*.progresivo|in:INDIVIDUAL,LINKEADO',\n 'maquinas.*.progresivo.individual.correcto' => 'required_with:maquinas.*.progresivo|in:true,false',\n 'maquinas.*.progresivo.porc_recuperacion.valor' => 'required_with:maquinas.*.progresivo|string',\n 'maquinas.*.progresivo.porc_recuperacion.correcto' => 'required_with:maquinas.*.progresivo|in:true,false',\n 'maquinas.*.progresivo.nombre_progresivo.valor' => 'required_with:maquinas.*.progresivo|string',\n 'maquinas.*.progresivo.nombre_progresivo.correcto' => 'required_with:maquinas.*.progresivo|in:true,false',\n\n 'maquinas.*.niveles_progresivo' => 'nullable',\n 'maquinas.*.niveles_progresivo.*.id_nivel' => 'required',\n 'maquinas.*.niveles_progresivo.*.nombre_nivel' => 'required',\n 'maquinas.*.niveles_progresivo.*.base' => 'required',\n 'maquinas.*.niveles_progresivo.*.porc_oculto' => ['nullable','regex:/^\\d\\d?([,|.]\\d\\d?)?$/'],\n 'maquinas.*.niveles_progresivo.*.porc_visible' => ['required','regex:/^\\d\\d?([,|.]\\d\\d?\\d?)?$/'],\n\n\n ], array(), self::$atributos)->after(function($validator){\n\n // $validator->getData()\n\n })->validate();\n\n $layout_parcial = LayoutParcial::find($request->id_layout_parcial);\n\n $layout_parcial->tecnico = $request->tecnico;\n $layout_parcial->id_usuario_fiscalizador = $request->fiscalizador_toma;\n $layout_parcial->id_usuario_cargador = session('id_usuario');\n $layout_parcial->fecha_ejecucion = $request->fecha_ejecucion;\n $layout_parcial->observacion_fiscalizacion = $request->observacion;\n $detalle_layout_parcial = $layout_parcial->detalles;\n if(isset($request->maquinas)){\n //por cada renglon tengo progresivo, nivels y configuracion de maquina\n foreach ($request->maquinas as $maquina_de_layout){\n $maquina = Maquina::find($maquina_de_layout['id_maquina']);//maquina que corresponde a detalle de layout\n $bandera =1 ;\n $detalle = $layout_parcial->detalles()->where('id_maquina' , $maquina_de_layout['id_maquina'])->get();\n //valido que todos los campos esten corretos\n\n if(!(filter_var($maquina_de_layout['nro_admin']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $maquina_con_diferencia = new CampoConDiferencia;//si el nombre juego presentaba diferencia\n $maquina_con_diferencia->columna ='nro_admin';\n $maquina_con_diferencia->entidad ='maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['nro_admin']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['juego']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $maquina_con_diferencia = new CampoConDiferencia;//si el nombre juego presentaba diferencia\n $maquina_con_diferencia->columna ='nombre_juego';\n $maquina_con_diferencia->entidad ='maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['juego']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['marca']['correcto'],FILTER_VALIDATE_BOOLEAN))){//si el marca presentaba diferencia\n $maquina_con_diferencia = new CampoConDiferencia;\n $maquina_con_diferencia->columna = 'marca';\n $maquina_con_diferencia->entidad = 'maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['marca']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['nro_isla']['correcto'],FILTER_VALIDATE_BOOLEAN))){//si el numero isla presentaba diferencia\n $maquina_con_diferencia = new CampoConDiferencia;\n $maquina_con_diferencia->columna = 'nro_isla';\n $maquina_con_diferencia->entidad = 'maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['nro_isla']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['nro_serie']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $maquina_con_diferencia = new CampoConDiferencia;\n $maquina_con_diferencia->columna = 'nro_serie';\n $maquina_con_diferencia->entidad = 'maquina';\n $maquina_con_diferencia->valor = $maquina_de_layout['nro_serie']['valor'];\n $maquina_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $maquina_con_diferencia->save();\n $bandera=0;\n }\n\n //reviso configuracion de progresivo\n if(isset($maquina_de_layout['progresivo'])){ //configuracion progresivo\n $progresivo = Progresivo::find($maquina_de_layout['progresivo']['id_progresivo']);\n $pozo= $maquina->pozo;\n\n if(!(filter_var($maquina_de_layout['progresivo']['maximo']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $progresivos_con_diferencia = new CampoConDiferencia;\n $progresivos_con_diferencia->columna ='maximo';\n $progresivos_con_diferencia->entidad ='progresivo';\n $progresivos_con_diferencia->valor = $maquina_de_layout['progresivo']['maximo']['valor'];\n $progresivos_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $progresivos_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['progresivo']['porc_recuperacion']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $progresivos_con_diferencia = new CampoConDiferencia;\n $progresivos_con_diferencia->columna ='porc_recuperacion';\n $progresivos_con_diferencia->entidad ='progresivo';\n $progresivos_con_diferencia->valor = $maquina_de_layout['progresivo']['porc_recuperacion']['valor'];\n $progresivos_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $progresivos_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['progresivo']['nombre_progresivo']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $progresivos_con_diferencia = new CampoConDiferencia;\n $progresivos_con_diferencia->columna ='nombre_progresivo';\n $progresivos_con_diferencia->entidad ='progresivo';\n $progresivos_con_diferencia->valor = $maquina_de_layout['progresivo']['nombre_progresivo']['valor'];\n $progresivos_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $progresivos_con_diferencia->save();\n $bandera=0;\n }\n if(!(filter_var($maquina_de_layout['progresivo']['individual']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $progresivos_con_diferencia = new CampoConDiferencia;\n $progresivos_con_diferencia->columna ='individual';\n $progresivos_con_diferencia->entidad ='progresivo';\n $progresivos_con_diferencia->valor = $maquina_de_layout['progresivo']['individual']['valor'];\n $progresivos_con_diferencia->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $progresivos_con_diferencia->save();\n $bandera=0;\n }\n\n //reviso niveles del progresivo\n if(isset($maquina_de_layout['niveles'])){\n $i=1;\n foreach ($maquina_de_layout['niveles'] as $nivel) {\n if(!(filter_var($nivel['porc_visible']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='porc_visible';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['porc_visible']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n if(!(filter_var($nivel['porc_oculto']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='porc_oculto';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['porc_oculto']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n if(!(filter_var($nivel['base']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='base';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['base']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n if(!(filter_var($nivel['nombre_nivel']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='nombre_nivel';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['nombre_nivel']['valor'];\n\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n\n if(!(filter_var($nivel['base']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='base';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['base']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n if(!(filter_var($nivel['nombre_nivel']['correcto'],FILTER_VALIDATE_BOOLEAN))){\n $niv_con_dif = new CampoConDiferencia;\n $niv_con_dif->columna ='nombre_nivel';\n $niv_con_dif->entidad ='nivel_progresivo/'.$i;\n $niv_con_dif->valor = $nivel['nombre_nivel']['valor'];\n $niv_con_dif->detalle_layout_parcial()->associate($detalle[0]->id_detalle_layout_parcial);\n $niv_con_dif->save();\n $bandera=0;\n }\n $i++;\n }\n }\n }\n\n if($detalle->count() == 1 ){\n $detalle[0]->correcto=$bandera;\n $detalle[0]->denominacion = $maquina_de_layout['denominacion'];\n $detalle[0]->porcentaje_devolucion = $maquina_de_layout['porcentaje_dev'];\n $detalle[0]->save();\n }\n\n }\n }\n $estado_relevamiento = EstadoRelevamiento::where('descripcion','finalizado')->get();\n $layout_parcial->id_estado_relevamiento = $estado_relevamiento[0]->id_estado_relevamiento; //finalizado\n $layout_parcial->save();\n return ['estado' => $estado_relevamiento[0]->descripcion,\n 'codigo' => 200 ];//codigo ok, dispara boton buscar en vista\n }", "public function valid()\n {\n\n if ($this->container['major_group_id'] === null) {\n return false;\n }\n if ($this->container['sub_group_id'] === null) {\n return false;\n }\n if ($this->container['lob_id'] === null) {\n return false;\n }\n if ($this->container['sku'] === null) {\n return false;\n }\n if ($this->container['item_description'] === null) {\n return false;\n }\n if ($this->container['backorder'] === null) {\n return false;\n }\n if ($this->container['charge_code'] === null) {\n return false;\n }\n if ($this->container['max_cycle'] === null) {\n return false;\n }\n if ($this->container['max_interim'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['seasonal_item'] === null) {\n return false;\n }\n if ($this->container['secure'] === null) {\n return false;\n }\n if ($this->container['unit_code'] === null) {\n return false;\n }\n if ($this->container['forward_lot_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['storage_lot_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['forward_item_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['storage_item_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['allocation_rule'] === null) {\n return false;\n }\n if ($this->container['receiving_criteria_scheme_id'] === null) {\n return false;\n }\n if ($this->container['hazmat'] === null) {\n return false;\n }\n return true;\n }", "function validarDatosRegistro() {\r\n // Recuperar datos Enviados desde formulario_nuevo_equipo.php\r\n $datos = Array();\r\n $datos[0] = (isset($_REQUEST['marca']))?\r\n $_REQUEST['marca']:\"\";\r\n $datos[1] = (isset($_REQUEST['modelo']))?\r\n $_REQUEST['modelo']:\"\";\r\n $datos[2] = (isset($_REQUEST['matricula']))?\r\n $_REQUEST['matricula']:\"\";\r\n \r\n //-----validar ---- //\r\n $errores = Array();\r\n $errores[0] = !validarMarca($datos[0]);\r\n $errores[1] = !validarModelo($datos[1]);\r\n $errores[2] = !validarMatricula($datos[2]);\r\n \r\n // ----- Asignar a variables de Sesión ----//\r\n $_SESSION['datos'] = $datos;\r\n $_SESSION['errores'] = $errores; \r\n $_SESSION['hayErrores'] = \r\n ($errores[0] || $errores[1] ||\r\n $errores[2]);\r\n \r\n}", "protected function prepareForValidation()\n {\n $this->merge([\n 'insumos' => json_decode($this->insumos, true),\n ]);\n }", "function validar(){\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n\n if (empty($_POST[\"noEmpleado\"])) {\n $this->numEmpErr = \"El numero de empleado es requerido\";\n } else {\n $this->noEmpleado = $this->test_input($_POST[\"noEmpleado\"]);\n if (is_numeric($this->noEmpleado)) {\n $this->numEmpErr = \"Solo se permiten numeros\";\n }\n }\n\n if (empty($_POST[\"nombre\"])) {\n $this->nameErr = \"El nombre es requerido\";\n } else {\n $this->nombre = $this->test_input($_POST[\"nombre\"]);\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->nombre)) {\n $this->nameErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"carrera\"])) {\n $this->carreraErr = \"La carrera es requerida\";\n } else {\n $this->carrera = $this->test_input($_POST[\"carrera\"]);\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->carrera)) {\n $this->carreraErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"telefono\"])) {\n $this->telErr = \"El telefono es requerido\";\n } else {\n $this->telefono = $this->test_input($_POST[\"telefono\"]);\n if (is_numeric($this->telefono)) {\n $this->telErr = \"Solo se permiten numeros\";\n }\n }\n\n }\n }", "public function valid()\n {\n\n if (strlen($this->container['company_name']) > 254) {\n return false;\n }\n if (strlen($this->container['company_name']) < 0) {\n return false;\n }\n if ($this->container['firstname'] === null) {\n return false;\n }\n if (strlen($this->container['firstname']) > 255) {\n return false;\n }\n if (strlen($this->container['firstname']) < 0) {\n return false;\n }\n if ($this->container['lastname'] === null) {\n return false;\n }\n if (strlen($this->container['lastname']) > 255) {\n return false;\n }\n if (strlen($this->container['lastname']) < 0) {\n return false;\n }\n if ($this->container['street'] === null) {\n return false;\n }\n if (strlen($this->container['street']) > 254) {\n return false;\n }\n if (strlen($this->container['street']) < 3) {\n return false;\n }\n if ($this->container['post_code'] === null) {\n return false;\n }\n if (strlen($this->container['post_code']) > 40) {\n return false;\n }\n if (strlen($this->container['post_code']) < 2) {\n return false;\n }\n if ($this->container['city'] === null) {\n return false;\n }\n if (strlen($this->container['city']) > 99) {\n return false;\n }\n if (strlen($this->container['city']) < 2) {\n return false;\n }\n if ($this->container['country_code'] === null) {\n return false;\n }\n if (strlen($this->container['country_code']) > 2) {\n return false;\n }\n if (strlen($this->container['country_code']) < 0) {\n return false;\n }\n if (strlen($this->container['telephone']) > 99) {\n return false;\n }\n if (strlen($this->container['telephone']) < 0) {\n return false;\n }\n return true;\n }", "public function validate(){\n\n if(!$this->convert_and_validate_rows()){\n return 0;\n }\n\n if(!$this->validate_columns()){\n return 0;\n }\n\n if(!$this->validate_regions()){\n return 0;\n }\n\n return 1;\n }" ]
[ "0.70007986", "0.6986544", "0.6949182", "0.69255984", "0.6897925", "0.68956846", "0.68956846", "0.68162394", "0.6747183", "0.67454726", "0.66702", "0.66171324", "0.64890045", "0.6477106", "0.64625376", "0.64479244", "0.64308196", "0.63936", "0.6371499", "0.63226116", "0.6312653", "0.6287968", "0.6287968", "0.6287968", "0.6287968", "0.6287968", "0.6287968", "0.6287968", "0.6287968", "0.6280903", "0.62754905", "0.6262434", "0.62462765", "0.6209277", "0.6204907", "0.61936265", "0.618866", "0.6185905", "0.6180155", "0.61707085", "0.6170513", "0.61617196", "0.61586195", "0.6146954", "0.61345226", "0.61228937", "0.6122551", "0.6117057", "0.6117057", "0.6114394", "0.6110402", "0.61101115", "0.6106325", "0.6099108", "0.6093148", "0.6093148", "0.6093148", "0.6093148", "0.60919553", "0.6076066", "0.6068371", "0.6064099", "0.6060189", "0.60584325", "0.60524833", "0.6044759", "0.60350466", "0.60346943", "0.6027569", "0.601518", "0.59883916", "0.59883916", "0.59883916", "0.59883916", "0.59883916", "0.59883916", "0.59883916", "0.59883916", "0.59883916", "0.59883916", "0.59883916", "0.59883916", "0.5974258", "0.59735215", "0.59666073", "0.5965085", "0.59649533", "0.596365", "0.5958142", "0.5943796", "0.5943796", "0.5943796", "0.5943796", "0.59371036", "0.5921433", "0.5920203", "0.5919492", "0.5912013", "0.59119755", "0.5903671" ]
0.71513873
0
Atualiza os dados da Estrutura da escola
public function atualizarDadosEstrutura(DBLayoutLinha $oLinha, $oDadosEscola) { $oDaoEscola = db_utils::getDao('escola'); $oDaoEscolaEstrutura = db_utils::getDao('escolaestrutura'); if ($oLinha->educacao_indigena != "" && $oLinha->educacao_indigena != trim($oDadosEscola->ed18_i_educindigena)) { $oDaoEscola->ed18_i_educindigena = $oLinha->educacao_indigena; } if ($oLinha->lingua_ensino_ministrado_lingua_indigena != "" && $oLinha->lingua_ensino_ministrado_lingua_indigena != trim($oDadosEscola->ed18_i_tipolinguain)) { $oDaoEscola->ed18_i_tipolinguain = $oLinha->lingua_ensino_ministrado_lingua_indigena; } if ($oLinha->lingua_ensino_ministrada_lingua_portuguesa != "" && $oLinha->lingua_ensino_ministrada_lingua_portuguesa != trim($oDadosEscola->ed18_i_tipolinguapt)) { $oDaoEscola->ed18_i_tipolinguapt = $oLinha->lingua_ensino_ministrada_lingua_portuguesa; } if ($oLinha->codigo_lingua_indigena != "" && $oLinha->codigo_lingua_indigena != trim($oDadosEscola->ed18_i_linguaindigena)) { $oDaoEscola->ed18_i_linguaindigena = $oLinha->codigo_lingua_indigena; } if ($oLinha->localizacao_diferenciada_escola != "" && $oLinha->localizacao_diferenciada_escola != trim($oDadosEscola->ed18_i_locdiferenciada)) { $oDaoEscola->ed18_i_locdiferenciada = $oLinha->localizacao_diferenciada_escola; } $oDaoEscola->ed18_i_codigo = $oDadosEscola->ed18_i_codigo; $oDaoEscola->alterar($oDadosEscola->ed18_i_codigo); if ($oDaoEscola->erro_status == '0') { throw new Exception("Erro na alteração dos dados da escola. Erro da classe: ".$oDaoEscola->erro_msg); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function envios_datos()\n\t{\n\n\t\tparent::objeto();\n\n\t\t$this->tabla=\"envios\";\n\t\t$this->campoClave=\"IdEnvio\";\n\t\t$this->id=null;\n\t\t\n\t\t\n$v=new Variable(2,$this->tabla,\"IdEnvio\",1);\n\t\t\t\n$v->clave=true;\n\t\t\t\n\t\t\t\n$v->autonumerica=true;\n\t\t\t\n$this->agregarVariable2($v);\n$v=new Variable(2,$this->tabla,\"IdMail\",2);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Envio\",3);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Descripcion\",4);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"TablaDatosExtras\",5);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"CondicionDatosExtras\",6);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"FechaCreacion\",7);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"FechaModificacion\",8);\n$this->agregarVariable2($v);\n\n\t}", "function usuarios_estados_datos()\n\t{\n\n\t\tparent::objeto();\n\n\t\t$this->tabla=\"usuarios_estados\";\n\t\t$this->campoClave=\"Id\";\n\t\t$this->id=null;\n\t\t\n\t\t\n$v=new Variable(2,$this->tabla,\"Id\",1);\n\t\t\t\n$v->clave=true;\n\t\t\t\n\t\t\t\n$v->autonumerica=true;\n\t\t\t\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Estado\",2);\n$this->agregarVariable2($v);\n\n\t}", "public function actualizar() {\n $ord = $this->orden;\n $this->cargarPersonas($ord);\n }", "function salva()\n\t{\n\t\trestauraConObj($this->mapa,$this->postgis_mapa);\n\t\t$this->mapa->save($this->arquivo);\n\t}", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "function dadosCadastros(){//função geral que será chamada na index\n pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array\n contaNumeroCadastros();//conta Quantos cadastros existem\n }", "public function atualizar()\n {\n return (new Database('vagas'))->update('id = '.$this->id, [\n 'titulo' => $this->titulo,\n 'descricao' => $this->descricao,\n 'ativo' => $this->ativo,\n 'data' => $this->data \n ]);\n }", "function asignar_valores(){\n\t\t$this->tabla=$_POST['tabla'];\n\t\t$this->pertenece=$_POST['pertenece'];\n\t\t$this->asunto=$_POST['asunto'];\n\t\t$this->descripcion=$_POST['contenido'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->hora=$_POST['hora'];\n\t\t$this->fechamod=$_POST['fechamod'];\n\t}", "function salva()\n {\n if (isset($this->layer)) {\n $this->recalculaSLD();\n }\n restauraConObj($this->mapa, $this->postgis_mapa);\n $this->mapa->save($this->arquivo);\n }", "abstract function ActualizarDatos();", "public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }", "public function gerarDados() {\n \n if (empty($this->sDataInicial)) {\n throw new Exception(\"Data inicial nao informada!\");\n }\n \n if (empty($this->sDataFinal)) {\n throw new Exception(\"Data final não informada!\");\n }\n /**\n * Separamos a data do em ano, mes, dia\n */\n list($iAno, $iMes, $iDia) = explode(\"-\",$this->sDataFinal);\n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sSqlSubsidio = \"select c16_mes, \";\n $sSqlSubsidio .= \" c16_ano,\";\n $sSqlSubsidio .= \" c16_subsidiomensal,\";\n $sSqlSubsidio .= \" c16_subsidioextraordinario,\";\n $sSqlSubsidio .= \" z01_nome, \";\n $sSqlSubsidio .= \" z01_cgccpf \";\n $sSqlSubsidio .= \" from padsigapsubsidiosvereadores \"; \n $sSqlSubsidio .= \" inner join cgm on z01_numcgm = c16_numcgm \"; \n $sSqlSubsidio .= \" where c16_ano = {$iAno} \";\n $sSqlSubsidio .= \" and c16_mes <= $iMes\"; \n $sSqlSubsidio .= \" and c16_instit = {$sListaInstit}\";\n $sSqlSubsidio .= \" order by c16_ano, c16_mes\";\n $rsSubsidio = db_query($sSqlSubsidio); \n $iTotalLinhas = pg_num_rows($rsSubsidio);\n for ($i = 0; $i < $iTotalLinhas; $i++) {\n \n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n $oSubSidio = db_utils::fieldsMemory($rsSubsidio, $i);\n \n $oRetorno = new stdClass();\n $oRetorno->subCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oRetorno->subMesAnoMovimento = $sDiaMesAno;\n $iUltimoDiaMes = cal_days_in_month(CAL_GREGORIAN, $oSubSidio->c16_mes, $oSubSidio->c16_ano); \n $oRetorno->subMesAnoReferencia = $oSubSidio->c16_ano.\"-\".str_pad($oSubSidio->c16_mes, 2, \"0\", STR_PAD_LEFT).\"-\".\n str_pad($iUltimoDiaMes, 2, \"0\", STR_PAD_LEFT);\n $oRetorno->subNomeVereador = substr($oSubSidio->z01_nome, 0, 80); \n $oRetorno->subCPF = str_pad($oSubSidio->z01_cgccpf, 11, \"0\", STR_PAD_LEFT); \n $oRetorno->subMensal = $this->corrigeValor($oSubSidio->c16_subsidiomensal, 13); \n $oRetorno->subExtraordinario = $this->corrigeValor($oSubSidio->c16_subsidioextraordinario, 13); \n $oRetorno->subTotal = $this->corrigeValor(($oSubSidio->c16_subsidioextraordinario+\n $oSubSidio->c16_subsidiomensal), 13);\n array_push($this->aDados, $oRetorno); \n }\n return true;\n }", "protected function migrarDados()\n {\n $serviceDemanda = $this->getService('OrdemServico\\Service\\DemandaFile');\n try {\n $serviceDemanda->begin();\n $arrUsuario = $this->getService('OrdemServico\\Service\\UsuarioFile')->fetchPairs([], 'getNoUsuario', 'getIdUsuario');\n $OrdemSevicoSevice = $this->getService('OrdemServico\\Service\\OrdemServicoDemandaFile');\n $arrDemanda = $serviceDemanda->findBy([], ['id_demanda' => 'asc']);\n $serviceDemanda::setFlush(false);\n foreach ($arrDemanda as $demanda) {\n $intIdUsuario = $arrUsuario[$demanda->getNoExecutor()];\n if ($intIdUsuario) {\n $demanda->setVlComplexidade(null)\n ->setVlImpacto(null)\n ->setVlCriticidade(null)\n ->setVlFatorPonderacao(null)\n ->setVlFacim(null)\n ->setVlQma(null)\n ->setIdUsuario($intIdUsuario);\n $serviceDemanda->getEntityManager()->persist($demanda);\n $arrDemandaServico = $OrdemSevicoSevice->findBy(['id_demanda' => $demanda->getIdDemanda()]);\n if ($arrDemandaServico) {\n $ordemServicoDemanda = reset($arrDemandaServico);\n $ordemServicoDemanda->setIdUsuarioAlteracao($demanda->getIdUsuario())\n ->setDtAlteracao(Date::convertDateTemplate($demanda->getDtAbertura()));\n $OrdemSevicoSevice->getEntityManager()->persist($demanda);\n }\n }\n }\n $serviceDemanda::setFlush(true);\n $serviceDemanda->commit();\n } catch (\\Exception $exception) {\n $serviceDemanda->rollback();\n var_dump($exception->getMessage());\n die;\n }\n }", "public function atualizar()\r\n {\r\n return (new Database('instituicao'))->update('id=' . $this->id, [\r\n 'nome' => $this->nome,\r\n 'datacriacao' => $this->datacriacao,\r\n 'tipo' => $this->tipo\r\n\r\n ]);\r\n }", "public function atualizar(){\r\n return (new Database('atividades'))->update('id = '.$this->id,[\r\n 'titulo' => $this->titulo,\r\n 'descricao' => $this->descricao,\r\n 'ativo' => $this->ativo,\r\n 'data' => $this->data\r\n ]);\r\n }", "private function inicializa_propiedades(): array\n {\n $identificador = \"cat_sat_tipo_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Tipo\");\n $pr = $this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_division_producto_id\";\n $propiedades = array(\"label\" => \"SAT - División\", \"con_registros\" => false);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n\n $identificador = \"cat_sat_grupo_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Grupo\", \"con_registros\" => false);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_clase_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Clase\", \"con_registros\" => false);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_producto_id\";\n $propiedades = array(\"label\" => \"SAT - Producto\", \"con_registros\" => false, \"cols\" => 12);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_unidad_id\";\n $propiedades = array(\"label\" => \"SAT - Unidad\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_obj_imp_id\";\n $propiedades = array(\"label\" => \"Objeto del Impuesto\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"com_tipo_producto_id\";\n $propiedades = array(\"label\" => \"Tipo Producto\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"cat_sat_conf_imps_id\";\n $propiedades = array(\"label\" => \"Conf Impuestos\", \"cols\" => 12);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"codigo\";\n $propiedades = array(\"place_holder\" => \"Código\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"descripcion\";\n $propiedades = array(\"place_holder\" => \"Producto\", \"cols\" => 12);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n $identificador = \"precio\";\n $propiedades = array(\"place_holder\" => \"Precio\", \"cols\" => 6);\n $pr =$this->asignar_propiedad(identificador:$identificador, propiedades: $propiedades);\n if(errores::$error){\n return $this->errores->error(mensaje: 'Error al inicializa',data: $pr);\n }\n\n return $this->keys_selects;\n }", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "public function TraspasoData(){\r\n\t\t$this->idorigen = \"\";\r\n\t\t$this->iddestino = \"\";\r\n\t\t$this->idusuario = \"\";\r\n\t\t$this->fecha = \"NOW()\";\r\n\r\n\t\t#Realizar el traspaso de cada producto\r\n\t\t$this->idtraspaso = \"\";\r\n\t\t$this->idproducto = \"\";\r\n\t\t$this->cantidad = \"\";\r\n\t}", "public function persist() {\n\n $classenta = new cl_assenta();\n\n $classenta->h16_regist = $this->getMatricula();\n $classenta->h16_assent = $this->getTipoAssentamento();\n $classenta->h16_dtconc = ($this->getDataConcessao() instanceof DBDate ? $this->getDataConcessao()->getDate() : $this->getDataConcessao());\n $classenta->h16_histor = $this->getHistorico();\n $classenta->h16_nrport = $this->getCodigoPortaria();\n $classenta->h16_atofic = $this->getDescricaoAto();\n $classenta->h16_quant = $this->getDias();\n $classenta->h16_perc = ($this->getPercentual()) ? $this->getPercentual() : '0';\n $classenta->h16_dtterm = ($this->getDataTermino() instanceof DBDate ? $this->getDataTermino()->getDate() : $this->getDataTermino());\n $classenta->h16_hist2 = $this->getSegundoHistorico();\n $classenta->h16_login = ($this->getLoginUsuario()) ? $this->getLoginUsuario() : '1';\n $classenta->h16_dtlanc = ($this->getDataLancamento() instanceof DBDate ? $this->getDataLancamento()->getDate() : $this->getDataLancamento());\n $classenta->h16_conver = ((bool)(int)$this->isConvertido()) == false ? 'false' : 'true';\n $classenta->h16_anoato = $this->getAnoPortaria();\n $classenta->h16_hora = $this->getHora();\n\n if(empty($this->iCodigo)) {\n\n $classenta->incluir(null);\n\n if ($classenta->erro_status == \"0\") {\n return $classenta->erro_msg;\n }\n\n $this->setCodigo($classenta->h16_codigo);\n } else {\n\n $classenta->h16_codigo = $this->getCodigo();\n $classenta->alterar($this->getCodigo());\n\n if ($classenta->erro_status == \"0\") {\n return $classenta->erro_msg;\n }\n }\n\n return $this;\n }", "function alta_inventario(){\n\t\t\n\t\t$u= new Pr_factura();\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresaid'];\n\t\t$u->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$u->fecha_captura=date(\"Y-m-d H:i:s\");\n\t\t$u->fecha=date(\"Y-m-d H:i:s\");\n\t\t$u->cproveedores_id=1;\n $u->fecha_pago=date(\"Y-m-d H:i:s\");\n $u->ctipo_factura_id=2;\n\t\t$fecha=explode(\" \", $_POST['fecha']);\n\t\t$u->fecha=$fecha[2].\"/\".$fecha[1].\"/\".$fecha[0];\n\t\tunset($_POST['fecha']);\n\t\tunset($_POST['tipo_entrada']);\n\t\t$related = $u->from_array($_POST);\n\t\t// save with the related objects\n\t\t\n\t\tif($u->save($related)){\n //Dar de alta el lote si el proveedor no es el inicial\n if($u->cproveedores_id>0){\n $l=new Lote();\n $l->fecha_recepcion=$u->fecha;\n $l->espacio_fisico_inicial_id=$u->espacios_fisicos_id;\n $l->pr_factura_id=$u->id;\n $l->save(); \n $u->lote_id=$l->id;\n $u->save();\n }\n }\n\t\t\techo \"<input type='hidden' name='id' id='id' value='$u->id'>\";\n \n\t}", "public function TemparioData(){\n\t\t$this->id = \"\"; \n\t\t$this->id_tempario = \"\";\n\t\t$this->descripcion = \"\";\n\t\t$this->tiempo = \"\";\n\t\n\t\t\n\t}", "public function atualizar(){\r\n return (new Database('cartao'))->update(' id = '.$this->id, [\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n }", "function evt__enviar(){\n if($this->dep('datos')->tabla('mesa')->esta_cargada()){\n $m = $this->dep('datos')->tabla('mesa')->get();\n // print_r($m);\n $m['estado'] = 2;//Cambia el estado de la mesa a Enviado\n $this->dep('datos')->tabla('mesa')->set($m);\n // print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n // $this->dep('datos')->tabla('mesa')->resetear();\n \n $m = $this->dep('datos')->tabla('mesa')->get_listado($m['id_mesa']);\n if($m[0]['estado'] == 2){//Obtengo de la BD y verifico que hizo cambios en la BD\n //Se enviaron correctamente los datos\n toba::notificacion()->agregar(utf8_decode(\"Los datos fueron enviados con éxito\"),\"info\");\n }\n else{\n //Se generó algún error al guardar en la BD\n toba::notificacion()->agregar(utf8_decode(\"Error al enviar la información, verifique su conexión a internet\"),\"info\");\n }\n }\n \n }", "public function editData() {\n $this->daftar_barang = array_values($this->daftar_barang);\n $data_barang = json_encode($this->daftar_barang, JSON_PRETTY_PRINT);\n file_put_contents($this->file, $data_barang);\n $this->ambilData();\n }", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->e80_codage = ($this->e80_codage == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_codage\"]:$this->e80_codage);\n if($this->e80_data == \"\"){\n $this->e80_data_dia = ($this->e80_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_data_dia\"]:$this->e80_data_dia);\n $this->e80_data_mes = ($this->e80_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_data_mes\"]:$this->e80_data_mes);\n $this->e80_data_ano = ($this->e80_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_data_ano\"]:$this->e80_data_ano);\n if($this->e80_data_dia != \"\"){\n $this->e80_data = $this->e80_data_ano.\"-\".$this->e80_data_mes.\"-\".$this->e80_data_dia;\n }\n }\n if($this->e80_cancelado == \"\"){\n $this->e80_cancelado_dia = ($this->e80_cancelado_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_cancelado_dia\"]:$this->e80_cancelado_dia);\n $this->e80_cancelado_mes = ($this->e80_cancelado_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_cancelado_mes\"]:$this->e80_cancelado_mes);\n $this->e80_cancelado_ano = ($this->e80_cancelado_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_cancelado_ano\"]:$this->e80_cancelado_ano);\n if($this->e80_cancelado_dia != \"\"){\n $this->e80_cancelado = $this->e80_cancelado_ano.\"-\".$this->e80_cancelado_mes.\"-\".$this->e80_cancelado_dia;\n }\n }\n $this->e80_instit = ($this->e80_instit == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_instit\"]:$this->e80_instit);\n }else{\n $this->e80_codage = ($this->e80_codage == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"e80_codage\"]:$this->e80_codage);\n }\n }", "function actualizarEstadisticasEnvios() {\n// primero borra estadísticas actuales\n// luego agrega los envios \n// por último actualiza las estadísticas\n// esto es porque hacer un left join de envios a envios_subscriptos demora mucho.\n\n\t$sql=\"DELETE from estadisticas_envios\";\n\t$this->database->ejecutarSentenciaSQL($sql);\n\t$sql=\"INSERT INTO estadisticas_envios (IdEnvio) SELECT IdEnvio FROM envios\";\n\t$this->database->ejecutarSentenciaSQL($sql);\n\t$sql=\"SELECT IdEnvio, COUNT( IdSubscripto ) AS EnviosTotales, COUNT( DISTINCT IdSubscripto ) AS SubscriptosUnicos, SUM( IF( IdEstadoEnvio =1, 1, 0 ) ) AS Pendientes, SUM( IF( IdEstadoEnvio =2, 1, 0 ) ) AS Enviados, SUM( IF( IdEstadoEnvio =3, 1, 0 ) ) AS Rebotados, MIN( FechaHora ) AS Primero, MAX( FechaHora ) AS Ultimo, SUM( IF( DATEDIFF( FechaHora, NOW( ) ) > -7, 1, 0 ) ) AS UltimaSemana, SUM( IF( DATEDIFF( FechaHora, NOW( ) ) =0, 1, 0 ) ) AS UltimoDia, SUM( IF( TIMEDIFF( FechaHora, NOW( ) ) <= '-01:00:00', 1, 0 ) ) AS UltimaHora, SUM( IF( TIMEDIFF( FechaHora, NOW( ) ) < '-00:15:00', 1, 0 ) ) AS Ultimos15Min\nFROM envios_subscriptos\nGROUP BY IdEnvio\";\n\t$this->database->obtenerRecordset($sql);\n\t$rs=new RS($this->database->rs);\n\twhile ($row=$rs->darSiguienteFila()) {\n\t\t$sql=\"UPDATE estadisticas_envios SET EnviosTotales=\" . $row[\"EnviosTotales\"] . \",SubscriptosUnicos=\". $row[\"SubscriptosUnicos\"] . \",Pendientes=\". $row[\"Pendientes\"] . \",Enviados=\". $row[\"Enviados\"] . \",Rebotados=\". $row[\"Rebotados\"] . \",Primero='\". ($row[\"Primero\"] !=null ? $row[\"Primero\"] .\"'\" :\"null\"). \",Ultimo='\". ($row[\"Ultimo\"]!=null?$row[\"Ultimo\"]. \"'\":\"null\") . \",UltimaSemana=\". $row[\"UltimaSemana\"] . \",UltimoDia=\". $row[\"UltimoDia\"] . \",UltimaHora=\". $row[\"UltimaHora\"] . \",Ultimos15Min=\". $row[\"Ultimos15Min\"] . \" WHERE IdEnvio=\" . $row[\"IdEnvio\"]\t;\n\t\t$this->database->ejecutarSentenciaSQL($sql);\n\t}\n}", "private function iniciarRecolectarData()\r\n\t\t{\r\n\t\t\tself::findPagoDetalleActividadEconomica();\r\n\t\t\tself::findPagoDetalleInmuebleUrbano();\r\n\t\t\tself::findPagoDetalleVehiculo();\r\n\t\t\tself::findPagoDetalleAseo();\r\n\t\t\tself::findPagoDetallePropaganda();\r\n\t\t\tself::findPagoDetalleEspectaculo();\r\n\t\t\tself::findPagoDetalleApuesta();\r\n\t\t\tself::findPagoDetalleVario();\r\n\t\t\tself::findPagoDetalleMontoNegativo();\r\n\t\t\tself::ajustarDataReporte();\r\n\t\t}", "function __construct(){\n // Mapping con la tabla de EJEDISTANCIA\n $mappingString = '{ \n \"dbConnectionClass\":\"AvalesConnection\",\n \"dbTable\" : \"AVALES\",\n \"attributes\" : {\n \"idAval\" : {\"fiedlName\" : \"ID_AVAL\", \"type\" : \"NUMERIC\", \"onInsert\" : \"NO_INSERT\", \"onUpdate\" : \"NO_UPDATE\"},\n \"nroAval\" : {\"fiedlName\" : \"NRO_AVAL\", \"type\" : \"NUMERIC\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"nroExpediente\" : {\"fiedlName\" : \"NRO_EXPEDIENTE\", \"type\" : \"NUMERIC\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"nroRegistro\" : {\"fiedlName\" : \"REGISTRO\", \"type\" : \"NUMERIC\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"idIngeniero\" : {\"fiedlName\" : \"ID_INGENIERO\", \"type\" : \"NUMERIC\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"idTitular\" : {\"fiedlName\" : \"ID_TITULAR\", \"type\" : \"NUMERIC\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"idVehiculo\" : {\"fiedlName\" : \"ID_VEHICULO\", \"type\" : \"NUMERIC\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"fechaAlta\" : {\"fiedlName\" : \"FECHA_ALTA\", \"type\" : \"DATE\", \"onInsert\" : \"NO_INSERT\", \"onUpdate\" : \"NO_UPDATE\"},\n \"pendiente\" : {\"fiedlName\" : \"PENDIENTE\", \"type\" : \"STRING\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"esAlta\" : {\"fiedlName\" : \"ID_INGENIERO\", \"type\" : \"NUMERIC\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"tipoAlta\" : {\"fiedlName\" : \"TIPO_ALTA\", \"type\" : \"STRING\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"codPlanta\" : {\"fiedlName\" : \"COD_PLANTA\", \"type\" : \"STRING\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"fechaFinalizacion\" : {\"fiedlName\" : \"FECHA_FINALIZACION\", \"type\" : \"DATE\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"estadoActual\" : {\"fiedlName\" : \"ESTADO_ACTUAL\", \"type\" : \"NUMERIC\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"fotos\" : {\"fiedlName\" : \"FOTOS\", \"type\" : \"STRING\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"porAntiguedad\" : {\"fiedlName\" : \"POR_ANTIGUEDAD\", \"type\" : \"STRING\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"},\n \"idUsuarioFinalizacion\" : {\"fiedlName\" : \"USUARIO_FINALIZACION\", \"type\" : \"NUMERIC\", \"onInsert\" : \"INSERT\", \"onUpdate\" : \"UPDATE\"}\n }\n }';\n\n # Initial Values...\n \n parent::__construct(json_decode($mappingString));\n }", "public function gerarDados() {\n \n if (empty($this->sDataInicial)) {\n throw new Exception(\"Data inicial nao informada!\");\n }\n \n if (empty($this->sDataFinal)) {\n throw new Exception(\"Data final não informada!\");\n }\n /**\n * Separamos a data do em ano, mes, dia\n */\n list($iAno, $iMes, $iDia) = explode(\"-\",$this->sDataFinal);\n \n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sWhere = \"o70_instit in ({$sListaInstit})\";\n $iAnoUsu = (db_getsession(\"DB_anousu\")-1);\n $sDataIni = $iAnoUsu.\"-01-01\";\n $sDataFim = $iAnoUsu.\"-12-31\";\n $sSqlBalAnterior = db_receitasaldo(11, 1, 3, true, $sWhere, $iAnoUsu, $sDataIni, $sDataFim, true);\n \n $sSqlAgrupado = \"select case when fc_conplano_grupo($iAnoUsu, substr(o57_fonte,1,1) || '%', 9000 ) is false \"; \n $sSqlAgrupado .= \" then substr(o57_fonte,2,14) else substr(o57_fonte,1,15) end as o57_fonte, \";\n $sSqlAgrupado .= \" o57_descr, \";\n $sSqlAgrupado .= \" saldo_inicial, \";\n $sSqlAgrupado .= \" saldo_arrecadado_acumulado, \"; \n $sSqlAgrupado .= \" x.o70_codigo, \";\n $sSqlAgrupado .= \" x.o70_codrec, \";\n $sSqlAgrupado .= \" coalesce(o70_instit,0) as o70_instit, \";\n $sSqlAgrupado .= \" fc_nivel_plano2005(x.o57_fonte) as nivel \"; \n $sSqlAgrupado .= \" from ({$sSqlBalAnterior}) as x \";\n $sSqlAgrupado .= \" left join orcreceita on orcreceita.o70_codrec = x.o70_codrec and o70_anousu={$iAnoUsu} \";\n $sSqlAgrupado .= \" order by o57_fonte \"; \n $rsBalancete = db_query($sSqlAgrupado);\n $iTotalLinhas = pg_num_rows($rsBalancete);\n for ($i = 1; $i < $iTotalLinhas; $i++) {\n \n $oReceita = db_utils::fieldsMemory($rsBalancete, $i);\n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n \n $oReceitaRetorno = new stdClass();\n \n $oReceitaRetorno->braCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oReceitaRetorno->braMesAnoMovimento = $sDiaMesAno;\n $oReceitaRetorno->braContaReceita = str_pad($oReceita->o57_fonte, 20, 0, STR_PAD_RIGHT);\n $oReceitaRetorno->braCodigoOrgaoUnidadeOrcamentaria = str_pad($oInstituicao->codtrib, 4, \"0\", STR_PAD_LEFT);\n $nSaldoInicial = $oReceita->saldo_inicial;\n $oReceita->saldo_inicial = str_pad(number_format(abs($oReceita->saldo_inicial),2,\".\",\"\"), 13,'0', STR_PAD_LEFT);\n $oReceitaRetorno->braValorReceitaOrcada = $oReceita->saldo_inicial;\n $oReceita->saldo_arrecadado_acumulado = str_pad(number_format(abs($oReceita->saldo_arrecadado_acumulado) \n ,2,\".\",\"\"), 12,'0', STR_PAD_LEFT);\n $oReceitaRetorno->braValorReceitaRealizada = $oReceita->saldo_arrecadado_acumulado;\n $oReceitaRetorno->braCodigoRecursoVinculado = str_pad($oReceita->o70_codigo, 4, \"0\", STR_PAD_LEFT); \n $oReceitaRetorno->braDescricaoContaReceita = substr($oReceita->o57_descr, 0, 255); \n $oReceitaRetorno->braTipoNivelConta = ($oReceita->o70_codrec==0?'S':'A'); \n $oReceitaRetorno->braNumeroNivelContaReceita = $oReceita->nivel;\n $this->aDados[] = $oReceitaRetorno; \n }\n return true;\n }", "public function changeToOrdine()\n {\n\n //crea la tabella degli ordini verso i fornitori\n //Rielabora\n $preventivatore = $this->getPreventivatore();\n $result = $preventivatore->elabora();\n $imponibile = $result['prezzo_cliente_senza_iva'];\n $iva = $result['prezzo_cliente_con_iva'] - $result['prezzo_cliente_senza_iva'];\n $importo_trasportatore = $result['costo_trazione'];\n $importo_depositario = $result['deposito'];\n $importo_traslocatore_partenza = $result['costo_scarico_totale'] ;\n $importo_traslocatore_destinazione = $result['costo_salita_piano_totale'] + $result['costo_montaggio_totale'] + $result['costo_scarico_ricarico_hub_totale'];\n\n $totali = array();\n $totali[$this->id_trasportatore] = 0;\n $totali[$this->id_depositario] = 0;\n $totali[$this->id_traslocatore_destinazione] = 0;\n $totali[$this->id_traslocatore_partenza] = 0;\n\n $totaliMC = array();\n $totaliMC[$this->id_trasportatore] = 0;\n $totaliMC[$this->id_depositario] = 0;\n $totaliMC[$this->id_traslocatore_destinazione] = 0;\n $totaliMC[$this->id_traslocatore_partenza] = 0;\n\n\n $totali[$this->id_trasportatore] = $totali[$this->id_trasportatore] + $importo_trasportatore;\n $totali[$this->id_depositario] = $totali[$this->id_depositario] + $importo_depositario;\n $totali[$this->id_traslocatore_partenza] = $totali[$this->id_traslocatore_partenza] + $importo_traslocatore_partenza;\n $totali[$this->id_traslocatore_destinazione] = $totali[$this->id_traslocatore_destinazione] + $importo_traslocatore_destinazione;\n\n\n $mc = $preventivatore->getMC();\n\n $totaliMC[$this->id_trasportatore] = $totaliMC[$this->id_trasportatore] + $mc;\n $totaliMC[$this->id_depositario] = $totaliMC[$this->id_depositario] + $mc;\n $totaliMC[$this->id_traslocatore_destinazione] = $totaliMC[$this->id_traslocatore_destinazione] + $mc;\n $totaliMC[$this->id_traslocatore_partenza] = $totaliMC[$this->id_traslocatore_partenza] + $mc;\n\n $imponibile = round($totali[$this->id_trasportatore]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_trasportatore] - $imponibile,2);\n\n $ordine_trasportatore = new OrdineFornitore($this->id_preventivo, $this->id_trasportatore, $totali[$this->id_trasportatore], $imponibile, $iva, $totaliMC[$this->id_trasportatore], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASPORTO);\n $ordine_trasportatore->save();\n\n $imponibile = round($totali[$this->id_traslocatore_partenza]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_traslocatore_partenza] - $imponibile,2);\n\n $ordine_traslocatore_partenza = new OrdineFornitore($this->id_preventivo, $this->id_traslocatore_partenza, $totali[$this->id_traslocatore_partenza], $imponibile, $iva, $totaliMC[$this->id_traslocatore_destinazione], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASLOCO_PARTENZA);\n $ordine_traslocatore_partenza->save();\n\n $imponibile = round($totali[$this->id_traslocatore_destinazione]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_traslocatore_destinazione] - $imponibile,2);\n $ordine_traslocatore_destinazione = new OrdineFornitore($this->id_preventivo, $this->id_traslocatore_destinazione, $totali[$this->id_traslocatore_destinazione], $imponibile, $iva, $totaliMC[$this->id_traslocatore_partenza], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASLOCO_DESTINAZIONE);\n $ordine_traslocatore_destinazione->save();\n\n if ($this->giorni_deposito>10) {\n $imponibile = round($totali[$this->id_depositario]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_depositario] - $imponibile,2);\n\n $ordine_depositario = new OrdineFornitore($this->id_preventivo, $this->id_depositario, $totali[$this->id_depositario], $imponibile, $iva, $totaliMC[$this->id_depositario], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_DEPOSITO);\n $ordine_depositario->save();\n }\n\n\n\n $data_ordine = date('Y-m-d');\n $con = DBUtils::getConnection();\n $sql =\"UPDATE preventivi SET tipo=\".OrdineBusiness::TIPO_ORDINE.\" , data='\".$data_ordine.\"' ,\n importo_commessa_trasportatore ='\".$totali[$this->id_trasportatore].\"',\n importo_commessa_traslocatore_partenza ='\".$totali[$this->id_traslocatore_partenza].\"',\n importo_commessa_traslocatore_destinazione ='\".$totali[$this->id_traslocatore_destinazione].\"',\n importo_commessa_depositario ='\".$totali[$this->id_depositario].\"',\n imponibile ='\".$imponibile.\"',\n iva ='\".$iva.\"'\n WHERE id_preventivo=\".$this->id_preventivo;\n\n $res = mysql_query($sql);\n //echo \"\\nSQL: \".$sql;\n DBUtils::closeConnection($con);\n\n return new OrdineCliente($this->id_preventivo);\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed07_i_codigo = ($this->ed07_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_i_codigo\"]:$this->ed07_i_codigo);\n $this->ed07_c_senha = ($this->ed07_c_senha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_senha\"]:$this->ed07_c_senha);\n $this->ed07_c_necessidades = ($this->ed07_c_necessidades == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_necessidades\"]:$this->ed07_c_necessidades);\n $this->ed07_c_foto = ($this->ed07_c_foto == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_foto\"]:$this->ed07_c_foto);\n $this->ed07_t_descr = ($this->ed07_t_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_t_descr\"]:$this->ed07_t_descr);\n $this->ed07_i_responsavel = ($this->ed07_i_responsavel == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_i_responsavel\"]:$this->ed07_i_responsavel);\n $this->ed07_c_certidao = ($this->ed07_c_certidao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_certidao\"]:$this->ed07_c_certidao);\n $this->ed07_c_cartorio = ($this->ed07_c_cartorio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_cartorio\"]:$this->ed07_c_cartorio);\n $this->ed07_c_livro = ($this->ed07_c_livro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_livro\"]:$this->ed07_c_livro);\n $this->ed07_c_folha = ($this->ed07_c_folha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_c_folha\"]:$this->ed07_c_folha);\n if($this->ed07_d_datacert == \"\"){\n $this->ed07_d_datacert_dia = ($this->ed07_d_datacert_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_d_datacert_dia\"]:$this->ed07_d_datacert_dia);\n $this->ed07_d_datacert_mes = ($this->ed07_d_datacert_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_d_datacert_mes\"]:$this->ed07_d_datacert_mes);\n $this->ed07_d_datacert_ano = ($this->ed07_d_datacert_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_d_datacert_ano\"]:$this->ed07_d_datacert_ano);\n if($this->ed07_d_datacert_dia != \"\"){\n $this->ed07_d_datacert = $this->ed07_d_datacert_ano.\"-\".$this->ed07_d_datacert_mes.\"-\".$this->ed07_d_datacert_dia;\n }\n }\n $this->ed07_t_pendentes = ($this->ed07_t_pendentes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_t_pendentes\"]:$this->ed07_t_pendentes);\n }else{\n $this->ed07_i_codigo = ($this->ed07_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed07_i_codigo\"]:$this->ed07_i_codigo);\n }\n }", "function recuperarDatos(){\r\n\t\t\t\t$this->objFunc=$this->create('MODEmpresa');\r\n\t\t\t\t$objetoFuncion = $this->create('MODEmpresa');\r\n\t\t\t\t$this->res=$this->objFunc->insertarEmpresa($this->objParam);\t//esta bien\t\t\t\r\n\t\t\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\t\t}", "public function recalcula() {\n\n //Si el cliente no está sujeto a iva\n //pongo el iva a cero en las líneas para evitar que por cambio\n //de cliente se aplique indebidamente\n $cliente = new Clientes($this->IDCliente);\n if ($cliente->getIva()->getIDTipo() == '0') {\n $lineas = new FemitidasLineas();\n $lineas->queryUpdate(array(\"Iva\" => 0, \"Recargo\" => 0), \"`IDFactura`= '{$this->IDFactura}'\");\n unset($lineas);\n }\n //Si el cliente no está sujeto a recargo de equivalencia\n //lo pongo a cero en las líneas para evitar que por cambio\n //de cliente se aplique indebidamente\n elseif ($cliente->getRecargoEqu()->getIDTipo() == '0') {\n $lineas = new FemitidasLineas();\n $lineas->queryUpdate(array(\"Recargo\" => 0), \"`IDFactura`= '{$this->IDFactura}'\");\n unset($lineas);\n }\n unset($cliente);\n\n //SI TIENE DESCUENTO, CALCULO EL PORCENTAJE QUE SUPONE RESPECTO AL IMPORTE BRUTO\n //PARA REPERCUTUIRLO PORCENTUALMENTE A CADA BASE\n $pordcto = 0;\n if ($this->getDescuento() != 0)\n $pordcto = round(100 * ($this->getDescuento() / $this->getImporte()), 2);\n\n //Calcular los totales, desglosados por tipo de iva.\n $this->conecta();\n if (is_resource($this->_dbLink)) {\n $lineas = new FemitidasLineas();\n $tableLineas = \"{$lineas->getDataBaseName()}.{$lineas->getTableName()}\";\n $articulos = new Articulos();\n $tableArticulos = \"{$articulos->getDataBaseName()}.{$articulos->getTableName()}\";\n unset($lineas);\n unset($articulos);\n\n $query = \"select sum(Importe) as Bruto,sum(ImporteCosto) as Costo from {$tableLineas} where (IDFactura='\" . $this->getIDFactura() . \"')\";\n $this->_em->query($query);\n $rows = $this->_em->fetchResult();\n $bruto = $rows[0]['Bruto'];\n\n $query = \"select Iva,Recargo, sum(Importe) as Importe from {$tableLineas} where (IDFactura='\" . $this->getIDFactura() . \"') group by Iva,Recargo order by Iva\";\n $this->_em->query($query);\n $rows = $this->_em->fetchResult();\n $totbases = 0;\n $totiva = 0;\n $totrec = 0;\n $bases = array();\n\n foreach ($rows as $key => $row) {\n $importe = $row['Importe'] * (1 - $pordcto / 100);\n $cuotaiva = round($importe * $row['Iva'] / 100, 2);\n $cuotarecargo = round($importe * $row['Recargo'] / 100, 2);\n $totbases += $importe;\n $totiva += $cuotaiva;\n $totrec += $cuotarecargo;\n\n $bases[$key] = array(\n 'b' => $importe,\n 'i' => $row['Iva'],\n 'ci' => $cuotaiva,\n 'r' => $row['Recargo'],\n 'cr' => $cuotarecargo\n );\n }\n\n $subtotal = $totbases + $totiva + $totrec;\n\n // Calcular el recargo financiero según la forma de pago\n $formaPago = new FormasPago($this->IDFP);\n $recFinanciero = $formaPago->getRecargoFinanciero();\n $cuotaRecFinanciero = $subtotal * $recFinanciero / 100;\n unset($formaPago);\n\n $total = $subtotal + $cuotaRecFinanciero;\n\n //Calcular el peso, volumen y n. de bultos de los productos inventariables\n switch ($_SESSION['ver']) {\n case '0': //Estandar\n $columna = \"Unidades\";\n break;\n case '1': //Cristal\n $columna = \"MtsAl\";\n break;\n }\n $em = new EntityManager($this->getConectionName());\n $query = \"select sum(a.Peso*l.{$columna}) as Peso,\n sum(aVolumen*l.{$columna}) as Volumen,\n sum(Unidades) as Bultos \n from {$tableArticulos} as a,{$tableLineas} as l\n where (l.IDArticulo=a.IDArticulo)\n and (a.Inventario='1')\n and (l.IDFactura='{$this->IDFactura}')\";\n $em->query($query);\n $rows = $em->fetchResult();\n $em->desConecta();\n\n $this->setImporte($bruto);\n $this->setBaseImponible1($bases[0]['b']);\n $this->setIva1($bases[0]['i']);\n $this->setCuotaIva1($bases[0]['ci']);\n $this->setRecargo1($bases[0]['r']);\n $this->setCuotaRecargo1($bases[0]['cr']);\n $this->setBaseImponible2($bases[1]['b']);\n $this->setIva2($bases[1]['i']);\n $this->setCuotaIva2($bases[1]['ci']);\n $this->setRecargo2($bases[1]['r']);\n $this->setCuotaRecargo2($bases[1]['cr']);\n $this->setBaseImponible3($bases[2]['b']);\n $this->setIva3($bases[2]['i']);\n $this->setCuotaIva3($bases[2]['ci']);\n $this->setRecargo3($bases[2]['r']);\n $this->setCuotaRecargo3($bases[2]['cr']);\n $this->setTotalBases($totbases);\n $this->setTotalIva($totiva);\n $this->setTotalRecargo($totrec);\n $this->setRecargoFinanciero($recFinanciero);\n $this->setCuotaRecargoFinanciero($cuotaRecFinanciero);\n $this->setTotal($total);\n $this->setPeso($rows[0]['Peso']);\n $this->setVolumen($rows[0]['Volumen']);\n $this->setBultos($rows[0]['Bultos']);\n\n $this->save();\n }\n }", "function update() {\r\n $exp_id = VAR3;\r\n $fil_id = VAR4;\r\n $seccion = VAR5;\r\n \r\n // Find ser_id\r\n $expediente = new tab_expediente ();\r\n $tab_expediente = $expediente->dbselectById($exp_id);\r\n $ser_id = $tab_expediente->getSer_id();\r\n \r\n // Tab_archivo\r\n $this->archivo = new tab_archivo();\r\n $row = $this->archivo->dbselectByField(\"fil_id\", $fil_id);\r\n $row = $row[0]; \r\n \r\n\r\n \r\n // Tab_doccorr\r\n $tab_doccorr = new Tab_doccorr();\r\n $sql = \"SELECT * \r\n FROM tab_doccorr \r\n WHERE fil_id='\" . $row->fil_id . \"'\";\r\n $doccorr = $tab_doccorr->dbSelectBySQL($sql);\r\n if($doccorr){\r\n $doccorr = $doccorr[0]; \r\n // Nur\r\n $hojas_ruta = new hojas_ruta();\r\n $this->registry->template->dco_id = $doccorr->dco_id;\r\n $this->registry->template->fil_cite = $hojas_ruta->obtenerSelect($doccorr->fil_cite);\r\n $seguimientos = new seguimientos();\r\n $this->registry->template->fil_nur_s = $seguimientos->obtenerSelect($doccorr->fil_nur_s);\r\n\r\n $this->registry->template->fil_nur = $doccorr->fil_nur;\r\n $this->registry->template->fil_asunto = $doccorr->fil_asunto;\r\n $this->registry->template->fil_sintesis = $doccorr->fil_sintesis;\r\n }else{\r\n // Nur\r\n $this->registry->template->dco_id = \"\";\r\n $this->registry->template->fil_cite = \"\";\r\n $this->registry->template->fil_nur_s = \"\";\r\n $this->registry->template->fil_nur = \"\";\r\n $this->registry->template->fil_asunto = \"\";\r\n $this->registry->template->fil_sintesis = \"\"; \r\n }\r\n// $this->registry->template->fil_nur = \"\";\r\n// $this->registry->template->fil_asunto = \"\";\r\n// $this->registry->template->fil_sintesis = \"\";\r\n// $this->registry->template->fil_cite = \"\";\r\n// $this->registry->template->fil_nur_s = \"\";\r\n \r\n \r\n\r\n\r\n // Tab_exparchivo\r\n $sql = \"SELECT * \r\n FROM tab_exparchivo \r\n WHERE fil_id='\" . $row->fil_id . \"'\";\r\n $exa_row = $this->archivo->dbSelectBySQL($sql);\r\n $exa_row = $exa_row[0];\r\n $this->registry->template->exp_id = $exp_id;\r\n $this->registry->template->tra_id = $exa_row->tra_id;\r\n $this->registry->template->cue_id = $exa_row->cue_id;\r\n $this->registry->template->exa_id = $exa_row->exa_id;\r\n \r\n $expediente = new expediente ();\r\n // Tab_archivo\r\n $this->registry->template->seccion = $seccion;\r\n $this->registry->template->fil_id = $fil_id;\r\n $this->registry->template->fil_codigo = $row->fil_codigo;\r\n $this->registry->template->fil_nro = $row->fil_nro;\r\n $this->registry->template->fil_titulo = $row->fil_titulo;\r\n $this->registry->template->fil_subtitulo = $row->fil_subtitulo;\r\n $this->registry->template->fil_fecha = $row->fil_fecha;\r\n $this->registry->template->fil_mes = $expediente->obtenerSelectMes($row->fil_mes);\r\n $this->registry->template->fil_anio = $expediente->obtenerSelectAnio($row->fil_anio); \r\n \r\n $idioma = new idioma (); \r\n $this->registry->template->idi_id = $idioma->obtenerSelect($row->idi_id);\r\n\r\n $this->registry->template->fil_proc = $row->fil_proc;\r\n $this->registry->template->fil_firma = $row->fil_firma;\r\n $this->registry->template->fil_cargo = $row->fil_cargo;\r\n // Include dynamic fields\r\n $expcampo = new expcampo();\r\n $this->registry->template->filcampo = $expcampo->obtenerSelectCampos($ser_id); \r\n $sopfisico = new sopfisico();\r\n $this->registry->template->sof_id = $sopfisico->obtenerSelect($row->sof_id);\r\n $this->registry->template->fil_nrofoj = $row->fil_nrofoj;\r\n $this->registry->template->fil_tomovol = $row->fil_tomovol;\r\n $this->registry->template->fil_nroejem = $row->fil_nroejem;\r\n $this->registry->template->fil_nrocaj = $row->fil_nrocaj;\r\n $this->registry->template->fil_sala = $row->fil_sala;\r\n $archivo = new archivo ();\r\n $this->registry->template->fil_estante = $archivo->obtenerSelectEstante($row->fil_estante);\r\n $this->registry->template->fil_cuerpo = $row->fil_cuerpo;\r\n $this->registry->template->fil_balda = $row->fil_balda;\r\n $this->registry->template->fil_tipoarch = $row->fil_tipoarch;\r\n $this->registry->template->fil_mrb = $row->fil_mrb;\r\n \r\n $this->registry->template->fil_ori = $row->fil_ori;\r\n $this->registry->template->fil_cop = $row->fil_cop;\r\n $this->registry->template->fil_fot = $row->fil_fot;\r\n \r\n $this->registry->template->fil_confidencilidad = $row->fil_confidencialidad;\r\n $this->registry->template->fil_obs = $row->fil_obs;\r\n \r\n $this->registry->template->required_archivo = \"\"; \r\n\r\n //palabras clave\r\n $palclave = new palclave();\r\n $this->registry->template->pac_nombre = $palclave->listaPC();\r\n $this->registry->template->fil_descripcion = $palclave->listaPCFile($row->fil_id);\r\n \r\n $arc = new archivo ();\r\n $this->registry->template->confidencialidad = $arc->loadConfidencialidad('1');\r\n $this->registry->template->PATH_WEB = PATH_WEB;\r\n $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;\r\n $exp = new expediente ();\r\n if ($seccion == \"estrucDocumental\") {\r\n $this->registry->template->PATH_EVENT = \"update_save\";\r\n $this->registry->template->linkTree = $exp->linkTree($exp_id, $exa_row->tra_id, $exa_row->cue_id);\r\n } else {\r\n $this->registry->template->PATH_EVENT = \"update_saveReg\";\r\n $this->registry->template->linkTree = $exp->linkTreeReg($exp_id, $exa_row->tra_id, $exa_row->cue_id);\r\n }\r\n $this->menu = new menu ();\r\n $liMenu = $this->menu->imprimirMenu($seccion, $_SESSION ['USU_ID']);\r\n $this->registry->template->men_titulo = $liMenu;\r\n \r\n $this->registry->template->GRID_SW = \"true\";\r\n $this->registry->template->PATH_J = \"jquery-1.4.1\";\r\n $this->registry->template->tituloEstructura = $this->tituloEstructuraD;\r\n $this->registry->template->show('header');\r\n $this->registry->template->controller = $seccion;\r\n $this->llenaDatos(VAR3);\r\n $this->registry->template->show('regarchivo.tpl');\r\n }", "protected function crearEgreso($data)\r\n {\r\n $this->egreso = new Egreso();\r\n $this->egreso->fromArray($data);\r\n $this->egreso->setDefaultValues();\r\n $this->em->persist($this->egreso);\r\n }", "function evt__form_pase__modificacion($datos)\r\n\t{\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $datos['id_cargo']=$car['id_cargo'];\r\n \r\n \r\n //print_r($pase_nuevo);exit;\r\n if($this->dep('datos')->tabla('pase')->esta_cargada()){//es modificacion\r\n $pas=$this->dep('datos')->tabla('pase')->get();\r\n if($pas['tipo']<>$datos['tipo']){\r\n toba::notificacion()->agregar('no puede cambiar el tipo del pase', 'info'); \r\n }else{\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n }\r\n }else{//es alta de un pase nuevo\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n $pase_nuevo=$this->dep('datos')->tabla('pase')->get();\r\n $p['id_pase']=$pase_nuevo['id_pase'];\r\n $this->dep('datos')->tabla('pase')->cargar($p);//lo cargo para que se sigan viendo los datos en el formulario\r\n if($datos['tipo']=='T'){//si el pase es temporal\r\n //ingreso un cargo en la unidad destino\r\n //la ingresa con fecha de alta = desde\r\n $nuevo_cargo['id_persona']=$car['id_persona'];\r\n $nuevo_cargo['codc_carac']=$car['codc_carac'];\r\n $nuevo_cargo['codc_categ']=$car['codc_categ'];\r\n $nuevo_cargo['codc_agrup']=$car['codc_agrup'];\r\n $nuevo_cargo['chkstopliq']=$car['chkstopliq'];\r\n $nuevo_cargo['fec_alta']=$datos['desde'];\r\n $nuevo_cargo['pertenece_a']=$datos['destino'];\r\n $nuevo_cargo['generado_x_pase']=$pase_nuevo['id_pase']; \r\n $res=$this->controlador()->dep('datos')->tabla('cargo')->agregar_cargo($nuevo_cargo);\r\n if($res==1){\r\n toba::notificacion()->agregar('Se ha creado un nuevo cargo en el destino del pase', 'info');\r\n }\r\n \r\n }else{//pase definitivo entonces tengo que modificar la fecha del cargo en la unidad destino con la fecha de alta del definitivo\r\n $nuevafecha = strtotime ( '-1 day' , strtotime ( $datos['desde'] ) ) ;\r\n $nuevafecha = date ( 'Y-m-d' , $nuevafecha );\r\n //print_r($nuevafecha);exit;\r\n $salida=$this->controlador()->dep('datos')->tabla('cargo')->modificar_alta($datos['id_cargo'],$datos['destino'],$datos['desde']);\r\n //le coloca fecha de baja al cargo de la unidad origen\r\n $this->controlador()->dep('datos')->tabla('cargo')->finaliza_cargo($datos['id_cargo'],$nuevafecha);\r\n if($salida==1){\r\n toba::notificacion()->agregar('Se ha modificado la fecha del cargo generado a partir del pase temporal', 'info');\r\n }\r\n \r\n } \r\n }\r\n \r\n\t}", "function geraClasseDadosFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.DadosFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoDadosFormularioCadastro.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n # varre a estrutura dos campos da tabela em questao\n $camposForm = $aModeloFinal = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n $nomeCampo \t = $nomeCampoOriginal;\n //$nomeCampo \t = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n switch ((string)$oCampo->TIPO) {\n case 'date':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n case 'datetime':\n case 'timestamp':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataHoraFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n default:\n if((int)$oCampo->CHAVE == 1)\n if((string)$aTabela['TIPO_TABELA'] != 'NORMAL')\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n else\n $camposForm[] = \"if(\\$acao == 2){\\n\\t\\t\\t\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\\n\\t\\t}\";\n else\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n break;\n }\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.DadosFormulario.php\",\"w\");\n fputs($fp, $modeloFinal);\n fclose($fp);\n return true;\t\n }", "public function enfocarCamaraAlumnos1() {\n\n self::$alumnos1->enfocar();\n\n }", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "function modificarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tabla','id_tabla','int4');\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function atualizar($oficina){\r\n\t\t$sql = 'UPDATE oficina SET id = :id, nome = :nome, data = :data, carga_horaria = :carga_horaria, horario = :horario, id_evento = :id_evento, tipo = :tipo, vagas = :vagas WHERE id = :id';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->bindValue(':id',$oficina->getId()); \n\r\t\t$consulta->bindValue(':nome',$oficina->getNome()); \n\r\t\t$consulta->bindValue(':data',$oficina->getData()); \n\r\t\t$consulta->bindValue(':carga_horaria',$oficina->getCarga_horaria()); \n\r\t\t$consulta->bindValue(':horario',$oficina->getHorario()); \n\r\t\t$consulta->bindValue(':id_evento',$oficina->getId_evento()); \n\r\t\t$consulta->bindValue(':tipo',$oficina->getTipo()); \n\r\t\t$consulta->bindValue(':vagas',$oficina->getVagas()); \r\n\t\t$consulta->execute();\r\n\t}", "public function guardarDatos($datos){\n \n $inscripto = new InscriptosPadronSisa();\n $inscripto->id = $this->convertirEnTexto($datos->id); \n $inscripto->codigosisa = $this->convertirEnTexto($datos->codigoSISA);\n $inscripto->identificadorenaper = $this->convertirEnTexto($datos->identificadoRenaper);\n $inscripto->padronsisa = $this->convertirEnTexto($datos->PadronSISA);\n $inscripto->tipodocumento = $this->convertirEnTexto($datos->tipoDocumento);\n $inscripto->nrodocumento = $this->convertirEnTexto($datos->nroDocumento);\n $inscripto->apellido = $this->convertirEnTexto($datos->apellido);\n $inscripto->nombre = $this->convertirEnTexto($datos->nombre);\n $inscripto->sexo = $this->convertirEnTexto($datos->sexo);\n $inscripto->fechanacimiento = $this->convertirEnTexto($datos->fechaNacimiento);\n $inscripto->estadocivil = $this->convertirEnTexto($datos->estadoCivil);\n $inscripto->provincia = $this->convertirEnTexto($datos->provincia);\n $inscripto->departamento = $this->convertirEnTexto($datos->departamento);\n $inscripto->localidad = $this->convertirEnTexto($datos->localidad);\n $inscripto->domicilio = $this->convertirEnTexto($datos->domicilio);\n $inscripto->pisodpto = $this->convertirEnTexto($datos->pisoDpto);\n $inscripto->codigopostal = $this->convertirEnTexto($datos->codigoPostal);\n $inscripto->paisnacimiento = $this->convertirEnTexto($datos->paisNacimiento);\n $inscripto->provincianacimiento = $this->convertirEnTexto($datos->provinciaNacimiento);\n $inscripto->localidadnacimiento = $this->convertirEnTexto($datos->localidadNacimiento);\n $inscripto->nacionalidad = $this->convertirEnTexto($datos->nacionalidad);\n $inscripto->fallecido = $this->convertirEnTexto($datos->fallecido);\n $inscripto->fechafallecido = $this->convertirEnTexto($datos->fechaFallecido);\n $inscripto->donante = $this->convertirEnTexto($datos->donante);\n try {\n $inscripto->save();\n unset($inscripto);\n return TRUE;\n } catch (QueryException $e) {\n return json_encode($e);\n } \n }", "public function persist (){\n \n $this->query = \"INSERT INTO libros(titulo,autor,editorial) VALUES (:titulo, :autor, :editorial)\";\n\n // $this->parametros['id']=$user_data[\"id\"];\n $this->parametros['titulo']=$this->titulo;\n $this->parametros['autor']=$this->autor;\n $this->parametros['editorial']=$this->editorial;\n \n $this->get_results_from_query();\n\n\n $this->mensaje = \"Libro agregado exitosamente\";\n \n }", "protected function alterar(){\n header(\"Content-type: text/html;charset=utf-8\");\n $sql = \"SHOW FULL FIELDS FROM \" . $this->table;\n $execute = conexao::toConnect()->executeS($sql);\n $sets = \"\";\n $id_registro = '';\n $contador = \"\";\n $count = 1;\n foreach ($execute as $contar) {\n if ($contar->Key != 'PRI') {\n $atributos_field = $contar->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n $contador = $contador + 1;\n }\n }\n }\n foreach ($execute as $key => $attr){\n if ($attr->Key != 'PRI') {\n $atributos_field = $attr->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n if ($count != $contador) {\n $sets .= $attr->Field . \" = '\" . $this->$get() . \"',\";\n } else {\n $sets .= $attr->Field . \" = '\" . $this->$get().\"'\";\n }\n $count = $count + 1;\n }\n }else{\n $id_registro = $attr->Field;\n }\n }\n $update = \"UPDATE \".$this->table.\" SET \".$sets.\" WHERE \".$id_registro.\" = \".$this->getIdTable();\n\n $execute_into = conexao::toConnect()->executeQuery($update);\n if (count($execute_into) > 0) {\n return $execute_into;\n }else{\n return false;\n }\n }", "function alta_compra(){\n\t\t$u= new Pr_pedido();\n\t\t$u->get_by_id($_POST['id']);\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$usuario=$this->usuario->get_usuario($GLOBALS['usuarioid']);\n\t\t//Encargada de Tienda\n\t\tif ($usuario->puesto_id==6 or $usuario->puesto_id==7) {\n\t\t\t$u->corigen_pedido_id=3;\n\t\t\t$u->usuario_validador_id=$u->usuario_id;\n\t\t} else {\n\t\t\t$u->corigen_pedido_id=2;\n\t\t}\n\t\t$u->fecha_alta=date(\"Y-m-d H:i:s\");\n\t\t$related = $u->from_array($_POST);\n\t\t//Adecuar las Fechas al formato YYYY/MM/DD\n\t\t$fecha_pago=explode(\" \", $_POST['fecha_pago']);\n\t\t$fecha_entrega=explode(\" \", $_POST['fecha_entrega']);\n\t\t$u->fecha_pago=\"\".$fecha_pago[2].\"-\".$fecha_pago[1].\"-\".$fecha_pago[0];\n\t\t$u->fecha_entrega=\"\".$fecha_entrega[2].\"-\".$fecha_entrega[1].\"-\".$fecha_entrega[0] ;\n\t\t// save with the related objects\n\t\tif($u->save($related)) {\n\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\techo '<button type=\"submit\" id=\"boton1\" style=\"display:none;\">Actualizar Registro</button>';\n\t\t\techo \"<p id=\\\"response\\\">Datos Generales Guardados<br/><b>Capturar los detalles del pedido</b></p>\";\n\t\t} else\n\t\t\tshow_error(\"\".$u->error->string);\n\t}", "public function trataDados()\r\n {\r\n // trata os campos do form\r\n if ($this->form->isSubmitted() && $this->form->isValid()) {\r\n $this->data = $this->form->getData();\r\n\r\n // não filtra campo em branco\r\n foreach ($this->data as $k => $v){\r\n if(empty($v)){\r\n unset($this->data[$k]);\r\n }\r\n }\r\n }\r\n $this->trataObjetos();\r\n }", "function Actualizar() {\n /**\n * Crear instancia de EstacionHidrometrica\n */\n $EstacionHidrometrica = new EstacionHidrometrica();\n /**\n * Colocar los datos del POST por medio de los metodos SET\n */\n $EstacionHidrometrica->setIdEstacion(filter_input(INPUT_GET, 'clave'));\n $EstacionHidrometrica->setNombre(filter_input(INPUT_GET, 'nombre'));\n $EstacionHidrometrica->setCuenca_id(filter_input(INPUT_GET, 'cuenca_id'));\n $EstacionHidrometrica->setCorriente(filter_input(INPUT_GET, 'corriente'));\n $EstacionHidrometrica->setRegion_id(filter_input(INPUT_GET, 'region_id'));\n $EstacionHidrometrica->setEstado_id(filter_input(INPUT_GET, 'estado_id'));\n $EstacionHidrometrica->setLatitud(filter_input(INPUT_GET, 'latitud'));\n $EstacionHidrometrica->setLongitud(filter_input(INPUT_GET, 'longitud'));\n if ($EstacionHidrometrica->Update() != null) {\n echo 'OK';\n } else {\n echo 'Algo salío mal :(';\n }\n}", "private function iniciar_indice_empresas(){\n\t\t//==========necesarios para empresa================\n\t\trequire_once 'inc/clases/public/empresa.class.php';\t\t\t//pagina de empresa (y empresas)\n\t\trequire_once 'inc/clases/config/builder_config.class.php';\t//clase builder(reservas)\n\t\trequire_once 'inc/clases/public/salida_anuncios.class.php';\n\n\t\t$this->Empresa = new Empresa();\n\t\t$this->Modulos = new Salida_anuncios();\n\t\t// if(is_null($this->Empresa->user)){\n\t\t// \t//es null, devolvera inmobiliarias\n\t\t// }else if($this->Empresa->user == false){\n\t\t// \t$this->forzar_404();\n\t\t// }else{\n\t\t// \t//es bien\n\t\t// \t$this->empresa = $this->Empresa->salida;\n\t\t// }\n\t}", "public function salvar_meu_cadastro($dados,$password = true){\n\n #seta o endereço, se tiver sido preenchido\n if (_v($dados,\"bairro\") != \"\"){\n $end = [\"bairro\"=>$dados[\"bairro\"], \"cidade\"=>$dados[\"cidade\"], \"uf\"=>$dados[\"uf\"]];\n $CI =& get_instance();\n $CI->load->model('Endereco_model');\n $endereco = $CI->Endereco_model->getOrCreate($end);\n $dados[\"idbairro\"] = $endereco[\"idbairro\"];\n } else {\n $dados[\"idbairro\"] = null;\n }\n \n #transforma o nome dos campos que vem do formulário para o nome no db\n $fields = [\"id\",\"nome_completo\",\"nome_social\",\"email\",\"cpf\",\"tipoInscricao\",\n \"curriculo\",\"lattes\",\"telefone\",\"foto\",\n \"instituicao\"=>\"idinstituicao\",\n \"curso\"=>\"idcurso\",\"pago\",\"logradouro\",\"idnivelcurso\",\n \"cep\",\"numero\",\"idbairro\",\"outra_instituicao\"];\n\n $tratados = $this->replaceNames($dados,$fields);\n if (!isset($dados[\"id\"])){\n $tratados[\"id\"] = null;\n }\n \n\n #caso ele tenha marcado outra instituicao\n if (isset($tratados[\"idinstituicao\"])){\n if ($tratados[\"idinstituicao\"] == \"outra\"){\n $tratados[\"idinstituicao\"] = null;\n } else {\n $tratados[\"outra_instituicao\"] = null;\n }\n }\n\n if (_v($dados,\"password\") != \"\"){\n if (_v($dados,\"id\") == \"\" && !isset($dados[\"password\"])){\n $tratados[\"password\"] = sha1(\"12345678\");\n } else {\n $tratados[\"password\"] = sha1($dados[\"password\"]);\n\n #se eu estiver alterando a minha propria senha na area de perfil\n if (isset($_SESSION[\"user\"]) && _v($_SESSION[\"user\"],\"id\") == $dados[\"id\"]){\n $tratados[\"email_confirmado\"] = true;\n }\n }\n if ($password == false){\n $tratados[\"password\"] = null;\n }\n }\n\n #todo mundo terá pago por padrão\n $tratados['pago'] = true;\n\n #todo mundo é participante por padrão\n if (_v($dados,\"id\") == \"\"){\n $tratados['nivel'] = NIVEL_PARTICIPANTE;\n }\n \n \n return parent::salvar($tratados);\n }", "function asignar_valores(){\n\t\t$this->codigo=$_POST['codigo'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->categoria=$_POST['categoria'];\n\t\t$this->hotel=$_POST['hoteles'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->lugar=$_POST['lugar'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->detal=$_POST['detal'];\n\t\t$this->mayor=$_POST['mayor'];\n\t\t$this->limite=$_POST['limite'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->segmento=$_POST['segmento'];\n\t\t$this->principal=$_POST['principal'];\n\t\t\n\t\t\n\t}", "protected function asignarCamposRelacionales() {\n foreach($this->campos as $nombre=>$campo) {\n if($campo->tipo!='relacional'||($campo->relacion!='1:1'&&$campo->relacion!='1:0')) continue;\n $columna=$campo->columna;\n if(is_object($this->consultaValores->$nombre)) {\n //Asignado como entidad u objeto anónimo\n $this->consultaValores->$columna=$this->consultaValores->$nombre->id;\n } elseif(is_array($this->consultaValores->$nombre)) {\n //Asignado como array\n $this->consultaValores->$columna=$this->consultaValores->$nombre['id'];\n }\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->bo04_codmov = ($this->bo04_codmov == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_codmov\"]:$this->bo04_codmov);\n $this->bo04_codbo = ($this->bo04_codbo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_codbo\"]:$this->bo04_codbo);\n if($this->bo04_datamov == \"\"){\n $this->bo04_datamov_dia = ($this->bo04_datamov_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_datamov_dia\"]:$this->bo04_datamov_dia);\n $this->bo04_datamov_mes = ($this->bo04_datamov_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_datamov_mes\"]:$this->bo04_datamov_mes);\n $this->bo04_datamov_ano = ($this->bo04_datamov_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_datamov_ano\"]:$this->bo04_datamov_ano);\n if($this->bo04_datamov_dia != \"\"){\n $this->bo04_datamov = $this->bo04_datamov_ano.\"-\".$this->bo04_datamov_mes.\"-\".$this->bo04_datamov_dia;\n }\n }\n $this->bo04_coddepto_ori = ($this->bo04_coddepto_ori == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_coddepto_ori\"]:$this->bo04_coddepto_ori);\n $this->bo04_coddepto_dest = ($this->bo04_coddepto_dest == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_coddepto_dest\"]:$this->bo04_coddepto_dest);\n $this->bo04_entrada = ($this->bo04_entrada == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_entrada\"]:$this->bo04_entrada);\n $this->bo04_saida = ($this->bo04_saida == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_saida\"]:$this->bo04_saida);\n }else{\n $this->bo04_codmov = ($this->bo04_codmov == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"bo04_codmov\"]:$this->bo04_codmov);\n }\n }", "static public function mdlRealizarComprasGenerales($tabla, $datos){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET usuario = :usuario, serie = :serie, idPedido = :idPedido, folioCompra = :folioCompra, cliente = :cliente, cantidad = :cantidad, importeCompra = :importeCompra, status = :status, sinAdquisicion = :sinAdquisicion, fechaRecepcion = :fechaRecepcion, fechaElaboracion = :fechaElaboracion, fechaTermino = :fechaTermino, observaciones = :observaciones, estado = :estado, pendiente = :pendiente WHERE idPedido = :idPedido and serie = :serie\");\r\n\r\n\t\t$stmt->bindParam(\":idPedido\", $datos[\"idPedido\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":usuario\", $datos[\"usuario\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":serie\", $datos[\"serie\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":folioCompra\", $datos[\"folioCompra\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":cliente\", $datos[\"cliente\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":cantidad\", $datos[\"cantidad\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":importeCompra\", $datos[\"importeCompra\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":status\", $datos[\"status\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":sinAdquisicion\", $datos[\"sinAdquisicion\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":fechaRecepcion\", $datos[\"fechaRecepcion\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":fechaElaboracion\", $datos[\"fechaElaboracion\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":fechaTermino\", $datos[\"fechaTermino\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":observaciones\", $datos[\"observaciones\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":estado\", $datos[\"estado\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":pendiente\", $datos[\"pendiente\"], PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(\":id\", $datos[\"id\"], PDO::PARAM_INT);\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"ok\";\t\r\n\r\n\t\t}else{\r\n\r\n\t\t\treturn \"error\";\r\n\t\t\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\t\t\r\n\t\t$stmt = null;\r\n\r\n\t}", "private function setDados() {\n $Cover = $this->dados['post_capa']; //Esse indice não pode ser limpo pelo trim nem o array_map\n $Content = $this->dados['post_conteudo']; //Esse indice não pode ser limpo pelo trim nem o array_map\n unset($this->dados['post_capa'], $this->dados['post_conteudo']); //Como os itens anteriores ja foram guardados em váriáveis então podemos dar unset neles, assim podemos pegar eles após limpesa dos dados\n\n $this->dados = array_map('strip_tags', $this->dados); //Realizando a limpesa dos dados de entrada com metoto strip_tags, assim evitando entrada de códigos maliciosos\n $this->dados = array_map('trim', $this->dados); //Realizando a limpesa dos dados de entrada com metoto trim, assim evitando entrada de códigos maliciosos\n\n $this->dados['post_nome'] = Check::Name($this->dados['post_titulo']); //Adicionando ao atributo Dados no indice post_name com checagem pelo metodo statico Check::Name\n $this->dados['post_data'] = Check::Data($this->dados['post_data']); //Adicionando ao atributo Dados no indice post_date com checagem pelo metodo statico Check::Data\n \n\n $this->dados['post_capa'] = $Cover; //Adicionando ao atributo Dados no indice post_capa o conteudo da variável $Cover\n $this->dados['post_conteudo'] = $Content; //Adicionando ao atributo Dados no indice post_content o conteudo da váriável $Content\n $this->dados['post_categoria_pai'] = $this->getCatParent(); //Adicionando ao atributo Dados no indice post_categoria_pai o conteudo do metodo getCatParent\n }", "function compilar_metadatos_generales()\n\t{\n\t\t$this->manejador_interface->titulo(\"Compilando datos generales\");\n\t\ttoba_proyecto_db::set_db( $this->db );\n\t\t$path = $this->get_dir_generales_compilados();\n\t\ttoba_manejador_archivos::crear_arbol_directorios( $path );\n\t\t$this->compilar_metadatos_generales_basicos();\n\t\t$this->compilar_metadatos_generales_grupos_acceso();\n\t\t$this->compilar_metadatos_generales_puntos_control();\n\t\t$this->compilar_metadatos_generales_mensajes();\n\t\t$this->compilar_metadatos_generales_dimensiones();\n\t\t$this->compilar_metadatos_generales_consultas_php();\n\t\t$this->compilar_metadatos_generales_servicios_web();\n\t\t$this->compilar_metadatos_generales_pms();\n\n\t}", "function backup ($datos){\n //verificamos si la asignacion ya existe\n //if(!$this->existe($datos)){\n //persistir en asignacion, asignacion_definitiva y asignacion_periodo\n //hay que inferir a que cuatrimestre pertenece la asignacion\n \n \n $datos['nro_doc']=$this->s__nro_doc;\n $datos['tipo_doc']=$this->s__tipo_doc; \n $this->dep('datos')->tabla('asignacion')->nueva_fila($datos);\n $this->dep('datos')->tabla('asignacion')->sincronizar();\n $this->dep('datos')->tabla('asignacion')->resetear();\n $cuatrimestre=$this->obtener_cuatrimestre();\n $fecha= getdate();\n $dato=array(\n \n 'cuatrimestre' => $cuatrimestre,\n 'anio' => $fecha['year'],\n \n );\n $secuencia=recuperar_secuencia('asignacion_id_asignacion_seq');\n if(strcmp($this->s__tipo, 'Definitiva')==0){\n $dato['id_asignacion']=$secuencia;\n $dato['nombre'] = $this->s__dia;\n $this->dep('datos')->tabla('asignacion_definitiva')->nueva_fila($dato);\n $this->dep('datos')->tabla('asignacion_definitiva')->sincronizar();\n $this->dep('datos')->tabla('asignacion_definitiva')->resetear();\n }\n else{ \n $periodo=array(\n 'id_asignacion' => $secuencia,\n 'fecha_inicio' => $datos['fecha_inicio'],\n 'fecha_fin' => $datos['fecha_fin']\n );\n $this->dep('datos')->tabla('asignacion_periodo')->nueva_fila($periodo);\n $this->dep('datos')->tabla('asignacion_periodo')->sincronizar();\n $this->dep('datos')->tabla('asignacion_periodo')->resetear();\n //en esta seccion se guarda informacion en la relacion esta_formada\n $dias=$datos['dias'];\n foreach ($dias as $dia){\n $dato['nombre']=$dia;\n $dato['id_asignacion']=$secuencia;\n $this->dep('datos')->tabla('esta_formada')->nueva_fila($dato);\n $this->dep('datos')->tabla('esta_formada')->sincronizar();\n $this->dep('datos')->tabla('esta_formada')->resetear();\n }\n }\n// }\n// else{\n// toba::notificacion()->agregar(\"No es posible registrar la asignación porque ya existe\", 'error');\n// }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->db55_sequencial = ($this->db55_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_sequencial\"]:$this->db55_sequencial);\n $this->db55_layouttxt = ($this->db55_layouttxt == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_layouttxt\"]:$this->db55_layouttxt);\n $this->db55_seqlayout = ($this->db55_seqlayout == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_seqlayout\"]:$this->db55_seqlayout);\n if($this->db55_data == \"\"){\n $this->db55_data_dia = ($this->db55_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_data_dia\"]:$this->db55_data_dia);\n $this->db55_data_mes = ($this->db55_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_data_mes\"]:$this->db55_data_mes);\n $this->db55_data_ano = ($this->db55_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_data_ano\"]:$this->db55_data_ano);\n if($this->db55_data_dia != \"\"){\n $this->db55_data = $this->db55_data_ano.\"-\".$this->db55_data_mes.\"-\".$this->db55_data_dia;\n }\n }\n $this->db55_hora = ($this->db55_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_hora\"]:$this->db55_hora);\n $this->db55_usuario = ($this->db55_usuario == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_usuario\"]:$this->db55_usuario);\n $this->db55_nomearq = ($this->db55_nomearq == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_nomearq\"]:$this->db55_nomearq);\n $this->db55_obs = ($this->db55_obs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_obs\"]:$this->db55_obs);\n $this->db55_conteudo = ($this->db55_conteudo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_conteudo\"]:$this->db55_conteudo);\n }else{\n $this->db55_sequencial = ($this->db55_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"db55_sequencial\"]:$this->db55_sequencial);\n }\n }", "public function setRegistro($user_data = array()){\n $this->query = \"\";\n $tblCol = '';\n $tblVal = ''; $err_img = '';\n $colExt = ''; $colName = '';\n $valExt = ''; $valName = '';\n //traemos la siguiente secuencia de la tabla segun los parametros de entrada\n if(isset($user_data['cod_' . str_replace('sys_','',$user_data['no_esq_tabla'])]) and empty($user_data['cod_' . str_replace('sys_','',$user_data['no_esq_tabla'])])){\n $user_data['cod_' . str_replace('sys_','',$user_data['no_esq_tabla'])] = ModeloSistema::setSigSecuencia($user_data['no_esq_tabla']);\n }\n //Llenamos el usuario de la transaccion si la tabla lo requiere y los asignamos al array de valores para el insert\n if (isset($user_data['cod_usuario']) and empty($user_data['cod_usuario'])){$user_data['cod_usuario'] = Session::get('cod');}\n /*obtengo el nombre de la tabla para futuras validaciones */\n $pos = strpos($user_data['no_esq_tabla'], '_');\n $nomTabla = substr($user_data['no_esq_tabla'],$pos+1,strlen($user_data['no_esq_tabla']));\n foreach($user_data as $col=>$dat){\n if(strpos($col,'no_') === false){\n $tblCol = $tblCol . $col . ',';\n $tblVal = $tblVal . \"'\" . $dat . \"'\" . ',';\n }\n }\n\n //Procesamos los archivos adjuntos que vienen con el post\n $icount = contarCoincidencias($user_data,\"tmp_img\");\n for($f=0;$f<$icount;$f++):\n $t=$f>0 ? $f : '';\n if (isset($user_data[\"no_tmp_img\".$t]) Or !empty($user_data[\"no_tmp_img\".$t])):\n $err_img = $err_img . uploadImg($user_data, SYS_DIR_ADJ, $valName, $colName,$t);\n endif;\n //completamos las columnas extras para la transaccion\n if (!empty($valName)) {\n $valExt .= \",'\" . $valName . \"'\";\n $colExt .= \",\" . $colName . \"\";\n $colExt .= $nomTabla;\n }\n endfor;\n\n $this->query = \" INSERT INTO \" . $user_data['no_esq_tabla'] . \"\n (\". substr($tblCol,0,(strlen($tblCol)-1)) .\"\" . $colExt .\")\n VALUES (\". substr($tblVal,0,(strlen($tblVal)-1)) . \"\" . $valExt . \")\";\n $this->execute_single_query();\n //Swicth para eventos posteriores al insert segund lo requiera cada proceso\n switch ($user_data['no_nom_tabla']){\n //Asignamos la configuracion al usuario\n case 'nuevaUsuario':\n for($i=0;$i<count($user_data['no_cod_menu']);$i++){\n $this->query = \" INSERT INTO \" . $user_data['no_esq_tabla'] . \"_menu\n (cod_usuario,cod_menu)\n VALUES ('\" .$user_data['cod_' . $nomTabla] . \"','\" .$user_data['no_cod_menu'][$i]. \"')\";\n $this->execute_single_query();\n }\n for($i=0;$i<count($user_data['no_menu_sub']);$i++){\n $this->query = \" INSERT INTO \" . $user_data['no_esq_tabla'] . \"_menu_sub\n (cod_usuario,cod_menu_sub)\n VALUES ('\" .$user_data['cod_' . $nomTabla] . \"','\" .$user_data['no_menu_sub'][$i]. \"')\";\n $this->execute_single_query();\n $this->query = \" call pbAsignaSubMenu(\" . $user_data['cod_' . $nomTabla] . \",\" . $user_data['no_menu_sub'][$i] . \")\";\n $this->execute_single_query();\n }\n for($i=0;$i<count($user_data['no_cod_empresa']);$i++){\n $this->query = \" INSERT INTO \" . $user_data['no_esq_tabla'] . \"_empresa\n (cod_usuario,cod_empresa)\n VALUES ('\" .$user_data['cod_' . $nomTabla] . \"','\" .$user_data['no_cod_empresa'][$i]. \"')\";\n $this->execute_single_query();\n }\n\n $this->query = \" INSERT INTO \" . $user_data['no_esq_tabla'] . \"_perfil\n (cod_usuario,cod_perfil)\n VALUES ('\" .$user_data['cod_' . $nomTabla] . \"','\" .$user_data['no_cod_perfil']. \"')\";\n $this->execute_single_query();\n $err_img = $err_img . \" La configuracion del sistema a sido asinada al usuario: \" . $user_data['nom_' . $nomTabla] ;\n break;\n case 'NuevaConfiguracionGeneral':\n if ($user_data['cod_estado'] == 'AAA') {\n $this->query = \" call pbActualizaConfig(2,\" . $user_data['cod_config'] . \")\";\n $this->execute_single_query();\n $err_img = $err_img . \" La configuracion ha sido definida como predeterminada\";\n }\n break;\n }\n $this->msj = \"La transaccion se registro correctamente. \" . $err_img;\n }", "function Actualizar()\n{\n /**\n * Crear instancia de concesion\n */\n $Titlulo = new Titulo();\n /**\n * Colocar los datos del GET por medio de los metodos SET\n */\n $Titlulo->setId_titulo(filter_input(INPUT_GET, \"id_titulo\"));\n $Titlulo->setUso_id(filter_input(INPUT_GET, \"uso_id\"));\n $Titlulo->setTitular(filter_input(INPUT_GET, \"titular\"));\n $Titlulo->setVol_amparado_total(filter_input(INPUT_GET, \"vol_amparado_total\"));\n $Titlulo->setNum_aprov_superf(filter_input(INPUT_GET, \"num_aprov_superf\"));\n $Titlulo->setVol_aprov_superf(filter_input(INPUT_GET, \"vol_aprov_superf\"));\n $Titlulo->setNum_aprov_subt(filter_input(INPUT_GET, \"num_aprov_subt\"));\n $Titlulo->setVol_aprov_subt(filter_input(INPUT_GET, \"vol_aprov_subt\"));\n $Titlulo->setPuntos_desc(filter_input(INPUT_GET, \"puntos_desc\"));\n $Titlulo->setVol_desc_diario(filter_input(INPUT_GET, \"vol_desc_diario\"));\n $Titlulo->setZonas_fed_amp_titulo(filter_input(INPUT_GET, \"zonas_fed_amp_titulo\"));\n $Titlulo->setSupeficie(filter_input(INPUT_GET, \"supeficie\"));\n $Titlulo->setFecha_reg(filter_input(INPUT_GET, \"fecha_reg\"));\n if ($Titlulo->Update()) {\n echo 'OK';\n } else {\n echo 'No se ha podido actualizar el registro en la base de datos';\n }\n}", "public function Anular()\n\t{\n\t\tif($this->TieneCobranzasVigentes())\n\t\t\tthrow new Exception('No se puede anular una factura que tiene cobranzas');\n\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t\t//echo 'ejecutar como trans';\n\t\t\t$this->FechaAnulacion = date('Y-m-d');\n\t\t\t\n\t\t\t$q =\tDoctrine_Query::create()\n\t\t\t\t\t\t->from('OrdenDeTrabajo ot')\n ->Update()\n ->Set('FacturaId', 'NULL')\n ->andWhere('ot.ClienteId = ?', $this->ClienteId)\n ->andWhere('ot.FacturaId = ?', $this->Id);\n \n\t\t\t$conn->beginTransaction();\n\t\t\t\n\t\t\t$this->save();\n\t\t\t//actualizar ordenes asociadas la factura\n\t\t\t$q->execute();\n\t\t\t\n\t\t\t$conn->commit();\n\t\t\n\t}", "public function examen(){\r\n\t\tparent::conectaBDMy();\t \r\n\t\t$this->idExamen=\"\";\t\t\r\n\t\t$this->tipoExamen=\"\";\t\r\n\t\t$this->descripcion=\"\";\r\n\t}", "private function setData($data){\n\t\n\t\t$this->setIdusuario($data['idusuario']);\n\t\t$this->setDeslogin($data['deslogin']);\n\t\t$this->setDessenha($data['dessenha']);\n\t\t$this->setDtcadastro(new DateTime($data['dtcadastro']));\t\t\n\t}", "function salida_por_traspaso(){\n\t\t$e= new Salida();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cclientes_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "function insertAtenciones(){\n\n\t$id_item=2; // proyecto : LEVEL\n\t$id_status=3;\n\t$id_nivel=1;\n\t$id_usuario=146; //larry portanova\n\t$id_user=203; //larry portanova\n\n\n\t//leer archivo\n\t$buffer=implode('',file('atenciones2/level.csv'));\n\n\t//parsear csv\n\t$atenciones=[];\n\n\t$lineas=explode(\"\\n\",$buffer);\n\n\t$campos=explode(\",\",$lineas[0]);\n\n\tforeach($lineas as $i => $linea){\n\n\t\tif($i==0) continue;\n\n\t\t$columnas=str_getcsv($linea);\n\n\t\tforeach($columnas as $j => $columna){\n\n\t\t\t$atenciones[$i][strtolower(trim($campos[$j]))]=$columna;\n\t\t}\n\n\t}\n\n\t// prin($atenciones);\n\n\t//inserts\n\n\t$fechaMonth=[\n\t'Ene'=>'01','Feb'=>'02','Mar'=>'03','Apr'=>'04','May'=>'05','Jun'=>'06','Jul'=>'07','Aug'=>'08','Set'=>'09','Oct'=>'10','Nov'=>'11','Dic'=>'12',\n\t'01'=>'01','02'=>'02','03'=>'03','04'=>'04','05'=>'05','06'=>'06','07'=>'07','08'=>'08','09'=>'09','10'=>'10','11'=>'11','12'=>'12',\n\t];\n\n\n\n\tforeach($atenciones as $i => &$atencion){\n\n\t\tif(trim($atencion['nombre'])=='') continue;\n\n\t\t//eliminamos vacio\n\t\tunset($atencion['']);\n\n\t\t//nombre completo\n\t\t$atencion['nombre_completo']=$atencion['nombre'];\n\n\t\t//nombre y apellidos\n\t\t$nom_partes=explode(\" \",$atencion['nombre']);\n\t\t$atencion['nombre']=$nom_partes[0];\n\t\tunset($nom_partes[0]);\n\t\t$atencion['apellidos']=trim(implode(\" \",$nom_partes));\n\n\t\t//fecha\n\t\t$atencion['fecha_original']=$atencion['fecha'];\n\t\t$fecha_partes=explode(\"-\",$atencion['fecha']);\n\t\t$atencion['fecha']=\"2015-\".$fechaMonth[$fecha_partes[1]].\"-\".str_pad($fecha_partes[0], 2, \"0\", STR_PAD_LEFT).\" 14:00:00\";\n\n\t\t$atencion['seguimiento']='Primer contacto';\n\t\t// prin($atencion['fecha']);\n\n\t\t// prin($atencion);\n\n\t\t// continue;\n\n\t\t//\n\t\t//cliente\n\t\t$clienteId=getIdOrCreate(\n\t\t\t\"clientes\",\n\t\t\t[\n\t\t\t\t\"nombre\" =>$atencion['nombre'],\n\t\t\t\t\"apellidos\" =>$atencion['apellidos'],\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"celular_claro\" =>$atencion['tel. cel.'],\n\t\t\t\t\"email\" =>$atencion['email'],\n\t\t\t\t\"telefono\" =>$atencion['fijo'],\n\n\t\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\t\"user\" \t\t =>$id_user,//\n\n\t\t\t\t// \"tipo_cliente\" =>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"email\" \t\t=>\"guillermolozan@icloud.com\",\n\t\t\t]\n\t\t\t);\n\n\n\t\t//\t$pedido='[{\"type\":\"departamento\",\"price\":\"621000\",\"id\":\"12\"}]';\n\t\t//departamento\n\t\t$item_item=select_fila(\"id,pvlista\",\"productos_items_items\",\"where numero=\".$atencion['departamento'].\" and id_item=\".$id_item);\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\"}]';\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\",\"name\":\"1 departamento'.$atencion['departamento'].'\",\"num\":\"'.$atencion['departamento'].'\",\"torre\":\"1\"}]';\n\n\t\t$canalId=getIdOrCreate(\n\t\t\t\"contacto_canales\",\n\t\t\t[\n\t\t\t\"nombre\" =>$atencion['medio'],\n\t\t\t]\n\t\t\t);\n\n\n\t\t// prin($atencion);\n\t\t//atencion\n\t\t$venta=insert(\n\t\t\t[\n\t\t\t\"fecha_creacion\" =>$atencion['fecha'],//\n\t\t\t\"fecha_creacion2\"=>$atencion['fecha'],//\n\t\t\t\"visibilidad\" =>'1',\n\t\t\t\"id_cliente\" =>$clienteId,\n\t\t\t\"id_status\" =>$id_status,//\n\t\t\t\"id_nivel\" =>$id_nivel,//\n\t\t\t\"id_canal\" =>$canalId,\n\t\t\t\"id_item\" =>$id_item,//\n\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\"user\" \t\t =>$id_user,//\n\t\t\t\n\t\t\t// \"pedido\" =>$pedido,//\n\t\t\t// \"pvlista\" =>$item_item['pvlista'],//\n\t\t\t// \"pvpromocion\" =>$item_item['pvlista'],//\n\n\t\t\t// \"id_item_item\" =>$item_item['id'],//\n\n\t\t\t]\n\t\t\t,\"ventas_items\"\n\t\t\t);\n\n\t\tif(trim($atencion['seguimiento'])!='')\n\t\tinsert(\n\t\t\t[\n\t\t\t'fecha_creacion' =>$atencion['fecha'],\n\t\t\t// \"id_item\" =>$id_item,//\n\t\t\t'id_grupo' =>$venta['id'],\n\t\t\t// \"id_cliente\" =>$clienteId,\n\t\t\t'texto' =>$atencion['seguimiento'],\n\t\t\t]\n\t\t\t,'ventas_mensajes'\n\t\t\t,1\n\t\t\t);\n\n\t}\n\n\t// exit();\n\n\tprin(\"Inserciones DONE\");\n\n\t// prin($atenciones);\n\n\t// prin($celdas);\n\n\n\t// $matriz = str_getcsv($buffer,',','\"','\\\\',\"\\n\");\n\n\t// $matriz = str_getcsv($buffer); \n\n\t// prin($matriz);\n\n}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed20_i_codigo = ($this->ed20_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_codigo\"]:$this->ed20_i_codigo);\n $this->ed20_c_outroscursos = ($this->ed20_c_outroscursos == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_outroscursos\"]:$this->ed20_c_outroscursos);\n $this->ed20_c_posgraduacao = ($this->ed20_c_posgraduacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_posgraduacao\"]:$this->ed20_c_posgraduacao);\n $this->ed20_i_escolaridade = ($this->ed20_i_escolaridade == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_escolaridade\"]:$this->ed20_i_escolaridade);\n $this->ed20_i_censomunicender = ($this->ed20_i_censomunicender == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censomunicender\"]:$this->ed20_i_censomunicender);\n $this->ed20_i_censoufender = ($this->ed20_i_censoufender == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoufender\"]:$this->ed20_i_censoufender);\n $this->ed20_c_passaporte = ($this->ed20_c_passaporte == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_passaporte\"]:$this->ed20_c_passaporte);\n $this->ed20_i_censoufcert = ($this->ed20_i_censoufcert == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoufcert\"]:$this->ed20_i_censoufcert);\n $this->ed20_c_certidaocart = ($this->ed20_c_certidaocart == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaocart\"]:$this->ed20_c_certidaocart);\n if($this->ed20_c_certidaodata == \"\"){\n $this->ed20_c_certidaodata_dia = ($this->ed20_c_certidaodata_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaodata_dia\"]:$this->ed20_c_certidaodata_dia);\n $this->ed20_c_certidaodata_mes = ($this->ed20_c_certidaodata_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaodata_mes\"]:$this->ed20_c_certidaodata_mes);\n $this->ed20_c_certidaodata_ano = ($this->ed20_c_certidaodata_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaodata_ano\"]:$this->ed20_c_certidaodata_ano);\n if($this->ed20_c_certidaodata_dia != \"\"){\n $this->ed20_c_certidaodata = $this->ed20_c_certidaodata_ano.\"-\".$this->ed20_c_certidaodata_mes.\"-\".$this->ed20_c_certidaodata_dia;\n }\n }\n $this->ed20_c_certidaolivro = ($this->ed20_c_certidaolivro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaolivro\"]:$this->ed20_c_certidaolivro);\n $this->ed20_c_certidaofolha = ($this->ed20_c_certidaofolha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaofolha\"]:$this->ed20_c_certidaofolha);\n $this->ed20_c_certidaonum = ($this->ed20_c_certidaonum == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_certidaonum\"]:$this->ed20_c_certidaonum);\n $this->ed20_i_certidaotipo = ($this->ed20_i_certidaotipo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_certidaotipo\"]:$this->ed20_i_certidaotipo);\n if($this->ed20_d_dataident == \"\"){\n $this->ed20_d_dataident_dia = ($this->ed20_d_dataident_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_d_dataident_dia\"]:$this->ed20_d_dataident_dia);\n $this->ed20_d_dataident_mes = ($this->ed20_d_dataident_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_d_dataident_mes\"]:$this->ed20_d_dataident_mes);\n $this->ed20_d_dataident_ano = ($this->ed20_d_dataident_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_d_dataident_ano\"]:$this->ed20_d_dataident_ano);\n if($this->ed20_d_dataident_dia != \"\"){\n $this->ed20_d_dataident = $this->ed20_d_dataident_ano.\"-\".$this->ed20_d_dataident_mes.\"-\".$this->ed20_d_dataident_dia;\n }\n }\n $this->ed20_i_censoufident = ($this->ed20_i_censoufident == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoufident\"]:$this->ed20_i_censoufident);\n $this->ed20_i_censoorgemiss = ($this->ed20_i_censoorgemiss == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoorgemiss\"]:$this->ed20_i_censoorgemiss);\n $this->ed20_c_identcompl = ($this->ed20_c_identcompl == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_identcompl\"]:$this->ed20_c_identcompl);\n $this->ed20_i_censomunicnat = ($this->ed20_i_censomunicnat == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censomunicnat\"]:$this->ed20_i_censomunicnat);\n $this->ed20_i_censoufnat = ($this->ed20_i_censoufnat == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censoufnat\"]:$this->ed20_i_censoufnat);\n $this->ed20_i_nacionalidade = ($this->ed20_i_nacionalidade == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_nacionalidade\"]:$this->ed20_i_nacionalidade);\n $this->ed20_i_raca = ($this->ed20_i_raca == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_raca\"]:$this->ed20_i_raca);\n $this->ed20_c_nis = ($this->ed20_c_nis == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_nis\"]:$this->ed20_c_nis);\n $this->ed20_i_codigoinep = ($this->ed20_i_codigoinep == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_codigoinep\"]:$this->ed20_i_codigoinep);\n $this->ed20_i_pais = ($this->ed20_i_pais == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_pais\"]:$this->ed20_i_pais);\n $this->ed20_i_tiposervidor = ($this->ed20_i_tiposervidor == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_tiposervidor\"]:$this->ed20_i_tiposervidor);\n $this->ed20_i_rhregime = ($this->ed20_i_rhregime == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_rhregime\"]:$this->ed20_i_rhregime);\n $this->ed20_c_efetividade = ($this->ed20_c_efetividade == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_c_efetividade\"]:$this->ed20_c_efetividade);\n $this->ed20_i_censocartorio = ($this->ed20_i_censocartorio == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_censocartorio\"]:$this->ed20_i_censocartorio);\n $this->ed20_i_zonaresidencia = ($this->ed20_i_zonaresidencia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_zonaresidencia\"]:$this->ed20_i_zonaresidencia);\n }else{\n $this->ed20_i_codigo = ($this->ed20_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed20_i_codigo\"]:$this->ed20_i_codigo);\n }\n }", "public function Actualizar_Exp_Laboral($data){\n $modelo = new HojaVida();\n $fechahora = $modelo->get_fecha_actual();\n $datosfecha = explode(\" \",$fechahora);\n $fechalog = $datosfecha[0];\n $horalog = $datosfecha[1];\n \n $tiporegistro = \"Experiencia Laboral\";\n $accion = \"Actualiza una Nueva \".$tiporegistro.\" En el Sistema (Hoja vida) TALENTO HUMANO\";\n $detalle = $_SESSION['nombre'].\" \".$accion.\" \".$fechalog.\" \".\"a las: \".$horalog;\n $tipolog = 15;\n $idusuario = $_SESSION['idUsuario'];\n //$idusuario = $_POST['id_user'];;\n try {\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\t\t\n //EMPIEZA LA TRANSACCION\n $this->pdo->beginTransaction();\n $sql = \"UPDATE th_experiencia_laboral SET \n exp_id_departamento = ?,\n exp_id_municipio = ?, \n exp_rama_flag = ?,\n exp_empresa = ?,\n exp_cargo = ?,\n exp_CS_flag = ?,\n exp_id_area_CS = ?,\n exp_fecha_inicio = ?,\n exp_fecha_actualmente = ?,\n exp_fecha_fin = ?,\n exp_ruta_certificado = ?,\n exp_id_usuarioE = ?\n WHERE exp_id = ?\";\n\n $this->pdo->prepare($sql)\n ->execute(\n array( \n $data->exp_id_departamento,\n $data->exp_id_municipio,\n $data->exp_rama,\n $data->exp_empresa,\n $data->exp_cargo,\n $data->exp_CS_flag,\n $data->exp_id_area,\n $data->exp_fecha_inicio,\n $data->exp_fecha_actualmente,\n $data->exp_fecha_fin,\n $data->exp_ruta_certificado,\n $idusuario,\n $data->id\n )\n ); \n \n $this->pdo->exec(\"INSERT INTO log (fecha, accion,detalle,idusuario,idtipolog) VALUES ('$fechalog', '$accion','$detalle','$idusuario','$tipolog')\");\n //SE TERMINA LA TRANSACCION \n $this->pdo->commit();\n } catch (Exception $e) {\n $this->pdo->rollBack();\n die($e->getMessage());\n }\n }", "public function actualiza($dataArray){\n //deleted, created_at y updated_at son comunes, pero estos jamas se actualizaran por acá\n if (array_key_exists('fechaNac',$dataArray))\n $dataArray['fechaNac'] = DateFormat::spanishDateToEnglishDate($dataArray['fechaNac']);\n if (array_key_exists('password',$dataArray))\n $dataArray['password'] = bcrypt($dataArray['password']);\n $this->personaNatural->update($dataArray);\n $this->model->update($dataArray); //set data only in its PersonaNatural model\n }", "function alta_entrada(){\n $e = new Entrada();\n\t\t$precio=$_POST['costo_unitario'];\n\t\t$producto_id=$_POST['cproductos_id'];\n $e->usuario_id = $GLOBALS['usuarioid'];\n $e->empresas_id = $GLOBALS['empresaid'];\n $related = $e->from_array($_POST);\n //if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n $f = new Pr_factura();\n $f->get_by_id($e->pr_facturas_id);\n $e->espacios_fisicos_id = $f->espacios_fisicos_id;\n $e->lote_id = $f->lote_id;\n $e->costo_total = ($e->cantidad * $e->costo_unitario);\n\t\t$e->existencia = $e->cantidad;\n $e->cproveedores_id = $f->cproveedores_id;\n $e->fecha = date(\"Y-m-d H:i:s\");\n if ($e->id == 0)\n unset($e->id);\n if ($e->save($related)) {\n echo $e->id;\n\t\t\t$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n } else\n echo 0;\n }", "function __construct(){\n $this->valorBruto = 0;\n $this->valorImpostos = 0;\n\n $this->itens = array(); // gera um array pra guardar os itens\n $this->acoesAoGerar = array();\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->tf33_i_codigo = ($this->tf33_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_i_codigo\"]:$this->tf33_i_codigo);\n $this->tf33_i_login = ($this->tf33_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_i_login\"]:$this->tf33_i_login);\n $this->tf33_i_fechamento = ($this->tf33_i_fechamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_i_fechamento\"]:$this->tf33_i_fechamento);\n $this->tf33_c_nomearquivo = ($this->tf33_c_nomearquivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_c_nomearquivo\"]:$this->tf33_c_nomearquivo);\n if($this->tf33_d_datasistema == \"\"){\n $this->tf33_d_datasistema_dia = ($this->tf33_d_datasistema_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_d_datasistema_dia\"]:$this->tf33_d_datasistema_dia);\n $this->tf33_d_datasistema_mes = ($this->tf33_d_datasistema_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_d_datasistema_mes\"]:$this->tf33_d_datasistema_mes);\n $this->tf33_d_datasistema_ano = ($this->tf33_d_datasistema_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_d_datasistema_ano\"]:$this->tf33_d_datasistema_ano);\n if($this->tf33_d_datasistema_dia != \"\"){\n $this->tf33_d_datasistema = $this->tf33_d_datasistema_ano.\"-\".$this->tf33_d_datasistema_mes.\"-\".$this->tf33_d_datasistema_dia;\n }\n }\n $this->tf33_c_horasistema = ($this->tf33_c_horasistema == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_c_horasistema\"]:$this->tf33_c_horasistema);\n $this->tf33_o_arquivo = ($this->tf33_o_arquivo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_o_arquivo\"]:$this->tf33_o_arquivo);\n }else{\n $this->tf33_i_codigo = ($this->tf33_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf33_i_codigo\"]:$this->tf33_i_codigo);\n }\n }", "public function ActualizarOpcion()\n {\n try {\n $content = trim(file_get_contents(\"php://input\"));\n $decoded = json_decode($content, true);\n $dbm = $this->get(\"db_manager\");\n $dbm = new DbmControlescolar($dbm->getEntityManager());\n\n $Calificacionporperiodo = $dbm->getRepositorioById(\"CeCalificacionperiodoporalumno\", \"calificacionperiodoporalumnoid\", $decoded[\"calificacionperiodoporalumnoid\"]);\n\n //Iniciamos el proceso de guardar en la bitacora\n self::saveBitacoraCapturaCalificacion($dbm, 1, $decoded[\"usuarioid\"], $Calificacionporperiodo);\n\n //Si viene el id de la calificacion final, la opcion que se actualizara es la de la opcion final\n if ($decoded[\"calificacionfinalperiodoporalumnoid\"]) {\n $Calificacionfinal = $dbm->getRepositorioById(\"CeCalificacionfinalperiodoporalumno\", \"calificacionfinalperiodoporalumnoid\", $decoded[\"calificacionfinalperiodoporalumnoid\"]);\n $Calificacionfinal->setPonderacionOpcionId($dbm->getRepositorioById(\"CePonderacionopcion\", \"ponderacionopcionid\", $decoded[\"ponderacionopcionid\"]));\n $dbm->saveRepositorio($Calificacionfinal);\n } else { // Caso contrario, es la del periodo\n $Calificacionporperiodo->setPonderacionOpcionId($dbm->getRepositorioById(\"CePonderacionopcion\", \"ponderacionopcionid\", $decoded[\"ponderacionopcionid\"]));\n $dbm->saveRepositorio($Calificacionporperiodo);\n }\n\n //Terminamos el proceso de guardar en la bitacora (enviar desde el front la calificacionporperiodo cuando se califica la final)\n self::saveBitacoraCapturaCalificacion($dbm, 2, $decoded[\"usuarioid\"], $Calificacionporperiodo);\n return new View(\"Se ha actualizado la opción \", Response::HTTP_OK);\n } catch (\\Exception $e) {\n return new View($e->getMessage(), Response::HTTP_BAD_REQUEST);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed03_i_codigo = ($this->ed03_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_codigo\"]:$this->ed03_i_codigo);\n $this->ed03_i_rechumanoativ = ($this->ed03_i_rechumanoativ == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_rechumanoativ\"]:$this->ed03_i_rechumanoativ);\n $this->ed03_i_relacaotrabalho = ($this->ed03_i_relacaotrabalho == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_relacaotrabalho\"]:$this->ed03_i_relacaotrabalho);\n }else{\n $this->ed03_i_codigo = ($this->ed03_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed03_i_codigo\"]:$this->ed03_i_codigo);\n }\n }", "private function setExercicio(){\n\t\t$this->Enunciado = $this->Data['enunciado'];\n\t\t$this->A = $this->Data['opA'];\n\t\t$this->B = $this->Data['opB'];\n\t\t$this->C = $this->Data['opC'];\n\t\t$this->D = $this->Data['opD'];\n\t\t$this->E = $this->Data['opE'];\n\t\t$this->Correta = $this->Data['correta'];\n\n\t\t$this->Query = ['c_enumexer' => $this->Enunciado,\n\t\t\t\t\t\t'c_altaexer' => $this->A,\n\t\t\t\t\t\t'c_altbexer' => $this->B,\n\t\t\t\t\t\t'c_altcexer' => $this->C,\n\t\t\t\t\t\t'c_altdexer' => $this->D,\n\t\t\t\t\t\t'c_alteexer' => $this->E,\n\t\t\t\t\t\t'c_correxer' => $this->Correta];\n\n\t}", "function salvarCadastro() {\n $this->layout = '_layout.perfilUsuario';\n $usuario = new Usuario();\n // $usuario->codgusario = $this->getParametro(0);\n $api = new ApiUsuario();\n $sec = new Validador();\n \n if(isset($_FILES[\"foto\"][\"name\"])){\n $arquivo =$_FILES[\"foto\"][\"name\"];\n $path_dir = \"fotos/\". $arquivo;\n $vs= move_uploaded_file($_FILES[\"foto\"][\"tmp_name\"], $path_dir);\n }\n /**\n * recebe\n */\n \n $senha = $sec->criptografarUrl($_POST['senha']);\n \n \n $usuario->setNome($_POST['nome']);\n $usuario->setApelido($_POST['apelido']);\n $usuario->setNumeroEstudante(addslashes($_POST['numeroEstudante']));\n $usuario->setTelefone($_POST['telefone']);\n $usuario->setEmail($_POST['email']);\n $usuario->setNivel($_POST['nivel']);\n $usuario->setSenha($senha);\n $usuario->setFoto(isset($arquivo)?$arquivo:'');\n \n /**\n * condiçao pra actualizar ou inserir \n */\n if(isset($_POST['codgusario']) && !empty($_POST['codgusario'])):\n \n \n $query = $api->salavarInsert(new Usuario('POST'));\n \n else:\n $query = $api->salavarInsert($usuario);\n \n endif;\n \n $this->dados = array('salvar' => $query);\n $this->view();\n }", "public function run()\n { \n \n Empresa::truncate(); // Evita duplicar datos\n \n $empresa = new Empresa();\n $empresa->nombre = \"Hidrandina\";\n $empresa->descripcion = \"Descripcion 1\";\n $empresa->ruc = intval(20132023542);\n $empresa->user_id = 1;\n $empresa->save();\n\n $empresa = new Empresa();\n $empresa->nombre = \"Enel Distribucion\";\n $empresa->descripcion = \"Descripcion 2\";\n $empresa->ruc = intval(20269985902);\n $empresa->user_id = 1;\n $empresa->save();\n\n Tarifa::truncate(); // Evita duplicar datos\n\n $tarifa = new Tarifa();\n $tarifa->codigo = \"Tarifa 1\";\n $tarifa->tipo = \"Comercial\";\n $tarifa->save();\n\n $tarifa = new Tarifa();\n $tarifa->codigo = \"Tarifa 2\";\n $tarifa->tipo = \"Domestico\";\n $tarifa->save();\n\n Distrito::truncate(); // Evita duplicar datos\n\n $distrito = new Distrito();\n $distrito->nombre = \"San Blas\"; \n $distrito->save();\n\n $distrito = new Distrito();\n $distrito->nombre = \"Santa Luzmila\"; \n $distrito->save();\n\n Region::truncate(); // Evita duplicar datos\n\n $distrito = new Region();\n $distrito->nombre = \"San Martin\"; \n $distrito->save();\n\n $distrito = new Region();\n $distrito->nombre = \"Moyobamba\"; \n $distrito->save();\n\n Ficha::truncate(); // Evita duplicar datos\n \n $ficha = new Ficha();\n $ficha->localidad = \"Shucllapampa\";\n $ficha->D1FE = \"Potencia 65W, S\";\n $ficha->D2FE = \"Corriente 10A, S\";\n $ficha->D3FE = \"Capacidad 92Ah, S\";\n $ficha->D4FE = \"Potencia 85W, S\";\n $ficha->D1FF = \"Tension 16.7, N\";\n $ficha->D2FF = \"Tension 12.8, S\"; $ficha->D3FF = \"Tension 12.8, S\";\n $ficha->D4FF = \"Tension 11.8, N\";\n $ficha->Comentarios = \"Sin observaciones\"; \n $ficha->Resultado = \"Si Cumple\"; \n $ficha->tarifa_id = 1;\n $ficha->empresa_id = 1; \n $ficha->region_id = 1;\n // $ficha->distrito_id = 1;\n $ficha->save();\n\n $ficha->distritos()->attach([1]); //Relacionar la ficha a un distrito\n\n $ficha = new Ficha();\n $ficha->localidad = \"Contumasa\";\n $ficha->D1FE = \"Potencia 45W, S\";\n $ficha->D2FE = \"Corriente 8A, S\";\n $ficha->D3FE = \"Capacidad 72Ah, S\";\n $ficha->D4FE = \"Potencia 95W, S\";\n $ficha->D1FF = \"Tension 19.7, N\";\n $ficha->D2FF = \"Tension 11.8, S\"; $ficha->D3FF = \"Tension 10.8, S\";\n $ficha->D4FF = \"Tension 12.8, N\";\n $ficha->Comentarios = \"Se obtuvieron las siguientes observaciones: No cuenta con pararayos y 01 transformador averiado\";\n $ficha->Resultado = \"No Cumple\";\n $ficha->tarifa_id = 2;\n $ficha->empresa_id = 2; \n $ficha->region_id = 2;\n // $ficha->distrito_id = 2;\n $ficha->save();\n\n $ficha->distritos()->attach([2]); //Relacionar la ficha a un distrito\n\n }", "public function atualizar()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"UPDATE MinisterioTemDiscipulo SET \t ministerioId= ? , funcaoId = ?\n WHERE discipuloId = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->ministerioId );\n $stm->bindParam(2, $this->funcaoId );\n $stm->bindParam(3, $this->discipuloId );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n //var_dump($erro);\n //exit();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "public function atualizar()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"UPDATE MinisterioTemDiscipulo SET \t ministerioId= ? , funcaoId = ?\n WHERE discipuloId = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->ministerioId );\n $stm->bindParam(2, $this->funcaoId );\n $stm->bindParam(3, $this->discipuloId );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n //var_dump($erro);\n //exit();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "function set_deputados() {\n\n\t\ttry {\n\n\t\t\t$dadosAbertosClient = new dadosAbertosClient;\n\n\t\t\t// legislatura de valor 18 foi definida pois eh o periodo onde estao os deputados vigentes no ano de 2017\n\t\t\t$listaDeputados = $dadosAbertosClient->listaDeputadosPorLegislatura(18);\n\n\t\t\tforeach ($listaDeputados as $deputado) {\n\n\t\t\t\t$deputado = Deputado::findByIdDeputado($deputado['id']);\t\n\n\t\t\t\tif($deputado)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$deputadoData = [\n\t\t\t\t\t'id_deputado' => $deputado->id,\n\t\t\t\t\t'nome' => $deputado->nome,\n\t\t\t\t\t'partido' => $deputado->partido,\n\t\t\t\t\t'tag_localizacao' => $deputado->tagLocalizacao\n\t\t\t\t];\n\n\t\t\t\tDeputado::create($deputadoData);\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\t\t\techo $e->getMessage();\n\t\t}\n\n\t}", "function restablecer()\n {\n $this->_datos = null;\n $this->_errores = array();\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->k142_sequencial = ($this->k142_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_sequencial\"]:$this->k142_sequencial);\n $this->k142_idret = ($this->k142_idret == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_idret\"]:$this->k142_idret);\n $this->k142_processo = ($this->k142_processo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_processo\"]:$this->k142_processo);\n if($this->k142_dataprocesso == \"\"){\n $this->k142_dataprocesso_dia = ($this->k142_dataprocesso_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_dia\"]:$this->k142_dataprocesso_dia);\n $this->k142_dataprocesso_mes = ($this->k142_dataprocesso_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_mes\"]:$this->k142_dataprocesso_mes);\n $this->k142_dataprocesso_ano = ($this->k142_dataprocesso_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_dataprocesso_ano\"]:$this->k142_dataprocesso_ano);\n if($this->k142_dataprocesso_dia != \"\"){\n $this->k142_dataprocesso = $this->k142_dataprocesso_ano.\"-\".$this->k142_dataprocesso_mes.\"-\".$this->k142_dataprocesso_dia;\n }\n }\n $this->k142_titular = ($this->k142_titular == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_titular\"]:$this->k142_titular);\n $this->k142_observacao = ($this->k142_observacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_observacao\"]:$this->k142_observacao);\n }else{\n $this->k142_sequencial = ($this->k142_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"k142_sequencial\"]:$this->k142_sequencial);\n }\n }", "public function enfocarCamaraAlumnos2() {\n\n self::$alumnos2->enfocar();\n\n }", "private function tbl_guiones_registro_afectacion() {\r\n\t\t\t$this->guiones_registro_afectacion = $this->esquema->createTable('GUIONES_REGISTRO_AFECTACION');\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la afectacion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_afectacion->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function actualizar_Datos_Usuario2(){\n\t\t$sql = \"UPDATE usuarios SET Documento=\".$this->usuario->get_Nid().\",\n\t\t\t\t\t\t\t\t\tNombres='\".$this->usuario->get_Nombres().\"',\n\t\t\t\t\t\t\t\t\tApellidos = '\".$this->usuario->get_Apellidos().\"',\n\t\t\t\t\t\t\t\t\tUsuario = '\".$this->usuario->get_Usuario().\"',\n\t\t\t\t\t\t\t\t\tPregunta = '\".$this->usuario->get_Pregunta().\"',\n\t\t\t\t\t\t\t\t\tRespuesta = '\".$this->usuario->get_Respuesta().\"',\n\t\t\t\t\t\t\t\t\tTipo_Documento = '\".$this->usuario->get_TipoId().\"',\n\t\t\t\t\t\t\t\t\tCiudad = '\".$this->usuario->get_Ciudad().\"',\n\t\t\t\t\t\t\t\t\tDireccion = '\".$this->usuario->get_Direccion().\"',\n\t\t\t\t\t\t\t\t\tEdad = '\".$this->usuario->get_Edad().\"',\n\t\t\t\t\t\t\t\t\tFoto = '\".$this->usuario->get_Foto().\"',\n\t\t\t\t\t\t\t\t\tTelefono = '\".$this->usuario->get_Celular().\"',\n\t\t\t\t\t\t\t\t\tCorreo_Electronico = '\".$this->usuario->get_Email().\"',\n\t\t\t\t\t\t\t\t\tGenero = '\".$this->usuario->get_Genero().\"',\n\t\t\t\t\t\t\t\t\tperfiles_Nombre = '\".$this->usuario->get_Perfil().\"'\n\t\t\t WHERE Documento=\".$this->usuario->get_Nid().\"\";\n\n\n\n\t\t//echo $sql;\n\t\t$salida = 0;\n\t\t$valida = new Validacion_Datos(); // <- Para validar los tipos de datos\n\t\t// Validacion de los minimos\n\t\tif(!(strlen($this->usuario->get_Nid()) > 7))\t\t\t$salida = 2;\n\t\telseif(!(strlen($this->usuario->get_Nombres()) > 1))\t$salida = 3;\n\t\telseif(!(strlen($this->usuario->get_Apellidos()) > 1))\t$salida = 4;\n\t\telseif(!(strlen($this->usuario->get_Usuario()) > 4))\t$salida = 5;\n\t\telseif(!(strlen($this->usuario->get_Pregunta()) > 9))\t$salida = 7;\n\t\telseif(!(strlen($this->usuario->get_Respuesta()) > 1))\t$salida = 8;\n\t\telseif(!(strlen($this->usuario->get_Ciudad()) > 1))\t\t$salida = 10;\n\t\telseif(!(strlen($this->usuario->get_Direccion()) > 2))\t$salida = 11;\n\t\telseif(!(strlen($this->usuario->get_Edad()) > 0))\t\t$salida = 12;\n\t\telseif(!(strlen($this->usuario->get_Foto()) > 2))\t\t$salida = 13;\n\t\telseif(!(strlen($this->usuario->get_Celular()) > 7))\t$salida = 14;\n\t\telseif(!(strlen($this->usuario->get_Email()) > 6))\t\t$salida = 15;\n\t\t// Validacion de los tipos de datos (Numérico,Alfabético,Alfanumérico)\n\t\telseif(!($valida->is_Number($this->usuario->get_Nid())))\t\t\t\t$salida = 18;\n\t\telseif(!($valida->is_Alphanumeric($this->usuario->get_Usuario())))\t\t$salida = 19;\n\t\telseif(!($valida->is_Alphabetic($this->usuario->get_Nombres())))\t\t$salida = 20;\n\t\telseif(!($valida->is_Alphabetic($this->usuario->get_Apellidos())))\t\t$salida = 21;\n\t\telseif(!($valida->is_Alphanumeric($this->usuario->get_Respuesta())))\t$salida = 24;\n\t\telseif(!($valida->is_Alphabetic($this->usuario->get_Ciudad())))\t\t\t$salida = 25;\n\t\telseif(!($valida->is_Number($this->usuario->get_Edad())))\t\t\t\t$salida = 26;\n\t\telseif(!($valida->is_Number($this->usuario->get_Celular())))\t\t\t$salida = 28;\n\n\n\t\t///////////////////////////////////////////////////////////////////////////\n\n\t\t\n\t\telseif($this->bd->insertar($sql))\n\t\t\t$salida = true;\n\t\telse $salida = 31;\n\t\t\n\n\t\treturn $salida;\n\t}", "function regenerar()\n\t{\n\t\t$this->manejador_interface->titulo( \"Regenerando PROYECTO {$this->identificador}\" );\n\t\ttoba_logger::instancia()->debug( \"Regenerando PROYECTO {$this->identificador}\");\n\t\ttry {\n\t\t\t$this->db->abrir_transaccion();\n\t\t\t$this->db->retrasar_constraints();\n\t\t\t$this->instancia->exportar_local_proyecto($this->identificador);\n\t\t\t$this->eliminar();\n\t\t\t$this->cargar();\n\t\t\t$this->instancia->cargar_informacion_instancia_proyecto( $this->identificador );\n\t\t\t$this->instancia->actualizar_secuencias();\n\t\t\t$this->generar_roles_db();\n\t\t\t$this->db->cerrar_transaccion();\n\t\t} catch ( toba_error $e ) {\n\t\t\t$this->db->abortar_transaccion();\n\t\t\tthrow $e;\n\t\t}\n\t}", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->etiqueta=$_POST['etiqueta'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->icono=$_POST['icono'];\n\t}", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->d02_contri = ($this->d02_contri == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_contri\"]:$this->d02_contri);\n $this->d02_codedi = ($this->d02_codedi == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_codedi\"]:$this->d02_codedi);\n $this->d02_codigo = ($this->d02_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_codigo\"]:$this->d02_codigo);\n if($this->d02_dtauto == \"\"){\n $this->d02_dtauto_dia = ($this->d02_dtauto_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_dtauto_dia\"]:$this->d02_dtauto_dia);\n $this->d02_dtauto_mes = ($this->d02_dtauto_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_dtauto_mes\"]:$this->d02_dtauto_mes);\n $this->d02_dtauto_ano = ($this->d02_dtauto_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_dtauto_ano\"]:$this->d02_dtauto_ano);\n if($this->d02_dtauto_dia != \"\"){\n $this->d02_dtauto = $this->d02_dtauto_ano.\"-\".$this->d02_dtauto_mes.\"-\".$this->d02_dtauto_dia;\n }\n }\n $this->d02_autori = ($this->d02_autori == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_autori\"]:$this->d02_autori);\n $this->d02_idlog = ($this->d02_idlog == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_idlog\"]:$this->d02_idlog);\n if($this->d02_data == \"\"){\n $this->d02_data_dia = ($this->d02_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_data_dia\"]:$this->d02_data_dia);\n $this->d02_data_mes = ($this->d02_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_data_mes\"]:$this->d02_data_mes);\n $this->d02_data_ano = ($this->d02_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_data_ano\"]:$this->d02_data_ano);\n if($this->d02_data_dia != \"\"){\n $this->d02_data = $this->d02_data_ano.\"-\".$this->d02_data_mes.\"-\".$this->d02_data_dia;\n }\n }\n $this->d02_profun = ($this->d02_profun == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_profun\"]:$this->d02_profun);\n $this->d02_valorizacao = ($this->d02_valorizacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_valorizacao\"]:$this->d02_valorizacao);\n }else{\n $this->d02_contri = ($this->d02_contri == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"d02_contri\"]:$this->d02_contri);\n }\n }", "public function save(){\r\n\t\tif(empty($this->idLibro)){\t\t\t\r\n\t\t\t$this->idLibro = $this->con->autoInsert(array(\r\n\t\t\t\"id_area_conocimiento\" => $this->idAreaConocimiento,\r\n\t\t\t\"ISBN\" => $this->iSBN,\r\n\t\t\t\"titulo\" => $this->titulo,\r\n\t\t\t\"año_publicación\" => $this->añoPublicación,\r\n\t\t\t\"idioma\" => $this->idioma,\r\n\t\t\t\"palabras_claves\" => $this->palabrasClaves,\r\n\t\t\t\"id_editorial\" => $this->idEditorial,\r\n\t\t\t\"caratula\" => $this->caratula,\r\n\t\t\t\"archivo\" => $this->archivo,\r\n\t\t\t\"caratula_size\" => $this->caratulaSize,\r\n\t\t\t\"caratula_content_type\" => $this->caratulaContentType,\r\n\t\t\t\"archivo_size\" => $this->archivoSize,\r\n\t\t\t\"archivo_content_type\" => $this->archivoContentType,\r\n\t\t\t\"fecha_ingreso\" => $this->fechaIngreso,\r\n\t\t\t),\"libro\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\treturn $this->con->autoUpdate(array(\r\n\t\t\t\"id_area_conocimiento\" => $this->idAreaConocimiento,\r\n\t\t\t\"ISBN\" => $this->iSBN,\r\n\t\t\t\"titulo\" => $this->titulo,\r\n\t\t\t\"año_publicación\" => $this->añoPublicación,\r\n\t\t\t\"idioma\" => $this->idioma,\r\n\t\t\t\"palabras_claves\" => $this->palabrasClaves,\r\n\t\t\t\"id_editorial\" => $this->idEditorial,\r\n\t\t\t\"caratula\" => $this->caratula,\r\n\t\t\t\"archivo\" => $this->archivo,\r\n\t\t\t\"caratula_size\" => $this->caratulaSize,\r\n\t\t\t\"caratula_content_type\" => $this->caratulaContentType,\r\n\t\t\t\"archivo_size\" => $this->archivoSize,\r\n\t\t\t\"archivo_content_type\" => $this->archivoContentType,\r\n\t\t\t\"fecha_ingreso\" => $this->fechaIngreso,\r\n\t\t\t),\"libro\",\"idLibro=\".$this->getId());\r\n\t}", "public function setData($data)\n {\n// -- `idVeiculo` INT(11) NOT NULL,\n// -- `idMotorista` INT(11) NOT NULL,\n// -- `idTiposFretes` INT(11) NOT NULL,\n// -- `Observacoes` VARCHAR(255) NULL DEFAULT NULL,\n// -- `ValorPedagios` DECIMAL(10,2) NOT NULL,\n// -- `Distancia` DECIMAL(10,3) NOT NULL,\n// -- `DataEntrega` DATE NULL DEFAULT NULL,\n// -- `ValorFrete` DECIMAL(10,2) NOT NULL,\n $this->SetIdNotaTransporte($data['IdNotaTransporte']);\n $this->SetIdVeiculo($data['idVeiculo']);\n $this->SetIdMotoriste($data['idMotorista']);\n $this->SetIdTipoFrete($data['idTipoFretes']);\n $this->SetDistancia($data['Distancia']); \n $this->SetValorFrete($data['ValorFrete']);\n $this->SetDataEmissao($data['DataEntrega']);\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->tr20_id = ($this->tr20_id == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_id\"]:$this->tr20_id);\n if($this->tr20_dtalvara == \"\"){\n $this->tr20_dtalvara_dia = ($this->tr20_dtalvara_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_dia\"]:$this->tr20_dtalvara_dia);\n $this->tr20_dtalvara_mes = ($this->tr20_dtalvara_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_mes\"]:$this->tr20_dtalvara_mes);\n $this->tr20_dtalvara_ano = ($this->tr20_dtalvara_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_dtalvara_ano\"]:$this->tr20_dtalvara_ano);\n if($this->tr20_dtalvara_dia != \"\"){\n $this->tr20_dtalvara = $this->tr20_dtalvara_ano.\"-\".$this->tr20_dtalvara_mes.\"-\".$this->tr20_dtalvara_dia;\n }\n }\n $this->tr20_numcgm = ($this->tr20_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_numcgm\"]:$this->tr20_numcgm);\n $this->tr20_ruaid = ($this->tr20_ruaid == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_ruaid\"]:$this->tr20_ruaid);\n $this->tr20_nro = ($this->tr20_nro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_nro\"]:$this->tr20_nro);\n $this->tr20_bairroid = ($this->tr20_bairroid == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_bairroid\"]:$this->tr20_bairroid);\n $this->tr20_complem = ($this->tr20_complem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_complem\"]:$this->tr20_complem);\n $this->tr20_fone = ($this->tr20_fone == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_fone\"]:$this->tr20_fone);\n $this->tr20_prefixo = ($this->tr20_prefixo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_prefixo\"]:$this->tr20_prefixo);\n }else{\n $this->tr20_id = ($this->tr20_id == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tr20_id\"]:$this->tr20_id);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->tf28_i_codigo = ($this->tf28_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_codigo\"]:$this->tf28_i_codigo);\n $this->tf28_i_situacao = ($this->tf28_i_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_situacao\"]:$this->tf28_i_situacao);\n $this->tf28_i_pedidotfd = ($this->tf28_i_pedidotfd == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_pedidotfd\"]:$this->tf28_i_pedidotfd);\n if($this->tf28_d_datasistema == \"\"){\n $this->tf28_d_datasistema_dia = ($this->tf28_d_datasistema_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_d_datasistema_dia\"]:$this->tf28_d_datasistema_dia);\n $this->tf28_d_datasistema_mes = ($this->tf28_d_datasistema_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_d_datasistema_mes\"]:$this->tf28_d_datasistema_mes);\n $this->tf28_d_datasistema_ano = ($this->tf28_d_datasistema_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_d_datasistema_ano\"]:$this->tf28_d_datasistema_ano);\n if($this->tf28_d_datasistema_dia != \"\"){\n $this->tf28_d_datasistema = $this->tf28_d_datasistema_ano.\"-\".$this->tf28_d_datasistema_mes.\"-\".$this->tf28_d_datasistema_dia;\n }\n }\n $this->tf28_c_horasistema = ($this->tf28_c_horasistema == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_c_horasistema\"]:$this->tf28_c_horasistema);\n $this->tf28_c_obs = ($this->tf28_c_obs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_c_obs\"]:$this->tf28_c_obs);\n $this->tf28_i_login = ($this->tf28_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_login\"]:$this->tf28_i_login);\n }else{\n $this->tf28_i_codigo = ($this->tf28_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"tf28_i_codigo\"]:$this->tf28_i_codigo);\n }\n }", "protected function entidades(){\n\t\tfor($i=1; $i < 6;$i++) $niveis[$i] = \"nivel de busca {$i}\";\n\t\t$this->visualizacao->nivel = VComponente::montar(VComponente::caixaCombinacao, 'nivel', isset($_POST['nivel']) ? $_POST['nivel'] : 1 ,null,$niveis);\n\t\t$this->visualizacao->filtro = isset($_POST['filtro']) ? $_POST['filtro'] : null;\n\t\t$this->visualizacao->listagens = false;\n\t\tif(!$this->visualizacao->filtro) return;\n\t\t$d = dir(\".\");\n\t\t$negocios = new colecao();\n\t\t$controles = new colecao();\n\t\twhile (false !== ($arquivo = $d->read())) {\n\t\t\tif( is_dir($arquivo) && ($arquivo{0} !== '.') ){\n\t\t\t\tif(is_file($arquivo.'/classes/N'.ucfirst($arquivo).'.php')){\n\t\t\t\t\t$negocio = 'N'.ucfirst($arquivo);\n\t\t\t\t\t$obNegocio = new $negocio();\n\t\t\t\t\tif( $obNegocio instanceof negocioPadrao ) {\n\t\t\t\t\t\t$ordem[$arquivo] = array(\n\t\t\t\t\t\t\t'nome'=>$obNegocio->pegarInter()->pegarNome(),\n\t\t\t\t\t\t\t'caminho'=>$arquivo.'/classes/N'.ucfirst($arquivo).'.php'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$negocios->$arquivo = $obNegocio;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t\tasort($ordem);\n\t\t$this->visualizacao->ordem = $ordem;\n\t\t$listagens = array();\n\t\tforeach($ordem as $idx => $arquivo){\n\t\t\t$obNegocio = $negocios->pegar($idx);\n\t\t\t$nome['controle'] = definicaoEntidade::controle($obNegocio, 'verPesquisa');\n\t\t\tif($this->exibirListagem($arquivo)){\n\t\t\t\t$colecao = $obNegocio->pesquisaGeral($this->pegarFiltro(),$this->pegarPagina(),isset($_POST['nivel']) ? $_POST['nivel'] : 1);\n\t\t\t\tcall_user_func_array(\"{$nome['controle']}::montarListagem\", array($this->visualizacao,$colecao,$this->pegarPagina(),$nome['controle']));\n\t\t\t\t$this->visualizacao->listagem->passarControle($nome['controle']);\n\t\t\t\tif($colecao->contarItens()){\n\t\t\t\t\t$listagens[$idx]['listagem'] = $this->visualizacao->listagem;\n\t\t\t\t\t$listagens[$idx]['ocorrencias'] = $colecao->contarItens();\n\t\t\t\t\t$listagens[$idx]['nome'] = $arquivo['nome'];\n\t\t\t\t\t$listagens[$idx]['controlePesquisa'] = $nome['controle'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tunset($this->visualizacao->listagem);\n\t\t$this->visualizacao->listagens = $listagens;\n\t}", "public function alterarDados($conexao,$id_pessoa){\n $query = \"update empresa_startup set modelo_negocio = ?,publico_alvo = ?, momento = ?, segmento_principal = ?, segmento_secundario = ?, tamanho_time = ?, faturamento_anual = ? where id_pessoa = ?;\";\n $stmt = $conexao->prepare($query);\n $stmt->execute([$this->getModeloNegocio(),$this->getPublicoAlvo(),$this->getMomento(),$this->getSegmentoPricipal(),$this->getSegmentoSecundario(),$this->getTamanhoTime(),$this->getFaturamentoAnual(),$id_pessoa]);\n }", "public function alterarDadosGerais($conexao,$id_pessoa){\n $query = \"update empresa_startup set nome = ?, razao_social = ?, cnpj = ?, email = ?, data_fundacao = ?, telefone = ? where id_pessoa = ?;\";\n $stmt = $conexao->prepare($query);\n $stmt->execute([$this->getNome(),$this->getRazaoSocial(),$this->getCnpj(),$this->getEmail(),$this->getDataFundacao(),$this->getTelefone(),$id_pessoa]);\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->s113_i_codigo = ($this->s113_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_codigo\"]:$this->s113_i_codigo);\n $this->s113_i_prestadorhorarios = ($this->s113_i_prestadorhorarios == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_prestadorhorarios\"]:$this->s113_i_prestadorhorarios);\n $this->s113_i_numcgs = ($this->s113_i_numcgs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_numcgs\"]:$this->s113_i_numcgs);\n if($this->s113_d_agendamento == \"\"){\n $this->s113_d_agendamento_dia = ($this->s113_d_agendamento_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_dia\"]:$this->s113_d_agendamento_dia);\n $this->s113_d_agendamento_mes = ($this->s113_d_agendamento_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_mes\"]:$this->s113_d_agendamento_mes);\n $this->s113_d_agendamento_ano = ($this->s113_d_agendamento_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_ano\"]:$this->s113_d_agendamento_ano);\n if($this->s113_d_agendamento_dia != \"\"){\n $this->s113_d_agendamento = $this->s113_d_agendamento_ano.\"-\".$this->s113_d_agendamento_mes.\"-\".$this->s113_d_agendamento_dia;\n }\n }\n if($this->s113_d_exame == \"\"){\n $this->s113_d_exame_dia = ($this->s113_d_exame_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_dia\"]:$this->s113_d_exame_dia);\n $this->s113_d_exame_mes = ($this->s113_d_exame_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_mes\"]:$this->s113_d_exame_mes);\n $this->s113_d_exame_ano = ($this->s113_d_exame_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_ano\"]:$this->s113_d_exame_ano);\n if($this->s113_d_exame_dia != \"\"){\n $this->s113_d_exame = $this->s113_d_exame_ano.\"-\".$this->s113_d_exame_mes.\"-\".$this->s113_d_exame_dia;\n }\n }\n $this->s113_i_ficha = ($this->s113_i_ficha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_ficha\"]:$this->s113_i_ficha);\n $this->s113_c_hora = ($this->s113_c_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_hora\"]:$this->s113_c_hora);\n $this->s113_i_situacao = ($this->s113_i_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_situacao\"]:$this->s113_i_situacao);\n if($this->s113_d_cadastro == \"\"){\n $this->s113_d_cadastro_dia = ($this->s113_d_cadastro_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_dia\"]:$this->s113_d_cadastro_dia);\n $this->s113_d_cadastro_mes = ($this->s113_d_cadastro_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_mes\"]:$this->s113_d_cadastro_mes);\n $this->s113_d_cadastro_ano = ($this->s113_d_cadastro_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_ano\"]:$this->s113_d_cadastro_ano);\n if($this->s113_d_cadastro_dia != \"\"){\n $this->s113_d_cadastro = $this->s113_d_cadastro_ano.\"-\".$this->s113_d_cadastro_mes.\"-\".$this->s113_d_cadastro_dia;\n }\n }\n $this->s113_c_cadastro = ($this->s113_c_cadastro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_cadastro\"]:$this->s113_c_cadastro);\n $this->s113_i_login = ($this->s113_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_login\"]:$this->s113_i_login);\n $this->s113_c_encaminhamento = ($this->s113_c_encaminhamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_encaminhamento\"]:$this->s113_c_encaminhamento);\n }else{\n $this->s113_i_codigo = ($this->s113_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_codigo\"]:$this->s113_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->s113_i_codigo = ($this->s113_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_codigo\"]:$this->s113_i_codigo);\n $this->s113_i_prestadorhorarios = ($this->s113_i_prestadorhorarios == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_prestadorhorarios\"]:$this->s113_i_prestadorhorarios);\n $this->s113_i_numcgs = ($this->s113_i_numcgs == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_numcgs\"]:$this->s113_i_numcgs);\n if($this->s113_d_agendamento == \"\"){\n $this->s113_d_agendamento_dia = ($this->s113_d_agendamento_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_dia\"]:$this->s113_d_agendamento_dia);\n $this->s113_d_agendamento_mes = ($this->s113_d_agendamento_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_mes\"]:$this->s113_d_agendamento_mes);\n $this->s113_d_agendamento_ano = ($this->s113_d_agendamento_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_agendamento_ano\"]:$this->s113_d_agendamento_ano);\n if($this->s113_d_agendamento_dia != \"\"){\n $this->s113_d_agendamento = $this->s113_d_agendamento_ano.\"-\".$this->s113_d_agendamento_mes.\"-\".$this->s113_d_agendamento_dia;\n }\n }\n if($this->s113_d_exame == \"\"){\n $this->s113_d_exame_dia = ($this->s113_d_exame_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_dia\"]:$this->s113_d_exame_dia);\n $this->s113_d_exame_mes = ($this->s113_d_exame_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_mes\"]:$this->s113_d_exame_mes);\n $this->s113_d_exame_ano = ($this->s113_d_exame_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_exame_ano\"]:$this->s113_d_exame_ano);\n if($this->s113_d_exame_dia != \"\"){\n $this->s113_d_exame = $this->s113_d_exame_ano.\"-\".$this->s113_d_exame_mes.\"-\".$this->s113_d_exame_dia;\n }\n }\n $this->s113_i_ficha = ($this->s113_i_ficha == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_ficha\"]:$this->s113_i_ficha);\n $this->s113_c_hora = ($this->s113_c_hora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_hora\"]:$this->s113_c_hora);\n $this->s113_i_situacao = ($this->s113_i_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_situacao\"]:$this->s113_i_situacao);\n if($this->s113_d_cadastro == \"\"){\n $this->s113_d_cadastro_dia = ($this->s113_d_cadastro_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_dia\"]:$this->s113_d_cadastro_dia);\n $this->s113_d_cadastro_mes = ($this->s113_d_cadastro_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_mes\"]:$this->s113_d_cadastro_mes);\n $this->s113_d_cadastro_ano = ($this->s113_d_cadastro_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_d_cadastro_ano\"]:$this->s113_d_cadastro_ano);\n if($this->s113_d_cadastro_dia != \"\"){\n $this->s113_d_cadastro = $this->s113_d_cadastro_ano.\"-\".$this->s113_d_cadastro_mes.\"-\".$this->s113_d_cadastro_dia;\n }\n }\n $this->s113_c_cadastro = ($this->s113_c_cadastro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_cadastro\"]:$this->s113_c_cadastro);\n $this->s113_i_login = ($this->s113_i_login == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_login\"]:$this->s113_i_login);\n $this->s113_c_encaminhamento = ($this->s113_c_encaminhamento == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_c_encaminhamento\"]:$this->s113_c_encaminhamento);\n }else{\n $this->s113_i_codigo = ($this->s113_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"s113_i_codigo\"]:$this->s113_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed10_i_codigo = ($this->ed10_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_i_codigo\"]:$this->ed10_i_codigo);\n $this->ed10_i_tipoensino = ($this->ed10_i_tipoensino == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_i_tipoensino\"]:$this->ed10_i_tipoensino);\n $this->ed10_i_grauensino = ($this->ed10_i_grauensino == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_i_grauensino\"]:$this->ed10_i_grauensino);\n $this->ed10_c_descr = ($this->ed10_c_descr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_c_descr\"]:$this->ed10_c_descr);\n $this->ed10_c_abrev = ($this->ed10_c_abrev == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_c_abrev\"]:$this->ed10_c_abrev);\n $this->ed10_mediacaodidaticopedagogica = ($this->ed10_mediacaodidaticopedagogica == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_mediacaodidaticopedagogica\"]:$this->ed10_mediacaodidaticopedagogica);\n $this->ed10_ordem = ($this->ed10_ordem == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_ordem\"]:$this->ed10_ordem);\n $this->ed10_censocursoprofiss = ($this->ed10_censocursoprofiss == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_censocursoprofiss\"]:$this->ed10_censocursoprofiss);\n }else{\n $this->ed10_i_codigo = ($this->ed10_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed10_i_codigo\"]:$this->ed10_i_codigo);\n }\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->ed100_i_codigo = ($this->ed100_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_codigo\"]:$this->ed100_i_codigo);\n $this->ed100_i_historicompsfora = ($this->ed100_i_historicompsfora == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_historicompsfora\"]:$this->ed100_i_historicompsfora);\n $this->ed100_i_disciplina = ($this->ed100_i_disciplina == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_disciplina\"]:$this->ed100_i_disciplina);\n $this->ed100_i_justificativa = ($this->ed100_i_justificativa == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_justificativa\"]:$this->ed100_i_justificativa);\n $this->ed100_i_qtdch = ($this->ed100_i_qtdch == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_qtdch\"]:$this->ed100_i_qtdch);\n $this->ed100_c_resultadofinal = ($this->ed100_c_resultadofinal == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_c_resultadofinal\"]:$this->ed100_c_resultadofinal);\n $this->ed100_t_resultobtido = ($this->ed100_t_resultobtido == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_t_resultobtido\"]:$this->ed100_t_resultobtido);\n $this->ed100_c_situacao = ($this->ed100_c_situacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_c_situacao\"]:$this->ed100_c_situacao);\n $this->ed100_c_tiporesultado = ($this->ed100_c_tiporesultado == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_c_tiporesultado\"]:$this->ed100_c_tiporesultado);\n $this->ed100_i_ordenacao = ($this->ed100_i_ordenacao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_ordenacao\"]:$this->ed100_i_ordenacao);\n $this->ed100_c_termofinal = ($this->ed100_c_termofinal == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_c_termofinal\"]:$this->ed100_c_termofinal);\n $this->ed100_opcional = ($this->ed100_opcional == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_opcional\"]:$this->ed100_opcional);\n $this->ed100_basecomum = ($this->ed100_basecomum == \"f\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_basecomum\"]:$this->ed100_basecomum);\n }else{\n $this->ed100_i_codigo = ($this->ed100_i_codigo == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"ed100_i_codigo\"]:$this->ed100_i_codigo);\n }\n }", "public function cadastrar(){\r\n //DEFINIR A DATA DE CADASTRO\r\n $this->cadastro = date('Y-m-d H:i:s');\r\n\r\n $db = new Database('cartao');\r\n $this->id = $db->insert([\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n\r\n }", "public function run()\n {\n foreach ($this->edificios as $edificio)\n \t{\n \t\t$a = new Edificio();\n \t\t$a->nombre = $edificio['nombre'];\n \t\t$a->anchura = $edificio['anchura'];\n \t\t$a->altura = $edificio['altura'];\n \t\t$a->imagen = $edificio['imagen'];\n \t\t$a->descripcion = $edificio['descripcion'];\n\t\t$a->tipoEd = $edificio['tipoEd'];\n\t\t$a->fecha = $edificio['fecha'];\n \t\t$a->save();\n \t}\n \t$this->command->info('Tabla edificio inicializada con datos');\n }" ]
[ "0.68908185", "0.6624296", "0.65803236", "0.6539708", "0.6483837", "0.6390325", "0.63697505", "0.63639045", "0.63455856", "0.6331048", "0.6306228", "0.6294902", "0.62913674", "0.626887", "0.62684584", "0.6244881", "0.6234761", "0.6217092", "0.6193883", "0.61607015", "0.6144623", "0.6133456", "0.613254", "0.6093758", "0.6089089", "0.6075528", "0.6054977", "0.6053058", "0.60425365", "0.6037621", "0.60371715", "0.6034751", "0.6013518", "0.5996315", "0.5982586", "0.5974069", "0.59715044", "0.5970636", "0.5968676", "0.59679604", "0.59636045", "0.5961734", "0.59609383", "0.59568816", "0.5956033", "0.5954528", "0.5954061", "0.5950539", "0.5948372", "0.5946764", "0.5941649", "0.59406227", "0.593861", "0.5936335", "0.5935853", "0.5935195", "0.593359", "0.5932615", "0.5932344", "0.59296435", "0.59182084", "0.5910333", "0.5909349", "0.5902482", "0.59002185", "0.5898277", "0.5893759", "0.588553", "0.5876634", "0.5876168", "0.58754456", "0.58715725", "0.5870521", "0.5865827", "0.58619136", "0.5861814", "0.585973", "0.585973", "0.5859594", "0.5857909", "0.585572", "0.58531696", "0.5851821", "0.5850914", "0.58498996", "0.58347356", "0.5833095", "0.5827834", "0.5823704", "0.5820624", "0.5819866", "0.58171177", "0.5811578", "0.58089656", "0.5799795", "0.5799795", "0.5796497", "0.57952666", "0.5794121", "0.5789866" ]
0.61303544
23
Validamos campos que possuem input text e necessitam informar determinada quantidade, se estes sao validos
public function validarEquipamentosGeral (IExportacaoCenso $oExportacaoCenso, $iSequencial, $sEquipamento) { $sMensagem = ""; switch ($iSequencial) { case 3000002: $sMensagem = "Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores: "; break; case 3000003: $sMensagem = "Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores de Uso Administrativo: "; break; case 3000024: $sMensagem = "Dados de Infra Estrutura da escola -> Campo Quantidade de Computadores de Uso dos Alunos: "; break; case 3000019: $sMensagem = "Dados de Infra Estrutura da escola -> Campo Número de Salas de Aula Existentes na Escola: "; break; case 3000020: $sMensagem = "Dados de Infra Estrutura da escola -> Campo Número de Salas Utilizadas Como Sala de Aula - "; $sMensagem .= "Dentro e Fora do Prédio: "; break; } $lTodosDadosValidos = true; if (strlen($sEquipamento) > 4) { $lTodosDadosValidos = false; $sMensagemTamanho = "Quantidade de dígitos informado inválido. É permitido no máximo 4 dígitos."; $oExportacaoCenso->logErro( $sMensagem.$sMensagemTamanho, ExportacaoCensoBase::LOG_ESCOLA ); } if( $sEquipamento != null ) { if( !DBNumber::isInteger( $sEquipamento ) ) { $lTodosDadosValidos = false; $sMensagemInteiro = "Valor informado para quantidade inválido. Informe apenas números no campo de quantidade."; $oExportacaoCenso->logErro( $sMensagem.$sMensagemInteiro, ExportacaoCensoBase::LOG_ESCOLA ); } } if( DBNumber::isInteger($sEquipamento) && $sEquipamento == 0 ) { $lTodosDadosValidos = false; $sMensagemInvalido = "Valor informado para quantidade inválido. Deixar o campo vazio, ao invés de informar 0."; $oExportacaoCenso->logErro( $sMensagem.$sMensagemInvalido, ExportacaoCensoBase::LOG_ESCOLA ); } return $lTodosDadosValidos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "function form1()\r\n {\r\n global $f3;\r\n $isValid= true;\r\n if (!validString($f3->get('animal'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['animal']\", \"Please enter an animal \");\r\n }\r\n if (!validQty($f3->get('qty'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['qty']\", \"Please enter quantity\");\r\n }\r\n return $isValid;\r\n }", "public function validate(){\n\t\t\n\t\tparent::validate();\n\t\t\n\t\tif (isset($this->amount_limit)){\n\t\t\t\n\t\t\tif (!is_numeric($this->amount_limit))\n\t\t\t\t$this->errorAmountLimit = \"Podaj prawidłową kwotę.\";\n\t\t\t\n\t\t\tif ($this->amount_limit < 0)\n\t\t\t\t$this->errorAmountLimit = \"Kwota limitu nie może być ujemna.\";\n\t\t}\n\t\t\n\t\tif ($this->errorName != null || $this->errorAmountLimit != null){\n\t\t\t$this->success = false;\n\t\t}\n\n\t}", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "function validate_quantity($input_value) {\n $error = array();\n // if the $input_value (buyer input) is not numeric, $error['notNumeric']which contain the message \"Please input numeric value\" will be adding to the $error = array().\n if (!is_numeric($input_value))\n $error['notNumeric'] = \"Please input numeric value\";\n // if the $input_value (buyer input) is less than zero (negative), $error[\"cannotBeNegative\"] which contain the message \"Please input a positive value\" will be adding to the $error = array().\n if ($input_value < 0)\n $error[\"cannotBeNegative\"] = \"Please input a positive value\";\n // if the $input_value (buyer input)contain decimal, $error[\"float\"] which contain the message \"Please enter a whole integer\" will be adding to the $error = array().\n if (strpos($input_value, '.') != FALSE)\n $error[\"float\"] = \"Please enter a whole integer\";\n return $error;\n}", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "function validQty($qty)\n{\n return !empty($qty)\n && ctype_digit($qty)\n && $qty >= 1;\n}", "function validatePos() {\n for($i=1; $i<=9; $i++) {\n if ( ! isset($_POST['year'.$i]) ) continue;\n if ( ! isset($_POST['desc'.$i]) ) continue;\n \n $year = $_POST['year'.$i];\n $desc = $_POST['desc'.$i];\n \n if ( strlen($year) == 0 || strlen($desc) == 0 ) {\n return \"All fields are required\";\n }\n \n if ( ! is_numeric($year) ) {\n return \"Position year must be numeric\";\n }\n }\n return true;\n }", "function validarFormulario()\n\t\t{\n\t\t}", "function _geneshop_qty_element_validate($element, &$form_state, $form) {\n if (!filter_var($element['#value'], FILTER_VALIDATE_INT) || $element['#value'] <= 0) {\n form_error($element, t('Incorrect value of qty'));\n }\n}", "public function check_validity() {\r\n\t\t$value = $this->get_posted_value();\r\n\r\n\t\t// required field check\r\n\t\t// 0, '0', and 0.0 need special handling since they're valid, but PHP considers them falsy values.\r\n\t\tif ( $this->props['required'] && ( empty( $value ) && ! in_array( $value, [ 0, '0', 0.0 ], true ) ) ) {\r\n\t\t\t// translators: Placeholder %s is the label for the required field.\r\n\t\t\tthrow new \\Exception( sprintf( _x( '%s is a required field.', 'Add listing form', 'my-listing' ), $this->props['label'] ) );\r\n\t\t}\r\n\r\n\t\t// if field isn't required, then no validation is needed for empty values\r\n\t\tif ( empty( $value ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// otherwise, run validations\r\n\t\t$this->validate();\r\n\t}", "function validatePos(){\n for ($i=0; $i<9; $i++){\n if( isset($_POST['year'.$i]) && isset($_POST['desc'.$i]) ) {\n if ( strlen ($_POST['year'.$i])<1 || strlen($_POST['desc'.$i])<1 ){\n $_SESSION['error']='All fields are required';\n return false;\n }\n else if( ! is_numeric($_POST['year'.$i])) {\n $_SESSION['error']=\"Year must be numeric\";\n return false;\n }\n }\n }\n return true;\n }", "function validarInput( $text , $tipo){\r\n\t\tif ($tipo=='string' ){\r\n\t\t\tif ($text!='' && strlen($text) != 0){\r\n\t\t\t\t$valido=true;\r\n\t\t\t}else{\r\n\t\t\t\t$valido=false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif (esEntero($text) && strlen($text) != 0){\r\n\t\t\t\t$valido=true;\r\n\t\t\t}else{\r\n\t\t\t\t$valido=false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $valido;\r\n\t}", "public function validate_customer_input_fields()\n {\n $passed_validation_tests = true;\n $check_name = has_presence($this->name);\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n if (!$check_name) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Customer name cannot be blank.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_telephone = has_presence($this->telephone);\n $check_telephone_numeric = has_number($this->telephone);\n $check_telephone_length = has_length($this->telephone, ['exact' => 10]);\n if (!$check_telephone or !$check_telephone_numeric or !$check_telephone_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Telephone: \";\n $msg .= h($this->telephone);\n $msg .= \" cannot be blank and must consists of 10 digits.\";\n $msg .= \"</li>\";\n }\n\n $check_barcode = has_presence($this->barcode);\n $check_barcode_numeric = has_number($this->barcode);\n $check_barcode_length = has_length($this->barcode, ['exact' => 6]);\n if (!$check_barcode or !$check_barcode_numeric or !$check_barcode_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Barcode: \";\n $msg .= h($this->barcode);\n $msg .= \" cannot be blank and must consists of 6 digits.\";\n $msg .= \"</li>\";\n }\n\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "function validar(){\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n\n if (empty($_POST[\"noEmpleado\"])) {\n $this->numEmpErr = \"El numero de empleado es requerido\";\n } else {\n $this->noEmpleado = $this->test_input($_POST[\"noEmpleado\"]);\n if (is_numeric($this->noEmpleado)) {\n $this->numEmpErr = \"Solo se permiten numeros\";\n }\n }\n\n if (empty($_POST[\"nombre\"])) {\n $this->nameErr = \"El nombre es requerido\";\n } else {\n $this->nombre = $this->test_input($_POST[\"nombre\"]);\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->nombre)) {\n $this->nameErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"carrera\"])) {\n $this->carreraErr = \"La carrera es requerida\";\n } else {\n $this->carrera = $this->test_input($_POST[\"carrera\"]);\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->carrera)) {\n $this->carreraErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"telefono\"])) {\n $this->telErr = \"El telefono es requerido\";\n } else {\n $this->telefono = $this->test_input($_POST[\"telefono\"]);\n if (is_numeric($this->telefono)) {\n $this->telErr = \"Solo se permiten numeros\";\n }\n }\n\n }\n }", "public function rules()\n {\n return ['quantity' => 'required|min:1|integer|max:9999'];\n }", "public function validate()\n {\n if ($this->ingredient() || $this->upc()) {\n return;\n }\n\n throw new \\Exception('You must enter either an ingredient or UPC code to search for');\n }", "public function validaDatos(){\n\t\t\t\t\n\t\t\t\tif( $this->nombre == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su nombre por favor.</strong><br />\";\n\t\t\t\t\t}else if( strlen($this->nombre) > 20 ){\n\t\t\t\t\t\t$errores.= \"<strong>* Escriba un nombre con menos caracteres. (20 caracteres maximo - sin espacios)</strong><br />\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif( $this->email == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su email por favor.</strong><br />\";\n\t\t\t\t\t}else if( !preg_match($this->sintax,$this->email)){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese formato correcto de email</strong><br /> 'ej: nombre@dominio.com' .<br />\";\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $this->asunto == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su asunto por favor. </strong><br />\";\n\t\t\t\t\t}else if( strlen($this->asunto) > 20 ){\n\t\t\t\t\t\t$errores.= \"<strong>* Escriba un asunto con menos caracteres. (20 caracteres maximo - sin espacios) </strong><br />\";\n\t\t\t\t\t}\n\t\t\t\t\t\t\t \n\t\t\t\tif( $this->msj == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su mensaje por favor. </strong><br />\";\n\t\t\t\t\t}else if( strlen($this->msj) > 200 ){\n\t\t\t\t\t$this->errores.= \"<strong>* Maximo permitido 200 caracteres. </strong><br />\";\n\t\t\t\t\t}\n\t\t\t}", "public function _validacion_busqueda_producto(){\n\t\t$this->form_validation->set_rules('textdescripcion', 'Texto de busqueda', 'required'); //callback_username_check\n\t\n\n if ($this->form_validation->run() == FALSE)\n {\n // $this->form_validation->set_message('_validacion_producto', 'The {field} field can not be the word \"test\"');\n\t\t\t\t\t return false;\n }else{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t}", "public function rules()\n { \n \n return [\n 'edit_cena'=>'required|numeric|gt:0'\n ];\n \n }", "function ValidaCampos(){\n\t\t\n\t\t $this->form_validation->set_rules(\"id_clase\", \"Id_clase\", \"callback_select_clase\");\n\t\t $this->form_validation->set_rules(\"ofrenda_clase\", \"Ofrenda_clase\", \"trim|required\");\n\t\t $this->form_validation->set_rules(\"fecha_ofrenda\", \"Fecha_ofrenda\", \"trim|required\");\n\t\t \n\t}", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "function validate() {\n\t\t\t$this->field['msg'] = ( isset( $this->field['msg'] ) ) ? $this->field['msg'] : esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );\n\n\t\t\tif ( ! is_numeric( str_replace( ',', '', $this->value ) ) || strpos( $this->value, ',' ) == false ) {\n\t\t\t\t$this->value = ( isset( $this->current ) ) ? $this->current : '';\n\t\t\t\t$this->field['current'] = $this->value;\n\n\t\t\t\t$this->error = $this->field;\n\t\t\t}\n\t\t}", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "function check()\n {\n if (trim($this->monto) == '') {\n $this->setError(JText::_('Debe Ingresar Un Monto a Pagar'));\n return false;\n }\n\n return true;\n }", "private function checkRequired()\n {\n if ($this->fld->is_required == 1 && !$this->is_val_set) {\n throw new Exceptions\\DXCustomException(sprintf(trans('errors.required_field'), $this->fld->title_list));\n }\n }", "function form_check() {\n\tglobal $cert_amt_tbl;\n\t\n\t// required fields array\n\t$required_fields = array('Discount Amount'=> $cert_amt_tbl->discount_amount);\n\t\t\n\t// check error values and write error array\t\t\t\t\t\n\tforeach($required_fields as $field_name => $output) {\n\t if (empty($output)) {\n\t\t$errors_array[] = $field_name;\n\t }\n\t}\n\t\n\tif (!empty($errors_array)) {\n\t $error_message = 'You did not supply a value for these fields: ' . implode(', ',$errors_array);\n\t}\n\t\n return $error_message;\n }", "function validForm()\n{\n global $f3;\n $isValid = true;\n\n if (!validFood($f3->get('food'))) {\n\n $isValid = false;\n $f3->set(\"errors['food']\", \"Please enter a food item\");\n }\n\n if (!validQty($f3->get('qty'))) {\n\n $isValid = false;\n $f3->set(\"errors['qty']\", \"Please enter 1 or more\");\n }\n\n if (!validMeal($f3->get('meal'))) {\n\n $isValid = false;\n $f3->set(\"errors['meal']\", \"Please select a meal\");\n }\n\n if (!validCondiments($f3->get('cond'))) {\n\n $isValid = false;\n $f3->set(\"errors['cond']\", \"Invalid selection\");\n }\n\n return $isValid;\n}", "public function rules()\n {\n return [\n 'quantity'=>'required|min:1|max:99999999999|integer',\n ];\n }", "function checkqty($txtvalue)\n{\n\t$flag = true;\n\t$options = array(\n\t\t\t\t'options' => array( 'min_range' => 1 )\n\t\t\t\t);\n\n\tif (filter_var($txtvalue, FILTER_VALIDATE_INT, $options) !== false)\n\t{\n\t\t$flag = true;\n\t}\n\telse\n\t{\n\t\t$flag = false;\n\t}\n\n\treturn $flag;\n}", "function addProduct(){\n \n if (isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['category']) && !empty($_POST['category']) && isset($_POST['quantity']) && !empty($_POST['quantity']) && isset ($_POST['unit_price']) && !empty ($_POST['unit_price']) && isset($_POST['description']) && !empty($_POST['description'])){\n\n\n $cleanName = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING);\n $cleanDescription = filter_input(INPUT_POST, 'description', FILTER_SANITIZE_STRING);\n $cleanCategory = filter_input(INPUT_POST, 'category', FILTER_SANITIZE_NUMBER_INT);\n $cleanQuantity = filter_input(INPUT_POST, 'quantity', FILTER_SANITIZE_NUMBER_INT);\n $price = (float)str_replace(\",\",\".\",htmlentities($_POST['unit_price']));\n $cleanPrice = filter_var($price, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n\n if (preg_match(\"#^[a-zA-Z0-9-_][a-zA-Z0-9-_ ]{1,49}$#\", $cleanName)){\n // Le nom du produit est valide \n if (preg_match(\"#^[a-zA-Z-_0-9àáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð.;,?!:/ ]{1,254}$#\", $cleanDescription)){\n // La description du produit est valide\n if (preg_match(\"#^[0-9]{1,4}$#\", $cleanCategory)){\n // La categorie du produit est valide \n if (preg_match(\"#^[0-9]{1,5}$#\", $cleanQuantity)){\n // La quantité du produit est valide\n if (preg_match(\"#^[0-9]+([.0-9])+$#\", $cleanPrice)){\n // Le prix du produit est valide\n \n\n\n\n // Verifier le format du fichier\n // move_uploaded_file($_FILES['image']['tmp_name'], $image); \n \n // $image = $_SERVER['DOCUMENT_ROOT'] . '/ecommerce1/public/images/' . $_FILES['image']['name'];\n // var_dump($image);\n\n // addProductToDB($_POST['name'], intVal($_POST['category']), $_POST['quantity'], (float) $_POST['unit_price'], $_POST['description'], '/' . $_FILES['image']['name']);\n header('location:index.php?action=productAdmin');\n\n\n\n\n }\n }\n }\n }\n }\n }\n \n else {\n $categories = getCategories();\n require_once 'view/product/addProductFormView.php';\n }\n\n\n\n}", "public function isValid()\n\t{\n\t\tif (empty($this->titre)) $this->titre = \"TITRE A REMPLACER\";\n\t\telse $this->titre = trim (preg_replace('/\\s+/', ' ', $this->titre) ); // Suppression des espaces\n\t\tif (!empty($this->contenu)) $this->contenu = trim (preg_replace('/\\s+/', ' ', $this->contenu) ); // Suppression des espaces\n\t\tif (empty($this->statut)) $this->statut = 0;\n\t\tif (empty($this->id_type)) $this->id_type = 1;\n\t\tif (empty($this->id_membre)) $this->id_membre = 0;\n\t}", "public function _validacion_producto(){\n\t\t$this->form_validation->set_rules('textcodigo', 'Codigo Producto', 'required'); //callback_username_check\n $this->form_validation->set_rules('textdescrip', 'Descripcion Producto', 'required');\n\t\t$this->form_validation->set_rules('txtcantidad', 'Cantidad Producto', 'required');\n\t\t$this->form_validation->set_rules('txtstockminimo', 'Stock Minimo Producto', 'required');\n\t\t$this->form_validation->set_rules('txtstockmaximo', 'Stock Maximo Producto', 'required');\n\t\t$this->form_validation->set_rules('select_tipoproducto', 'Tipo de Producto', 'required');\n\t\t$this->form_validation->set_rules('select_categoriaproducto', 'Categoria de Producto', 'required');\n\t\t$this->form_validation->set_rules('txtfechanac', 'Vecha Vencimiento Producto', 'required');\n\n if ($this->form_validation->run() == FALSE)\n {\n // $this->form_validation->set_message('_validacion_producto', 'The {field} field can not be the word \"test\"');\n\t\t\t\t\t return false;\n }else{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\n \n\t}", "public function rules()\n {\n // will receive user inputs.\n return array(\n array('tanggal,divisiid,nama', 'required'),\t\t\t\n );\n }", "function validar(){\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n\n if (empty($_POST[\"matricula\"])) {\n $this->matriculaErr = \"La matricula es requerida\";\n } else {\n $this->matricula = $this->test_input($_POST[\"matricula\"]);\n // check if name only contains letters and whitespace\n if (is_numeric($this->matricula)) {\n $this->nameErr = \"Solo se permiten numeros\";\n }\n }\n\n if (empty($_POST[\"nombree\"])) {\n $this->nameErr = \"El nombre es requerido\";\n } else {\n $this->nombre = $this->test_input($_POST[\"nombree\"]);\n // check if name only contains letters and whitespace\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->nombre)) {\n $this->nameErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"carreraa\"])) {\n $this->nameErr = \"La carrera es requerida\";\n } else {\n $this->carrera = $this->test_input($_POST[\"carreraa\"]);\n // check if name only contains letters and whitespace\n if (!preg_match(\"/^[a-zA-Z ]*$/\",$this->carrera)) {\n $this->carreraErr = \"Solo se permiten letras y espacios en blanco\";\n }\n }\n\n if (empty($_POST[\"email\"])) {\n $this->emailErr = \"Email is required\";\n } else {\n $this->email = $this->test_input($_POST[\"email\"]);\n // check if e-mail address is well-formed\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->emailErr = \"Invalid email format\";\n }\n }\n\n if (empty($_POST[\"telefonoo\"])) {\n $this->telErr = \"El telefono es requerido\";\n } else {\n $this->telefono = $this->test_input($_POST[\"telefonoo\"]);\n // check if name only contains letters and whitespace\n if (is_numeric($this->telefono)) {\n $this->telErr = \"Solo se permiten numeros\";\n }\n }\n\n }\n }", "function validaOpcion($opcionSeleccionada)\r\n{\r\n\tif(is_numeric($opcionSeleccionada)) return true;\r\n\telse return false;\r\n}", "public function validate()\n {\n if ($this->getOptions('required') == 1 && $this->getValue() == '') {\n $this->setLibelle('<div class=\"error_message\">Le champ est requis et ne doit pas être vide.</div>');\n return false;\n } else {\n return true;\n }\n }", "private function addValidation($inData){\r\n // the size indicator -> if the size radio is not selected -> refuse\r\n $sizeIndicator = false;\r\n // if the quantity are all 0 -> refuse\r\n $quantityIndicator = false;\r\n // indicates the food's category for further price query\r\n $data['category'] = $inData['category'];\r\n // item array prepared in the return array $data for setting items\r\n $data['item'] = array();\r\n // first loop for striping useless $_GET entries and valid whether\r\n // Necessary fileds are being selected by user\r\n foreach($inData as $key => $value){\r\n // for finding size $key , and find which index it is \r\n if(preg_match('/s(\\d)(.*)/',$value,$match) ){\r\n $sizeIndicator = true;\r\n $data['item'][$match[1]]['size'] = $match[2];\r\n }\r\n // same as size $key, it fins out which index the item is\r\n if(preg_match('/q(\\d)/',$key,$match) && $value != 0){\r\n $quantityIndicator = true;\r\n $data['item'][$match[1]]['quantity'] = $value;\r\n }\r\n }\r\n // if the size or the quantity is not filled in by user, refuse him\r\n if(!($sizeIndicator && $quantityIndicator))\r\n return array('error' => 'You have to select at least 1) Size 2) Quantity for the SAME food~');\r\n // the indicator for seeing whether same food's both size and quantity\r\n // are correctly input by user\r\n $matchIndicator = true;\r\n // second foreach runs a size check on the data['item']'s each elements\r\n // it will refuse the user if the element is not sized two\r\n $outData = array();\r\n foreach($data['item'] as $key => $item){\r\n if((count($item))!= 1){\r\n $matchIndicator = false;\r\n }\r\n $name = $this -> model -> getName($data['category'])[$key - 1]; \r\n $size = $item['size'];\r\n $quantity = $item['quantity'];\r\n $price_for_one = $this -> model -> getPrice($data['category'],$name)[$size]; \r\n array_push($outData,compact('name','size','quantity','price_for_one'));\r\n }\r\n // if wrong filed is inserted by user, refuse him\r\n if($matchIndicator)\r\n return array('error' => 'You sure sure you input the correct thing?');\r\n // outdata that will be finally returned.\r\n // totally 4 fields are going to be included for each row\r\n // 1) name 2) size 3) quantity 4) price for one\r\n //return the data that should be passed to the controller method\r\n //that actually renders the views\r\n return $outData;\r\n }", "function Solicitar_Stock_ali($Value){\n echo \"<label for='Stock'><b>Stock</b></label>\";\n echo \"<input type='text' placeholder='Stock del alimento' name='Stock' required maxlength='100' value='\".$Value.\"'\";\n echo \"title='Ingrse un numero mayor a 1 y menor a 999' pattern='^\\d{1,3}$'>\";\n echo \"<br><br>\";\n}", "public function rules()\n {\n $producto = Producto::find($this->input('producto_id'));\n $cantMaxima = $producto->stock;\n return [\n 'producto_id' => 'required|numeric',\n 'cantidad' => 'required|numeric|max:'.$cantMaxima,\n 'descripcion' => 'string|max:255',\n ];\n }", "function validaOpcion($opcionSeleccionada)\n{\n\tif(is_numeric($opcionSeleccionada)) return true;\n\telse return false;\n}", "function validaOpcion($opcionSeleccionada)\n{\n\tif(is_numeric($opcionSeleccionada)) return true;\n\telse return false;\n}", "public function rules()\n {\n return [\n 'producto_id' => 'sometimes|required',\n 'cantidad' => 'sometimes|required|numeric|min:1',\n 'stock' => 'sometimes|required|numeric|gte:cantidad',\n 'um' => 'sometimes|required',\n ];\n }", "function validarNullInt($valor,&$error, $campo) {\n\n $CI = & get_instance();\n \n if(trim($valor) == \"\"):\n \n return true;\n \n else:\n \n if(filter_var($valor, FILTER_VALIDATE_INT) === FALSE):\n \n $error = mensajeCampo($campo);\n return false;\n\n else:\n \n return true;\n\n endif;\n\n endif;\n\n}", "protected function validate() {\r\n if ($this->getBaseAmount() <= 0)\r\n $this->errors->add(\"The base amount of alicuota must be greater than 0.\");\r\n// \t\t\telse\r\n// \t\t\t{\r\n// \t\t\t\t$relativeError = (($this->getTaxAmount() / $this->getBaseAmount() * 100) - $this->getTaxPercent());\r\n// \t\t\t\t$relativeError = $relativeError / $this->getTaxPercent();\r\n// \t\t\t\t$relativeError = NumberDataTypeHelper::truncate($relativeError, 2);\r\n// \t\t\t\tif (abs($relativeError) > 0.01)\r\n// \t\t\t\t\t$this->errors->add(\"The base and tax amount do not match with the alicuota ({$this->getName()}). Diference: $relativeError\");\r\n// \t\t\t}\r\n }", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "public function validarCampo($tipo,$campo){\n $valido = false;\n \n switch ($tipo) {\n case 'telefono':\n if (preg_match(\"/[+]{1}[0-9]{11}/i\", $campo)) {\n $valido = true;\n } else {\n $valido = false;\n }\n break;\n case 'correo':\n $valido = (!preg_match(\"/^([a-z0-9ÁéÉíÍóÓúÚñÑ\\+_\\-]+)(\\.[a-z0-9ÁéÉíÍóÓúÚñÑ\\+_\\-]+)*@([a-z0-9ÁéÉíÍóÓúÚñÑ\\-]+\\.)+[a-z]{2,6}$/ix\", $campo)) ? FALSE : TRUE;\n break;\n case 'rut':\n $rut = preg_replace('/[^k0-9]/i', '', $campo);\n $dv = substr($rut, -1);\n $numero = substr($rut, 0, strlen($rut) - 1);\n $i = 2;\n $suma = 0;\n foreach (array_reverse(str_split($numero)) as $v) {\n if ($i == 8)\n $i = 2;\n $suma += $v * $i;\n ++$i;\n }\n $dvr = 11 - ($suma % 11);\n\n if ($dvr == 11)\n $dvr = 0;\n if ($dvr == 10)\n $dvr = 'K';\n\n if ($dvr == strtoupper($dv)){\n $valido = true;\n }\n else{\n $valido = false;\n }\n\n ////\n break;\n }\n\n return $valido;\n }", "function validate($name,$value,$minlen,$maxlen,$datatype=\"\",$min_val=\"\",$max_val=\"\",$regexp=\"\") {\t//SAT0112:To prevent entering values which is not less than min_val and not greater than max val\n\n\t$resp=true;\n\n\t//echo \"Validating: name=\".$name.\" val=\".$value.\" min=\".$minlen.\" maxlen=\".$maxlen.\" type=\".$datatype.\" regexp=\".$regexp.\"<br>\";\n\n\t// If the value is empty and the field is not mandatory, then return\n\tif ( (!isset($minlen) || $minlen == 0) && $value == \"\" ) {\n\t\treturn true;\n\t}\n\n\t// Empty Check\n\t// Changed to === to ensure 0 does not fail \n\tif ( isset($minlen) && $minlen > 0 && $value === \"\" ) {\n\t\tadd_msg(\"ERROR\",$name.\" cannot be empty. \"); \n\t\treturn false;\n\t}\n\n\t//echo \"count($value)=[\".preg_match(\"/^[0-9]+$/\",\"12344a4\").\"]<br>\";\n\t// MIN LEN check\n\tif ( isset($minlen) && strlen($value) < $minlen ) {\n\t\tadd_msg(\"ERROR\",$name.\" should be atleast \".$minlen.\" characters long. \"); \n\t\treturn false;\n\t}\n\n\t// MAX LEN check\n\tif ( $datatype == 'enum' ) { \n\t\t$enum_str=$maxlen;\n\t\tunset($maxlen);\n\t}\n\n\tif ( isset($maxlen) && strlen($value) > $maxlen ) {\n\t\tadd_msg(\"ERROR\",$name.\" cannot be longer than \".$maxlen.\" characters. \"); \n\t\treturn false;\n\t}\n\n\t// CUSTOM REGEXP check\n\tif ( isset($regexp) && !preg_match(\"/$regexp/\",$value) ) {\n\t\tadd_msg(\"ERROR\",$name.\" is not valid. \"); \n\t\treturn false;\n\t}\n\n\t// MIN value check\n\tif( ($min_val !== '' && $value < $min_val) ) {\n\t\tadd_msg(\"ERROR\",$name.\" cannot be less than \".$min_val.\". \"); \n\t\treturn false;\n\t}\n\n\t// MAX value check\n\tif( ($max_val !== '' && $value > $max_val) ) {\n\t\tadd_msg(\"ERROR\",$name.\" cannot be greater than \".$max_val.\". \"); \n\t\treturn false;\n\t}\n\t// STANDARD DATATYPES check\n\tif ( isset($datatype) ) {\n\t\tswitch ($datatype) {\n\t\t\tcase \"int\":\n\t\t\t\tif ( filter_var($value, FILTER_VALIDATE_INT) === false ) {\n\t\t\t\t\tadd_msg(\"ERROR\",$name.\" should contain only digits. \"); \n\t\t\t\t\treturn false;\n\t\t\t\t} \n\t\t\t\tbreak;\n\t\t\tcase \"decimal\":\n\t\t\t\tif ( filter_var($value, FILTER_VALIDATE_FLOAT) === false ) {\n\t\t\t\t\tadd_msg(\"ERROR\",$name.\" should contain only digits. \"); \n\t\t\t\t\treturn false;\n\t\t\t\t} \n\t\t\t\tbreak;\n\t\t\tcase \"PASSWORD\":\n\t\t\tcase \"char\": // anything\n\t\t\tcase \"varchar\": // anything\n\t\t\tcase \"text\": // anything\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"bigint\":\n\t\t\tcase \"tinyint\":\n\t\t\t\tif (!preg_match(\"/^[0-9]+$/\",$value)) {\n\t\t\t\t\tadd_msg(\"ERROR\",$name.\" should contain only digits. \"); \n\t\t\t\t\treturn false;\n\t\t\t\t} \n\t\t\t\tbreak;\n\t\t\tcase \"date\":\n\t\t\t\t$arr=preg_split(\"/-/\",$value); // splitting the array\n\t\t\t\t$yy=get_arg($arr,0); // first element of the array is month\n\t\t\t\t$mm=get_arg($arr,1); // second element is date\n\t\t\t\t$dd=get_arg($arr,2); // third element is year\n\t\t\t\tif( $dd == \"\" || $mm == \"\" || $yy == \"\" || !checkdate($mm,$dd,$yy) ){\n\t\t\t\t\tadd_msg(\"ERROR\",$name.\" is not a valid date, should be of the format YYYY-MM-DD \"); \n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t/*case \"PASSWORD\":\n\t\t\t\tif (!preg_match(\"/^[a-zA-Z\\-_0-9]+$/\",$value)) {\n\t\t\t\t\tadd_msg(\"ERROR\",$name.\" can contain only alphabets,numbers,'-' and '_'. <br/>\"); \n\t\t\t\t\treturn false;\n\t\t\t\t} \n\t\t\t\tbreak;\t\t\n\t\t\t*/\n\t\t\tcase \"SIMPLE_STRING\": // can only have alphabets, spaces, dots, -'s or +\n\t\t\t\tif (!preg_match(\"/^[a-zA-Z0-9\\.\\s\\-\\+]+$/\",$value)) {\n\t\t\t\t\tadd_msg(\"ERROR\",$name.\" should contain only alphabets, numbers, spaces '.', '-' or '+'. \"); \n\t\t\t\t\treturn false;\n\t\t\t\t} \n\t\t\t\tbreak;\n\t\t\tcase \"EMAIL\":\n\t\t\t\tif ( filter_var($value, FILTER_VALIDATE_EMAIL) == false ) {\n\t\t\t\t\tadd_msg(\"ERROR\",$name.\" is not valid, should be of the format abc@xyz.com. \"); \n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"MOBILE\":\n\t\t\t\tif (!preg_match(\"/^[0-9]+$/\",$value)) {\n\t\t\t\t\tadd_msg(\"ERROR\",$name.\" is not valid, should be of the format 919123456789 \"); \n\t\t\t\t\treturn false;\n\t\t\t\t} \n\t\t\t\tbreak;\n\t\t\tcase 'FILENAME':\n\t\t\t\tif ($value != basename($value) || !preg_match(\"/^[a-zA-Z0-9_\\.-]+$/\",$value) || !preg_match('/^(?:[a-z0-9_-]|\\.(?!\\.))+$/iD', $value)) {\n\t\t\t\t\tadd_msg('ERROR', \"Invalid $name. \");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'enum':\n\t\t\t\t$enum_arr=explode(',',$enum_str);\n\t\t\t\tif ( in_array($value, $enum_arr) ) {\n\t\t\t\t\tadd_msg('ERROR', \"Invalid $name.\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tadd_msg(\"ERROR\",$name.\" is not valid. Please re enter.\"); \n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function validaOpcion($opcionSeleccionada) {\n if (is_numeric($opcionSeleccionada))\n return true;\n else\n return false;\n}", "public function validasiJasa()\n {\n $this->form_validation->set_rules('jasa', 'Title', 'required', [\n 'required' => 'Title tidak boleh kosong!'\n ]);\n $this->form_validation->set_rules('deskripsi', 'Deskripsi', 'required', [\n 'required' => 'Deskripsi tidak boleh kosong!'\n ]);\n $this->form_validation->set_rules('harga', 'Harga', 'required|numeric', [\n 'required' => 'Harga tidak boleh kosong!'\n ]);\n }", "public function validarCadastro(){\n $valido = true;\n if(strlen($this->__get('nome')) < 3){\n $valido = false;\n }\n if(strlen($this->__get('email')) < 3){\n $valido = false;\n }\n if(strlen($this->__get('senha')) < 3){\n $valido = false;\n }\n\n return $valido;\n }", "public function rules()\n {\n return ['nome' => 'required|min:5|max:100' ];\n }", "public function rules()\n {\n return [\n 'nome' => 'required|unique:frutas',\n 'quantidade' => 'required|integer',\n 'data_validade' => 'required|date'\n ];\n }", "function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}", "private function _validate()\n {\n $data = array();\n $data['error_string'] = array();\n $data['inputerror'] = array();\n $data['status'] = TRUE;\n\n //merubah form yang di post menjadi array asosiatif\n $jumlahField = array(\n 'nomor_part' => $this->input->post('nomor_part'),\n 'nama_part' => $this->input->post('nama_part'),\n 'qty' => $this->input->post('qty'),\n 'harga_jual' => $this->input->post('harga_jual'),\n 'harga_beli' => $this->input->post('harga_beli'),\n );\n\n //menguraikan array jumlahField\n foreach ($jumlahField as $key => $value):\n if ($value == \"\")://kondisi untuk mengecek jika value atau inputan ada yang kosong\n $data['inputerror'][] = $key;\n $data['error_string'][] = str_replace(\"_\", \" \", $key).' tidak boleh kosong';\n $data['status'] = FALSE;\n endif;\n endforeach;\n\n if($data['status'] === FALSE):\n echo json_encode($data);\n exit();\n endif;\n }", "function validateProveidor() {\n $validation = new Validation(true, '');\n $patroLletres = \"/^[\\A-Za-z]+$/i\";\n\n if ($validation->getOk() && trim($this->getNom()) == '') {\n $validation->setMsg(\"El nom no pot està buit.\");\n $validation->setOK(false);\n }\n if ($validation->getOk() && !preg_match($patroLletres, trim($this->getNom()))) {\n $validation->setMsg(\"El nom només pot ser alfabètic.\");\n $validation->setOK(false);\n }\n\n if ($validation->getOk() && trim($this->getCodi()) == '') {\n $validation->setMsg(\"El codi no pot està buit.\");\n $validation->setOK(false);\n }\n\n return $validation;\n }", "public function rules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('tgl_awal,tgl_akhir', 'required'),\r\n\t\t);\r\n\t}", "public function validation() {\r\n return array(\r\n array(\r\n 'jenis_pelanggaran,sanksi_pelanggaran,poin_pelanggaran', 'required',\r\n \r\n ),\r\n \r\n \r\n array(\r\n 'poin_pelanggaran','numeric',\r\n ),\r\n );\r\n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "function validate()\n{\n $check = true;\n\n $v_id_vehicle = $_POST['id_vehicle'];\n $v_marca = $_POST['marca'];\n $v_modelo = $_POST['modelo'];\n $v_HP = $_POST['HP'];\n $v_Km = $_POST['Km'];\n $v_Anyo_produccion = $_POST['Anyo_produccion'];\n $v_color = $_POST['color'];\n $v_precio = $_POST['precio'];\n\n\n $r_id_vehicle = validate_id_vehicle($v_id_vehicle);\n $r_marca = validate_marca($v_marca);\n $r_modelo = validate_modelo($v_modelo);\n $r_HP = validate_HP($v_HP);\n $r_Km = validate_Km($v_Km);\n $r_Anyo_produccion = validate_Anyo_produccion($v_Anyo_produccion);\n $r_color = validate_color($v_color);\n $r_precio = validate_precio($v_precio);\n\n if ($r_id_vehicle !== 1) {\n $error_id_vehicle = \" * El id_vehicle introducido no es valido\";\n $check = false;\n } else {\n $error_id_vehicle = \"\";\n }\n if ($r_marca !== 1) {\n $error_marca = \" * La marca introducida no es valida\";\n $check = false;\n } else {\n $error_marca = \"\";\n }\n if ($r_modelo !== 1) {\n $error_modelo = \" * El modelo introducido no es valido\";\n $check = false;\n } else {\n $error_modelo = \"\";\n }\n if ($r_HP !== 1) {\n $error_HP = \" * El HP introducido no es valido\";\n $check = false;\n } else {\n $error_HP = \"\";\n }\n if (!$r_Km) {\n $error_Km = \" * No has indicado kilometraje\";\n $check = false;\n } else {\n $error_Km = \"\";\n }\n if (!$r_Anyo_produccion) {\n $error_Anyo_produccion = \" * No has introducido ninguna Anyo_produccion\";\n $check = false;\n } else {\n $error_Anyo_produccion = \"\";\n }\n\n if (!$r_color) {\n $error_color = \" * No has seleccionado ningun color\";\n $check = false;\n } else {\n $error_color = \"\";\n }\n if (!$r_precio) {\n $error_precio = \" * El texto introducido no es valido\";\n $check = false;\n } else {\n $error_precio = \"\";\n }\n\n return $check;\n}", "public function validate_fields() {\n \n\t\t//...\n \n }", "public function rules() {\n return array(\n array('out_summ, in_curr', 'required'),\n array('out_summ', 'numerical', 'min' => 1, 'tooSmall' => Yii::t('payment', 'The summ can not be less than $ 1'), 'message' => Yii::t('payment', 'Summ must be a number')),\n );\n }", "public function rules()\n {\n return [\n 'name' => \"required\",\n 'quantity' => \"required|in:मेट्रिक टन,क्विन्टल,किलोग्राम,लिटर,क्यारेट\",\n 'import' => \"required|numeric\",\n 'export' => \"required|numeric\"\n ];\n }", "function validaEntero ($texto) {\n// prueba si la entrada es un entero, sin signo\nreturn preg_match(\"/^[0-9]+$/\", $texto );\n}", "function validasi_masukan_numerik(&$pesan_error, $name) {\n $pattern = \"/^[0-9]+$/\"; //pattern angka 0-9, selain dari itu false\n //dicek jika masukan kosong atau tidak valid menurut pattern maka dipastikan masukan salah\n if (@$_POST[$name]!='' & !preg_match($pattern, @$_POST[$name])) $pesan_error[$name] = 'Hanya boleh memasukkan angka';\n}", "public function validarCuit()\n\t{\n\t\tif($this->input->post('cuit')){\n\t\t\t$cuit =\tstr_replace ( '-' , '' , $this->input->post('cuit'));\t\n\t\t\tif(validarCUIT($cuit)){\n\t\t\t\techo 1;\n\t\t\t}else{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\techo 0;\n\t\t}\t\n\t}", "public function rules()\n {\n return [\n 'model' => 'required',\n 'quantity' => 'numeric|required'\n ];\n }", "function validaCampos()\n {\n $this->form_validation->set_rules(\"producto\", \"Producto\", \"trim|required\");\n\t\t$this->form_validation->set_rules(\"plazo\", \"Plazo\", \"trim|required\");\n $this->form_validation->set_rules(\"fechaInicio\", \"Fecha Inicio\", \"trim|required\");\n $this->form_validation->set_rules(\"fechaFinal\", \"Fecha Final\", \"trim|required\");\n $this->form_validation->set_rules(\"tasaInteres\", \"Tasa Interes\", \"trim|required\");\n $this->form_validation->set_rules(\"capital\", \"Capital\", \"trim|required\");\n $this->form_validation->set_rules(\"deuda\", \"Deuda\", \"trim|required\");\n\t\t$this->form_validation->set_rules(\"tipo\", \"Tipo\", \"callback_select_tipo\");\n\t\t$this->form_validation->set_rules(\"estado\", \"Estado\", \"callback_select_estado\");\n /*$this->form_validation->set_rules(\"distrito\", \"Distrito\", \"callback_select_distrito\");\n $this->form_validation->set_rules(\"provincia\", \"Provincia\", \"callback_select_provincia\");\n $this->form_validation->set_rules(\"departamento\", \"Departamento\", \"callback_select_departamento\");\n $this->form_validation->set_rules(\"telefono\", \"Telefono\", \"trim|required\");\n $this->form_validation->set_rules(\"sexo\", \"Sexo\", \"callback_select_sexo\");\n $this->form_validation->set_rules(\"oficinaAfiliacion\", \"OficinaAfiliacion\", \"callback_select_oficina\");*/\n }", "public function validateOrder();", "function validate_input ($input_array) {\n\t$errors = array();\n\n\t$integer_fields = array('model', 'ram', 'hd', 'price');\n\tforeach ($integer_fields as $key) {\n\t\tif (!is_numeric($input_array[$key]) || preg_match('/\\./', $input_array[$key])) {\n\t\t\t$errors[] = \"The value of $key must be an integer.\";\n\t\t}\n\t}\n\n\tif (!is_numeric($input_array['speed'])) {\n\t\t$errors[] = \"The value of speed must be a number.\";\n\t}\n\n\treturn $errors;\n}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('biaya, status', 'required'),\n\t\t\tarray('Tagihan_id, status', 'numerical', 'integerOnly'=>true),\n\t\t\tarray('biaya', 'numerical'),\n\t\t);\n\t}", "public function checkInput() {\r\n\t\t\r\n//\t\tif (mb_strlen($this->mValue) < $this->aConfig['minlength']) {\r\n//\t\t\t$this->sErrorLabel = '$locale/sbSystem/formerrors/string_too_short';\r\n//\t\t}\r\n//\t\tif (mb_strlen($this->mValue) > $this->aConfig['maxlength']) {\r\n//\t\t\t$this->sErrorLabel = '$locale/sbSystem/formerrors/string_too_long';\r\n//\t\t}\r\n//\t\tif (mb_strlen($this->mValue) == 0 && $this->aConfig['required'] == 'TRUE') {\r\n//\t\t\t$this->sErrorLabel = '$locale/sbSystem/formerrors/not_null';\r\n//\t\t}\r\n//\t\t\r\n//\t\t$this->additionalChecks();\r\n\t\t\r\n\t\tif ($this->sErrorLabel == '') {\r\n\t\t\treturn (TRUE);\r\n\t\t} else {\r\n\t\t\treturn (FALSE);\r\n\t\t}\r\n\t\t\r\n\t}", "function testTextFieldGivenNumberExpectsNumericStringValueReturned() {\n\n\t\t// arrange\n\t\tglobal $post;\n\t\t$TestValidTextField = new TestValidTextField();\n\t\t$TestValidTextField->fields['field']['type'] = 'text';\n\t\t$_POST = array(\n\t\t\t'post_ID' => 1,\n\t\t\t'field' => 1,\n\t\t);\n\t\t$validated = array();\n\n\t\t// act\n\t\t$TestValidTextField->validate($_POST['post_ID'], $TestValidTextField->fields['field'], $validated['field'], array());\n\n\t\t// assert\n\t\t$this->assertEquals('1', $validated['field']);\n\t}", "public function rules()\n {\n return [\n 'idpoi' => 'required|integer|digits_between:0,3|min:0',\n 'valor.*' => 'required|integer|digits_between:0,2|min:0',\n 'id.*' => 'required|integer|digits_between:0,2|min:0',\n ];\n }", "function validate_input($input_data, $input_type) {\n $output_data = trim($input_data);\n $output_data = stripslashes($output_data);\n $output_data = htmlspecialchars($output_data);\n if($input_type == 'text') {\n // not sure what to do here; \n }\n if($input_type == 'number') {\n if(!is_numeric($output_data)) {\n return false;\n }\n }\n return $output_data;\n}", "public function rules()\n {\n return [\n 'descripcion' => 'required|max:50',\n /* 'estadia' => 'required|max:50', */\n 'valor_pago' => 'required|numeric|min:0.00|max:999999.99'\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('name, price_type', 'required'),\n\t\t);\n\t}", "private function validateForm($_POST) {\n\n $hash = self::getHash();\n /* @var Entity\\NeoCart $cart */\n $cart = $this->NeoCartModel->getCart($hash);\n\n $cartItems = $cart->getCartItems();\n\n if (!$cartItems) {\n exit(\"Error(1:20) Va rugam contactati administratorul: office@oringo.ro\");\n }\n\n foreach ($cartItems as $cartItem) {\n /* @var $cartItem Entity\\CartItem */\n /* @var $item Entity\\Item */\n $item = $cartItem->getItem();\n\n if ($item->getItem_type() == \"offer\") {\n for ($i = 0; $i < $cartItem->getQuantity(); $i++) {\n if ($cartItem->getIs_gift()) {\n if (strlen($_POST['name_' . $cartItem->getId()][$i]) < 2 || !filter_var($_POST['email_' . $cartItem->getId()][$i], FILTER_VALIDATE_EMAIL)) {\n $errors.= \"Introduceti corect datele prietenului !<br/>\";\n break 2;\n }\n } else\n if (strlen($_POST['name_' . $cartItem->getId()][$i]) < 2) {\n $errors.= \"Introduceti datele beneficiarului !<br/>\";\n break 2;\n }\n }\n }\n }\n //exit();\n if (!isset($_POST['payment_method']))\n $errors.='Alegeti metoda de plata';\n\n return $errors;\n }", "public function rules()\n {\n return [\n 'value'=>'required|numeric|min:5',\n //Comprobar si esta el dato en la tabla\n 'currency'=>'required|exists:currencies,iso',\n 'payment_platform'=>'required|exists:payment_plataforms,id',\n ];\n }", "private function validatePaymentFields(){\n }", "public function rules()\n {\n return [\n 'deskripsi' => 'required',\n 'jumlah' => 'required'\n ];\n }", "private function validateFields()\n {\n $errors = array();\n for ($x=0; $x < count($this->_fields); $x++)\n {\n $field = $this->_fields[$x];\n if ($field['type'] == WFT_CC_EXPIRATION)\n {\n // one or both fields left blank\n if (strlen(trim($this->getPostValue($field['id'] . 'Month'))) == 0 ||\n strlen(trim($this->getPostValue($field['id'] . 'Year'))) == 0)\n {\n if ($field['required'])\n $errors[] = 'You must select an card expiration month and year';\n $monthValue = $yearValue = -1;\n $value = '';\n }\n else\n {\n $monthValue = intval($this->getPostValue($field['id'] . 'Month'));\n $yearValue = intval($this->getPostValue($field['id'] . 'Year'));\n $curYear = intval(date('Y'));\n if ($yearValue < $curYear)\n $errors[] = 'The expiration year is in the past';\n if ($monthValue < 1 || $monthValue > 12)\n $errors[] = 'The expiration month is not valid';\n }\n }\n else if($field['required'] && !strlen(trim($this->getPostValue($field['id']))))\n {\n if (strlen($field['caption']) > 0)\n $errors[] = $field['caption'] . ' is a required field';\n else\n $errors[] = 'This field is required';\n $value = '';\n }\n else if($field['type'] == WFT_CURRENCY)\n {\n $value = trim($this->getPostValue($field['id']));\n $value = str_replace('$', '', $value);\n $cur = floatval($value);\n $value = strval($cur);\n }\n else if($field['type'] == WFT_ANTI_SPAM_IMAGE)\n {\n $antiSpamInput = $this->getPostValue($field['id']);\n $wordVerifyID = $this->getPostValue('wordVerifyID');\n $graphs = new Graphs();\n $wordVerifyText = $graphs->getVerificationImageText($wordVerifyID);\n if (strtoupper($antiSpamInput) != $wordVerifyText || $antiSpamInput == '')\n {\n $errors[] = 'The text you entered did not correspond with the text in the security image';\n $value = 0;\n }\n else\n {\n $value = 1;\n }\n $graphs->clearVerificationImageText($wordVerifyID);\n }\n else if($field['type'] == WFT_SELECT || $field['type'] == WFT_CC_TYPE || $field['type'] == WFT_BOOLEAN)\n {\n $value = $this->getPostValue($field['id']);\n if (!strcmp($value, 'noset'))\n {\n $errors[] = $field['caption'] . ': You must select an option';\n }\n }\n else if($field['type'] == WFT_CC_NUMBER)\n {\n $value = '';\n // Clean credit card number input\n $cardNumber = preg_replace('/[^0-9]/', '', $this->getPostValue($field['id']));\n\n if ($field['required'] == false && !strlen($cardNumber))\n {\n $value = '';\n }\n else\n {\n // Guess the card type by using a pregex pattern matching algorithm\n $cardType = $this->getCreditCardTypeByNumber($cardNumber);\n if ($cardType == -1)\n $errors[] = 'The credit card number you entered is not a recognized Visa, MasterCard, American Express '\n . 'or Discover card.';\n else if (!$this->isCardNumberValid($cardType, $cardNumber))\n $errors[] = 'The credit card number you entered has not been recognized and may be invalid.';\n else\n {\n // Valid card number, now change all card type fields to match\n // the autodetected card type (visa, mastercard, etc.)\n $value = $cardNumber;\n $cardTypeName = $this->getCreditCardName($cardType);\n\n for ($y=0; $y < count($this->_fields); $y++)\n {\n if ($this->_fields[$y]['type'] == WFT_CC_TYPE)\n {\n $this->_fields[$y]['validatedDataOverride'] = $cardTypeName;\n $this->_fields[$y]['validatedData'] = $cardTypeName;\n }\n }\n }\n }\n }\n else\n {\n $value = trim($this->getPostValue($field['id']));\n\n if (!($field['required'] == false && !strlen($value)))\n {\n if (strlen($field['regex_test']) > 0)\n {\n if (!preg_match($field['regex_test'], $value))\n {\n $errors[] = $field['regex_fail'];\n }\n }\n if (strlen($value) < $field['length'][0] || strlen($value) > $field['length'][1])\n {\n if ($field['length'][0] == $field['length'][1])\n {\n if (strlen(trim($field['caption'])) > 0)\n $errors[] = sprintf(\"%s must be %d characters in length\",\n $field['caption'], $field['length'][0]);\n else\n $errors[] = sprintf(\"This field must be %d characters in length\",\n $field['length'][0]);\n }\n else\n $errors[] = sprintf(\"%s must be between %s characters in length\",\n $field['caption'], implode(' and ', $field['length']));\n }\n }\n $value = str_replace(array(\"\\r\",\"\\n\",\"\\t\",\"\\f\"), '', strip_tags($value));\n }\n\n // Set the validated (form returned) data\n switch($field['type'])\n {\n case WFT_CC_EXPIRATION:\n if ($monthValue != -1 && $yearValue != -1)\n $this->_fields[$x]['validatedData'] = sprintf('%d/%d', $monthValue, $yearValue);\n else\n $this->_fields[$x]['validatedData'] = '';\n break;\n default:\n if (isset($this->_fields[$x]['validatedDataOverride']) && strlen($this->_fields[$x]['validatedDataOverride']))\n $this->_fields[$x]['validatedData'] = $this->_fields[$x]['validatedDataOverride'];\n else\n $this->_fields[$x]['validatedData'] = $value;\n break;\n }\n }\n return $errors;\n }", "function validarFlotante ($Cad) {\n// prueba si la entrada es un numero de punto flotante, con un signo opcional\nreturn preg_match(\"/^-?([0-9])+([\\.|,]([0-9])*)?$/\", $Cad );\n}", "function validaValor($cadena)\n{\n\tif(eregi('^[a-zA-Z0-9._αινσϊρ‘!Ώ? -]{1,40}$', $cadena)) return TRUE;\n\telse return FALSE;\n}", "public function validate(){\r\n\t\tif(array_get($this->entity, array_get($this->validate, 'fieldName')) != $this->fieldValue){\r\n\t\t\tHmsException::occur($fieldName. '必须等于', $this->fieldValue);\r\n\t\t}\r\n\t}", "public abstract function validation();", "public function rules()\n {\n return [\n 'nama' => 'required',\n 'brand' => 'required',\n 'stock' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'quantity' => 'required|numeric|max:999.99',\n 'amount' => 'required|numeric|max:999.99',\n ];\n }", "public function rules()\n {\n return [\n 'nome' => 'required',\n 'nome' => 'min:3',\n 'numero_temporadas' => 'required',\n 'qtd_episodios' => 'required',\n ];\n }", "public function validate_fields() {\n\n\t\t\t\t$phone = $this->sanatizePhone( $_POST['havanao_phone_number'] );\n\n\t\t\t\tif ( strlen( trim( preg_replace( '/^(\\+?250)\\d{9}/', '', $phone ) ) ) ) {\n\t\t\t\t\twc_add_notice( __( 'Invalid phone number provided. Please provide a valid Rwanda mobile phone number', 'havanao' ), 'error' );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public function validarProfesion() {\r\n if (!$this->hasErrors()) {\r\n if ($this->profesion != null) {\r\n $objProfesion = ProfesionCliente::model()->findByPk($this->profesion);\r\n \r\n if($objProfesion==null)\r\n $this->addError('profesion', 'Profesión no válida');\r\n }\r\n }\r\n }", "function validarCampos()\r\n\t{\r\n\t\t$retorno = array('bool' => true, 'msg' => null);\r\n\r\n\t\tforeach($_POST as $nombre_campo => $valor){\r\n\r\n\t\t\t/*\r\n\t\t\t\tVALIDACIONES\r\n\t\t\t*/\r\n\r\n\t\t\t//bool = true: caso que no exite error alguno en los campos\r\n\t\t\t//bool = false: caso que exista error...(tamano, caracteres especiales)\r\n\r\n\t\t\tif(strlen($valor) >= 1){ //no esta vacio\r\n\r\n\t\t\t\tswitch($nombre_campo){\r\n\r\n\t\t\t\t\tcase 'nombre':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^[a-zA-Z0-9\\_\\-]{0,40}\\s?[a-zA-Z0-9\\_\\-]{0,40}?$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Verifica los caracteres del nombre';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'email':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9]+\\.[a-zA-Z0-9-.]+$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Tu correo no es valido';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'password':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^.{0,12}$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Comprueba el limite de caracteres de tu contraseña';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t//validaciones de datos de contras\r\n\r\n\t\t\t\t\tcase 'nombreContra':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^.{0,20}$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Comprueba el limite de caracteres del nombre de la contraseña';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'contenidoContra':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^.{0,30}$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Comprueba el limite de caracteres de tu contraseña';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t} else{\r\n\r\n\t\t\t\t$retorno['msg'] = 'Por favor rellena todos los campos';\r\n\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t}\r\n\t\t} \r\n\r\n\t\treturn $retorno;\r\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('dari_tanggal, sampai_tanggal, ', 'required'),\n array('neg_Asal, nama_prov, namaPelbong, jenisKom, kodeHS', 'safe'),\n\t\t);\n\t}", "function validate($input) {\n\t\t$values = array();\n\t\tforeach($input as $col => $value) {\n\t\t\tif($value != \"\") {\n\t\t\t\t$values[$col] = $value;\n\t\t\t}\n\t\t}\n\t\tif($values[\"instrument\"] == 0) {\n\t\t\tunset($values[\"instrument\"]);\n\t\t}\n\t\t\n\t\tparent::validate($values);\n\t}", "function checkInput()\r\n\t{\r\n\t\tglobal $lng;\r\n\t\t\r\n\t\tforeach ($this->dirs as $dir)\r\n\t\t{\r\n\t\t\t$num_value = $_POST[$this->getPostVar()][$dir][\"num_value\"] = \r\n\t\t\t\ttrim(ilUtil::stripSlashes($_POST[$this->getPostVar()][$dir][\"num_value\"]));\r\n\t\t\t$num_unit = $_POST[$this->getPostVar()][$dir][\"num_unit\"] = \r\n\t\t\t\ttrim(ilUtil::stripSlashes($_POST[$this->getPostVar()][$dir][\"num_unit\"]));\r\n\t\t\t\t\r\n\t\t\t/*\r\n\t\t\tif ($this->getRequired() && trim($num_value) == \"\")\r\n\t\t\t{\r\n\t\t\t\t$this->setAlert($lng->txt(\"msg_input_is_required\"));\r\n\t\r\n\t\t\t\treturn false;\r\n\t\t\t}*/\r\n\t\t\t\r\n\t\t\tif (!is_numeric($num_value) && $num_value != \"\")\r\n\t\t\t{\r\n\t\t\t\t$this->setAlert($lng->txt(\"sty_msg_input_must_be_numeric\"));\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (trim($num_value) != \"\")\r\n\t\t\t{\r\n\t\t\t\tswitch ($dir)\r\n\t\t\t\t{\r\n\t\t\t\t\tcase \"all\": $this->setAllValue($num_value.$num_unit); break;\r\n\t\t\t\t\tcase \"top\": $this->setTopValue($num_value.$num_unit); break;\r\n\t\t\t\t\tcase \"bottom\": $this->setBottomValue($num_value.$num_unit); break;\r\n\t\t\t\t\tcase \"left\": $this->setLeftValue($num_value.$num_unit); break;\r\n\t\t\t\t\tcase \"right\": $this->setRightValue($num_value.$num_unit); break;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function rules()\n {\n return [\n 'naziv'=>'required',\n 'sastojci'=>'required',\n 'cena'=>'required|regex:/^[1-9][0-9]*$/'\n ];\n }" ]
[ "0.6576863", "0.6508983", "0.65006053", "0.637773", "0.63258946", "0.63067025", "0.6271203", "0.624336", "0.62144107", "0.61223096", "0.6069423", "0.60493195", "0.60072404", "0.6002623", "0.59875906", "0.5986854", "0.59738904", "0.5948958", "0.5946237", "0.5921209", "0.5909912", "0.5893843", "0.5884129", "0.5884129", "0.5877464", "0.5859911", "0.58578634", "0.5850862", "0.58425385", "0.58213866", "0.5817079", "0.581266", "0.5808294", "0.5799655", "0.5797821", "0.578084", "0.5757221", "0.57520074", "0.57460684", "0.5737943", "0.5736919", "0.5735672", "0.57281667", "0.57203156", "0.5701257", "0.5701257", "0.56885093", "0.56788564", "0.5672925", "0.5666811", "0.56549126", "0.56525415", "0.5636058", "0.5620497", "0.5617154", "0.56169635", "0.56026465", "0.55969834", "0.558285", "0.5574167", "0.55624413", "0.555123", "0.5542778", "0.55333924", "0.5531953", "0.55207545", "0.5511", "0.55096805", "0.55087924", "0.55047756", "0.54997265", "0.5494686", "0.54943424", "0.549417", "0.5492208", "0.54875976", "0.5485086", "0.54841757", "0.5483782", "0.5478176", "0.54735035", "0.547294", "0.5472316", "0.54715145", "0.5471314", "0.5470289", "0.54701984", "0.54615206", "0.5460254", "0.54590654", "0.54581577", "0.54530954", "0.5452406", "0.54498917", "0.5447786", "0.5446502", "0.5445933", "0.54403406", "0.5439472", "0.54370195" ]
0.6053715
11
gives the price in the current currency format
public function getCurrentCurrencyPriceOfSellerProduct() { $sp_id = $this->sp_id; $user_helper = new UserHelper; $to_curr_id = $user_helper-> getCurrentUserChoiceCurrencyId(); $price = $this->getPriceOfSellerProduct($sp_id); $from_curr_id = $this->getCurrentPriceObjectOfSellerProduct($sp_id)->curr_id; $currency_helper = new CurrencyHelper; return $currency_helper->currencyConvert($from_curr_id,$to_curr_id,$price); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPrice()\n {\n return '£' . number_format($this->price, 2);\n }", "public function formatedPrice()\n {\n // if I format total amount of cart, use cart->total_price\n $amount = $this->price ? $this->price : $this->total_price;\n $fmt_price = new NumberFormatter('en', NumberFormatter::CURRENCY);\n \n return $fmt_price->formatCurrency($amount, \"EUR\");\n }", "public function getPrice()\n\t{\n\t\t$total = intval($this->var['price']);\n\t\t$d = $total/100;\n\t\t$c = $total%100;\n\t\treturn sprintf(\"%d.%02d\",$d,$c);\n\t\t//return \"$d.$c\";\n\t}", "public function price_to_s(){\n return number_format($this->price, 2, '€', '');\n }", "public function getFormattedPrice()\n {\n return $this->formatted_price;\n }", "public function getFormattedPrice()\n {\n return $this->formatted_price;\n }", "public function getCurrency();", "public function getCurrency();", "function presentPrice($price)\n{\n // $currencies = new ISOCurrencies();\n // $numberFormatter = new \\NumberFormatter('en_US', \\NumberFormatter::CURRENCY);\n // $moneyFormatter = new IntlMoneyFormatter($numberFormatter, $currencies);\n // return $moneyFormatter->format($money);\n $fmt = new NumberFormatter('vi-VN', NumberFormatter::CURRENCY);\n return $fmt->formatCurrency($price, \"VND\");\n\n #en-US USD\n #vi-VN VND\n}", "public function presentPrice(){\n \t\n \treturn money_format('$%i', $this->price / 100);\n }", "public function getFormattedPrice(): string\n {\n\n return number_format($this->price, 0, '', ' ');\n\n }", "function to_price($amount = 0.00, $symbol = \"$\", $currency_code = \"USD\"){\n $amount = floatval($amount);\n return sprintf(\"%s%.2f %s\", $symbol, $amount, $currency_code);\n}", "public function getCurrency(): string;", "public function getCurrency(): string;", "function convert_price_default_currency($price,$rate=1)\n{\n\treturn sprintf('%0.2f',($price/$rate));\n}", "public function viewPrice()\n {\n return number_format($this->price/100, 2);\n }", "function money($price,$decimals = 2)\n {\n return number_format($price,$decimals);\n }", "private static function moneyFormat($price)\r\n {\r\n return addCurrency(number_format($price, 2, ',', ' '));\r\n }", "public function getFormattedPrice()\n {\n return $this->formatProductPrice($this->getFinalPrice($this->displayPriceIncludingTax()));\n }", "function format_price($price)\n{\n $price = number_format(ceil($price), 0, \".\", \" \");\n return $price . \" \" . \"₽\";\n}", "public function getCurrency() : string\n {\n return $this->currency;\n }", "public function getCurrency() : string\n {\n return $this->currency;\n }", "public function convertPrice($price=0){\n return $this->priceCurrency->convert($price);\n }", "public function format() {\n\t\treturn elgg_echo('payments:price', [$this->getConvertedAmount(), $this->getCurrency()]);\n\t}", "public function pricer($price)\n {\n $string_price = number_format($price,2,',','.');\n return $string_price;\n }", "public function Price() {\n\t\t$amount = $this->Amount();\n\n\t\t//Transform price here for display in different currencies etc.\n\t\t$this->extend('updatePrice', $amount);\n\n\t\treturn $amount;\n\t}", "function __formatCurrency($value)\n {\n if ($this->__init['definitions']['currency_type'] === 'dolar') {\n if (preg_match('/(([0-9]+)\\.([0-9]{1,2}))/', $value)) {\n $value.= 00;\n list($val, $decimal) = explode('.', $value);\n $decimal = substr($decimal, 0, 2);\n return $val . $decimal;\n } else return $value . '00';\n } else if ($this->__init['definitions']['currency_type'] === 'real') {\n if (preg_match('/(([0-9]+)\\,([0-9]{1,2}))/', $value)) {\n $value.= 00;\n list($val, $decimal) = explode(',', $value);\n $decimal = substr($decimal, 0, 2);\n return $val . $decimal;\n } else return $value . '00';\n } else return $value;\n }", "function getfaircoin_price($price){\r\n global $edd_options;\r\n\r\n if( $price == 0 ) { // <span style=\"font-family:arial\">ƒ</span>\r\n $price = '1 Fair = '.number_format($edd_options['faircoin_price'], 2, '.', ',').' EUR';\r\n }\r\n return $price;\r\n}", "function convertToDollar($localAmount, $rate){\n return round ($localAmount/$rate, 3);\n //return number_format(round ($localAmount/$rate, 3), 3, \".\", \",\");\n\n}", "public function getFinanceFromPrice()\n {\n $product = $this->getProduct();\n $finaceFromPrice = $product->getData('finance_from_price');\n $price = Mage::helper('core')->currency($finaceFromPrice, true, false);\n\n return $price;\n }", "public function getFormattedPriceAttribute()\n {\n //attributes['price']\n return number_format(($this->attributes['price'] / 100), 2, '.', '');\n }", "function format_price($price, string $currency = null)\n{\n return sprintf(\n config('vanilo.framework.currency.format'),\n $price,\n $currency ?? config('vanilo.framework.currency.sign')\n );\n}", "public function currencyPrice()\n {\n \t$this->currencyPrice = CurrencyPrice::getCurrencyPrices($this->sellPrices->CurrencyNo)->BuyPrice;\n \treturn $this->currencyPrice > 0 ? $this->currencyPrice : 1 ;\n }", "function getCurrency()\r\n\t{\r\n\t\treturn $this->call_API('getCurrency');\r\n\t}", "function price () {\n global $value;\n $pricefloat = ceil($value['price']);\n\n if ($pricefloat <= 999) {\n echo $pricefloat;\n } elseif ($pricefloat >= 1000) {\n $num_format = number_format($pricefloat, 0, '.', ' ');\n echo $num_format . \" &#8381;\";\n }\n }", "protected function priceFormat($price)\n {\n return number_format((float)$price, 2, '.', '') * 100;\n }", "public function formatPrice($value)\n\t{\n\t\treturn Mage::getSingleton('adminhtml/session_quote')->getStore()->formatPrice($value);\n\t}", "public function getCurrencyPrice()\n {\n return isset($this->currencyPrice) ? $this->currencyPrice : null;\n }", "public function getPrice($format = true)\n {\n return $format == true ? number_format($this->price, 2, \",\", \"&nbsp;\") : $this->price;\n }", "function couponxl_format_price_number( $price ){\n\n\tif( !is_numeric( $price ) ){\n\t\treturn $price;\n\t}\n\t$unit_position = couponxl_get_option( 'unit_position' );\n\t$unit = '₹';\n\n\tif( $unit_position == 'front' ){\n\t\treturn $unit.number_format( $price, 2 );\n\t}\n\telse{\n\t\treturn $unit.number_format( $price, 2 );\n\t}\n}", "public function get_price(){\n\t\treturn $this->price;\n\t}", "function formatPrice2($price)\n{\n\t$price = @number_format($price, 2, '.', ' '); // Igor\n\treturn $price;\n}", "function fetch_currency_with_symbol($amount,$currency = '')\r\n{\r\n\t$amt_display = '';\r\n\tif($amount==''){ $amount =0; }\r\n\t$decimals=get_option('tmpl_price_num_decimals');\r\n\t$decimals=($decimals!='')?$decimals:2;\r\n\tif($amount >=0 )\r\n\t{\r\n\t\tif(@$amount !='')\r\n\t\t\t$amount = $amount;\r\n\t\t\t$currency = get_option('currency_symbol');\r\n\t\t\t$position = get_option('currency_pos');\r\n\t\tif($position == '1')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.$amount;\r\n\t\t}\r\n\t\telse if($position == '2')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.' '.$amount;\r\n\t\t}\r\n\t\telse if($position == '3')\r\n\t\t{\r\n\t\t\t$amt_display = $amount.$currency;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$amt_display = $amount.' '.$currency;\r\n\t\t}\r\n\t\treturn apply_filters('tmpl_price_format',$amt_display,$amount,$currency);\r\n\t}\r\n}", "public function getCurrency(): Currency;", "public function getSourceCurrency();", "public function getCurrency(){\n return $this->currency;\n }", "public function getToCurrency()\n {\n return $this->toCurrency;\n }", "protected function escapeCurrency($price)\n {\n return preg_replace(\"/[^0-9\\.,]/\", '', $price);\n }", "public function getCurrency()\n {\n return $this->getData(self::CURRENCY);\n }", "public function getPrice()\n {\n return '';\n }", "static function toCurrency($amount)\r\n {\r\n return \"$\" . number_format((double) $amount, 2);\r\n }", "public function getCurrentPrice() : float;", "public static function convertPriceWithCurrency($price, $currency){\n return JeproshopTools::displayPrice($price, $currency);\n }", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getPrecio()\r\n {\r\n return \"5.00$\";\r\n }", "function formatPrice($price){\n$explodePrice = explode('.', $price);\n\nreturn $explodePrice[0]. '<span class =\"card-price-cents\">€'. $explodePrice[1]. '</span>';\n\n}", "public function getPriceCurrency(): ?string\n {\n return $this->priceCurrency;\n }", "public function formatCurrency($amount);", "function presentPrice($price)\n {\n /*%i is the placeholder for the dollar amount \n money_format function does not exist on all OSes, windows is 1 of them \n see https://stackoverflow.com/questions/21507977/fatal-error-call-to-undefined-function-money-format#:~:text=this%20function%20available.-,The%20function%20money_format()%20is%20only%20defined%20if%20the%20system,()%20is%20undefined%20in%20Windows.&text=It%20has%20been%20pointed%20out,comment%20or%20Learner%20Student's%20answer). */\n \n return '$' . number_format($price / 100, 2);\n }", "public function getPrice() {\n $price = 420;\n return $price;\n }", "public function getPrice()\n {\n return $this->get(self::_PRICE);\n }", "public static function currency() {\n\t\treturn self::$currency;\n\t}", "public function getDollarPrice(): float;", "public function getOrderCurrencyCode();", "function pms_format_price( $price = 0, $currency = '', $args = array() ) {\r\n\r\n $currency = pms_get_currency_symbol( $currency );\r\n\r\n //format number based on current locale with 2 decimals\r\n $price = number_format_i18n( $price, 2 );\r\n\r\n //remove any decimal 0s that are irrelevant; will match: x,00, x.00 and also x,10 or x.10\r\n $price = preg_replace('/(\\.|\\,)?0*$/', '', $price);\r\n\r\n $price = ( !empty( $args['before_price'] ) && !empty( $args['after_price'] ) ? $args['before_price'] . $price . $args['after_price'] : $price );\r\n $currency = ( !empty( $args['before_currency'] ) && !empty( $args['after_currency'] ) ? $args['before_currency'] . $currency . $args['after_currency'] : $currency );\r\n\r\n $settings = get_option( 'pms_payments_settings' );\r\n\r\n $output = ( !isset( $settings['currency_position'] ) || ( isset( $settings['currency_position'] ) && $settings['currency_position'] == 'after' ) ? $price . $currency : $currency . $price );\r\n\r\n return apply_filters( 'pms_format_price', $output, $price, $currency, $args );\r\n\r\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "function formatcurrency($floatcurr, $curr = \"USD\")\n{\n $currencies['ARS'] = array(2,',','.'); // Argentine Peso\n $currencies['AMD'] = array(2,'.',','); // Armenian Dram\n $currencies['AWG'] = array(2,'.',','); // Aruban Guilder\n $currencies['AUD'] = array(2,'.',' '); // Australian Dollar\n $currencies['BSD'] = array(2,'.',','); // Bahamian Dollar\n $currencies['BHD'] = array(3,'.',','); // Bahraini Dinar\n $currencies['BDT'] = array(2,'.',','); // Bangladesh, Taka\n $currencies['BZD'] = array(2,'.',','); // Belize Dollar\n $currencies['BMD'] = array(2,'.',','); // Bermudian Dollar\n $currencies['BOB'] = array(2,'.',','); // Bolivia, Boliviano\n $currencies['BAM'] = array(2,'.',','); // Bosnia and Herzegovina, Convertible Marks\n $currencies['BWP'] = array(2,'.',','); // Botswana, Pula\n $currencies['BRL'] = array(2,',','.'); // Brazilian Real\n $currencies['BND'] = array(2,'.',','); // Brunei Dollar\n $currencies['CAD'] = array(2,'.',','); // Canadian Dollar\n $currencies['KYD'] = array(2,'.',','); // Cayman Islands Dollar\n $currencies['CLP'] = array(0,'','.'); // Chilean Peso\n $currencies['CNY'] = array(2,'.',','); // China Yuan Renminbi\n $currencies['COP'] = array(2,',','.'); // Colombian Peso\n $currencies['CRC'] = array(2,',','.'); // Costa Rican Colon\n $currencies['HRK'] = array(2,',','.'); // Croatian Kuna\n $currencies['CUC'] = array(2,'.',','); // Cuban Convertible Peso\n $currencies['CUP'] = array(2,'.',','); // Cuban Peso\n $currencies['CYP'] = array(2,'.',','); // Cyprus Pound\n $currencies['CZK'] = array(2,'.',','); // Czech Koruna\n $currencies['DKK'] = array(2,',','.'); // Danish Krone\n $currencies['DOP'] = array(2,'.',','); // Dominican Peso\n $currencies['XCD'] = array(2,'.',','); // East Caribbean Dollar\n $currencies['EGP'] = array(2,'.',','); // Egyptian Pound\n $currencies['SVC'] = array(2,'.',','); // El Salvador Colon\n $currencies['ATS'] = array(2,',','.'); // Euro\n $currencies['BEF'] = array(2,',','.'); // Euro\n $currencies['DEM'] = array(2,',','.'); // Euro\n $currencies['EEK'] = array(2,',','.'); // Euro\n $currencies['ESP'] = array(2,',','.'); // Euro\n $currencies['EUR'] = array(2,',','.'); // Euro\n $currencies['FIM'] = array(2,',','.'); // Euro\n $currencies['FRF'] = array(2,',','.'); // Euro\n $currencies['GRD'] = array(2,',','.'); // Euro\n $currencies['IEP'] = array(2,',','.'); // Euro\n $currencies['ITL'] = array(2,',','.'); // Euro\n $currencies['LUF'] = array(2,',','.'); // Euro\n $currencies['NLG'] = array(2,',','.'); // Euro\n $currencies['PTE'] = array(2,',','.'); // Euro\n $currencies['GHC'] = array(2,'.',','); // Ghana, Cedi\n $currencies['GIP'] = array(2,'.',','); // Gibraltar Pound\n $currencies['GTQ'] = array(2,'.',','); // Guatemala, Quetzal\n $currencies['HNL'] = array(2,'.',','); // Honduras, Lempira\n $currencies['HKD'] = array(2,'.',','); // Hong Kong Dollar\n $currencies['HUF'] = array(0,'','.'); // Hungary, Forint\n $currencies['ISK'] = array(0,'','.'); // Iceland Krona\n $currencies['INR'] = array(2,'.',','); // Indian Rupee\n $currencies['IDR'] = array(2,',','.'); // Indonesia, Rupiah\n $currencies['IRR'] = array(2,'.',','); // Iranian Rial\n $currencies['JMD'] = array(2,'.',','); // Jamaican Dollar\n $currencies['JPY'] = array(0,'',','); // Japan, Yen\n $currencies['JOD'] = array(3,'.',','); // Jordanian Dinar\n $currencies['KES'] = array(2,'.',','); // Kenyan Shilling\n $currencies['KWD'] = array(3,'.',','); // Kuwaiti Dinar\n $currencies['LVL'] = array(2,'.',','); // Latvian Lats\n $currencies['LBP'] = array(0,'',' '); // Lebanese Pound\n $currencies['LTL'] = array(2,',',' '); // Lithuanian Litas\n $currencies['MKD'] = array(2,'.',','); // Macedonia, Denar\n $currencies['MYR'] = array(2,'.',','); // Malaysian Ringgit\n $currencies['MTL'] = array(2,'.',','); // Maltese Lira\n $currencies['MUR'] = array(0,'',','); // Mauritius Rupee\n $currencies['MXN'] = array(2,'.',','); // Mexican Peso\n $currencies['MZM'] = array(2,',','.'); // Mozambique Metical\n $currencies['NPR'] = array(2,'.',','); // Nepalese Rupee\n $currencies['ANG'] = array(2,'.',','); // Netherlands Antillian Guilder\n $currencies['ILS'] = array(2,'.',','); // New Israeli Shekel\n $currencies['TRY'] = array(2,'.',','); // New Turkish Lira\n $currencies['NZD'] = array(2,'.',','); // New Zealand Dollar\n $currencies['NOK'] = array(2,',','.'); // Norwegian Krone\n $currencies['PKR'] = array(2,'.',','); // Pakistan Rupee\n $currencies['PEN'] = array(2,'.',','); // Peru, Nuevo Sol\n $currencies['UYU'] = array(2,',','.'); // Peso Uruguayo\n $currencies['PHP'] = array(2,'.',','); // Philippine Peso\n $currencies['PLN'] = array(2,'.',' '); // Poland, Zloty\n $currencies['GBP'] = array(2,'.',','); // Pound Sterling\n $currencies['OMR'] = array(3,'.',','); // Rial Omani\n $currencies['RON'] = array(2,',','.'); // Romania, New Leu\n $currencies['ROL'] = array(2,',','.'); // Romania, Old Leu\n $currencies['RUB'] = array(2,',','.'); // Russian Ruble\n $currencies['SAR'] = array(2,'.',','); // Saudi Riyal\n $currencies['SGD'] = array(2,'.',','); // Singapore Dollar\n $currencies['SKK'] = array(2,',',' '); // Slovak Koruna\n $currencies['SIT'] = array(2,',','.'); // Slovenia, Tolar\n $currencies['ZAR'] = array(2,'.',' '); // South Africa, Rand\n $currencies['KRW'] = array(0,'',','); // South Korea, Won\n $currencies['SZL'] = array(2,'.',', '); // Swaziland, Lilangeni\n $currencies['SEK'] = array(2,',','.'); // Swedish Krona\n $currencies['CHF'] = array(2,'.','\\''); // Swiss Franc \n $currencies['TZS'] = array(2,'.',','); // Tanzanian Shilling\n $currencies['THB'] = array(2,'.',','); // Thailand, Baht\n $currencies['TOP'] = array(2,'.',','); // Tonga, Paanga\n $currencies['AED'] = array(2,'.',','); // UAE Dirham\n $currencies['UAH'] = array(2,',',' '); // Ukraine, Hryvnia\n $currencies['USD'] = array(2,'.',','); // US Dollar\n $currencies['VUV'] = array(0,'',','); // Vanuatu, Vatu\n $currencies['VEF'] = array(2,',','.'); // Venezuela Bolivares Fuertes\n $currencies['VEB'] = array(2,',','.'); // Venezuela, Bolivar\n $currencies['VND'] = array(0,'','.'); // Viet Nam, Dong\n $currencies['ZWD'] = array(2,'.',' '); // Zimbabwe Dollar\n\n function formatinr($input){\n //CUSTOM FUNCTION TO GENERATE ##,##,###.##\n $dec = \"\";\n $pos = strpos($input, \".\");\n if ($pos === false){\n //no decimals \n } else {\n //decimals\n $dec = substr(round(substr($input,$pos),2),1);\n $input = substr($input,0,$pos);\n }\n $num = substr($input,-3); //get the last 3 digits\n $input = substr($input,0, -3); //omit the last 3 digits already stored in $num\n while(strlen($input) > 0) //loop the process - further get digits 2 by 2\n {\n $num = substr($input,-2).\",\".$num;\n $input = substr($input,0,-2);\n }\n return $num . $dec;\n }\n\n\n if ($curr == \"INR\"){ \n return formatinr($floatcurr);\n } else {\n return number_format($floatcurr,$currencies[$curr][0],$currencies[$curr][1],$currencies[$curr][2]);\n }\n \n\n}", "protected function get_currency() {\n\t\treturn $this->currency;\n\t}", "static function getPrice($procent , $price){\n return $price - ( $price / 100 * $procent);\n }", "function format_price($amount, $return_empty=FALSE)\n{\n\t$string = '';\n\tif($return_empty===FALSE and empty($amount))\n\t{\n\t\treturn FALSE;\n\t}\n\t\n\tif(ci_setting('price_currency'))\n\t{\n\t\tif(ci_setting('currency_position')=='before')\n\t\t{\n\t\t\treturn ci_setting('price_currency') . $amount;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $amount . ci_setting('price_currency');\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn $amount;\n\t}\n}", "public function getFormattedRebatePriceAttribute()\n {\n // dd($this->price->rebate_price);\n $locale = app()->getLocale();\n if ($locale == 'en') {\n return number_format(($this->attributes['rebate_price'] / 100), 2, '.', '');\n }\n return number_format(($this->attributes['rebate_price'] / 100), 2, '.', ' ');\n }", "public function getFormatedPrice()\n {\n return $this->getPriceModel()->getFormatedPrice($this);\n }", "public function getPrice(): string;", "function format_price($number)\n{\n return number_format($number, 0, '', '&thinsp;');\n}", "public function formatPrice($price)\n {\n // Suppress errors from formatting the price, as we may have EUR12,00 etc\n return @number_format($price, 2, '.', '');\n }", "public function getPrice()\n {\n $price = [ $this->price, $this->price_tax_inc ]; // These prices are in Company Currency\n\n $priceObject = Price::create( $price, Context::getContext()->company->currency );\n\n return $priceObject;\n }", "function print_price($price,$always_return=false,$exclude_currency=false)\n\t{\n\t\tglobal $ecom_siteid,$db,$sitesel_curr,$default_crr,$default_Currency_arr,$current_currency_details;\n\t\t//Get the rate for the current currency\n\t\t$curr_rate = $current_currency_details['curr_rate'] + $current_currency_details['curr_margin'];\n\t\t$curr_sign\t= $current_currency_details['curr_sign_char'];\n\t\tif ($always_return==true) // if always_return is set to true then return the price even if it is 0\n\t\t{\t\n\t\t\tif($exclude_currency == false)\n\t\t\t\treturn $curr_sign.sprintf('%0.2f',($price * $curr_rate));\n\t\t\telse\n\t\t\t\treturn sprintf('%0.2f',($price * $curr_rate));\n\t\t}\t\n\t\telse // return only if the price is >0\n\t\t{\n\t\t\tif ($price>0)\n\t\t\t{\n\t\t\t\tif($exclude_currency == false)\n\t\t\t\t\treturn $curr_sign.sprintf('%0.2f',($price * $curr_rate));\n\t\t\t\telse\n\t\t\t\t\treturn sprintf('%0.2f',($price * $curr_rate));\n\t\t\t}\t\n\t\t}\t\n\t}", "public function getCurrency()\n {\n return $this->MoneyCurrency;\n }", "function get_list_product_price() {\n\n global $product;\n\n if ( $price_html = $product->get_price_html() ) :\n \t\n \techo '<span class=\"price uk-margin-small-bottom\" style=\"float: right\">';\n \techo $price_html;\n \techo '</span>';\n \t\n endif; \n\n }", "public function getPrice() {\n\t\treturn($this->price);\n\t}", "public function getTargetCurrency();", "public function getPrice()\n {\n return $this->amount;\n }", "function currency( $c_f_x )\t\r\n {\r\n \t$c_f_x = round($c_f_x, 2);\t//THIS WILL ROUND THE ACCEPTED PARAMETER TO THE \r\n \t\t\t\t\t\t\t //PRECISION OF 2\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n \t$temp_c_f_variable = strstr(round($c_f_x,2), \".\");\t//THIS WILL ASSIGN THE \".\" AND WHAT EVER \r\n \t\t\t\t\t\t\t\t//ELSE COMES AFTER IT. REMEMBER DUE TO \r\n \t\t\t\t\t\t\t\t//ROUNDING THERE ARE ONLY THREE THINGS\r\n \t\t\t\t\t\t\t\t//THIS VARIABLE CAN CONTAIN, A PERIOD \r\n \t\t\t\t\t\t\t\t//WITH ONE NUMBER, A PERIOD WITH TWO NUMBERS,\r\n \t\t\t\t\t\t\t\t//OR NOTHING AT ALL\r\n \t\t\t\t\t\t\t\t//EXAMPLE : \".1\",\".12\",\"\"\r\n\t\t\t\t\t\t\t\t\t\r\n \tif (strlen($temp_c_f_variable) == 2)\t//THIS IF STATEMENT WILL CHECK TO SEE IF \r\n \t\t\t\t\t\t//LENGTH OF THE VARIABLE IS EQUAL TO 2. IF\r\n \t\t\t\t\t\t//IT IS, THEN WE KNOW THAT IT LOOKS LIKE \r\n \t\t\t\t\t\t//THIS \".1\" SO YOU WOULD ADD A ZERO TO GIVE IT \r\n \t\t\t\t\t\t// A NICE LOOKING FORMAT \r\n \t{\r\n \t\t$c_f_x = $c_f_x . \"0\";\r\n \t}\r\n\t\t\r\n \tif (strlen($temp_c_f_variable) == 0)\t//THIS IF STATEMENT WILL CHECK TO SEE IF \r\n \t\t\t\t\t\t//LENGTH OF THE VARIABLE IS EQUAL TO 2. IF\r\n \t\t\t\t\t\t//IT IS, THEN WE KNOW THAT IT LOOKS LIKE \r\n \t\t\t\t\t\t//THIS \"\" SO YOU WOULD ADD TWO ZERO'S TO GIVE IT \r\n \t\t\t\t\t\t// A NICE LOOKING FORMAT\r\n \t{\r\n \t\t$c_f_x = $c_f_x . \".00\";\r\n \t}\r\n\t\t\r\n\t\t$c_f_x = \"$\" . $c_f_x;\t//THIS WILL ADD THE \"$\" TO THE FRONT \r\n\r\n \treturn $c_f_x;\t//THIS WILL RETURN THE VARIABLE IN A NICE FORMAT\r\n \t\t\t\t\t//BUT REMEMBER THIS NEW VARIABLE WILL BE A STRING \r\n \t\t\t\t\t//THEREFORE CAN BE USED IN ANY FURTHER CALCULATIONS\r\n \t\t\r\n }", "function getWithCurrency($amount, $decimals = 2)\n{\n return FormatNumber($amount, $decimals) . \\Config::get('website.currency');\n}", "function tmpl_fetch_currency(){\r\n\t$currency = get_option('currency_symbol');\r\n\tif($currency){\r\n\t\treturn $currency;\r\n\t}else{\r\n\t\treturn '$';\r\n\t}\t\r\n}", "public function getPrice()\n {\n return 0.2;\n }", "public function obtainCurrency()\r\n {\r\n return $this->performRequest('GET', '/currency');\r\n }", "private function __getCurrency()\n\t{\n\t\tif($this->currency == null)\n\t\t$this->currency = 1;\n\t\treturn $this->currency;\n\t}", "public function OriginalPrice() {\n\t\t$amount = $this->OriginalAmount();\n\n\t\t//Transform price here for display in different currencies etc.\n\t\t$this->extend('updateOriginalPrice', $amount);\n\n\t\treturn $amount;\n\t}", "function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }", "function print_price_selected_currency($price,$rate=1,$sign,$always_return=false)\n{\n\tif ($always_return==true) // if always_return is set to true then return the price even if it is 0\n\treturn $sign.sprintf('%0.2f',($price * $rate));\n\telse // return only if the price is >0\n\t{\n\t\tif ($price>0)\n\t\treturn $sign.sprintf('%0.2f',($price * $rate));\n\t}\n}" ]
[ "0.8028956", "0.7970334", "0.78834796", "0.7825125", "0.7715409", "0.7715409", "0.76525545", "0.76525545", "0.7649477", "0.76446414", "0.7634305", "0.7575635", "0.75107884", "0.75107884", "0.7482765", "0.7474756", "0.74707025", "0.74187136", "0.73752934", "0.7330425", "0.731034", "0.731034", "0.7300297", "0.7279445", "0.7276327", "0.72479564", "0.72358066", "0.7212229", "0.7200107", "0.7140341", "0.7136747", "0.7133471", "0.7133192", "0.71242505", "0.7113308", "0.7099538", "0.7091958", "0.7091875", "0.708859", "0.7076381", "0.70505244", "0.70380086", "0.7025463", "0.7015779", "0.70156944", "0.70147294", "0.70072067", "0.69842225", "0.69842225", "0.6980969", "0.6975978", "0.6960793", "0.6958", "0.69563377", "0.69563377", "0.69563377", "0.69497406", "0.693718", "0.6932796", "0.6920958", "0.69199467", "0.6919131", "0.6915679", "0.6914555", "0.6914023", "0.69080216", "0.69037753", "0.68997", "0.68997", "0.68997", "0.68997", "0.68997", "0.68997", "0.68997", "0.68997", "0.6895443", "0.6871645", "0.6870139", "0.6858722", "0.6853037", "0.6845187", "0.6825927", "0.68210286", "0.6819505", "0.68129236", "0.68005544", "0.6792292", "0.678923", "0.678559", "0.67833894", "0.6770571", "0.67705244", "0.67648154", "0.6760029", "0.67588454", "0.67513806", "0.6751326", "0.6736553", "0.67296153", "0.67288095" ]
0.7075038
40
SellerProduct belongs to Seller.
public function seller() { // belongsTo(RelatedModel, foreignKey = seller_id, keyOnRelatedModel = id) return $this->belongsTo('App\Seller','seller_id','seller_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = from_seller_id, keyOnRelatedModel = seller_id)\n \treturn $this->belongsTo('App\\Seller','from_seller_id','seller_id');\n }", "public function seller(){\n return $this->belongsTo(Seller::class);\n }", "public function getProductSeller()\n {\n $product = $this->coreRegistry->registry('product');\n $productId = $product->getId();\n $sellerId = $this->helper->getSellerIdByProductId($productId);\n return $sellerId;\n }", "public function seller()\n {\n return $this->belongsTo(SellerProxy::modelClass(), 'seller_id');\n }", "public function getSellerId()\n {\n return $this->seller_id;\n }", "public function seller()\n {\n return $this->belongsTo(User::class, 'seller_id');\n }", "public function getSellerId()\n {\n return $this->driver->seller_id;\n }", "public function getOfferSellerId()\n {\n return $this->offer_seller_id;\n }", "public function seller()\n {\n return $this->morphTo(__FUNCTION__, 'seller_type', 'seller_id');\n }", "public function getSeller()\n {\n return $this->seller;\n }", "public function getSellerID()\n {\n return $this->sellerID;\n }", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function seller() {\n return $this->belongsTo(User::class);\n }", "public function getSellerId()\n {\n return $this->_fields['SellerId']['FieldValue'];\n }", "public function getSellerObject($id)\n {\n if ($sellerDetail = WkMpSeller::getSellerDetailByCustomerId($id)) {\n return $this->obj_seller = new WkMpSeller($sellerDetail['id_seller'], $this->context->language->id);\n }\n\n return false;\n }", "public static function getSellerByProduct($id_product) {\n if (empty($id_product))\n return null;\n return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('\n SELECT `id_seller`\n FROM `'._DB_PREFIX_.'seller_product`\n WHERE `id_product` = '.(int)$id_product);\n }", "public function setSellerProductId(?string $sellerProductId = null): self\n {\n // validation for constraint: string\n if (!is_null($sellerProductId) && !is_string($sellerProductId)) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerProductId, true), gettype($sellerProductId)), __LINE__);\n }\n if (is_null($sellerProductId) || (is_array($sellerProductId) && empty($sellerProductId))) {\n unset($this->SellerProductId);\n } else {\n $this->SellerProductId = $sellerProductId;\n }\n \n return $this;\n }", "public function getSeller()\n {\n return Seller::createFromConfiguration($this->paymentAdapter->getConfiguration());\n }", "public function getOffer($productId, $sellerId);", "public function updateProductSeller($partner_id, $product) {\n\t\t$product_ids = array ();\n\t\t\n\t\tif ($product and is_array ( $product )) {\n\t\t\tforeach ( $product as $individual_product ) {\n\t\t\t\t$product_ids [] = $individual_product ['selected'];\n\t\t\t}\n\t\t} else\n\t\t\t$product_ids [] = $product;\n\t\t\n\t\tforeach ( $product_ids as $product_id ) {\n\t\t\t\n\t\t\t$status = $this->chkProduct ( $product_id, $partner_id );\n\t\t\t\n\t\t\tif ($status == 1) {\n\t\t\t\t$this->db->query ( \"INSERT INTO \" . DB_PREFIX . \"customerpartner_to_product SET product_id = '\" . ( int ) $product_id . \"', customer_id = '\" . ( int ) $partner_id . \"'\" );\n\t\t\t} else {\n\t\t\t\t$this->db->query ( \"UPDATE \" . DB_PREFIX . \"customerpartner_to_product SET customer_id = '\" . ( int ) $partner_id . \"' WHERE product_id = '\" . ( int ) $product_id . \"' ORDER BY id ASC LIMIT 1 \" );\n\t\t\t}\n\t\t}\n\t}", "public static function disableSeller($idSeller){\n Product_Seller::where('id_seller', $idSeller)->update(['status' => Seller::disabled]);\n }", "public function setSellerId($seller_id)\n {\n $this->seller_id = $seller_id;\n\n return $this;\n }", "public function setSellerId($value)\n {\n $this->_fields['SellerId']['FieldValue'] = $value;\n return $this;\n }", "public function getSellerResource()\n {\n return new SellerResource($this->paymentAdapter->getConfiguration(), new Curl());\n }", "public function sellItem($seller){\r\n\t}", "public function show(Seller $seller)\n {\n return $seller;\n }", "public function setSeller(Seller $seller)\n {\n $this->seller = $seller;\n\n return $this;\n }", "public function withSellerId($value)\n {\n $this->setSellerId($value);\n return $this;\n }", "public function getSellerProductId(): ?string\n {\n return isset($this->SellerProductId) ? $this->SellerProductId : null;\n }", "public function getSellerName()\n {\n return $this->seller_name;\n }", "public function getSellerSupplierParty()\n {\n return $this->sellerSupplierParty;\n }", "public function getSellerGroupId()\n {\n return $this->seller_group_id;\n }", "public function destroy(Seller $seller, Product $product)\n {\n $this->checkSeller($seller, $product);\n\n $product->delete();\n\n Storage::delete($product->image); // The Storage Facade ' Storage:: ' will allow us to easily manage files. Specifically in this case we want to delete a file. The delete() method ' ->delete() ' receives the name of the file relatively from the root folder of the image system that we have. It means from the public ' img ' folder. We just need to specify the name of the file, that is basically the value of the ' image ' attribute of the product ie: ' ->delete($product->image) ' . After this the image shall be removed, and then we can remove the instance. Of course we can do in different order, and in this case is basically the same. Maybe you are wondering about that when we using the delete method for the product we are using SoftDeletes, that means the product still existing in the database, so we should not remove permanently the image and you are completely right. But for now, we are just gonna see how to remove definitely the image, and in a future section we are going to see how to differentiate between permanent removal and soft deleting of a product in this case.\n\n return $this->showOne($product);\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public static function sellerHasProduct($id_seller, $id_product)\n {\n $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('\n SELECT `id_seller`\n FROM `'._DB_PREFIX_.'seller_product`\n WHERE `id_seller` = '.(int)$id_seller.'\n AND `id_product` = '.(int)$id_product);\n\n return isset($result);\n }", "public function setSellerSKU($value) \n {\n $this->_fields['SellerSKU']['FieldValue'] = $value;\n return $this;\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function sellerStock()\n {\n \t// belongsTo(RelatedModel, foreignKey = ss_id, keyOnRelatedModel = ss_id)\n \treturn $this->belongsTo('App\\SellerStock','ss_id','ss_id');\n }", "public function isSeller() {\n $response = array (\n 'is_seller' => 1,\n 'msg' => '',\n 'redirect' => '' \n );\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n $customerSession = $objectManager->get ( 'Magento\\Customer\\Model\\Session' );\n if (! $customerSession->isLoggedIn ()) {\n $response = array (\n 'is_seller' => 0,\n 'msg' => 'You must have a Seller Account to access this page',\n 'redirect' => 'marketplace/seller/login' \n );\n } else {\n $customerGroupSession = $objectManager->get ( 'Magento\\Customer\\Model\\Group' );\n $customerGroupData = $customerGroupSession->load ( 'Marketplace Seller', 'customer_group_code' );\n $sellerGroupId = $customerGroupData->getId ();\n \n $currentCustomerGroupId = $customerSession->getCustomerGroupId ();\n \n if ($currentCustomerGroupId != $sellerGroupId) {\n $response = array (\n 'is_seller' => 0,\n 'msg' => 'Admin Approval is required. Please wait until admin confirms your Seller Account',\n 'redirect' => 'marketplace/seller/changebuyer' \n );\n }\n }\n return $response;\n }", "public function show(Seller $seller/*$id*/)\n {\n /*$vendedore = Seller::has('products')->findOrFail($id);\n\n return response()->json(['data'=>$vendedore], 200);*/\n\n return $this->showOne($seller);\n }", "public function setSellerName($seller_name)\n {\n $this->seller_name = $seller_name;\n\n return $this;\n }", "public function setSellerGroupId($seller_group_id)\n {\n $this->seller_group_id = $seller_group_id;\n\n return $this;\n }", "public function setSellerID($sellerID)\n {\n $this->sellerID = $sellerID;\n return $this;\n }", "public function postedBy()\n {\n return $this->belongsTo('App\\User','seller_id');\n }", "public function updated(Seller $seller)\n {\n\n }", "public function getSellerOffers($sellerId);", "public function show(seller $seller)\n {\n //\n }", "public function isSeller(){\n\t\t\tif ($this->config->get('module_purpletree_multivendor_status')) {\n\t\t$query = $this->db->query(\"SELECT id, store_status, multi_store_id, is_removed FROM \" . DB_PREFIX . \"purpletree_vendor_stores where seller_id='\".$this->customer_id.\"'\");\n\t\treturn $query->row;\n\t}\n\t}", "public function sellerStock()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\SellerStock','sp_id','sp_id');\n }", "public function setSellerUserName($sellerUserName)\n {\n $this->sellerUserName = $sellerUserName;\n return $this;\n }", "public function withSellerSKU($value)\n {\n $this->setSellerSKU($value);\n return $this;\n }", "public function show(Seller $seller)\n {\n return $this->showOne($seller);\n\n }", "public function sku()\n {\n return $this->belongsTo(Productos::class, 'fk_id_sku', 'id_sku');\n }", "public function verificarVendedor(Seller $seller,Product $product){\n if($seller->id !=$product->seller_id){\n //disparamos una excepcion\n throw new HttpException(422,'El vendedor especificado real no es el vendedor del producto');\n\n }\n }", "public function destroy(seller $seller)\n {\n //\n }", "public function verificarVendedor(Seller $seller, Product $product)\n {\n if($seller->id != $product->seller_id)\n {\n throw new HttpException(422,\n 'Vendedor solicitante no es el vendedor del producto');\n }\n }", "public function vendor()\n {\n // A product can only belong to one vendor\n return $this->belongs_to('Vendor');\n }", "PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function getSellerField()\n {\n $sellerId = $this->getProductSeller();\n return [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Select Seller'),\n 'componentType' => Field::NAME,\n 'formElement' => Select::NAME,\n 'dataScope' => 'seller_id',\n 'dataType' => Text::NAME,\n 'sortOrder' => 10,\n 'options' => $this->helper->getSellerList(),\n 'value' => $sellerId,\n 'disabled' => $sellerId ? true : false\n ],\n ],\n ],\n ];\n }", "public function setDistriSellerName($distri_seller_name)\n {\n $this->distri_seller_name = $distri_seller_name;\n\n return $this;\n }", "public function seller($value)\n {\n $this->setProperty('seller', $value);\n return $this;\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class, 'id_product', 'id_product');\n }", "public function store(Request $request, User $seller)\n {\n //crear instancias de producto a vendedor/usuario especifico\n $reglas = [\n 'name' => 'required', \n 'description' => 'required',\n 'quantity' => 'required|integer|min:1',\n 'image' => 'required|image'\n ];\n\n $this->validate($request,$reglas);\n\n $data = $request->all();\n $data['status'] = product::PRODUCTO_NO_DISPONIBLE;\n\n /**\n * la imagen vendra directamente de la peticion y laravel sabrá que este es un arcivo\n * el metodo store('ubicacion','sistema de archivos')\n * se creará nombre aleatorio y unico a la imagen\n */\n $data['image'] = $request->image->store('');\n\n $data['seller_id'] = $seller->id;\n\n $product = Product::create($data);\n\n return $this->showOne($product,201);\n\n }", "public function destroy(Seller $seller,Product $product)\n {\n //\n $this->verificarVendedor($seller,$product);\n //para eliminar la imagen del producto vamos a usar el facade storage\n //como ya esta por defecto el sistema d archivos images no hace falta ponerlo\n Storage::delete($product->image);\n $product->delete();\n\n return $this->showOne($product);\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function product() : BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function destroy(Seller $seller, Product $product)\n {\n //verificar que el vendedor es el propietario del producto\n $this->verificarVendedor($seller,$product);\n $product->delete();\n \n //eliminar imagen junto con el producto\n //Storage permite interactuar con el sistem de archivos\n Storage::delete($product->image);\n\n return $this->showOne($product);\n }", "public function eventNotifySeller() {\r\n /**\r\n * Date calculation, Current date and Previous date\r\n */\r\n $currentDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(time()));\r\n $previousDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(strtotime($currentDate . ' -1 day')));\r\n\r\n // Getting all seller ID's whose products updated in from yesterday\r\n\r\n $_sellerCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToSelect('seller_id')\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->groupByAttribute('seller_id')\r\n ->load();\r\n\r\n foreach ($_sellerCollection as $_seller) {\r\n $sellerId = $_seller->getSellerId();\r\n $products = \"\";\r\n\r\n //Loading seller product collection\r\n $_productCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToFilter('seller_id', $_seller->getSellerId())\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->addAttributeToSelect('*')\r\n ->load();\r\n\r\n $i = 1;\r\n foreach ($_productCollection as $_product) {\r\n $small_image = Mage::helper('catalog/image')->init($_product, 'small_image')->resize(51, 68);\r\n $products .= '<tr>';\r\n $products .= '<td style=\"text-align:center; margin:0 0 10px; vertical-align:middle; padding:0 0 10px;\">' . $i . '</td>';\r\n $products .= '<td style=\"text-align:center; padding:0 0 20px;\"><img src=' . $small_image . ' alt=' . $_product->getName() . ' /></td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getName() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getSku() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('seller_product_status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;;\">' . $_product->getPrice() . '</td>';\r\n $products .= '</tr>';\r\n\r\n $i++;\r\n }\r\n $templateId = 9;\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templateId);\r\n\r\n //Getting seller information\r\n\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n\r\n // Setting up default sender information\r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n // Setting email variables\r\n $emailTemplateVariablesValue = (array(\r\n 'sellername' => $sellerName,\r\n 'products' => $products,\r\n 'seller_store' => $sellerStore,\r\n ));\r\n\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n\r\n /**\r\n * Send email to the seller\r\n */\r\n $emailTemplate->send($sellerEmail, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }", "public function getproductlistofseller($sellerid) {\t\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required')); \t\n\t\t}\n\t\telse{\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t \n\t\t//Select Data from table\n\t\t//$sql3 = \"Select * FROM marketplace_product where seller_id=$sellerid\";\n\t\t$sql3 = \"Select * FROM marketplace_product a, catalog_product_entity b \n\t\twhere \n\t\ta.mageproduct_id=b.entity_id and \n\t\ta.seller_id=$sellerid and \n\t\tb.type_id!='customProductType' \";\n\t\t$result3 = $connection->fetchAll($sql3);\n\t\t$result4='';\n\t\t\n\t\tforeach($result3 as $data)\n\t\t{\n\t\t\t \n\t\t\t $productId =$data['mageproduct_id'];\n\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$offfer_tag = $currentproduct->getData('offfer_tag');\n\t\t\t\t\t$attr = $currentproduct->getResource()->getAttribute('offfer_tag');\n\t\t\t\t\t\n\t\t\t\t\t $optionText =$attr->getSource()->getOptionText($offfer_tag);\n\t\t\t\n\t\t\t\tif($optionText=='')\n\t\t\t\t{\n\t\t\t\t\t$optionText='null';\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t $_price=$currentproduct->getPrice();\n\t\t\t\t $_finalPrice=$currentproduct->getFinalPrice();\n\t\t\t\t\t $savetag='null';\n\t\t\t\t\t\tif($_finalPrice < $_price):\n\t\t\t\t\t\t$_savePercent = 100 - round(($_finalPrice / $_price)*100);\n\t\t\t\t\t\t//echo $_savePercent;\n\t\t\t\t\t\t$savetag=$_savePercent;\n endif;\n\n\t\t\t\t $producturl=$currentproduct->getProductUrl();\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $sql_wishlist = \"Select * FROM wishlist a ,wishlist_item b where a.customer_id=$sellerid and a.wishlist_id=b.wishlist_id and b.product_id=$productId \";\n\t\t $result_wishlist = $connection->fetchAll($sql_wishlist);\n\t\t\t\t /* $wish='';\n\t\t\t\t if(!empty($result_wishlist))\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>1); \n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>0);\n\t\t\t\t } */\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $reviewFactory = $objectManager->create('Magento\\Review\\Model\\Review');\n\t\t\t\t $storeId = $this->storeManager->getStore()->getId();\n $reviewFactory->getEntitySummary($currentproduct, $storeId);\n\t\t\t\t $ratingSummary = $currentproduct->getRatingSummary()->getRatingSummary();\n\t\t\t\t if($ratingSummary=='')\n\t\t\t\t{\n\t\t\t\t\t$ratingSummary='null';\n\t\t\t\t}\n\t\t\t\t //print_r($ratingSummary);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"description\"=>$currentproduct->getDescription(),\"price\"=>$currentproduct->getPrice(),\"finalPrice\"=>$currentproduct->getFinalPrice(),\"thumbnail\"=>'http://159.203.151.92/pub/media/catalog/product'.$currentproduct->getthumbnail(),\"offferTag\"=>array(\"shareurl\"=>$producturl,\"Tag\"=>$optionText,'discount'=>$savetag,'rating'=>$ratingSummary));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t \n\t\t} \n\t\t\n\t\treturn $result4;\n\t\t\n }\n\t }", "public function getDistriSellerName()\n {\n return $this->distri_seller_name;\n }", "public function add_seller_id_meta( $booking_id ) {\n $product_id = get_post_meta( $booking_id, '_booking_product_id', true );\n $seller_id = get_post_field( 'post_author', $product_id );\n update_post_meta( $booking_id, '_booking_seller_id', $seller_id );\n }", "public function sellerSales()\n {\n return $this->hasMany('App\\Domains\\Sale\\Sale');\n }", "public function index() {\r\n\r\n $data['total_sellers_alive'] = $this->seller_model->get_total_number_of_sellers(array(\"tag\" => SellerTags::$available));\r\n\r\n if ($this->input->get('product_id')) {\r\n // it means now we will have to mention sellers who\r\n // sell the product having this product_id\r\n $product_id = $this->input->get('product_id');\r\n $data['fetch_json_link'] = URL_X . 'Seller/index_json?product_id=' . $product_id;\r\n //lets fetch that product_details\r\n $this->load->model('product_model');\r\n $r = $this->product_model->get_one_product($product_id);\r\n $product_name = $r[0]->product_name;\r\n $product_brand = $r[0]->product_brand;\r\n $data['label'] = \"Sellers who sell the Product : \" . $product_name . \"- \"\r\n . \"<small>Brand: \" . $product_brand . '</small>';\r\n //set a different label for the add button\r\n $data['addButtonLabel'] = \"Attach a seller to this product\";\r\n $data['add_link'] = URL_X . 'Product_seller_mapping/add_new_seller_to_a_product/' . $product_id;\r\n //we are dealing with a mapping so edit link will not be present\r\n $data['delete_link'] = URL_X . 'Product_seller_mapping/delete_a_mapping/';\r\n } else {\r\n // full seller list page\r\n $data['edit_link'] = URL_X . 'Seller/edit/';\r\n $data['delete_link'] = URL_X . 'Seller/delete/';\r\n $data['fetch_json_link'] = URL_X . 'Seller/index_json';\r\n $data['label'] = \"All sellers\";\r\n $data['addButtonLabel'] = \"Add a seller to system\";\r\n $data['add_link'] = URL_X . 'Seller/add_new/';\r\n }\r\n $this->load->view(\"template/header\", $this->activation_model->get_activation_data());\r\n $this->load->view(\"seller/list_all_sellers\", $data);\r\n $this->load->view(\"template/footer\");\r\n }", "public function getSellerSKU() \n {\n return $this->_fields['SellerSKU']['FieldValue'];\n }", "public function getSellerContact()\n {\n return $this->sellerContact;\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function getLikesByProductId($sellerId,$productId);", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "function getSeller($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/seller/id/'.(int)$params['id'].'.json'),true);\n\t}", "public function update(Request $request, Seller $seller, Product $product)\n {\n //validando integridad del vendedor\n $this->verificarVendedor($seller,$product);\n\n $rules = [\n 'quantity' => 'integer|min:1',\n 'image' => 'image',\n 'status' => 'in:' . Product::PRODUCTO_DISPONIBLE .',' . Product::PRODUCTO_NO_DISPONIBLE\n ];\n\n $this->validate($request,$rules);\n\n //lenar primeras instancias de la actualizacion\n $product->fill(array_filter($request->only('name','description','quantity')));\n\n if($request->has('status')){\n $product->status = $request->status;\n\n if($product->estaDisponible() && $product->categories()->count() == 0){\n return $this->errorResponse('Producto activo debe tener al menos una categoria',409);\n }\n }\n\n if($request->hasFile('image')){\n //eliminar imagen junto con el producto\n //Storage permite interactuar con el sistem de archivos\n Storage::delete($product->image); \n $product->image = $request->image->store('');\n }\n\n if(!$product->isDirty()){\n return $this->errorResponse('se debe especificar al menos un valor diferente para actualizar',422);\n } \n \n $product->save();\n\n return $this->showOne($product);\n }", "public function addProduct($post, $codes): array\n {\n // Load models\n $sellerProductsModel = model('App\\Models\\SellerProductsModel');\n $productsModel = model('App\\Models\\ProductsModel');\n \n // Start transaction\n $sellerProductsModel->startTransaction();\n \n // Find the product by the code identifier\n $product = $productsModel\n ->where('CodeIdentifier', $post['CodeIdentifier'])\n ->find();\n \n // Check if the product exists\n if (!$product) {\n // Set vars\n $productToSave = $post;\n \n // Remove field\n unset($productToSave['SellerId']);\n \n // Save product\n $productsModel->insert($post);\n \n // Set vars\n $dbErrors = $productsModel->db->error();\n \n // Check for db errors\n if ($dbErrors['code'] != 0) {\n // Return error\n return $this->dbError();\n }\n \n // Get last id\n $product = ['Id' => $productsModel->getInsertID()];\n } else {\n $product = $product[0];\n }\n \n // Find seller\n $seller = $this->find($post['SellerId']);\n \n // Check if there are any sellers\n if (!$seller) {\n // Return error\n return $this->dbError(\n 'SellerId not found.',\n $codes['resource_not_found']\n );\n }\n \n // Set vars\n $sellerProductIds = [\n 'SellerId' => $post['SellerId'],\n 'ProductId' => $product['Id'],\n ];\n \n // Find seller/product\n $sellerProduct = $sellerProductsModel\n ->where($sellerProductIds)\n ->find();\n \n // Check if there's any existing seller/product\n if ($sellerProduct) {\n // Return error\n return $this->dbError(\n 'The provided product already exists for the provided seller in the database.',\n $codes['conflict']\n );\n }\n \n // Save the SellerProduct\n $sellerProductsModel->insert($sellerProductIds);\n \n // Set vars\n $dbErrors = $sellerProductsModel->db->error();\n \n // Check for db errors\n if ($dbErrors['code'] != 0) {\n // Return error\n return $this->dbError();\n }\n \n // End transaction\n $sellerProductsModel->endTransaction();\n \n // Return success\n return $this->success(\n array_merge($sellerProductIds, ['Id' => $sellerProductsModel->getInsertID()]),\n $codes['created']\n );\n }", "function getSellerProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/seller/'.(int)$params['seller_id'].'/product.json',$params),true);\n\t}", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function distributors()\n {\n return $this->belongsTo('App\\Distributor', 'distributor_id');\n }", "function save( $seller_id = false ) {\n\t\t// prepare user object and permission objects\n\t\t$seller_data = array();\n\n\t\t// save username\n\t\tif ( $this->has_data( 'seller_name' )) {\n\t\t\t$seller_data['seller_name'] = $this->get_data( 'seller_name' );\n\t\t}\n\n\t\t\n\t\tif( $this->has_data( 'seller_email' )) {\n\t\t\t$seller_data['seller_email'] = $this->get_data( 'seller_email' );\n\t\t}\n\t\t\n\t\tif( $this->has_data( 'seller_phone' )) {\n\t\t\t$seller_data['seller_phone'] = $this->get_data( 'seller_phone' );\n\t\t}\n\n\n\t\t// user_address\n\t\tif ( $this->has_data( 'seller_address' )) {\n\t\t\t$seller_data['seller_address'] = $this->get_data( 'seller_address' );\n\t\t}\n\n\t\t// save city\n\t\tif( $this->has_data( 'city' )) {\n\t\t\t$seller_data['city'] = $this->get_data( 'city' );\n\t\t}\n\n\t\t// save user_about_me\n\t\tif( $this->has_data( 'seller_about_me' )) {\n\t\t\t$seller_data['seller_about_me'] = $this->get_data( 'seller_about_me' );\n\t\t}\n\n\t\t// $permissions = ( $this->get_data( 'permissions' ) != false )? $this->get_data( 'permissions' ): array();\n\n\t\t// save data\n\t\t// print_r($user_data);die;\n\t\tif ( ! $this->Seller->save( $seller_data, $seller_id )) {\n\t\t// if there is an error in inserting user data,\t\n\n\t\t\t$this->set_flash_msg( 'error', get_msg( 'err_model' ));\n\t\t} else {\n\t\t// if no eror in inserting\n\n\t\t\tif ( $seller_id ) {\n\t\t\t// if user id is not false, show success_add message\n\t\t\t\t\n\t\t\t\t$this->set_flash_msg( 'success', get_msg( 'success_user_edit' ));\n\t\t\t} else {\n\t\t\t// if user id is false, show success_edit message\n\n\t\t\t\t$this->set_flash_msg( 'success', get_msg( 'success_user_add' ));\n\t\t\t}\n\t\t}\n\n\t\tredirect( $this->module_site_url());\n\t}", "public function getSource()\n {\n return 'seller';\n }", "public function buyer()\n {\n return $this->belongsTo('Buyer');\n }", "public function getSellerUserName()\n {\n return $this->sellerUserName;\n }", "public function buyer()\n {\n return $this->belongsTo('App\\Buyer');\n }", "function createSeller($params = array()){\n\t\t\n\t\t//echo json_encode($params['data']); die();\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::POST , '/multivendor/seller/seller.json' , false, $params['data'] ),true);\n\t}", "public function edit(seller $seller)\n {\n //\n }", "public function _construct()\n {\n $this->_init('seller/seller', 'seller_id');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function product()\n {\n return $this->belongsTo('Laracart\\Product\\Models\\Product', 'product_id');\n\n }", "public function insertSellerId()\n {\n $font_options = $this->getFontOptions();\n\n $this->sticker->text('ID: ' . $this->getSellerId(), $this->textXPosition, $this->textYPosition, function ($font) use ($font_options) {\n $font->file($font_options['file']);\n $font->color($font_options['color']);\n $font->size($font_options['size']);\n $font->align($font_options['align']);\n $font->valign($font_options['valign']);\n });\n\n return $this;\n }" ]
[ "0.76885915", "0.70231384", "0.6939045", "0.68660647", "0.68286306", "0.6785571", "0.67297745", "0.6599494", "0.65921324", "0.65291524", "0.648267", "0.64638203", "0.6338788", "0.61888975", "0.6186552", "0.6159727", "0.61529756", "0.6141431", "0.605049", "0.60227716", "0.59463024", "0.5902602", "0.5901981", "0.5882282", "0.5862754", "0.58563477", "0.5852548", "0.58422905", "0.5829699", "0.58046126", "0.57556397", "0.57528406", "0.5749178", "0.5713925", "0.57108694", "0.5704224", "0.5675505", "0.56720316", "0.56670284", "0.56545633", "0.56503695", "0.56472427", "0.5613805", "0.5589042", "0.55831623", "0.5582888", "0.5580121", "0.5546946", "0.54958683", "0.5477611", "0.5465108", "0.5452347", "0.5398765", "0.53966975", "0.53944063", "0.53911227", "0.5378708", "0.5368558", "0.536744", "0.5361934", "0.53557634", "0.53408474", "0.5325037", "0.53249186", "0.5289271", "0.5285883", "0.52802247", "0.5277295", "0.5258935", "0.5258665", "0.52537036", "0.5250404", "0.5248845", "0.52474517", "0.5232797", "0.5211581", "0.5208038", "0.5207781", "0.51896703", "0.517238", "0.5167494", "0.5165562", "0.5165086", "0.5155146", "0.51474184", "0.51436263", "0.51401854", "0.513569", "0.51345783", "0.51241356", "0.5107255", "0.5104042", "0.5101314", "0.50976837", "0.5096038", "0.5093818", "0.5093224", "0.5068718", "0.50638986", "0.506085" ]
0.698092
2
SellerProduct belongs to Product.
public function product() { // belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id) return $this->belongsTo('App\Product','p_id','p_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function getProductSeller()\n {\n $product = $this->coreRegistry->registry('product');\n $productId = $product->getId();\n $sellerId = $this->helper->getSellerIdByProductId($productId);\n return $sellerId;\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class, 'id_product', 'id_product');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function product() : BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = from_seller_id, keyOnRelatedModel = seller_id)\n \treturn $this->belongsTo('App\\Seller','from_seller_id','seller_id');\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = seller_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Seller','seller_id','seller_id');\n }", "public static function getSellerByProduct($id_product) {\n if (empty($id_product))\n return null;\n return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('\n SELECT `id_seller`\n FROM `'._DB_PREFIX_.'seller_product`\n WHERE `id_product` = '.(int)$id_product);\n }", "public function updateProductSeller($partner_id, $product) {\n\t\t$product_ids = array ();\n\t\t\n\t\tif ($product and is_array ( $product )) {\n\t\t\tforeach ( $product as $individual_product ) {\n\t\t\t\t$product_ids [] = $individual_product ['selected'];\n\t\t\t}\n\t\t} else\n\t\t\t$product_ids [] = $product;\n\t\t\n\t\tforeach ( $product_ids as $product_id ) {\n\t\t\t\n\t\t\t$status = $this->chkProduct ( $product_id, $partner_id );\n\t\t\t\n\t\t\tif ($status == 1) {\n\t\t\t\t$this->db->query ( \"INSERT INTO \" . DB_PREFIX . \"customerpartner_to_product SET product_id = '\" . ( int ) $product_id . \"', customer_id = '\" . ( int ) $partner_id . \"'\" );\n\t\t\t} else {\n\t\t\t\t$this->db->query ( \"UPDATE \" . DB_PREFIX . \"customerpartner_to_product SET customer_id = '\" . ( int ) $partner_id . \"' WHERE product_id = '\" . ( int ) $product_id . \"' ORDER BY id ASC LIMIT 1 \" );\n\t\t\t}\n\t\t}\n\t}", "public function product()\n {\n return $this->belongsTo('Laracart\\Product\\Models\\Product', 'product_id');\n\n }", "public function setProduct(Product $product);", "public function product()\n {\n return $this->belongsTo('Modules\\Admin\\Models\\Product','product_id','id');\n }", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function seller(){\n return $this->belongsTo(Seller::class);\n }", "public function product()\n {\n // belongsTo(RelatedModel, foreignKey = product_id, keyOnRelatedModel = id)\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::Class());\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id');\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n\n }", "public function product()\n {\n return $this->belongsTo( Product::class );\n }", "public function product(){\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(Product::class, $this->primaryKey);\n\t}", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function product()\n {\n return $this->belongsTo(BaseProduct::class);\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function product(){\n\n return $this->belongsTo(Product::class);\n\n }", "public function product() \n\t{\n\t\treturn $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n\t}", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function seller()\n {\n return $this->belongsTo(SellerProxy::modelClass(), 'seller_id');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(config('laravel-inventory.product'));\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo('Tricks\\Product');\n\t}", "public function product()\n {\n return $this->belongsTo('App\\Product', 'product_id');\n }", "public function product()\n {\n return $this->belongsTo('App\\Product');\n }", "public function product()\n {\n return $this->belongsTo('App\\Product');\n }", "public function Product()\n\t{\n\t\treturn $this->belongsTo('App\\Product');\n\t}", "public function product()\n {\n \treturn $this->belongsTo(Product::class);\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function product()\n {\n return $this->belongsTo('App\\Product');\n\t}", "public function getSellerId()\n {\n return $this->seller_id;\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function setSellerProductId(?string $sellerProductId = null): self\n {\n // validation for constraint: string\n if (!is_null($sellerProductId) && !is_string($sellerProductId)) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerProductId, true), gettype($sellerProductId)), __LINE__);\n }\n if (is_null($sellerProductId) || (is_array($sellerProductId) && empty($sellerProductId))) {\n unset($this->SellerProductId);\n } else {\n $this->SellerProductId = $sellerProductId;\n }\n \n return $this;\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function product()\n {\n return $this->belongsTo('\\App\\Product');\n }", "public function seller()\n {\n return $this->belongsTo(User::class, 'seller_id');\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Product', 'n_ProductId_FK')->withDefault();\n }", "public function _getProduct() {\n \n // get website id from request\n $websiteId = ( int ) $this->getRequest ()->getParam ( static::WEBSITE_ID );\n if ($websiteId <= 0) {\n $websiteId = Mage::app ()->getWebsite ( 'base' )->getId ();\n }\n \n // get store id from request\n $storeId = ( int ) $this->getRequest ()->getParam ( static::STORE_ID );\n if ($storeId <= 0) {\n $storeId = Mage::app ()->getWebsite ( $websiteId )->getDefaultGroup ()->getDefaultStoreId ();\n }\n if (is_null ( $this->_product )) {\n $productId = $this->getRequest ()->getParam ( 'id' );\n /**\n *\n * @var $productHelper Mage_Catalog_Helper_Product\n */\n $productHelper = Mage::helper ( 'catalog/product' );\n $product = $productHelper->getProduct ( $productId, $storeId );\n if (! ($product->getId ())) {\n $this->_critical ( static::RESOURCE_NOT_FOUND );\n }\n // check if product belongs to website current\n if ($this->_getStore ()->getId ()) {\n $isValidWebsite = in_array ( $websiteId, $product->getWebsiteIds () );\n if (! $isValidWebsite) {\n $this->_critical ( static::RESOURCE_NOT_FOUND );\n }\n }\n // Check display settings for customers & guests\n if ($this->getApiUser ()->getType () != Mage_Api2_Model_Auth_User_Admin::USER_TYPE) {\n // check if product assigned to any website and can be shown\n if ((! Mage::app ()->isSingleStoreMode () && ! count ( $product->getWebsiteIds () )) || ! $productHelper->canShow ( $product )) {\n $this->_critical ( static::RESOURCE_NOT_FOUND );\n }\n }\n $this->_product = $product;\n }\n return $this->_product;\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function getOffer($productId, $sellerId);", "public function destroy(Seller $seller, Product $product)\n {\n $this->checkSeller($seller, $product);\n\n $product->delete();\n\n Storage::delete($product->image); // The Storage Facade ' Storage:: ' will allow us to easily manage files. Specifically in this case we want to delete a file. The delete() method ' ->delete() ' receives the name of the file relatively from the root folder of the image system that we have. It means from the public ' img ' folder. We just need to specify the name of the file, that is basically the value of the ' image ' attribute of the product ie: ' ->delete($product->image) ' . After this the image shall be removed, and then we can remove the instance. Of course we can do in different order, and in this case is basically the same. Maybe you are wondering about that when we using the delete method for the product we are using SoftDeletes, that means the product still existing in the database, so we should not remove permanently the image and you are completely right. But for now, we are just gonna see how to remove definitely the image, and in a future section we are going to see how to differentiate between permanent removal and soft deleting of a product in this case.\n\n return $this->showOne($product);\n }", "public function getOfferSellerId()\n {\n return $this->offer_seller_id;\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function eventProduct()\n {\n return $this->belongsTo(\\App\\Models\\EventProduct::class, 'event_product_id');\n }", "public function products()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function getSellerId()\n {\n return $this->driver->seller_id;\n }", "public function product_user()\n {\n return $this->belongsTo(Product_user::class);\n }", "public function product()\n {\n return $this->belongsTo(config('inventory.models.product-variant'), 'product_variant_id');\n }", "public function wishlist_products()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function vendor()\n {\n // A product can only belong to one vendor\n return $this->belongs_to('Vendor');\n }", "public function producteur()\n {\n return $this->belongsTo(Producteur::class, 'id_producteur', 'id_producteur');\n }", "public function producto() {\n return $this->belongsTo(Producto::class);\n }", "public function products()\n\t{\n\t\treturn $this->belongsTo(Product::class);\n\t}", "public function seller()\n {\n return $this->morphTo(__FUNCTION__, 'seller_type', 'seller_id');\n }", "public function product()\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function sku()\n {\n return $this->belongsTo(Productos::class, 'fk_id_sku', 'id_sku');\n }", "public function products()\n {\n return $this->belongsTo('App\\Product', 'product_id');\n }", "public function getSellerID()\n {\n return $this->sellerID;\n }", "public function owner()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Products\\Models\\Product', 'product_id');\n }", "public function owner()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Products\\Models\\Product', 'product_id');\n }", "private function getProductModel() {\n if ($this->_productModel == NULL) {\n $this->_productModel = new Product();\n }\n return $this->_productModel;\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function producto(){\n return $this->belongsTo(Producto::class);\n }", "public function getProductId(){\n return $this->product_id;\n }", "public function getProduct_Id() {\n return $this->product_Id;\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function order_product(){\n return $this->hasOne(Order_product::class);\n }", "public function destroy(Seller $seller,Product $product)\n {\n //\n $this->verificarVendedor($seller,$product);\n //para eliminar la imagen del producto vamos a usar el facade storage\n //como ya esta por defecto el sistema d archivos images no hace falta ponerlo\n Storage::delete($product->image);\n $product->delete();\n\n return $this->showOne($product);\n }", "public function getSellerObject($id)\n {\n if ($sellerDetail = WkMpSeller::getSellerDetailByCustomerId($id)) {\n return $this->obj_seller = new WkMpSeller($sellerDetail['id_seller'], $this->context->language->id);\n }\n\n return false;\n }", "public function category_product()\n {\n return $this->belongsTo(Category_product::class);\n }", "public function getProduct()\r\n {\r\n return $this->product;\r\n }", "private function createVendorProduct(Product $product): VendorProduct\n {\n $vendorProduct = $product->vendorProducts()->create($this->vendorProductData);\n\n // insert vendor product stocks\n $this->attachVendorProductStocks($vendorProduct);\n\n return $vendorProduct;\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }" ]
[ "0.7453941", "0.6631913", "0.6611017", "0.6529833", "0.65122765", "0.6504716", "0.64855886", "0.6444062", "0.64420587", "0.6398855", "0.639708", "0.6349959", "0.6334471", "0.6326802", "0.63217384", "0.6319928", "0.6315557", "0.63107675", "0.6293553", "0.6270387", "0.62570566", "0.6256629", "0.6256629", "0.6256629", "0.6256629", "0.6217423", "0.6200813", "0.6197124", "0.61957043", "0.6187049", "0.6175666", "0.61731005", "0.617237", "0.616944", "0.616944", "0.616944", "0.616944", "0.61685693", "0.61642486", "0.61629844", "0.6162522", "0.6146794", "0.6146794", "0.6146794", "0.6143723", "0.6139986", "0.6131466", "0.6131288", "0.6107845", "0.6107845", "0.61023265", "0.6099144", "0.60869116", "0.60773605", "0.60771775", "0.6064683", "0.60601157", "0.60567486", "0.6040989", "0.60159844", "0.60033524", "0.60025644", "0.60025644", "0.595115", "0.59472656", "0.59404373", "0.59364885", "0.59246457", "0.59119886", "0.58882993", "0.5868312", "0.5865695", "0.58618575", "0.5845128", "0.5843642", "0.58276814", "0.58044136", "0.57646775", "0.5761488", "0.57579255", "0.5749737", "0.57374245", "0.5735708", "0.57344913", "0.5730178", "0.5699808", "0.5699808", "0.56679446", "0.56607187", "0.56598157", "0.5653915", "0.5648542", "0.5646184", "0.56461155", "0.5643659", "0.56375855", "0.5630749", "0.5629624", "0.56290543", "0.56194115" ]
0.61258805
48
SellerProduct has many Offers.
public function offers() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\Offer','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function offers()\n {\n return $this->hasMany('\\App\\Offer');\n }", "public function offer()\n {\n return $this->hasMany('App\\Models\\Offer');\n }", "public function offers() {\n return $this->hasMany('Rockit\\Models\\Offer');\n }", "public function getSellerOffers($sellerId);", "public function getOffer($productId, $sellerId);", "public function offermade($sellerId, $offerId){\n try{\n $response = array();\n $offerModel = $this->_offerFactory->create();\n $store = $this->_storemanager->getStore();\n $offerCollection = $offerModel->getCollection()\n ->addFieldToFilter('buyer_id', array('eq' => $sellerId))\n ->addFieldToFilter('id', array('eq' => $offerId))\n //->addFieldToFilter('expired', array('eq' => '0'))\n //->addFieldToFilter('offer_used', array('eq' => '1'))\n ;\n $offerCollection->getSelect()->where(\"offer_used = '1' OR status = 'counter_offer'\");\n if($offerCollection->getSize() > 0){\n $products = array();\n $offer = $offerCollection->getFirstItem();\n\n $response = $offer->getData();\n $productIds = explode(\",\",$offer->getProductId());\n foreach($productIds as $productId){\n $product = $this->_productModel->load($productId);\n $eachProduct = array();\n $eachProduct['productId'] = $product->getId();\n $eachProduct['name'] = $product->getName();\n $eachProduct['description'] = $product->getDescription();\n $eachProduct['price'] = $product->getPriceInfo()->getPrice('regular_price')->getValue();\n $eachProduct['imageUrl'] = $store->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();\n\n $eachProduct['productUrl'] = $product->getProductUrl();\n\n array_push($products, $eachProduct);\n }\n\n $partner = $this->_marketplacehelper->getSellerDataBySellerId($offer->getSellerId())->getFirstItem();\n\n if ($partner->getLogoPic()) {\n $logoPic = $this->_marketplacehelper->getMediaUrl().'avatar/'.$partner->getLogoPic();\n } else {\n $logoPic = $this->_marketplacehelper->getMediaUrl().'avatar/noimage.png';\n }\n $shopUrl = $this->_marketplacehelper->getRewriteUrl(\n 'marketplace/seller/collection/shop/'.\n $partner->getShopUrl()\n );\n $response['products'] = $products;\n $response['seller']['firstname'] = $partner->getFirstname();\n $response['seller']['lastname'] = $partner->getLastname();\n $response['seller']['email'] = $partner->getEmail();\n $response['seller']['logo_image'] = $logoPic;\n\n $response['seller']['username'] = $partner->getShopUrl();\n $response['seller']['shopUrl'] = $shopUrl;\n }\n\n return $this->getResponseFormat($response);\n } catch(\\Exception $e) {\n return $this->errorMessage($e);\n }\n }", "public function offerreceivedbyid($sellerId, $offerId){\n try{\n $response = array();\n $response['products'] = array();\n $response['buyer'] = array();\n $offerModel = $this->_offerFactory->create();\n $store = $this->_storemanager->getStore();\n $offerCollection = $offerModel->getCollection()\n ->addFieldToFilter('seller_id', array('eq' => $sellerId))\n ->addFieldToFilter('product_id', array('eq' => $offerId))\n //->addFieldToFilter('expired', array('eq' => '0'))\n //->addFieldToFilter('offer_used', array('eq' => '1'))\n ;\n $offerCollection->getSelect()->where(\"(offer_used = '1' OR status = 'counter_offer') AND status != 'counter' \");\n\n\n if($offerCollection->getSize() > 0){\n $productsArray = array();\n\n\n $productData = array();\n $product = $this->_productModel->load($offerId);\n $productData['name'] = $product->getName();\n $productData['description'] = $product->getDescription();\n $productData['original_price'] = $product->getCost();\n $productData['price'] = $product->getPriceInfo()->getPrice('regular_price')->getValue();\n $productData['imageUrl'] = $store->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();\n\n $productData['productUrl'] = $product->getProductUrl();\n\n array_push($productsArray, $productData);\n\n $buyerCollection = $offerModel->getCollection()\n ->addFieldToFilter('main_table.seller_id', array('eq' => $sellerId))\n ->addFieldToFilter('product_id', array('eq' => $offerId))\n //->addFieldToFilter('offer_used', array('eq' => '1'))\n ;\n $buyerCollection->getSelect()->where(\"(offer_used = '1' OR status = 'counter_offer') AND status != 'counter'\");\n $joinTable = $this->_objectManager->create(\n 'Webkul\\Agorae\\Model\\ResourceModel\\Mpfavouriteseller\\Collection'\n )->getTable('customer_entity');\n\n $buyerCollection->getSelect()->join(\n $joinTable.' as cgf',\n 'main_table.buyer_id = cgf.entity_id',\n array('firstname','lastname')\n );\n\n $sellerjoinTable = $this->_objectManager->create(\n 'Webkul\\Agorae\\Model\\ResourceModel\\Mpfavouriteseller\\Collection'\n )->getTable('marketplace_userdata');\n\n $buyerCollection->getSelect()->joinLeft(\n $sellerjoinTable.' as sgf',\n 'main_table.buyer_id = sgf.seller_id',\n array('shop_url as username')\n );\n $buyerCollection->setOrder(\"offer_amount\", \"desc\");\n\n\n\n $allBuyers = array();\n foreach ($buyerCollection as $eachBuyer) {\n $partner = $this->_marketplacehelper->getSellerDataBySellerId($eachBuyer->getBuyerId())->getFirstItem();\n $eachBuyerArray = array();\n $eachBuyerArray = $eachBuyer->getData();\n\n $now = date('Y-m-d H:i:s');\n $expiredDate = $this->offerhelper->getExpiredDate($eachBuyerArray['created_at']);\n $t1 = strtotime( $expiredDate );\n $t2 = strtotime($now);\n\n $diff = $t1 - $t2;\n $hours = $diff / ( 60 * 60 );\n\n if($hours > 0){\n $status = $eachBuyerArray['status'];\n }else{\n $status = \"expired\";\n }\n $eachBuyerArray['status'] = $status;\n $eachBuyerArray['shop_url'] =\"\";\n if($partner->getId()){\n $eachBuyerArray['shop_url'] = $this->_marketplacehelper->getRewriteUrl(\n 'marketplace/seller/collection/shop/'.\n $partner->getShopUrl()\n );\n }\n\n $eachBuyerArray['expired_at'] = $this->offerhelper->getExpiredDate($eachBuyer->getCreatedAt());\n\n\n array_push($allBuyers, $eachBuyerArray);\n }\n\n\n $response['products'] = $productsArray;\n $response['buyer'] = $allBuyers;\n\n\n\n }\n return $this->getResponseFormat($response);\n } catch(\\Exception $e) {\n return $this->errorMessage($e);\n }\n }", "public function getProductOffers($productId);", "public function offer()\n {\n return $this->belongsTo('Offer');\n }", "public function offer() {\n return $this->hasOne('Modules\\Admin\\Models\\Offer', 'id', 'offer_id');\n }", "public function getOfferSellerId()\n {\n return $this->offer_seller_id;\n }", "public function offer(){\n return $this->belongsTo('App\\Models\\Offer', 'offer_id', 'id');\n }", "public function offer()\n\t{\n\t\t// belongsTo(RelatedModel, foreignKey = offer_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo('App\\Offer','offer_id','offer_id');\n\t}", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function setSellerOfferDiscountByProductId($sellerId,$productId,$offerAmount, $offer_comment) {\n try {\n $rmaHelper = $this->_objectManager->create('Webkul\\MpRmaSystem\\Helper\\Data');\n $productSellerId = $rmaHelper->getSellerIdByproductid($productId);\n $response = [];\n $i = 0;\n if($sellerId == $productSellerId) {\n $likesByProductId = $this->_objectManager->create('Seasia\\Customapi\\Helper\\Data')->getLikesByProductId($productId);\n\n //echo '<pre>'; print_r($likesByProductId);die;\n if(is_array($likesByProductId)) {\n foreach($likesByProductId as $value) {\n $offerCollection = $this->_offerFactory->create();\n $offerCollection->setProductId($productId);\n $offerCollection->setSellerId($sellerId);\n $offerCollection->setBuyerId($value['entity_id']);\n $offerCollection->setOrderId(null);\n $offerCollection->setOfferAmount($offerAmount);\n $offerCollection->setStatus('pending');\n $offerCollection->setComment($offer_comment);\n $offerCollection->setCreatedAt(date(\"Y-m-d H:i:s\"));\n $offerCollection->setStripeToken(null);\n $offerCollection->setExpired(null);\n $offerCollection->setOfferUsed(null);\n $offerCollection->setOfferType('productOffer');\n $offerCollection->save();\n if($offerCollection->save()) {\n $offerId = $offerCollection->getId();\n $offer = $this->getOfferById($offerId);\n if($this->sendOfferMail(\"sent\", $offer)) {\n\n $notification_helper = $this->_objectManager->create(\n 'Seasia\\Customnotifications\\Helper\\Data'\n );\n\n $offerId = $offer->getId();\n $type = \"offer_received\";\n $buyer = $offer->getBuyerId();\n $seller = $offer->getSellerId();\n $message = 'Test';\n\n $notification_helper->setNotification($offerId,$type,$buyer,$seller,$message);\n // Send Notification To Buyer\n $i++;\n }\n }\n }\n }\n $response['status'] = \"Success \";\n $response['message'] = \"Discount set to offer successfully\";\n }\n return $this->getResponseFormat($response);\n } catch(\\Exception $e) {\n return $this->errorMessage($e);\n }\n }", "public function forSeller(string $seller) : OffersRequestBuilder {\n $this->queryParameters[OffersRequestBuilder::SELLER_PARAMETER_NAME] = $seller;\n return $this;\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = from_seller_id, keyOnRelatedModel = seller_id)\n \treturn $this->belongsTo('App\\Seller','from_seller_id','seller_id');\n }", "public function offers($sellerId, $pageNum, $length, $orderBy, $orderDir, $searchStr, $getData){\n try {\n $response = array();\n $responseArray = array();\n $offerModel = $this->_offerFactory->create();\n $key = \"\";\n if($getData == \"offermade\"){\n $key = \"buyer_id\";\n }else{\n $key = \"seller_id\";\n }\n\n\n $offerCollection = $offerModel->getCollection()\n ->addFieldToFilter($key, array('eq' => $sellerId))\n ;\n\n $offerCollection->getSelect()->where(\"(offer_used = '1' OR status = 'counter_offer') AND status != 'counter'\");\n\n // $joinTable = $this->_objectManager->create(\n // 'Webkul\\Agorae\\Model\\ResourceModel\\Mpfavouriteseller\\Collection'\n // )->getTable('customer_entity');\n\n\n $joinTable = $this->_objectManager->create(\n 'Webkul\\Agorae\\Model\\ResourceModel\\Mpfavouriteseller\\Collection'\n )->getTable('marketplace_userdata');\n\n\n\n if($getData == \"offermade\"){\n $offerCollection->getSelect()->joinLeft(\n $joinTable.' as cgf',\n 'main_table.seller_id = cgf.seller_id',\n array('shop_url as username')\n );\n }else{\n $offerCollection->getSelect()->joinLeft(\n $joinTable.' as cgf',\n 'main_table.buyer_id = cgf.seller_id',\n array('shop_url as username')\n );\n }\n\n\n\n $eavAttribute = $this->_objectManager->get(\n 'Magento\\Eav\\Model\\ResourceModel\\Entity\\Attribute'\n );\n $proAttId = $eavAttribute->getIdByCode('catalog_product', 'name');\n\n $catalogProductEntityVarchar = $this->_objectManager->create(\n 'Webkul\\Marketplace\\Model\\ResourceModel\\Product\\Collection'\n )->getTable('catalog_product_entity_varchar');\n\n\n $offerCollection->getSelect()->joinLeft($catalogProductEntityVarchar.' as cpev','main_table.product_id = cpev.entity_id', array('value as productName'))\n ->where('cpev.attribute_id = '.$proAttId);\n\n if($searchStr != \"\"){\n $offerCollection->getSelect()->where(\n 'shop_url like \"%'.$searchStr.'%\" OR value like \"%'.$searchStr.'%\" OR offer_amount like \"%'.$searchStr.'%\" OR status like \"%'.$searchStr.'%\"'\n );\n }\n\n $offerCollection->setPageSize($length)->setCurPage($pageNum);\n $offerCollection->setOrder($orderBy, $orderDir);\n $totalCount = $offerCollection->getSize();\n\n //echo $offerCollection->getSelect();\n\n //die(\"DDDDDDDDDDD\");\n\n $productArr = [];\n $i = 0;\n $j = 0;\n foreach($offerCollection as $collection){\n $partner = $this->_marketplacehelper->getSellerDataBySellerId($collection->getBuyerId())->getFirstItem();\n\n $seller = $this->_marketplacehelper->getSellerDataBySellerId($collection->getSellerId())->getFirstItem();\n\n $responseArray[$j] = $collection->getData();\n\n\n $now = date('Y-m-d H:i:s');\n $expiredDate = $this->offerhelper->getExpiredDate($collection->getCreatedAt());\n $t1 = strtotime( $expiredDate );\n $t2 = strtotime($now);\n\n $diff = $t1 - $t2;\n $hours = $diff / ( 60 * 60 );\n\n if($hours > 0){\n $status = $responseArray[$j]['status'];\n }else{\n $status = \"expired\";\n }\n $responseArray[$j]['status'] = $status;\n\n $productIds = explode(\",\",$collection->getProductId());\n if(count($productIds) > 0){\n $productNameArray = array();\n foreach ($productIds as $productId) {\n $productArr[$productId][$i] = $collection->getId();\n $i++;\n $product = $this->_productModel->load($productId);\n array_push($productNameArray, $product->getName());\n }\n $responseArray[$j]['productName'] = implode(\",\", $productNameArray);\n $responseArray[$j]['shop_url'] = $this->_marketplacehelper->getRewriteUrl(\n 'marketplace/seller/collection/shop/'.\n $seller->getShopUrl()\n );\n $responseArray[$j]['expired_at'] = $this->offerhelper->getExpiredDate($collection->getCreatedAt());\n\n }\n $j++;\n }\n //echo '<pre>'; print_r($responseArray);die;\n $finalArray = [];\n $idArray = [];\n $incr = 0;\n // if(!empty($productArr)) {\n // foreach($responseArray as $val) {\n // if(max($productArr[$val['product_id']]) == $val['id'] && !in_array($val['id'],$idArray)) {\n // $idArray[$incr++] = $val['id'];\n // array_push($finalArray, $val);\n // }\n // }\n // }\n //echo \"<pre>\"; print_r($responseArray);\n\n //die();\n $response['offers'] = $responseArray;\n $response['totalCount'] = $incr;\n return $this->getResponseFormat($response);\n } catch(\\Exception $e) {\n return $this->errorMessage($e);\n }\n }", "public function getOffers()\n {\n return $this->offers;\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = seller_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Seller','seller_id','seller_id');\n }", "public function offers($offers)\n {\n return $this->setProperty('offers', $offers);\n }", "public function seller()\n {\n return $this->belongsTo(SellerProxy::modelClass(), 'seller_id');\n }", "public function setOffers($offers) {\n $this->properties['offers'] = $offers;\n\n return $this;\n }", "public function getLikesByProductId($sellerId,$productId);", "public function requestOffer()\n {\n return $this->belongsTo(RequestOffer::class);\n }", "public function addOffer($offer) {\n $this->offers[] = $offer;\n }", "public function show(Offer $offer)\n {\n\n }", "public function seller(){\n return $this->belongsTo(Seller::class);\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function index()\n {\n $offers = Offers::get();\n return view('Admin.product_management.offer.index', compact('offers'));\n }", "public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'company_id');\n }", "public static function AddOffer(){\n\n\t\t\t\n\n\t\t}", "public function buyers()\n {\n return $this->hasMany(Comprador::class, 'idNivelEstudios');\n }", "public function getOffer()\n {\n return $this->offer;\n }", "public function sell(Request $request)\n\t{\n\t\t$this->validateInput($request);\n\t\t$attributes = $this->getAttributes($request);\n\t\t$attributes['type'] = 'sell';\n\n\t\tif ($id = $request->id) {\n\t\t\t$offer = $this->getOffer($id);\n\t\t\t$offer->fill($attributes)->save();\n\t\t\treturn $offer;\n\t\t} else {\n\t\t\treturn Auth::user()->marketplaceOffers()\n\t\t\t\t->create($attributes);\n\t\t}\n\t}", "public function sellerSales()\n {\n return $this->hasMany('App\\Domains\\Sale\\Sale');\n }", "public function getOffersList()\n {\n $query = $this->createQueryBuilder('offers')\n ->getQuery();\n\n return $query->getResult();\n }", "public function show(Offer $offer)\n {\n //\n }", "public function show(Offer $offer)\n {\n //\n }", "public function index()\n {\n $allOffers = Offers::orderBy('id', 'DESC')->get();\n $allproducts = Product::with('category')->where('status','1')->where('stock_status','1')->orderBy('id', 'DESC')->get();\n \n \n return view('Admin.offers_products',compact('allOffers','allproducts'));\n }", "public function setOffers($offers)\n {\n $this->setValue('offers', $offers);\n }", "public function supplies(){\n return $this->hasMany('CValenzuela\\Supply');\n }", "public function eventNotifySeller() {\r\n /**\r\n * Date calculation, Current date and Previous date\r\n */\r\n $currentDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(time()));\r\n $previousDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(strtotime($currentDate . ' -1 day')));\r\n\r\n // Getting all seller ID's whose products updated in from yesterday\r\n\r\n $_sellerCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToSelect('seller_id')\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->groupByAttribute('seller_id')\r\n ->load();\r\n\r\n foreach ($_sellerCollection as $_seller) {\r\n $sellerId = $_seller->getSellerId();\r\n $products = \"\";\r\n\r\n //Loading seller product collection\r\n $_productCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToFilter('seller_id', $_seller->getSellerId())\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->addAttributeToSelect('*')\r\n ->load();\r\n\r\n $i = 1;\r\n foreach ($_productCollection as $_product) {\r\n $small_image = Mage::helper('catalog/image')->init($_product, 'small_image')->resize(51, 68);\r\n $products .= '<tr>';\r\n $products .= '<td style=\"text-align:center; margin:0 0 10px; vertical-align:middle; padding:0 0 10px;\">' . $i . '</td>';\r\n $products .= '<td style=\"text-align:center; padding:0 0 20px;\"><img src=' . $small_image . ' alt=' . $_product->getName() . ' /></td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getName() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getSku() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('seller_product_status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;;\">' . $_product->getPrice() . '</td>';\r\n $products .= '</tr>';\r\n\r\n $i++;\r\n }\r\n $templateId = 9;\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templateId);\r\n\r\n //Getting seller information\r\n\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n\r\n // Setting up default sender information\r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n // Setting email variables\r\n $emailTemplateVariablesValue = (array(\r\n 'sellername' => $sellerName,\r\n 'products' => $products,\r\n 'seller_store' => $sellerStore,\r\n ));\r\n\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n\r\n /**\r\n * Send email to the seller\r\n */\r\n $emailTemplate->send($sellerEmail, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function offers_printed()\n {\n return $this->belongsToMany('Offer', 'user_print', 'nonmember_id', 'offer_id');\n }", "public function vendor()\n {\n // A product can only belong to one vendor\n return $this->belongs_to('Vendor');\n }", "public function offers_redeemed()\n {\n return $this->belongsToMany('Offer', 'user_redeem', 'nonmember_id', 'offer_id');\n }", "public function getOffers()\n {\n return $this->getValue('offers');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function providers()\n {\n return $this->hasMany(Proveedor::class, 'idNivelEstudios');\n }", "public function getSeller()\n {\n return $this->seller;\n }", "public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'user_id');\n }", "public function seller()\n {\n return $this->belongsTo(User::class, 'seller_id');\n }", "public function supplies()\n {\n return $this->hasMany(Supply::class);\n }", "public function getproductlistofseller($sellerid) {\t\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required')); \t\n\t\t}\n\t\telse{\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t \n\t\t//Select Data from table\n\t\t//$sql3 = \"Select * FROM marketplace_product where seller_id=$sellerid\";\n\t\t$sql3 = \"Select * FROM marketplace_product a, catalog_product_entity b \n\t\twhere \n\t\ta.mageproduct_id=b.entity_id and \n\t\ta.seller_id=$sellerid and \n\t\tb.type_id!='customProductType' \";\n\t\t$result3 = $connection->fetchAll($sql3);\n\t\t$result4='';\n\t\t\n\t\tforeach($result3 as $data)\n\t\t{\n\t\t\t \n\t\t\t $productId =$data['mageproduct_id'];\n\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$offfer_tag = $currentproduct->getData('offfer_tag');\n\t\t\t\t\t$attr = $currentproduct->getResource()->getAttribute('offfer_tag');\n\t\t\t\t\t\n\t\t\t\t\t $optionText =$attr->getSource()->getOptionText($offfer_tag);\n\t\t\t\n\t\t\t\tif($optionText=='')\n\t\t\t\t{\n\t\t\t\t\t$optionText='null';\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t $_price=$currentproduct->getPrice();\n\t\t\t\t $_finalPrice=$currentproduct->getFinalPrice();\n\t\t\t\t\t $savetag='null';\n\t\t\t\t\t\tif($_finalPrice < $_price):\n\t\t\t\t\t\t$_savePercent = 100 - round(($_finalPrice / $_price)*100);\n\t\t\t\t\t\t//echo $_savePercent;\n\t\t\t\t\t\t$savetag=$_savePercent;\n endif;\n\n\t\t\t\t $producturl=$currentproduct->getProductUrl();\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $sql_wishlist = \"Select * FROM wishlist a ,wishlist_item b where a.customer_id=$sellerid and a.wishlist_id=b.wishlist_id and b.product_id=$productId \";\n\t\t $result_wishlist = $connection->fetchAll($sql_wishlist);\n\t\t\t\t /* $wish='';\n\t\t\t\t if(!empty($result_wishlist))\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>1); \n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>0);\n\t\t\t\t } */\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $reviewFactory = $objectManager->create('Magento\\Review\\Model\\Review');\n\t\t\t\t $storeId = $this->storeManager->getStore()->getId();\n $reviewFactory->getEntitySummary($currentproduct, $storeId);\n\t\t\t\t $ratingSummary = $currentproduct->getRatingSummary()->getRatingSummary();\n\t\t\t\t if($ratingSummary=='')\n\t\t\t\t{\n\t\t\t\t\t$ratingSummary='null';\n\t\t\t\t}\n\t\t\t\t //print_r($ratingSummary);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"description\"=>$currentproduct->getDescription(),\"price\"=>$currentproduct->getPrice(),\"finalPrice\"=>$currentproduct->getFinalPrice(),\"thumbnail\"=>'http://159.203.151.92/pub/media/catalog/product'.$currentproduct->getthumbnail(),\"offferTag\"=>array(\"shareurl\"=>$producturl,\"Tag\"=>$optionText,'discount'=>$savetag,'rating'=>$ratingSummary));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t \n\t\t} \n\t\t\n\t\treturn $result4;\n\t\t\n }\n\t }", "public function getSellerId()\n {\n return $this->seller_id;\n }", "public function productOptions()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductOption','sp_id','sp_id');\n }", "public function __construct(Offer $offer)\n {\n $this->offer = $offer;\n }", "public function seller()\n {\n return $this->morphTo(__FUNCTION__, 'seller_type', 'seller_id');\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }", "function makeOffer()\r\n {\r\n \r\n }", "public function exchangeRequests(): HasMany\n {\n return $this->hasMany(ExchangeRequest::class, 'requested_product_id');\n }", "private function writeOffers($offers)\n {\n $chunkOffers = array_chunk($offers, $this->chunk);\n foreach ($chunkOffers as $offers) {\n $this->xml = $this->loadXml();\n\n $this->offers = $this->xml->shop->offers;\n $this->addOffers($offers);\n\n $this->xml->asXML($this->tmpFile);\n }\n\n unset($this->offers);\n }", "public function offers_get()\n\t{\n $token = $_SERVER['HTTP_TOKEN'];\n $data = array(\n 'status' => 0,\n 'code' => -1,\n 'msg' => 'Bad Request',\n 'data' => null\n );\n if($this->checkToken($token))\n {\n $offers = $this->Api_model->getOffers();\n if (isset($offers)) {\n $data = array(\n 'status' => 1,\n 'code' => 1,\n 'msg' => 'success',\n 'data' => $offers\n );\n }else{\n $data = array(\n 'status' => 1,\n 'code' => 1,\n 'msg' => 'success',\n 'data' => null\n );\n }\n }else\n {\n $data['msg'] = 'Request Unknown or Bad Request';\n }\n $this->response($data, REST_Controller::HTTP_OK);\n\t}", "public function OderDetails(){\n\t\treturn $this->hasMany('App\\OrderProduct','ID_Product');\n\t}", "public function getOffer($name);", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function sellItem($seller){\r\n\t}", "public function show(seller $seller)\n {\n //\n }", "public function getSellerResource()\n {\n return new SellerResource($this->paymentAdapter->getConfiguration(), new Curl());\n }", "public function getservicelistofseller($sellerid) {\t\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required')); \t\n\t\t}\n\t\telse{\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t \n\t\t//Select Data from table\n\t\t//$sql3 = \"Select * FROM marketplace_product where seller_id=$sellerid\";\n\t\t$sql3 = \"Select * FROM marketplace_product a, catalog_product_entity b \n\t\twhere \n\t\ta.mageproduct_id=b.entity_id and \n\t\ta.seller_id=$sellerid and \n\t\tb.type_id='customProductType' \";\n\t\t$result3 = $connection->fetchAll($sql3);\n\t\t$result4='';\n\t\t\n\t\tforeach($result3 as $data)\n\t\t{\n\t\t\t \n\t\t\t $productId =$data['mageproduct_id'];\n\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$offfer_tag = $currentproduct->getData('offfer_tag');\n\t\t\t\t\t$attr = $currentproduct->getResource()->getAttribute('offfer_tag');\n\t\t\t\t\t\n\t\t\t\t\t $optionText =$attr->getSource()->getOptionText($offfer_tag);\n\t\t\t\n\t\t\t\tif($optionText=='')\n\t\t\t\t{\n\t\t\t\t\t$optionText='null';\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t $_price=$currentproduct->getPrice();\n\t\t\t\t $_finalPrice=$currentproduct->getFinalPrice();\n\t\t\t\t\t $savetag='null';\n\t\t\t\t\t\tif($_finalPrice < $_price):\n\t\t\t\t\t\t$_savePercent = 100 - round(($_finalPrice / $_price)*100);\n\t\t\t\t\t\t//echo $_savePercent;\n\t\t\t\t\t\t$savetag=$_savePercent;\n endif;\n\n\t\t\t\t $producturl=$currentproduct->getProductUrl();\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $sql_wishlist = \"Select * FROM wishlist a ,wishlist_item b where a.customer_id=$sellerid and a.wishlist_id=b.wishlist_id and b.product_id=$productId \";\n\t\t $result_wishlist = $connection->fetchAll($sql_wishlist);\n\t\t\t\t /* $wish='';\n\t\t\t\t if(!empty($result_wishlist))\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>1); \n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>0);\n\t\t\t\t } */\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $reviewFactory = $objectManager->create('Magento\\Review\\Model\\Review');\n\t\t\t\t $storeId = $this->storeManager->getStore()->getId();\n $reviewFactory->getEntitySummary($currentproduct, $storeId);\n\t\t\t\t $ratingSummary = $currentproduct->getRatingSummary()->getRatingSummary();\n\t\t\t\t if($ratingSummary=='')\n\t\t\t\t{\n\t\t\t\t\t$ratingSummary='null';\n\t\t\t\t}\n\t\t\t\t //print_r($ratingSummary);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"description\"=>$currentproduct->getDescription(),\"price\"=>$currentproduct->getPrice(),\"finalPrice\"=>$currentproduct->getFinalPrice(),\"thumbnail\"=>'http://159.203.151.92/pub/media/catalog/product'.$currentproduct->getthumbnail(),\"offferTag\"=>array(\"shareurl\"=>$producturl,\"Tag\"=>$optionText,'discount'=>$savetag,'rating'=>$ratingSummary));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t \n\t\t} \n\t\t\n\t\treturn $result4;\n\t\t\n }\n\t }", "public function product_supply(){ return $this->hasMany(ProductSupply::class,'vehicle_id'); }", "public function vendors()\n {\n return $this->morphedByMany('App\\Models\\Event\\Person\\EventVendor', 'persona', 'pivot_persona_org', 'organization_id', 'persona_id');\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function offer(string $offerId) : OfferResponse {\n $this->setSegments(\"offers\", $offerId);\n return parent::executeRequest($this->buildUrl(),RequestType::SINGLE_OFFER);\n }", "public function apply(Builder $builder, Model $model)\n {\n //un usuario es vendedor(seller) cuando tiene productos\n $builder->has('products');\n }", "public function setOffer($offer)\n {\n $this->offer = $offer;\n\n return $this;\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function getProductSeller()\n {\n $product = $this->coreRegistry->registry('product');\n $productId = $product->getId();\n $sellerId = $this->helper->getSellerIdByProductId($productId);\n return $sellerId;\n }", "public function addSaleOffer(SaleOffer $saleOffer)\n {\n $saleOffer->setProduct($this);\n $this->saleOffers->add($saleOffer);\n }", "public function index() {\r\n\r\n $data['total_sellers_alive'] = $this->seller_model->get_total_number_of_sellers(array(\"tag\" => SellerTags::$available));\r\n\r\n if ($this->input->get('product_id')) {\r\n // it means now we will have to mention sellers who\r\n // sell the product having this product_id\r\n $product_id = $this->input->get('product_id');\r\n $data['fetch_json_link'] = URL_X . 'Seller/index_json?product_id=' . $product_id;\r\n //lets fetch that product_details\r\n $this->load->model('product_model');\r\n $r = $this->product_model->get_one_product($product_id);\r\n $product_name = $r[0]->product_name;\r\n $product_brand = $r[0]->product_brand;\r\n $data['label'] = \"Sellers who sell the Product : \" . $product_name . \"- \"\r\n . \"<small>Brand: \" . $product_brand . '</small>';\r\n //set a different label for the add button\r\n $data['addButtonLabel'] = \"Attach a seller to this product\";\r\n $data['add_link'] = URL_X . 'Product_seller_mapping/add_new_seller_to_a_product/' . $product_id;\r\n //we are dealing with a mapping so edit link will not be present\r\n $data['delete_link'] = URL_X . 'Product_seller_mapping/delete_a_mapping/';\r\n } else {\r\n // full seller list page\r\n $data['edit_link'] = URL_X . 'Seller/edit/';\r\n $data['delete_link'] = URL_X . 'Seller/delete/';\r\n $data['fetch_json_link'] = URL_X . 'Seller/index_json';\r\n $data['label'] = \"All sellers\";\r\n $data['addButtonLabel'] = \"Add a seller to system\";\r\n $data['add_link'] = URL_X . 'Seller/add_new/';\r\n }\r\n $this->load->view(\"template/header\", $this->activation_model->get_activation_data());\r\n $this->load->view(\"seller/list_all_sellers\", $data);\r\n $this->load->view(\"template/footer\");\r\n }", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function sellerStock()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\SellerStock','sp_id','sp_id');\n }", "public function vouchers()\n {\n return $this->hasMany(Voucher::class);\n }", "public function getSellerId()\n {\n return $this->driver->seller_id;\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function vouchers(){\n return $this->hasMany(Voucher::class);\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function dealers()\n {\n return $this->hasMany('App\\Models\\Dealer');\n }", "function getSellerProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/seller/'.(int)$params['seller_id'].'/product.json',$params),true);\n\t}", "public function seller() {\n return $this->belongsTo(User::class);\n }", "public function index(Seller $seller)\n {\n $product = $seller->products;\n return $this->showAll($product);\n }", "public function setOffers(array $offers)\n {\n $this->offers = $offers;\n\n return $this;\n }", "public static function getSellerItems(Request $request)\n {\n $seller=Auth::user();\n $items=Product::where('seller_id',$seller->id)->get();\n if($items){\n return response(['error'=>false,'items'=>$items],200);\n }\n else{\n return response(['error'=>true,'message'=>'no item found'],200);\n }\n }", "public function getUpSellProductCollection()\n {\n $collection = $this->getLinkInstance()->useUpSellLinks()\n ->getProductCollection()\n ->setIsStrongMode();\n $collection->setProduct($this);\n return $collection;\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}" ]
[ "0.7251613", "0.7072507", "0.70542306", "0.6957337", "0.687448", "0.67916447", "0.6669564", "0.6645745", "0.6535311", "0.6290579", "0.625721", "0.62374294", "0.62346464", "0.6223082", "0.6183931", "0.610311", "0.60545284", "0.6029322", "0.59926206", "0.59341013", "0.5902343", "0.5859308", "0.58404887", "0.57425064", "0.57175285", "0.5690488", "0.5684263", "0.5674677", "0.5667328", "0.5626998", "0.56056756", "0.5601698", "0.5599739", "0.55902475", "0.55758506", "0.5567347", "0.5558964", "0.5550176", "0.5546603", "0.5515776", "0.5515776", "0.54733", "0.5460918", "0.54253006", "0.54222715", "0.54165614", "0.5402032", "0.53892183", "0.5376907", "0.5371708", "0.5359824", "0.53593045", "0.53490764", "0.5344891", "0.5344009", "0.5338811", "0.53351736", "0.53222305", "0.53109425", "0.5296028", "0.52910924", "0.52904624", "0.5280633", "0.52763766", "0.52685547", "0.52605397", "0.52492034", "0.52477676", "0.52461433", "0.5244446", "0.5235474", "0.52313864", "0.5228787", "0.52198565", "0.5218308", "0.5216421", "0.52123463", "0.5187362", "0.51818776", "0.5174706", "0.5170381", "0.5168873", "0.5166376", "0.5163537", "0.5163157", "0.5162447", "0.5158251", "0.5152182", "0.5133337", "0.5124462", "0.5113307", "0.5110231", "0.5103962", "0.50978994", "0.50940657", "0.5091598", "0.50899804", "0.507052", "0.5069169", "0.5063433" ]
0.6941981
4
SellerProduct has many SellerProductRelations.
public function packageProductRelations() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\SellerProductRelation','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function products(): MorphToMany;", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function relations()\n {\n return $this->belongsToMany(Product::class, 'product_relations', 'product_id', 'related_product_id')\n ->using(ProductRelation::class);\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = from_seller_id, keyOnRelatedModel = seller_id)\n \treturn $this->belongsTo('App\\Seller','from_seller_id','seller_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product');\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function product_galleries() {\n return $this->hasMany(ProductGallery::class, 'product_id', 'id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\models\\Product', 'product_variants');\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = seller_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Seller','seller_id','seller_id');\n }", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function products()\n {\n // if the intermediate table is called differently an SQl error is raised\n // to use a custom table name it should be passed to \"belongsToMany\" method as the second argument\n return $this->belongsToMany(Product::class, 'cars__products');\n }", "public function products()\n {\n return $this->hasMany('App\\ProductLocation', 'productLocation', 'id');\n }", "public function images()\n {\n return $this->hasMany(ProductImageProxy::modelClass(), 'seller_product_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'restaurant_id');\n }", "public function products()\n {\n return $this->belongsToMany(Product::class, 'product_promotions');\n }", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function seller()\n {\n return $this->belongsTo(SellerProxy::modelClass(), 'seller_id');\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function products()\n {\n return $this->belongsToMany(\n Product::class,\n 'order_product',\n 'order_id',\n 'product_id'\n );\n }", "public function getGallery(){\n return $this->hasMany(ProductGallery::class, 'product_id','id');\n }", "public function products() {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function products() {\n return $this->hasMany('App\\Product', 'category_id', 'id');\n }", "public function seller(){\n return $this->belongsTo(Seller::class);\n }", "public function products()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function products() {\n \treturn $this->belongsToMany(Product::class, 'items_product', 'item_id', 'product_id');\n }", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function products(){\n return $this->belongsToMany('App\\Product', 'enumber_products', 'enumber_id', 'products_id');\n }", "public function roles()\n {\n return $this->belongsToMany('App\\SellersRoles','seller_acces','sellers_id','modules_id');\n }", "public function products()\n {\n return $this->morphedByMany('App\\Models\\Product', 'taggable');\n }", "public function products()\n {\n return $this->hasMany('fooCart\\src\\Product', 'tax_id', 'tax_id');\n }", "public function products()\n\t{\n\t\treturn $this->belongsTo(Product::class);\n\t}", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function products()\n {\n return $this->belongsToMany('App\\Product', 'tag_products', 'tag_id', 'product_id');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function products()\n {\n return $this->belongsTo('App\\Product', 'product_id');\n }", "public function relations() {\n // class name for the relations automatically generated below.\n return array(\n 'product' => array(self::BELONGS_TO, 'Product', 'product_id'),\n );\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function tagProducts()\n {\n return $this->hasMany('App\\Product_tag', 'tag_id', 'id');\n }", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function product()\n {\n return $this->hasMany(product::class, 'category_id', 'id');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function OderDetails(){\n\t\treturn $this->hasMany('App\\OrderProduct','ID_Product');\n\t}", "public function variants()\n {\n return $this->hasMany(Variant::class, 'product_id', 'id');\n }", "public function relatedProductsAction()\n {\n $productId = Mage::app()->getRequest()->getParam('productId');\n $relatedProducts = [];\n\n if ($productId != null) {\n $product = Mage::getModel('catalog/product')->load($productId);\n $relatedProductsId = $product->getRelatedProductIds();\n foreach ($relatedProductsId as $relatedProductId) {\n $relatedProducts[] = Mage::getModel('catalog/product')->load($relatedProductId)->getData();\n }\n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($relatedProducts));\n $this->getResponse()->setHeader('Content-type', 'application/json');\n }", "public function productos()\n {\n return $this->hasMany('App\\Models\\ProductoPedidoModel', 'id_pedido', 'id');\n }", "public function categoryProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = cate_id, localKey = cate_id)\n return $this->hasMany('App\\CategoryProductRelation','cate_id','cate_id');\n }", "public function product()\n {\n return $this->belongsToMany(Product::class,'product_id','id');\n \n }", "public function wishlist_products()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function eventNotifySeller() {\r\n /**\r\n * Date calculation, Current date and Previous date\r\n */\r\n $currentDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(time()));\r\n $previousDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(strtotime($currentDate . ' -1 day')));\r\n\r\n // Getting all seller ID's whose products updated in from yesterday\r\n\r\n $_sellerCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToSelect('seller_id')\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->groupByAttribute('seller_id')\r\n ->load();\r\n\r\n foreach ($_sellerCollection as $_seller) {\r\n $sellerId = $_seller->getSellerId();\r\n $products = \"\";\r\n\r\n //Loading seller product collection\r\n $_productCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToFilter('seller_id', $_seller->getSellerId())\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->addAttributeToSelect('*')\r\n ->load();\r\n\r\n $i = 1;\r\n foreach ($_productCollection as $_product) {\r\n $small_image = Mage::helper('catalog/image')->init($_product, 'small_image')->resize(51, 68);\r\n $products .= '<tr>';\r\n $products .= '<td style=\"text-align:center; margin:0 0 10px; vertical-align:middle; padding:0 0 10px;\">' . $i . '</td>';\r\n $products .= '<td style=\"text-align:center; padding:0 0 20px;\"><img src=' . $small_image . ' alt=' . $_product->getName() . ' /></td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getName() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getSku() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('seller_product_status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;;\">' . $_product->getPrice() . '</td>';\r\n $products .= '</tr>';\r\n\r\n $i++;\r\n }\r\n $templateId = 9;\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templateId);\r\n\r\n //Getting seller information\r\n\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n\r\n // Setting up default sender information\r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n // Setting email variables\r\n $emailTemplateVariablesValue = (array(\r\n 'sellername' => $sellerName,\r\n 'products' => $products,\r\n 'seller_store' => $sellerStore,\r\n ));\r\n\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n\r\n /**\r\n * Send email to the seller\r\n */\r\n $emailTemplate->send($sellerEmail, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }" ]
[ "0.78812474", "0.65362597", "0.65347147", "0.63908565", "0.6358779", "0.62923664", "0.62530893", "0.6236368", "0.6223156", "0.6222789", "0.6207354", "0.61728483", "0.616842", "0.616842", "0.6166494", "0.6166494", "0.6166494", "0.6166494", "0.6166494", "0.6166494", "0.6166494", "0.6164707", "0.61452746", "0.61205417", "0.611823", "0.6102171", "0.61002576", "0.61002576", "0.61002576", "0.61002576", "0.61002576", "0.61002576", "0.61002576", "0.6094037", "0.60805154", "0.6071891", "0.60448116", "0.60400736", "0.60265815", "0.60128236", "0.6009563", "0.60039854", "0.60012144", "0.5984989", "0.5977085", "0.5958136", "0.59309304", "0.59309304", "0.59309304", "0.59309304", "0.5917164", "0.59101135", "0.5900421", "0.5898504", "0.5887355", "0.5879758", "0.587633", "0.5845213", "0.58441216", "0.5839523", "0.5834907", "0.5824945", "0.5818976", "0.5809592", "0.58043134", "0.5781403", "0.57776225", "0.5771819", "0.57515687", "0.57407176", "0.5729609", "0.5723224", "0.5701474", "0.5699235", "0.5697705", "0.56960094", "0.56887496", "0.5688289", "0.5682952", "0.5662891", "0.56627846", "0.56358564", "0.5618044", "0.5610666", "0.56029695", "0.56013083", "0.55976164", "0.5591205", "0.5584671", "0.556349", "0.5553357", "0.554659", "0.5541729", "0.55308867", "0.5526245", "0.5525251", "0.55237865", "0.55111915", "0.55078506", "0.550068" ]
0.7408215
1
SellerProduct has many TransistionHistories.
public function transistionHistories() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\TransistionHistory','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function transistionHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\TransistionHistory','spsd_id','spsd_id');\n }", "public function sellerStockHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\SellerStockHistory','spsd_id','spsd_id');\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function history()\n {\n return $this->hasMany('App\\legalEntityHistory','legal_entity_id','id');\n }", "public function rewardHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = reward_id, localKey = reward_id)\n return $this->hasMany('App\\RewardHistory','reward_id','reward_id');\n }", "public function history_product($product_id = null) {\n\t\t$this->Sell->Product->recursive = -1;\n\t\t$this->set('products', $this->Sell->Product->find('all'));\n\t\t$this->set('years', $this->Sell->Year->find('list',array('fields'=>'Year.year,Year.year')));\n\t\t\n\t\t\n\t\t$product = null;\n\t\t$this->Sell->Product->id = $product_id;\n\t\tif (!$this->Sell->Product->exists()) {\n\t\t\t$p = $this->Sell->Product->find('first');\n\t\t\t$product_id = $p['Product']['id'];\n\t\t\tif(!$product_id) {\n\t\t\t\t$this->Session->setFlash(__('Cadastre um produto antes de continuar'));\n\t\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t\n\t\t//checando ano\n\t\t$year = null;\n\t\tif(isset($this->request->query['year']))\n\t\t\t$year = $this->request->query['year'];\n\t\telse {\n\t\t\t$y = $this->Sell->Year->find('first',array('order'=>'Year.year DESC'));\n\t\t\tif(isset($y['Year']['year']) && $y['Year']['year'])\n\t\t\t\t$year = $y['Year']['year'];\n\t\t\tif($year) {\n\t\t\t\t$this->redirect(array('controller'=>'sells','action'=>'history_product',$product_id,'?' => array('year' => $year)));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(!$year) {\n\t\t\t$this->Session->setFlash(__('Cadastre um ano antes de continuar'));\n\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t\treturn;\n\t\t}\n\n\t\t//construindo dados\n\t\t$product = $this->Sell->Product->read(null, $product_id);\n\n\t\t$sells = $this->Sell->find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Sell.product_id' => $product_id,\n\t\t\t\t\t\t'Year.year' => $year\n\t\t\t\t),\n\t\t\t\t'order' => 'Year.year DESC'\n\t\t));\n\n\t\t$this->Sell->Month->recursive = -1;\n\t\t$months = $this->Sell->Month->find('all');\n\n\t\t$graph = array(\n\t\t\t\t'title' => \"Vendas de {$product['Product']['name']} por Mês - {$year}\",\n\t\t\t\t'label_x' => 'mês',\n\t\t\t\t'label_y' => 'unidades',\n\t\t\t\t'axis_y' => array(\n\t\t\t\t\t\t'model' => 'Month',\n\t\t\t\t\t\t'field' => 'name',\n\t\t\t\t\t\t'data' => $months\n\t\t\t\t),\n\t\t\t\t'axis_x' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'label' => $product['Product']['name'],\n\t\t\t\t\t\t\t\t'model' => 'Sell',\n\t\t\t\t\t\t\t\t'field' => 'quantity',\n\t\t\t\t\t\t\t\t'data' => $sells\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t);\n\t\t$this->set(compact('graph','year','product'));\n\t}", "public function eventNotifySeller() {\r\n /**\r\n * Date calculation, Current date and Previous date\r\n */\r\n $currentDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(time()));\r\n $previousDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(strtotime($currentDate . ' -1 day')));\r\n\r\n // Getting all seller ID's whose products updated in from yesterday\r\n\r\n $_sellerCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToSelect('seller_id')\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->groupByAttribute('seller_id')\r\n ->load();\r\n\r\n foreach ($_sellerCollection as $_seller) {\r\n $sellerId = $_seller->getSellerId();\r\n $products = \"\";\r\n\r\n //Loading seller product collection\r\n $_productCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToFilter('seller_id', $_seller->getSellerId())\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->addAttributeToSelect('*')\r\n ->load();\r\n\r\n $i = 1;\r\n foreach ($_productCollection as $_product) {\r\n $small_image = Mage::helper('catalog/image')->init($_product, 'small_image')->resize(51, 68);\r\n $products .= '<tr>';\r\n $products .= '<td style=\"text-align:center; margin:0 0 10px; vertical-align:middle; padding:0 0 10px;\">' . $i . '</td>';\r\n $products .= '<td style=\"text-align:center; padding:0 0 20px;\"><img src=' . $small_image . ' alt=' . $_product->getName() . ' /></td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getName() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getSku() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('seller_product_status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;;\">' . $_product->getPrice() . '</td>';\r\n $products .= '</tr>';\r\n\r\n $i++;\r\n }\r\n $templateId = 9;\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templateId);\r\n\r\n //Getting seller information\r\n\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n\r\n // Setting up default sender information\r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n // Setting email variables\r\n $emailTemplateVariablesValue = (array(\r\n 'sellername' => $sellerName,\r\n 'products' => $products,\r\n 'seller_store' => $sellerStore,\r\n ));\r\n\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n\r\n /**\r\n * Send email to the seller\r\n */\r\n $emailTemplate->send($sellerEmail, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }", "public function histories()\n {\n return $this->belongsToMany(History::class, \"history_history\", \"history_one\", \"history_two\");\n }", "public function histories()\n {\n return $this->hasMany(History::class);\n }", "public function productHold()\n {\n return $this->hasMany('App\\Models\\ProductHold');\n }", "public function product()\n\t{\n\t\treturn $this->belongsToMany('App\\Models\\Products','inventory','store_id','product_id')->withPivot('stocks', 'lower_limit', 'higher_limit');\n\t}", "public function productTransactionReceipts()\n {\n return $this->hasMany('App\\Models\\ProductTransactionReceipt');\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function products(){\n return $this->belongsToMany('App\\Product', 'product_warehouse', 'warehouse_id', 'product_id')\n ->withPivot('quantity') //iot use increment and decrement i added the id column\n ->withTimestamps(); //for the timestamps created_at updated_at, to be maintained.\n }", "public function ingredientSuppliers(){\n return $this->hasMany(SupplierStock::class);\n }", "public function history_product_last_tree_years($product_id = null) {\n\t\t$this->Sell->Product->recursive = -1;\n\t\t$this->set('products', $this->Sell->Product->find('all'));\n\t\t\n\t\t$year = $this->Sell->Year->find('first',array('order'=>'Year.year DESC'));\n\t\tif(!isset($year['Year']['year']) || !$year['Year']['year']) {\n\t\t\t\t$this->Session->setFlash(__('Cadastre um ano antes de continuar'));\n\t\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t}\n\t\t$year = $year['Year']['year'];\n\t\t\n\t\t$this->Sell->Product->id = $product_id;\n\t\tif (!$this->Sell->Product->exists()) {\n\t\t\t$p = $this->Sell->Product->find('first');\n\t\t\t$product_id = $p['Product']['id'];\n\t\t\tif(!$product_id) {\n\t\t\t\t$this->Session->setFlash(__('Cadastre um produto antes de continuar'));\n\t\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\n\t\t//construindo dados\n\t\t$product = $this->Sell->Product->read(null, $product_id);\n\n\t\t\n\t\t$year1 = $year-2;\n\t\t$year2 = $year-1;\n\t\t$year3 = $year;\n\t\t\n\t\t$sells1 = $this->Sell->find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Sell.product_id' => $product_id,\n\t\t\t\t\t\t'Year.year = ' . $year1\n\t\t\t\t),\n\t\t\t\t'order' => 'Year.year DESC'\n\t\t));\n\t\t$sells2 = $this->Sell->find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Sell.product_id' => $product_id,\n\t\t\t\t\t\t'Year.year = ' . $year2\n\t\t\t\t),\n\t\t\t\t'order' => 'Year.year DESC'\n\t\t));\n\t\t$sells3 = $this->Sell->find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Sell.product_id' => $product_id,\n\t\t\t\t\t\t'Year.year = ' . $year3\n\t\t\t\t),\n\t\t\t\t'order' => 'Year.year DESC'\n\t\t));\n\n\t\t$this->Sell->Month->recursive = -1;\n\t\t$months = $this->Sell->Month->find('all');\n\n\t\t$graph = array(\n\t\t\t\t'title' => \"Vendas de {$product['Product']['name']} por Mês - {$year1}, {$year2} e {$year3}\",\n\t\t\t\t'label_x' => 'mês',\n\t\t\t\t'label_y' => 'unidades',\n\t\t\t\t'axis_y' => array(\n\t\t\t\t\t\t'model' => 'Month',\n\t\t\t\t\t\t'field' => 'name',\n\t\t\t\t\t\t'data' => $months\n\t\t\t\t),\n\t\t\t\t'axis_x' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'label' => $year1,\n\t\t\t\t\t\t\t\t'model' => 'Sell',\n\t\t\t\t\t\t\t\t'field' => 'quantity',\n\t\t\t\t\t\t\t\t'data' => $sells1\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'label' => $year2,\n\t\t\t\t\t\t\t\t'model' => 'Sell',\n\t\t\t\t\t\t\t\t'field' => 'quantity',\n\t\t\t\t\t\t\t\t'data' => $sells2\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'label' => $year3,\n\t\t\t\t\t\t\t\t'model' => 'Sell',\n\t\t\t\t\t\t\t\t'field' => 'quantity',\n\t\t\t\t\t\t\t\t'data' => $sells3\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t);\n\t\t$this->set(compact('graph','year','product'));\n\t}", "public function warehouse()\n {\n return $this->belongsToMany('App\\Warehouse', 'product_has_warehouse', 'product_id', 'warehouse_id');\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product', 'royalty_chart', 'vehicle_type_id', 'product_id')->withPivot('amount', 'status');\n }", "public function histories() {\n return $this->morphMany('App\\History', 'for_item');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withPivot('amount', 'data', 'consume');\n }", "public function member_histories() {\n return $this->hasMany('App\\Member_History');\n }", "public function amountProducts(){\n return $this->hasMany(AmountProduct::class);\n }", "public function transistionHistory()\n {\n \t// belongsTo(RelatedModel, foreignKey = th_id, keyOnRelatedModel = th_id)\n \treturn $this->belongsTo('App\\TransistionHistory','th_id','th_id');\n }", "public function ordersHistory() {\n return $this->hasMany(OrderHistory::class);\n }", "public function soldBooks()\n {\n return $this->hasManyThrough(Order::class, Book::class, 'user_id', 'book_id', 'id');\n }", "public function trades() {\n\t\treturn $this->hasMany( 'App\\Trade', 'trader' );\n\t}", "public function stockHold()\n {\n return $this->hasMany('App\\Models\\Stock\\HoldModel', 'stock_id', 'id');\n }", "public function orders_with_history() {\n return $this->belongsToMany('\\Veer\\Models\\Order','orders_history', 'status_id', 'orders_id'); \n }", "public function stocks(): HasMany\n {\n return $this->hasMany('Ronmrcdo\\Inventory\\Models\\InventoryStock');\n }", "public function Historico_Equipo()\n {\n return $this->hasMany('App\\Historico_equipo','entidad_id','id');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function exportProducts()\n\t{\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProductExportEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProductHistoryEvent' );\n\t\t\n\t\t$baseURL = Yii::app()->request->hostInfo;\n\t\t$pageSize = 20;\n\t\t\n\t\t$allProducts = Yii::app()->db->createCommand()\n\t ->select('p.id, p.parent, p.url, p.name, p.articul, p.price, p.notice, p.visible, p.discount, p.date_create, i.name AS img, s.name AS section')\n\t ->from('kalitniki_product AS p')\n\t ->join('kalitniki_product_img AS i', 'p.id = i.parent')\n\t ->join('kalitniki_product_assignment AS a', 'p.id = a.product_id')\n\t ->join('kalitniki_product_section AS s', 's.id = a.section_id')\n\t ->group('p.id')\n\t ->order('IF(p.position=0, 1, 0), p.position ASC ');\n\t\n\t $allProducts = $allProducts->queryAll();\n\t $productCount = count( $allProducts );\n\t \n\t $pages = ( $productCount % $pageSize ) > 0 ? floor( $productCount / $pageSize ) + 1 : $productCount / $pageSize;\n\t \n\t for ( $currentPage = 0; $currentPage <= $pages - 1; $currentPage++ )\n\t {\n\t \t$dataExport = new ProductHistoryEvent;\n\t \t\n\t \t$offset = $currentPage * $pageSize;\n\t \t$collection = array_slice( $allProducts, $offset, $pageSize );\n\t \t\n\t \tforeach ( $collection as $productItem )\n\t \t{\n\t \t\t$productPrices = array();\n\t\t\t\tif ( $productItem['discount'] )\n\t\t\t\t{\n\t\t\t\t $productPrice = array(\n\t\t\t 'price_id' => \"\",\n\t\t\t 'price_value' => Utils::calcDiscountPrice($productItem['price'], $productItem['discount']),\n\t\t\t 'price_priority' => null,\n\t\t\t 'price_active_from' => \"\",\n\t\t\t 'price_active_to' => \"\",\n\t\t\t 'price_customer_group' => \"\",\n\t\t\t 'price_quantity' => \"\"\n\t\t\t );\n\t\t\t \n\t\t\t $productPrices[] = $productPrice;\n\t\t\t\t}\n\t \t\t\n\t \t\t$productCategories = array();\n \t\t$productCategories[] = $productItem['section'];\n\t \t\t\n\t \t\t$product = new ProductExportEvent;\n $product->product_id = $productItem['id'];\n $product->parent_id = $productItem['parent'] ? $productItem['parent'] : \"\";\n $product->product_name = isset( $productItem['name'] ) ? $productItem['name'] : \"\";\n $product->product_desc = $productItem['notice'];\n $product->product_create_date = $productItem['date_create'];\n $product->product_sku = $productItem['articul'] ? $productItem['articul'] : \"\";\n $product->product_image = $baseURL . '/' . $productItem['img'];\n $product->product_url = $baseURL . '/' . $productItem['url'];\n $product->product_qty = \"\";\n $product->product_default_price = $productItem['price'];\n $product->product_prices = $productPrices;\n $product->product_categories = $productCategories;\n $product->product_relations = \"\";\n $product->product_is_removed = \"\";\n $product->product_is_active = $productItem['visible'];\n $product->product_active_from = \"\";\n $product->product_active_to = \"\";\n $product->product_show_as_new_from = \"\";\n $product->product_show_as_new_to = \"\";\n \n $dataExport->products[] = $product;\n\t \t}\n\n\t \t$this->client->sendEvent( $dataExport );\n\t }\n\t}", "public function tags()\n {\n return $this->hasManyThrough(\n 'App\\ProductTags',\n 'App\\ProductHasTags',\n 'product_id',\n 'id'\n );\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function trades() {\n return $this->hasMany(Trade::class);\n }", "public function productClicks()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductClick','sp_id','sp_id');\n }", "public function warehouses(): HasManyThrough\n\t{\n\t\treturn $this->hasManyThrough('Ronmrcdo\\Inventory\\Models\\InventoryStock', 'Ronmrcdo\\Inventory\\Models\\ProductSku')->with('warehouse');\n\t}", "public function stocks()\n {\n return $this->hasMany('App\\Models\\Stock');\n }", "public function views()\n {\n return $this->hasManyThrough('App\\View', 'App\\Product');\n }", "public function sellerStock()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\SellerStock','sp_id','sp_id');\n }", "public function transaction()\n {\n \treturn $this->hasMany('App\\Wages\\Transaction');\n }", "public function history()\n\t{\n\t\t$res = $this->hasManyThrough(Revision::class, RevisionSet::class, 'id', 'revision_set_id', 'revision_set_id')\n\t\t\t->where(\n\t\t\t\tfunction ($query) {\n\t\t\t\t\treturn $query->where('revisions.created_at', '<', $this->created_at);\n\t\t\t\t})\n\t\t\t->select('revisions.id', 'revisions.title', 'revisions.created_at', 'revisions.layout_name', 'revisions.layout_version');\n\t\treturn $res;\n\t}", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withTimestamps();\n }", "public function customWholesaleQuantities()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\CustomWholesaleQuantity','sp_id','sp_id');\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function transactions()\n {\n \treturn $this->hasMany('App\\Transaction');\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function products()\n {\n return $this->hasMany('fooCart\\src\\Product', 'tax_id', 'tax_id');\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function sellerStock()\n {\n \t// belongsTo(RelatedModel, foreignKey = ss_id, keyOnRelatedModel = ss_id)\n \treturn $this->belongsTo('App\\SellerStock','ss_id','ss_id');\n }", "public function selcom_transactions(){\n return $this->hasMany('App\\SelcomTransaction');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function transactions(){\n return $this->hasMany('App\\Transaction');\n }", "public function spendings(): HasMany\n {\n return $this->hasMany(Spending::class);\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function order_items_details()\n {\n return $this->hasManyThrough('App\\Models\\Product\\Product','App\\Models\\Sales\\SalesOrderItem', 'sales_order_id','id','id','product_id');\n }", "public function getOrderProductDetailAndHistoryAction (Request $request)\r\n {\r\n $orderProductId = $request->query->get('orderProductId');\r\n $em = $this->getDoctrine()->getManager();\r\n $userOrderRepository = $em->getRepository('YilinkerCoreBundle:UserOrder');\r\n $orderProductHistoryRepository = $em->getRepository('YilinkerCoreBundle:OrderProductHistory');\r\n $packageRepository = $em->getRepository('YilinkerCoreBundle:Package');\r\n $packageDetailRepository = $em->getRepository('YilinkerCoreBundle:PackageDetail');\r\n $shipmentInformationEntities = $packageRepository->getPackagesByOrderProducts(array($orderProductId));\r\n $orderProduct = $userOrderRepository->getTransactionOrderProducts(null, $orderProductId);\r\n $orderProductHistoryEntities = $orderProductHistoryRepository->findByOrderProduct($orderProductId);\r\n $orderProductHistory = array();\r\n $shipmentInformation = array();\r\n\r\n if ($orderProductHistoryEntities) {\r\n\r\n foreach ($orderProductHistoryEntities as $orderProductHistoryEntity) {\r\n $orderProductHistory[] = array (\r\n 'historyId' => $orderProductHistoryEntity->getOrderProductHistoryId(),\r\n 'orderProductStatus' => $orderProductHistoryEntity->getOrderProductStatus()->getName(),\r\n 'dateAdded' => $orderProductHistoryEntity->getDateAdded()->format('Y/m/d H:i:s')\r\n );\r\n }\r\n\r\n }\r\n\r\n if ($shipmentInformationEntities) {\r\n\r\n foreach ($shipmentInformationEntities as $shipmentInformationEntity) {\r\n $packageOrderProduct = $packageDetailRepository->findOneByOrderProduct($orderProductId);\r\n $warehouse = $shipmentInformationEntity->getWarehouse();\r\n\r\n $shipmentInformation[] = array (\r\n 'waybillNumber' => $shipmentInformationEntity->getWaybillNumber(),\r\n 'warehouse' => $warehouse ? $warehouse->getName() : 'Not available',\r\n 'quantity' => $packageOrderProduct && $packageOrderProduct->getQuantity()\r\n ? $packageOrderProduct->getQuantity()\r\n : $packageOrderProduct->getOrderProduct()->getQuantity(),\r\n 'dateAdded' => $shipmentInformationEntity->getDateAdded()->format('Y/m/d H:i:s')\r\n );\r\n }\r\n\r\n }\r\n\r\n $data = compact (\r\n 'orderProduct',\r\n 'orderProductHistory',\r\n 'shipmentInformation'\r\n );\r\n\r\n return new JsonResponse($data);\r\n }", "public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'company_id');\n }", "public function historyable()\n {\n return $this->morphTo('histories', 'histories_type', 'histories_id')->orderBy('date');\n }", "public function loanRepaymentLogs()\n {\n return $this->hasMany('App\\LoanRepaymentLog');\n }", "public function gradesChangesInHistory()\n {\n return $this->hasMany('App\\Model\\GradesHistory', 'teacher_id');\n }", "public function stockUnhold()\n {\n return $this->hasMany('App\\Models\\Stock\\UnholdModel', 'stock_id', 'id');\n }", "public function sales()\n {\n return $this->hasMany(Sale::class);\n }", "public function transactionDetails()\n {\n return $this->hasMany(TransactionDetail::class);\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class);\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class);\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withPivot('quantity');\n }", "public function stockout()\n {\n $user_id = Auth::user()->id;\n $merchant = Merchant::where('user_id','=',$user_id)->first();\n return $merchant_pro = $merchant->products()\n ->whereNull('product.deleted_at')\n ->leftJoin('product as productb2b', function($join) {\n $join->on('product.id', '=', 'productb2b.parent_id')\n ->where('productb2b.segment','=','b2b');\n })\n ->leftJoin('product as producthyper', function($join) {\n $join->on('product.id', '=', 'producthyper.parent_id')\n ->where('producthyper.segment','=','hyper');\n })\n ->leftJoin('tproduct as tproduct', function($join) {\n $join->on('product.id', '=', 'tproduct.parent_id');\n })\n ->leftJoin('productbc','product.id','=','productbc.product_id')\n ->leftJoin('bc_management','bc_management.id','=','productbc.bc_management_id')\n ->select(DB::raw('\n product.id,\n product.parent_id,\n bc_management.id as bc_management_id,\n productbc.deleted_at as pbdeleted_at,\n product.name,\n product.thumb_photo as photo_1,\n product.available,\n productb2b.available as availableb2b,\n producthyper.available as availablehyper,\n tproduct.available as warehouse_available,\n product.sku'))\n ->groupBy('product.id')\n ->where(\"product.status\",\"!=\",\"transferred\")\n ->where(\"product.status\",\"!=\",\"deleted\")\n ->where(\"product.status\",\"!=\",\"\")\n ->orderBy('product.created_at','DESC')\n ->get();\n\t\treturn Response()->json($products);\n }", "public function product_lists()\n {\n return $this->belongsToMany('App\\ProductVariant', 'shopping_list_products', 'shopping_list_id', 'variant_id')\n ->withPivot('quantity', 'branch_id', 'buying_date', 'buying_price')\n ->withTimestamps();\n }", "public function products()\n {\n return $this->hasMany(Product::class, 'state_id', 'id');\n }", "public function bulk_items(){\n return $this->belongsToMany('App\\Item','transaction_bulk')\n ->withPivot('quantity', 'unit_price')\n ->withTimestamps();\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function investor()\n {\n return $this->belongsToMany('App\\Models\\Investor', 'investor_bank_accounts', 'bank_id', 'investor_id');\n }", "public function stocks()\n {\n return $this->hasMany(InventoryStock::class, 'location_id', 'id');\n }", "public function sales()\n {\n // invoices\n return $this->belongsToMany('Biffy\\Entities\\Sale\\Sale')\n ->withPivot([])\n ->withTimestamps();\n }", "public function serviceTransactionReceipts()\n {\n return $this->hasMany('App\\Models\\ServiceTransactionReceipt');\n }", "public function buyers()\n {\n return $this->hasMany(Comprador::class, 'idNivelEstudios');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function tEntities()\n {\n return $this->hasMany(TEntity::class, 'sprachstil_id');\n }", "public function transaction()\n {\n return $this->hasMany(Transaction::class, 'transaction_detailID');\n }", "public function bookSellSubject()\n {\n return $this->hasMany(BookSell::class);\n }", "public function transaction()\n {\n return $this->hasMany('App\\Transaction');\n }", "public function inventory_items(){\n return $this->belongsToMany('App\\InventoryItem','transaction_inventory')\n ->withTimestamps();\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function sellerSales()\n {\n return $this->hasMany('App\\Domains\\Sale\\Sale');\n }", "public function saleItems()\n {\n return $this->hasManyThrough(SaleItem::class, Sale::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function twitterPerformance()\n {\n return $this->hasMany('App\\TwitterPerformance');\n }", "public function employeeSalesReport()\n {\n return $this->hasMany(Restaurant_order_detail::class, 'waiter_id', 'waiter_id');\n }", "public function vote_logs()\n {\n return $this->hasMany('App\\Models\\vote\\VoteLog', 'user_id');\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function tramites(): HasMany\n {\n return $this->hasMany(Tramite::class);\n }", "public function transactions()\n {\n return $this->hasMany(Transaction::class, $this->getForeignKey());\n }", "public function stockin()\n {\n $user_id = Auth::user()->id;\n \n $merchant = Merchant::where('user_id','=',$user_id)->first();\n return $merchant_pro = $merchant->products()\n ->whereNull('product.deleted_at')\n ->leftJoin('product as productb2b', function($join) {\n $join->on('product.id', '=', 'productb2b.parent_id')\n ->where('productb2b.segment','=','b2b');\n })\n ->leftJoin('product as producthyper', function($join) {\n $join->on('product.id', '=', 'producthyper.parent_id')\n ->where('producthyper.segment','=','hyper');\n })\n ->leftJoin('tproduct as tproduct', function($join) {\n $join->on('product.id', '=', 'tproduct.parent_id');\n })\n ->leftJoin('productbc','product.id','=','productbc.product_id')\n ->leftJoin('bc_management','bc_management.id','=','productbc.bc_management_id')\n ->select(DB::raw('\n product.id,\n product.parent_id,\n bc_management.id as bc_management_id,\n productbc.deleted_at as pbdeleted_at,\n product.name,\n product.thumb_photo as photo_1,\n product.available,\n productb2b.available as availableb2b,\n producthyper.available as availablehyper,\n tproduct.available as warehouse_available,\n product.sku'))\n ->groupBy('product.id')\n ->where(\"product.status\",\"!=\",\"transferred\")\n ->where(\"product.status\",\"!=\",\"deleted\")\n ->where(\"product.status\",\"!=\",\"\")\n ->orderBy('product.created_at','DESC')\n ->get();\n\t\treturn Response()->json($products);\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }" ]
[ "0.6671731", "0.666287", "0.6306795", "0.56660235", "0.5663323", "0.55213034", "0.55032563", "0.54803926", "0.546136", "0.5458228", "0.54511297", "0.5331444", "0.5260983", "0.52530915", "0.521661", "0.51714534", "0.51688176", "0.5140393", "0.5137394", "0.51203716", "0.5119787", "0.511662", "0.5103019", "0.5100281", "0.5093759", "0.50863636", "0.5043866", "0.50433975", "0.50425255", "0.5006087", "0.49989775", "0.49981022", "0.4989493", "0.49851322", "0.49660733", "0.4959781", "0.49503896", "0.49423665", "0.4924143", "0.49206534", "0.48605666", "0.48581278", "0.48542666", "0.4848168", "0.4844595", "0.48371252", "0.48331937", "0.48279914", "0.48262236", "0.48214614", "0.48109293", "0.47971404", "0.47917962", "0.4789826", "0.47857252", "0.4775975", "0.4771376", "0.47582793", "0.47507778", "0.4740914", "0.47379854", "0.47368056", "0.47361508", "0.47310492", "0.47304672", "0.4728919", "0.47265399", "0.4725434", "0.4725434", "0.47176546", "0.47070068", "0.46984407", "0.4693855", "0.46918383", "0.4691505", "0.46884036", "0.46863762", "0.46821287", "0.46809566", "0.46769437", "0.4672952", "0.46702406", "0.467024", "0.46680582", "0.46668196", "0.4664001", "0.46624708", "0.46534067", "0.46492508", "0.46482906", "0.4646779", "0.46432987", "0.46386883", "0.4636908", "0.4634149", "0.4631769", "0.4631474", "0.46304637", "0.46265754", "0.4624074" ]
0.67831755
0
SellerProduct has many ProductClicks.
public function productClicks() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\ProductClick','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function eventNotifySeller() {\r\n /**\r\n * Date calculation, Current date and Previous date\r\n */\r\n $currentDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(time()));\r\n $previousDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(strtotime($currentDate . ' -1 day')));\r\n\r\n // Getting all seller ID's whose products updated in from yesterday\r\n\r\n $_sellerCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToSelect('seller_id')\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->groupByAttribute('seller_id')\r\n ->load();\r\n\r\n foreach ($_sellerCollection as $_seller) {\r\n $sellerId = $_seller->getSellerId();\r\n $products = \"\";\r\n\r\n //Loading seller product collection\r\n $_productCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToFilter('seller_id', $_seller->getSellerId())\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->addAttributeToSelect('*')\r\n ->load();\r\n\r\n $i = 1;\r\n foreach ($_productCollection as $_product) {\r\n $small_image = Mage::helper('catalog/image')->init($_product, 'small_image')->resize(51, 68);\r\n $products .= '<tr>';\r\n $products .= '<td style=\"text-align:center; margin:0 0 10px; vertical-align:middle; padding:0 0 10px;\">' . $i . '</td>';\r\n $products .= '<td style=\"text-align:center; padding:0 0 20px;\"><img src=' . $small_image . ' alt=' . $_product->getName() . ' /></td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getName() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getSku() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('seller_product_status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;;\">' . $_product->getPrice() . '</td>';\r\n $products .= '</tr>';\r\n\r\n $i++;\r\n }\r\n $templateId = 9;\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templateId);\r\n\r\n //Getting seller information\r\n\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n\r\n // Setting up default sender information\r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n // Setting email variables\r\n $emailTemplateVariablesValue = (array(\r\n 'sellername' => $sellerName,\r\n 'products' => $products,\r\n 'seller_store' => $sellerStore,\r\n ));\r\n\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n\r\n /**\r\n * Send email to the seller\r\n */\r\n $emailTemplate->send($sellerEmail, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function wishlist_products()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products()\n\t{\n\t\treturn $this->belongsTo(Product::class);\n\t}", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function eventProduct()\n {\n return $this->belongsTo(\\App\\Models\\EventProduct::class, 'event_product_id');\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function clicks()\n {\n return $this->hasMany(Click::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function products()\n {\n return $this->belongsTo('App\\Product', 'product_id');\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function getLikesByProductId($sellerId,$productId);", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product');\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function getProductId(){\n return $this->product_id;\n }", "public function productHold()\n {\n return $this->hasMany('App\\Models\\ProductHold');\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function product()\n\t{\n\t\treturn $this->belongsTo('Tricks\\Product');\n\t}", "public function product() \n\t{\n\t\treturn $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n\t}", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function product()\n {\n return $this->belongsTo('Laracart\\Product\\Models\\Product', 'product_id');\n\n }", "public function products()\n {\n return $this->belongsToMany(\n Product::class,\n 'order_product',\n 'order_id',\n 'product_id'\n );\n }", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function products() {\n return $this->hasMany('App\\Product', 'category_id', 'id');\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withTimestamps();\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class, 'id_product', 'id_product');\n }", "public function products() {\n \treturn $this->belongsToMany(Product::class, 'items_product', 'item_id', 'product_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'restaurant_id');\n }", "public function product()\n {\n return $this->hasMany(product::class, 'category_id', 'id');\n }", "public function getOffer($productId, $sellerId);", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function product()\n {\n return $this->belongsToMany(Product::class,'product_id','id');\n \n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id');\n }", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function product()\n {\n return $this->belongsTo('Modules\\Admin\\Models\\Product','product_id','id');\n }", "public function product() : BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n }", "protected function _saveProducts()\n {\n $priceIsGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n $entityLinkField = $this->getProductEntityLinkField();\n\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = [];\n $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = [];\n $this->categoriesCache = [];\n $tierPrices = [];\n $mediaGallery = [];\n $labelsForUpdate = [];\n $imagesForChangeVisibility = [];\n $uploadedImages = [];\n $previousType = null;\n $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($bunch);\n\n foreach ($bunch as $rowNum => $rowData) {\n // reset category processor's failed categories array\n $this->categoryProcessor->clearFailedCategories();\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n $rowScope = $this->getRowScope($rowData);\n\n $rowData[self::URL_KEY] = $this->getUrlKey($rowData);\n\n $rowSku = $rowData[self::COL_SKU];\n\n if (null === $rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($rowSku)['attr_set_code'];\n }\n\n // 1. Entity phase\n if ($this->isSkuExist($rowSku)) {\n // existing row\n if (isset($rowData['attribute_set_code'])) {\n $attributeSetId = $this->catalogConfig->getAttributeSetId(\n $this->getEntityTypeId(),\n $rowData['attribute_set_code']\n );\n\n // wrong attribute_set_code was received\n if (!$attributeSetId) {\n throw new LocalizedException(\n __(\n 'Wrong attribute set code \"%1\", please correct it and try again.',\n $rowData['attribute_set_code']\n )\n );\n }\n } else {\n $attributeSetId = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n }\n\n $entityRowsUp[] = [\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'attribute_set_id' => $attributeSetId,\n $entityLinkField => $this->getExistingSku($rowSku)[$entityLinkField]\n ];\n } else {\n if (!$productLimit || $productsQty < $productLimit) {\n $entityRowsIn[strtolower($rowSku)] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($rowSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($rowSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => isset($rowData['has_options']) ? $rowData['has_options'] : 0,\n 'created_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n }\n\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n // 2. Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // 3. Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->processRowCategories($rowData);\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n unset($rowData['rowNum']);\n\n // 4.1. Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => $rowData['_tier_price_price'],\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] ||\n $priceIsGlobal ? 0 : $this->storeResolver->getWebsiteCodeToId($rowData['_tier_price_website']),\n ];\n }\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n\n // 5. Media gallery phase\n list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);\n $storeId = !empty($rowData[self::COL_STORE])\n ? $this->getStoreIdByCode($rowData[self::COL_STORE])\n : Store::DEFAULT_STORE_ID;\n $imageHiddenStates = $this->getImagesHiddenStates($rowData);\n foreach (array_keys($imageHiddenStates) as $image) {\n if (array_key_exists($rowSku, $existingImages)\n && array_key_exists($image, $existingImages[$rowSku])\n ) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n $uploadedImages[$image] = $image;\n }\n\n if (empty($rowImages)) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n }\n }\n\n $rowData[self::COL_MEDIA_IMAGE] = [];\n\n /*\n * Note: to avoid problems with undefined sorting, the value of media gallery items positions\n * must be unique in scope of one product.\n */\n $position = 0;\n foreach ($rowImages as $column => $columnImages) {\n foreach ($columnImages as $columnImageKey => $columnImage) {\n if (!isset($uploadedImages[$columnImage])) {\n $uploadedFile = $this->uploadMediaFiles($columnImage);\n $uploadedFile = $uploadedFile ?: $this->getSystemFile($columnImage);\n if ($uploadedFile) {\n $uploadedImages[$columnImage] = $uploadedFile;\n } else {\n $this->addRowError(\n ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,\n $rowNum,\n null,\n null,\n ProcessingError::ERROR_LEVEL_NOT_CRITICAL\n );\n }\n } else {\n $uploadedFile = $uploadedImages[$columnImage];\n }\n\n if ($uploadedFile && $column !== self::COL_MEDIA_IMAGE) {\n $rowData[$column] = $uploadedFile;\n }\n\n if ($uploadedFile && !isset($mediaGallery[$storeId][$rowSku][$uploadedFile])) {\n if (isset($existingImages[$rowSku][$uploadedFile])) {\n $currentFileData = $existingImages[$rowSku][$uploadedFile];\n if (isset($rowLabels[$column][$columnImageKey])\n && $rowLabels[$column][$columnImageKey] !=\n $currentFileData['label']\n ) {\n $labelsForUpdate[] = [\n 'label' => $rowLabels[$column][$columnImageKey],\n 'imageData' => $currentFileData\n ];\n }\n\n if (array_key_exists($uploadedFile, $imageHiddenStates)\n && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]\n ) {\n $imagesForChangeVisibility[] = [\n 'disabled' => $imageHiddenStates[$uploadedFile],\n 'imageData' => $currentFileData\n ];\n }\n } else {\n if ($column == self::COL_MEDIA_IMAGE) {\n $rowData[$column][] = $uploadedFile;\n }\n $mediaGallery[$storeId][$rowSku][$uploadedFile] = [\n 'attribute_id' => $this->getMediaGalleryAttributeId(),\n 'label' => isset($rowLabels[$column][$columnImageKey])\n ? $rowLabels[$column][$columnImageKey]\n : '',\n 'position' => ++$position,\n 'disabled' => isset($imageHiddenStates[$columnImage])\n ? $imageHiddenStates[$columnImage] : '0',\n 'value' => $uploadedFile,\n ];\n }\n }\n }\n }\n\n // 6. Attributes phase\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n $productType = isset($rowData[self::COL_TYPE]) ? $rowData[self::COL_TYPE] : null;\n if ($productType !== null) {\n $previousType = $productType;\n }\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if ($prevAttributeSet !== null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && $previousType !== null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n\n $productTypeModel = $this->_productTypeModels[$productType];\n if (!empty($rowData['tax_class_name'])) {\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($rowData[self::COL_SKU])\n ) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !$this->isSkuExist($rowSku)\n );\n $product = $this->_proxyProdFactory->create(['data' => $rowData]);\n\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType()\n && (\n in_array($attribute->getAttributeCode(), $this->dateAttrCodes)\n || $attribute->getIsUserDefined()\n )\n ) {\n $attrValue = $this->dateTime->formatDate($attrValue, false);\n } elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = gmdate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n } elseif ($backModel) {\n $attribute->getBackend()->beforeSave($product);\n $attrValue = $product->getData($attribute->getAttributeCode());\n }\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($rowStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$rowStore];\n }\n if (!$this->isSkuExist($rowSku)) {\n $storeIds[] = 0;\n }\n }\n foreach ($storeIds as $storeId) {\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$storeId])) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n }\n\n foreach ($bunch as $rowNum => $rowData) {\n if ($this->getErrorAggregator()->isRowInvalid($rowNum)) {\n unset($bunch[$rowNum]);\n }\n }\n\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n )->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->updateMediaGalleryVisibility(\n $imagesForChangeVisibility\n )->updateMediaGalleryLabels(\n $labelsForUpdate\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $bunch]\n );\n }\n\n return $this;\n }", "public function products() {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function product()\n {\n return $this->belongsTo('App\\Product', 'product_id');\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }" ]
[ "0.68106705", "0.60711646", "0.6036811", "0.59526765", "0.5870119", "0.58399224", "0.58379906", "0.58329725", "0.582531", "0.58238775", "0.5787094", "0.57846665", "0.57792914", "0.57792914", "0.57792914", "0.57792914", "0.57792914", "0.57792914", "0.57792914", "0.5774103", "0.57690847", "0.5759487", "0.57584333", "0.5743407", "0.57325757", "0.5722566", "0.5722566", "0.5707851", "0.57051826", "0.57051826", "0.57051826", "0.57051826", "0.57051826", "0.57051826", "0.57051826", "0.57050425", "0.5701736", "0.56949335", "0.5679687", "0.56795883", "0.5674396", "0.56599826", "0.5650262", "0.56471527", "0.5642224", "0.5641009", "0.56376445", "0.5629157", "0.5625299", "0.56232786", "0.56199217", "0.55966383", "0.5595774", "0.55947715", "0.55881655", "0.5580633", "0.5580633", "0.5580633", "0.5580633", "0.55766046", "0.55710787", "0.5564221", "0.5556419", "0.5550296", "0.55284095", "0.55232155", "0.55201524", "0.5516107", "0.55078214", "0.5497746", "0.5469585", "0.54670036", "0.5465432", "0.5458406", "0.5454593", "0.5454482", "0.5454007", "0.54519093", "0.54505765", "0.5437855", "0.5435693", "0.54109204", "0.5407964", "0.54041255", "0.53998476", "0.53959745", "0.53776914", "0.5374378", "0.5371141", "0.5360587", "0.5351566", "0.5343241", "0.5339973", "0.5337296", "0.5324861", "0.5322477", "0.5316892", "0.5316892", "0.5316892", "0.5316892" ]
0.7396898
0
SellerProduct has many Feedbacks.
public function feedbacks() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\Feedback','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function feedback()\n {\n return $this->hasMany('Feedback', 'department_id');\n }", "public function feedback()\n {\n return $this->hasOne('App\\Models\\User\\Feedback', 'user_id');\n }", "public function reviews() {\n return $this->hasMany('App\\Models\\ProductReview');\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function getProductReviews()\n {\n return $this->hasMany(ProductReview::className(), ['review_uuid' => 'uuid']);\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function eventNotifySeller() {\r\n /**\r\n * Date calculation, Current date and Previous date\r\n */\r\n $currentDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(time()));\r\n $previousDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(strtotime($currentDate . ' -1 day')));\r\n\r\n // Getting all seller ID's whose products updated in from yesterday\r\n\r\n $_sellerCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToSelect('seller_id')\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->groupByAttribute('seller_id')\r\n ->load();\r\n\r\n foreach ($_sellerCollection as $_seller) {\r\n $sellerId = $_seller->getSellerId();\r\n $products = \"\";\r\n\r\n //Loading seller product collection\r\n $_productCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToFilter('seller_id', $_seller->getSellerId())\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->addAttributeToSelect('*')\r\n ->load();\r\n\r\n $i = 1;\r\n foreach ($_productCollection as $_product) {\r\n $small_image = Mage::helper('catalog/image')->init($_product, 'small_image')->resize(51, 68);\r\n $products .= '<tr>';\r\n $products .= '<td style=\"text-align:center; margin:0 0 10px; vertical-align:middle; padding:0 0 10px;\">' . $i . '</td>';\r\n $products .= '<td style=\"text-align:center; padding:0 0 20px;\"><img src=' . $small_image . ' alt=' . $_product->getName() . ' /></td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getName() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getSku() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('seller_product_status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;;\">' . $_product->getPrice() . '</td>';\r\n $products .= '</tr>';\r\n\r\n $i++;\r\n }\r\n $templateId = 9;\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templateId);\r\n\r\n //Getting seller information\r\n\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n\r\n // Setting up default sender information\r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n // Setting email variables\r\n $emailTemplateVariablesValue = (array(\r\n 'sellername' => $sellerName,\r\n 'products' => $products,\r\n 'seller_store' => $sellerStore,\r\n ));\r\n\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n\r\n /**\r\n * Send email to the seller\r\n */\r\n $emailTemplate->send($sellerEmail, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function getSupportProducts()\n {\n return $this->hasMany(SupportProduct::class, ['indigent_id' => 'id']);\n }", "public function productClicks()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductClick','sp_id','sp_id');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function product()\n {\n return $this->hasMany(product::class, 'category_id', 'id');\n }", "public function products()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function relatedProducts (){\n #reviews...\n $product= Product::with('reviews')\n ->whereIndumentariaId($this->indumentaria->id)\n ->where('id', '!=', $this->id)\n ->where('status', Product::PUBLISHED)\n ->latest()\n ->limit(6)\n ->get();\n return $product;\n }", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function learn() \n\t{\n\t\treturn $this->belongsTo('App\\Models\\Learn', 'product_id', 'id');\n\t}", "public function setSellerOfferDiscountByProductId($sellerId,$productId,$offerAmount, $offer_comment) {\n try {\n $rmaHelper = $this->_objectManager->create('Webkul\\MpRmaSystem\\Helper\\Data');\n $productSellerId = $rmaHelper->getSellerIdByproductid($productId);\n $response = [];\n $i = 0;\n if($sellerId == $productSellerId) {\n $likesByProductId = $this->_objectManager->create('Seasia\\Customapi\\Helper\\Data')->getLikesByProductId($productId);\n\n //echo '<pre>'; print_r($likesByProductId);die;\n if(is_array($likesByProductId)) {\n foreach($likesByProductId as $value) {\n $offerCollection = $this->_offerFactory->create();\n $offerCollection->setProductId($productId);\n $offerCollection->setSellerId($sellerId);\n $offerCollection->setBuyerId($value['entity_id']);\n $offerCollection->setOrderId(null);\n $offerCollection->setOfferAmount($offerAmount);\n $offerCollection->setStatus('pending');\n $offerCollection->setComment($offer_comment);\n $offerCollection->setCreatedAt(date(\"Y-m-d H:i:s\"));\n $offerCollection->setStripeToken(null);\n $offerCollection->setExpired(null);\n $offerCollection->setOfferUsed(null);\n $offerCollection->setOfferType('productOffer');\n $offerCollection->save();\n if($offerCollection->save()) {\n $offerId = $offerCollection->getId();\n $offer = $this->getOfferById($offerId);\n if($this->sendOfferMail(\"sent\", $offer)) {\n\n $notification_helper = $this->_objectManager->create(\n 'Seasia\\Customnotifications\\Helper\\Data'\n );\n\n $offerId = $offer->getId();\n $type = \"offer_received\";\n $buyer = $offer->getBuyerId();\n $seller = $offer->getSellerId();\n $message = 'Test';\n\n $notification_helper->setNotification($offerId,$type,$buyer,$seller,$message);\n // Send Notification To Buyer\n $i++;\n }\n }\n }\n }\n $response['status'] = \"Success \";\n $response['message'] = \"Discount set to offer successfully\";\n }\n return $this->getResponseFormat($response);\n } catch(\\Exception $e) {\n return $this->errorMessage($e);\n }\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function products() {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function answers()\n {\n return $this->hasMany(FeedbackAnswer::class, 'feedback_id');\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function offerreceivedbyid($sellerId, $offerId){\n try{\n $response = array();\n $response['products'] = array();\n $response['buyer'] = array();\n $offerModel = $this->_offerFactory->create();\n $store = $this->_storemanager->getStore();\n $offerCollection = $offerModel->getCollection()\n ->addFieldToFilter('seller_id', array('eq' => $sellerId))\n ->addFieldToFilter('product_id', array('eq' => $offerId))\n //->addFieldToFilter('expired', array('eq' => '0'))\n //->addFieldToFilter('offer_used', array('eq' => '1'))\n ;\n $offerCollection->getSelect()->where(\"(offer_used = '1' OR status = 'counter_offer') AND status != 'counter' \");\n\n\n if($offerCollection->getSize() > 0){\n $productsArray = array();\n\n\n $productData = array();\n $product = $this->_productModel->load($offerId);\n $productData['name'] = $product->getName();\n $productData['description'] = $product->getDescription();\n $productData['original_price'] = $product->getCost();\n $productData['price'] = $product->getPriceInfo()->getPrice('regular_price')->getValue();\n $productData['imageUrl'] = $store->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();\n\n $productData['productUrl'] = $product->getProductUrl();\n\n array_push($productsArray, $productData);\n\n $buyerCollection = $offerModel->getCollection()\n ->addFieldToFilter('main_table.seller_id', array('eq' => $sellerId))\n ->addFieldToFilter('product_id', array('eq' => $offerId))\n //->addFieldToFilter('offer_used', array('eq' => '1'))\n ;\n $buyerCollection->getSelect()->where(\"(offer_used = '1' OR status = 'counter_offer') AND status != 'counter'\");\n $joinTable = $this->_objectManager->create(\n 'Webkul\\Agorae\\Model\\ResourceModel\\Mpfavouriteseller\\Collection'\n )->getTable('customer_entity');\n\n $buyerCollection->getSelect()->join(\n $joinTable.' as cgf',\n 'main_table.buyer_id = cgf.entity_id',\n array('firstname','lastname')\n );\n\n $sellerjoinTable = $this->_objectManager->create(\n 'Webkul\\Agorae\\Model\\ResourceModel\\Mpfavouriteseller\\Collection'\n )->getTable('marketplace_userdata');\n\n $buyerCollection->getSelect()->joinLeft(\n $sellerjoinTable.' as sgf',\n 'main_table.buyer_id = sgf.seller_id',\n array('shop_url as username')\n );\n $buyerCollection->setOrder(\"offer_amount\", \"desc\");\n\n\n\n $allBuyers = array();\n foreach ($buyerCollection as $eachBuyer) {\n $partner = $this->_marketplacehelper->getSellerDataBySellerId($eachBuyer->getBuyerId())->getFirstItem();\n $eachBuyerArray = array();\n $eachBuyerArray = $eachBuyer->getData();\n\n $now = date('Y-m-d H:i:s');\n $expiredDate = $this->offerhelper->getExpiredDate($eachBuyerArray['created_at']);\n $t1 = strtotime( $expiredDate );\n $t2 = strtotime($now);\n\n $diff = $t1 - $t2;\n $hours = $diff / ( 60 * 60 );\n\n if($hours > 0){\n $status = $eachBuyerArray['status'];\n }else{\n $status = \"expired\";\n }\n $eachBuyerArray['status'] = $status;\n $eachBuyerArray['shop_url'] =\"\";\n if($partner->getId()){\n $eachBuyerArray['shop_url'] = $this->_marketplacehelper->getRewriteUrl(\n 'marketplace/seller/collection/shop/'.\n $partner->getShopUrl()\n );\n }\n\n $eachBuyerArray['expired_at'] = $this->offerhelper->getExpiredDate($eachBuyer->getCreatedAt());\n\n\n array_push($allBuyers, $eachBuyerArray);\n }\n\n\n $response['products'] = $productsArray;\n $response['buyer'] = $allBuyers;\n\n\n\n }\n return $this->getResponseFormat($response);\n } catch(\\Exception $e) {\n return $this->errorMessage($e);\n }\n }", "public function wishlist_products()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function products() {\n return $this->hasMany('App\\Product', 'category_id', 'id');\n }", "public function products()\n {\n return $this->belongsTo('App\\Product', 'product_id');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function product()\n {\n return $this->belongsTo('Laracart\\Product\\Models\\Product', 'product_id');\n\n }", "public function offer()\n {\n return $this->hasMany('App\\Models\\Offer');\n }", "public function productsSurveys(){\n $user = $this->auth();\n if(empty($this->auth())){\n Utils::response(['status'=>false,'message'=>'Forbidden access.'],403);\n }\n $data = $this->getInput();\n if(($this->input->method() != 'post') || empty($data)){ \n Utils::response(['status'=>false,'message'=>'Bad request.'],400);\n }\n $validate = [\n ['field' =>'consumer_id','label'=>'Consumer ID','rules' => 'required' ],\n ];\n $errors = $this->ScannedproductsModel->validate($data,$validate);\n if(is_array($errors)){\n Utils::response(['status'=>false,'message'=>'Validation errors.','errors'=>$errors]);\n }\n\t\t$consumer_id = $data['consumer_id']; \n\t\t//echo $consumer_id; exit;\n $result = $this->ScannedproductsModel->findProductForConsumerSurvey($consumer_id);\n\t\t//$result = $this->ScannedproductsModel->sendFCMSurvey($mess,$consumer_id);\n\t\t\n\t\t//echo $result;\n\t\t/* \n if(!empty($result->product_video)){\n $result->product_video = Utils::setFileUrl($result->product_video);\n\t\t\techo $result->product_video;\n\t\t\t\n }*/\n\t\t\n\t\tif(empty($result)){\n $this->response(['status'=>false,'message'=>'Record not found'],200);\n }\n $this->response(['status'=>true,'message'=>'Push Surveys','data'=>$result]);\n\t\t\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo('Tricks\\Product');\n\t}", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function offermade($sellerId, $offerId){\n try{\n $response = array();\n $offerModel = $this->_offerFactory->create();\n $store = $this->_storemanager->getStore();\n $offerCollection = $offerModel->getCollection()\n ->addFieldToFilter('buyer_id', array('eq' => $sellerId))\n ->addFieldToFilter('id', array('eq' => $offerId))\n //->addFieldToFilter('expired', array('eq' => '0'))\n //->addFieldToFilter('offer_used', array('eq' => '1'))\n ;\n $offerCollection->getSelect()->where(\"offer_used = '1' OR status = 'counter_offer'\");\n if($offerCollection->getSize() > 0){\n $products = array();\n $offer = $offerCollection->getFirstItem();\n\n $response = $offer->getData();\n $productIds = explode(\",\",$offer->getProductId());\n foreach($productIds as $productId){\n $product = $this->_productModel->load($productId);\n $eachProduct = array();\n $eachProduct['productId'] = $product->getId();\n $eachProduct['name'] = $product->getName();\n $eachProduct['description'] = $product->getDescription();\n $eachProduct['price'] = $product->getPriceInfo()->getPrice('regular_price')->getValue();\n $eachProduct['imageUrl'] = $store->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();\n\n $eachProduct['productUrl'] = $product->getProductUrl();\n\n array_push($products, $eachProduct);\n }\n\n $partner = $this->_marketplacehelper->getSellerDataBySellerId($offer->getSellerId())->getFirstItem();\n\n if ($partner->getLogoPic()) {\n $logoPic = $this->_marketplacehelper->getMediaUrl().'avatar/'.$partner->getLogoPic();\n } else {\n $logoPic = $this->_marketplacehelper->getMediaUrl().'avatar/noimage.png';\n }\n $shopUrl = $this->_marketplacehelper->getRewriteUrl(\n 'marketplace/seller/collection/shop/'.\n $partner->getShopUrl()\n );\n $response['products'] = $products;\n $response['seller']['firstname'] = $partner->getFirstname();\n $response['seller']['lastname'] = $partner->getLastname();\n $response['seller']['email'] = $partner->getEmail();\n $response['seller']['logo_image'] = $logoPic;\n\n $response['seller']['username'] = $partner->getShopUrl();\n $response['seller']['shopUrl'] = $shopUrl;\n }\n\n return $this->getResponseFormat($response);\n } catch(\\Exception $e) {\n return $this->errorMessage($e);\n }\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function product() \n\t{\n\t\treturn $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n\t}", "public function product()\n {\n return $this->hasMany('App\\Models\\Product','gender_id','id');\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id');\n }", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function supplies(){\n return $this->hasMany('CValenzuela\\Supply');\n }", "public function offers()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n \treturn $this->hasMany('App\\Offer','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function products()\n\t{\n\t\treturn $this->belongsTo(Product::class);\n\t}", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function products()\n {\n return $this->belongsToMany('App\\Product');\n }", "public function product()\n {\n return $this->belongsTo('Modules\\Admin\\Models\\Product','product_id','id');\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n }", "public function productsLang()\n {\n// {\n// $idLang = 1;\n// }\n\n return $this->hasMany('App\\Models\\ProductLang')->where('lang_id', '=', 1);\n }", "public function supportticket(){\n return $this->hasMany('App\\SupportTicket', 'department_id', 'id');\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'user_id');\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'restaurant_id');\n }", "public function offers()\n {\n return $this->hasMany('\\App\\Offer');\n }", "public function products()\n {\n return $this->belongsToMany('App\\models\\Product', 'product_variants');\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function getOffer($productId, $sellerId);", "public function pdeductions(){\n return $this->hasMany(Productdeduction::class);\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function eventProduct()\n {\n return $this->belongsTo(\\App\\Models\\EventProduct::class, 'event_product_id');\n }", "public function product()\n {\n // belongsTo(RelatedModel, foreignKey = product_id, keyOnRelatedModel = id)\n return $this->belongsTo(Product::class);\n }" ]
[ "0.652182", "0.64511317", "0.6133539", "0.60101277", "0.58059", "0.5803118", "0.5752752", "0.57003075", "0.5639227", "0.56248295", "0.5585644", "0.5577789", "0.5566114", "0.5561023", "0.55426985", "0.55254346", "0.55254346", "0.55254346", "0.55254346", "0.55254346", "0.55254346", "0.55254346", "0.5478418", "0.54575497", "0.5449954", "0.54499257", "0.54347795", "0.54347795", "0.5418823", "0.5418823", "0.5418823", "0.5418823", "0.5418823", "0.5418823", "0.5418823", "0.5413739", "0.54086864", "0.5391975", "0.5367411", "0.5367003", "0.5366714", "0.5359618", "0.53547156", "0.532758", "0.53171617", "0.53119856", "0.5311526", "0.5310857", "0.53094774", "0.5300901", "0.5291216", "0.52870005", "0.5285755", "0.5285433", "0.5284862", "0.52795255", "0.52737147", "0.5268573", "0.52445614", "0.5244386", "0.52333504", "0.52321887", "0.52254325", "0.5218586", "0.5206328", "0.5195283", "0.51882714", "0.51808596", "0.5171881", "0.5170693", "0.516956", "0.5168899", "0.5164501", "0.5163579", "0.51621187", "0.51611334", "0.5137634", "0.5136479", "0.51352954", "0.51332474", "0.5118757", "0.51164156", "0.51139927", "0.5113446", "0.51109266", "0.51059544", "0.5102164", "0.51004773", "0.5099803", "0.5097401", "0.5088629", "0.5086152", "0.5086152", "0.5086152", "0.5086152", "0.5084519", "0.50829744", "0.507731", "0.5075857", "0.5075806" ]
0.66585064
0
SellerProduct has many ProductRatings.
public function productRatings() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\ProductRating','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ratings()\n {\n return $this->hasMany('App\\Models\\Rating');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function ratings()\n {\n return $this->hasMany(\\App\\Rating::class);\n }", "public function getProductReviews()\n {\n return $this->hasMany(ProductReview::className(), ['review_uuid' => 'uuid']);\n }", "public function ratings()\n {\n \treturn $this->hasMany(Rating::class);\n }", "public function reviews() {\n return $this->hasMany('App\\Models\\ProductReview');\n }", "public function ratings()\n {\n return $this->morphMany(Rating::class, 'rateable');\n }", "public function rateProduct(Request $request)\n {\n\n // Create a new empty Rating collection.\n $rating = new Rating;\n\n // Populate the \"rating\" collection with the values,\n // got from the user-submitted form.\n $rating->rating_product = $request->product;\n $rating->rating_rate = $request->userRating;\n\n // Save the \"rating\" collection to database.\n $rating->save();\n\n\n // Get all ratings records for the required product.\n $newRating = Rating::select('rating_rate')->where('rating_product', $request->product)->get();\n\n // Get the average rating of the required product, \n // and format it with two decimal places.\n $averageRating = $newRating->average('rating_rate');\n $formattedRating = number_format($averageRating, 2);\n\n return response()->json($formattedRating);\n }", "public function ratings()\n {\n return $this->morphMany(\\App\\Models\\Rating::class, 'rateable');\n }", "public function product_ratings($product_id)\n\t{\n\t\t$this->db->from('product_review');\n\t\t$this->db->where('product_review_status = 1 AND product_id = '.$product_id);\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public function ratings()\n {\n return $this->morphMany('willvincent\\Rateable\\Rating', 'rateablein');\n }", "public function rating(){\n return $this->belongsTo('App\\Models\\Rating');\n }", "public function getLikesByProductId($sellerId,$productId);", "public function rating()\n {\n return $this->belongsTo('App\\Models\\Rating','user_id','user_id');\n }", "public function rating()\n {\n return $this->hasOne('App\\Review')\n ->selectRaw('user_id, count(*) as count, avg(would_recommend) as avg, avg(communication) as communication, avg(as_described) as as_described')\n ->groupBy('user_id');\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function query(ProductRating $model)\n {\n return $model->where('deleted_at', null)->with('product', 'user');\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function ratings()\n {\n return $this->hasMany(WallRate::class);\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function averageRating()\n {\n return $this->hasOne('App\\StoreAverageRating');\n }", "public function relatedProducts (){\n #reviews...\n $product= Product::with('reviews')\n ->whereIndumentariaId($this->indumentaria->id)\n ->where('id', '!=', $this->id)\n ->where('status', Product::PUBLISHED)\n ->latest()\n ->limit(6)\n ->get();\n return $product;\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'restaurant_id');\n }", "function get_list_product_rating() {\n\n global $product;\n\n if ( ! wc_review_ratings_enabled() ) {\n \treturn;\n }\n\n echo wc_get_rating_html( $product->get_average_rating() ); // WordPress.XSS.EscapeOutput.OutputNotEscaped.\n\n }", "public function rating()\n\t{\n\t\tif ( !( $this instanceof \\IPS\\Node\\Ratings ) )\n\t\t{\n\t\t\tthrow new \\BadMethodCallException;\n\t\t}\n\t\t\n\t\tif ( $this->canRate() )\n\t\t{\n\t\t\t$idColumn = static::$databaseColumnId;\n\t\t\t\t\t\t\n\t\t\t$form = new \\IPS\\Helpers\\Form('rating');\n\t\t\t$form->add( new \\IPS\\Helpers\\Form\\Rating( 'rating', $this->averageRating() ) );\n\t\t\t\n\t\t\tif ( $values = $form->values() )\n\t\t\t{\n\t\t\t\t\\IPS\\Db::i()->insert( 'core_ratings', array(\n\t\t\t\t\t'class'\t\t=> get_called_class(),\n\t\t\t\t\t'item_id'\t=> $this->$idColumn,\n\t\t\t\t\t'member'\t=> \\IPS\\Member::loggedIn()->member_id,\n\t\t\t\t\t'rating'\t=> $values['rating'],\n\t\t\t\t\t'ip'\t\t=> \\IPS\\Request::i()->ipAddress()\n\t\t\t\t), TRUE );\n\t\t\t\t\n\t\t\t\tif ( isset( static::$ratingColumnMap['rating_average'] ) )\n\t\t\t\t{\n\t\t\t\t\t$column = static::$ratingColumnMap['rating_average'];\n\t\t\t\t\t$this->$column = \\IPS\\Db::i()->select( 'AVG(rating)', 'core_ratings', array( 'class=? AND item_id=?', get_called_class(), $this->$idColumn ) )->first();\n\t\t\t\t}\n\t\t\t\tif ( isset( static::$ratingColumnMap['rating_total'] ) )\n\t\t\t\t{\n\t\t\t\t\t$column = static::$ratingColumnMap['rating_total'];\n\t\t\t\t\t$this->$column = \\IPS\\Db::i()->select( 'SUM(rating)', 'core_ratings', array( 'class=? AND item_id=?', get_called_class(), $this->$idColumn ) )->first();\n\t\t\t\t}\n\t\t\t\tif ( isset( static::$ratingColumnMap['rating_hits'] ) )\n\t\t\t\t{\n\t\t\t\t\t$column = static::$ratingColumnMap['rating_hits'];\n\t\t\t\t\t$this->$column = \\IPS\\Db::i()->select( 'COUNT(*)', 'core_ratings', array( 'class=? AND item_id=?', get_called_class(), $this->$idColumn ) )->first();\n\t\t\t\t}\n\n\t\t\t\t$this->save();\n\t\t\t\t\n\t\t\t\tif ( \\IPS\\Request::i()->isAjax() )\n\t\t\t\t{\n\t\t\t\t\t\\IPS\\Output::i()->json( 'OK' );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $form->customTemplate( array( call_user_func_array( array( \\IPS\\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'ratingTemplate' ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \\IPS\\Theme::i()->getTemplate( 'global', 'core' )->rating( 'veryLarge', $this->averageRating() );\n\t\t}\n\t}", "private function findRatingByProduct($arrProduct){\n $queryResult = DB::table('product_reviews')\n ->whereIN('product_id',$arrProduct)\n ->groupBy('product_id')\n ->select(DB::raw('AVG(rating) as avg_rating, COUNT(*) as total_ratings,product_id'))\n ->get();\n //array to store the result\n $arrRating = array();\n\n //reading the results\n foreach($queryResult as $row) {\n\n $num_of_full_starts = round($row->avg_rating,1);// number of full stars\n $num_of_half_starts = $num_of_full_starts-floor($num_of_full_starts); //number of half stars\n $number_of_blank_starts = 5-($row->avg_rating); //number of white stars\n\n $arrRating[$row->product_id] = array(\n 'averageRating' => $row->avg_rating,\n 'totalRating' => $row->total_ratings,\n 'full_stars' => $num_of_full_starts,\n 'half_stars' => $num_of_half_starts,\n 'blank_stars' => $number_of_blank_starts\n );\n }\n\n \n\n\n return $arrRating;\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function rating()\n {\n $rating = Review::where('product_id', $this->id)->avg('rating');\n if ($rating) {\n $rating = (float)$rating;\n $rating = round($rating, 2);\n } else {\n $rating = 0;\n }\n return $rating;\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function getAggregateRating()\n {\n $collection = Mage::getModel('rating/rating_option_vote')\n ->getResourceCollection()\n ->setEntityPkFilter($this->getProduct()->getId())\n ->setStoreFilter(Mage::app()->getStore()->getId());\n return $this->getAverageRatingByCollection($collection);\n }", "function displayProductRating($rating = null,$pro_id = null) {\n\t\t// import department db\n\t\tApp::import('Model','ProductRating');\n\t\t$this->ProductRating = & new ProductRating();\n\t\t$total_rating_reviewers = $this->ProductRating->find('count',array('conditions'=>array('ProductRating.product_id'=>$pro_id)));\n\t\t$half_star = 0;$full_star = 0;$avg_rating = 0;$ratingStar='';\n\t\tif(!empty($rating)){\n\t\t\t$rating_arr = explode('.',$rating);\n\t\t\t$full_star = $rating_arr[0];\n\t\t\tif(!empty($rating_arr[1])){\n\t\t\t\t$first_decimal = $rating_arr[1][0];\n\t\t\t\tif($first_decimal >= 5){\n\t\t\t\t\t$half_star = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!empty($full_star)){\n\t\t\tfor($avgrate = 0; $avgrate < $full_star; $avgrate++){\n\t\t\t\t$ratingStar .= '<img src=\"'.SITE_URL.'img/red-star-rating.png\" width=\"12\" height=\"12\" alt=\"\" >';\n\t\t\t}\n\t\t}\n\t\tif(!empty($half_star)){ // half star\n\t\t\t$ratingStar .= '<img src=\"'.SITE_URL.'img/half-red-star-rating.png\" width=\"12\" height=\"12\" alt=\"\" >';\n\t\t\t$avg_rating = $full_star + 1;\n\t\t} else{\n\t\t\t$avg_rating = $full_star;\n\t\t}\n\t\t// show gray color stars\n\t\tfor($avgrate_white = 0; $avgrate_white < (5-$avg_rating); $avgrate_white++){\n\t\t\t$ratingStar .= '<img src=\"'.SITE_URL.'img/gray-star-rating.png\" width=\"12\" height=\"12\" alt=\"\" >';\n\t\t}\t\n\t\treturn $ratingStar. \" ($total_rating_reviewers)\";\n\t}", "public function show(Product $pro)\n {\n $comments = $pro->comments->where('status','1');\n $rates = $pro->ratings;\n// dd($rates);\n $rating = $pro->averageRating;\n// $rating = 0;\n// if(!empty($rates)){\n// foreach ($rates as $rate) {\n// $rating += $rate->rating;\n// }\n// $rating /= count($rates);\n// }\n// dd($rating);\n\n\n $mortabet = [];\n $ids = [];\n $tags = $pro->tags()->get();\n foreach($tags as $val){\n $products = $val->products()->get();\n foreach ($products as $product) {\n $ids = array_column($mortabet, 'id');\n if(!in_array($product->id, $ids) && ($product->id != $pro->id)){\n array_push($ids, $product->id);\n array_push($mortabet, $product);\n }\n }\n }\n return view('persiatc.pages.product',compact('pro','mortabet', 'comments', 'rating'));\n }", "public function showRating(Request $request){\n $this->validate($request, [\n 'product_id' => 'required'\n ]);\n // get rating\n \n $auth_id = Auth::id();\n $rating = Review::where([\"user_id\" => $auth_id, \"product_id\" => $request->product_id])->get();\n if(count($rating) > 0){\n $rating = json_decode(json_encode($rating));\n // avg ratings\n $review = Review::where('product_id', '=', $request->product_id)->avg('ratings');\n $avgRating = number_format($review, 0);\n return response()->json([$rating[0], $avgRating], 200);\n }\n \n \n \n }", "public function productImage(){\n\t\treturn $this->hasmany('App\\ProductImages','product_id');\n\t}", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function setRating(RatingInterface $rating);", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function images()\n {\n return $this->hasMany(ProductImageProxy::modelClass(), 'seller_product_id');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function product()\n {\n return $this->hasMany('App\\Models\\Product','gender_id','id');\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function getOffer($productId, $sellerId);", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function wishlist_products()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function product() \n\t{\n\t\treturn $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n\t}", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function getRating();", "public function getRating();", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $productRatings = $em->getRepository('AppBundle:ProductRating')->findAll();\n\n return $this->render('productrating/index.html.twig', array(\n 'productRatings' => $productRatings,\n ));\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function product()\n {\n return $this->belongsTo('Laracart\\Product\\Models\\Product', 'product_id');\n\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo('Tricks\\Product');\n\t}", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function getRating()\n {\n if (!$this->getRatingCollection()) {\n $ratingCollection = $this->_voteFactory->create()->getResourceCollection()->setReviewFilter(\n $this->getReviewId()\n )->addRatingInfo(\n $this->_storeManager->getStore()->getId()\n )->setStoreFilter(\n $this->_storeManager->getStore()->getId()\n )->load();\n\n $this->setRatingCollection($ratingCollection->getSize() ? $ratingCollection : false);\n }\n\n return $this->getRatingCollection();\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function getRatings(): Collection\n {\n\n return $this->ratings;\n\n }", "public function getProductRecommendations()\n {\n return $this->productRecommendations;\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function addItemRating(ItemRating $l)\n\t{\n\t\tif ($this->collItemRatings === null) {\n\t\t\t$this->initItemRatings();\n\t\t}\n\t\tif (!in_array($l, $this->collItemRatings, true)) { // only add it if the **same** object is not already associated\n\t\t\tarray_push($this->collItemRatings, $l);\n\t\t\t$l->setUser($this);\n\t\t}\n\t}", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function canRating($customerId, $productId)\n {\n if ($customerId == \"\") {\n return false;\n }\n\n $order = TblOrder::select('tbl_order.order_id', 'tbl_order.customer_id')\n ->leftJoin('order_details as dt', 'tbl_order.order_id', '=', 'dt.order_id')\n ->where('tbl_order.order_status', 4)\n ->where('tbl_order.customer_id', $customerId)\n ->where('dt.product_id', $productId)\n ->get();\n\n $rated = Rating::where('customer_id', $customerId)->where('product_id', $productId)->get();\n\n if (count($rated) == 0 && count($order) > 0) {\n return true;\n }\n \n return false;\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function Product()\n\t{\n\t\treturn $this->belongsTo('App\\Product');\n\t}", "public function product() : BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function addRatings()\n {\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class, 'id_product', 'id_product');\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public function displayTopRated()\n {\n // we first fetch all products with reviews. Then get those that meet our criteria\n // our criteria states that a top rated product should have at least 4.0 stars and\n // be reviewed at least 2 times. The hard coded values are just defaults, just in-case\n // the ones in our config are missing\n\n // for now, that criteria will be ok, since we have a few products and users\n $data = $this->with(['reviews'])->whereHas('reviews', function ($q) {\n\n $q->where('stars', '>=', config('site.reviews.hottest', 3.5));\n\n }, '>=', config('site.reviews.count', 10))->get()->sortByDesc(function ($p) {\n\n // sort by the number of stars\n return $p->reviews->sortBy(function ($r) {\n return $r->stars;\n });\n });\n\n return $data;\n }", "public static function getratingItem()\n {\n \n $value=DB::table('product_rating')->join('users','users.id','product_rating.user_id')->join('product','product.product_id','product_rating.product_id')->orderBy('product_rating.rate_id', 'desc')->get(); \n return $value;\n\t\n }" ]
[ "0.6855963", "0.6807352", "0.6797642", "0.66505176", "0.6642394", "0.6510678", "0.6349875", "0.63223785", "0.6298391", "0.62797666", "0.6196126", "0.6132254", "0.6077034", "0.6066809", "0.5938337", "0.5929765", "0.5868831", "0.5866199", "0.5850947", "0.5834548", "0.5830094", "0.5817065", "0.58126277", "0.5775715", "0.57747173", "0.5727387", "0.5700184", "0.5699851", "0.56950027", "0.5693551", "0.56903225", "0.56162", "0.5614092", "0.56083876", "0.5586904", "0.5581955", "0.5569933", "0.5543703", "0.5542534", "0.5528044", "0.5528044", "0.5528044", "0.5528044", "0.5528044", "0.5528044", "0.5528044", "0.5523059", "0.5519705", "0.55173784", "0.55128753", "0.55087095", "0.5502973", "0.55022115", "0.54941046", "0.5490361", "0.54853284", "0.5484437", "0.5481441", "0.5476667", "0.5476403", "0.54752237", "0.54752237", "0.5472847", "0.54717636", "0.5471377", "0.54657084", "0.54632777", "0.5448368", "0.5448311", "0.5448311", "0.5447288", "0.54457206", "0.5434762", "0.5430983", "0.5419015", "0.5418802", "0.5415025", "0.54030454", "0.54021525", "0.53964674", "0.53964674", "0.53964674", "0.53964674", "0.53964674", "0.53964674", "0.53964674", "0.5393466", "0.5387623", "0.538197", "0.5378631", "0.537722", "0.53632677", "0.5363238", "0.53622204", "0.53575766", "0.5355697", "0.5350281", "0.5350202", "0.53499544", "0.53467673" ]
0.77826184
0
SellerProduct has many ShoppingCarts.
public function shoppingCarts() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\ShoppingCart','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function shoppingCart()\n {\n return $this->hasMany(ShoppingCart::class);\n }", "public function carts() {\n return $this->belongsToMany('App\\Cart', 'sales', 'sale_id',\n 'sale_id', 'sale_id', 'sale_id')\n ;\n }", "public function carts()\n {\n return $this->hasMany('App\\Cart');\n }", "public function carts()\n {\n return $this->hasMany(Cart::class);\n }", "public function carts()\n {\n return $this->hasMany(Cart::class);\n }", "public function carts()\n {\n return $this->hasMany(Cart::class);\n }", "public function carts(){\n return $this->hasMany('App\\Model\\Cart','customer_id','id');\n }", "public function getCartItems()\n {\n return $this->hasMany(CartItem::className(), ['product_id' => 'id']);\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function cartItems() {\n return $this->hasMany(CartItem::class);\n }", "public function carts()\n\t{\n\t\treturn $this->belongsToMany(Cart::class, 'items_carts', 'item_id', 'cart_id');\n\t}", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function UserCart()\n {\n return $this->hasMany(UserCart::class, 'id_user_cart', 'id');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function cart()\n {\n return $this->hasMany(Item::class);\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function cart() {\n return $this->belongsTo('App\\Cart');\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function shops()\n {\n return $this->hasMany(Shop::class);\n }", "public function cart()\n {\n return $this->belongsTo(Cart::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function cart()\n {\n return $this->belongsTo('TechTrader\\Models\\Cart');\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany('fooCart\\src\\Product', 'tax_id', 'tax_id');\n }", "public function cart()\n {\n return $this->belongsTo('JulioBitencourt\\Cart\\Storage\\Eloquent\\Entities\\Cart');\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function getActiveCartProducts();", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function cartItem()\n {\n return $this->hasMany('App\\Model\\CartItem');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function cart() : BelongsTo\n {\n return $this->belongsTo(Cart::class);\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function productos(){\n return $this->hasMany(Producto::class);\n }", "public function carts()\n {\n return $this->belongsToMany(Cart::class)->withPivot('quantity')->withTimestamps();\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function productos()\n {\n return $this->hasMany(Producto::class);\n }", "public function productos()\n {\n return $this->hasMany('App\\Models\\ProductoPedidoModel', 'id_pedido', 'id');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function cart()\n {\n return $this->hasOne('App\\Cart', 'id_user');\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function getCatelogsByProductId($shop_product_id)\n {\n\n $shop_elements = $this->shop_elements\n ->where('shop_product_id', $shop_product_id);\n\n\n /* if ($shop_elements == null)\n return false;\n $shop_element_ids = array_map(function ($a) {\n return $a->id;\n }, $shop_elements);*/\n\n if ($shop_elements == null)\n return false;\n $shop_element_ids = $shop_elements->map(function ($a) {\n return $a->id;\n });\n\n\n /* $shop_catalogs = ShopCatalog::find()\n ->where([\n 'shop_element_id' => $shop_element_ids\n ])->all();*/\n\n\n $shop_catalogs = $this->shop_catalogs\n ->whereIn('shop_element_id', $shop_element_ids);\n\n // vdd($shop_catalogs);\n return $shop_catalogs;\n }", "public function orders_products(){\n return $this->hasMany(Order_product::class);\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function cart()\n {\n return $this->belongsTo('App\\Models\\Cart', 'cart_id', 'id');\n }", "public function products() {\n return $this->hasMany('App\\Product', 'category_id', 'id');\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function getCart();", "public function carts()\n {\n return $this->belongsToMany(Cart::class, 'cart_discount_code', 'discount_code_id', 'cart_id')->withPivot(\n 'cart_id',\n 'discount_code_id',\n 'attributed_at',\n 'converted_at',\n 'deleted_at',\n 'new_referral'\n );\n }", "public function getCartDetails()\n {\n return $this->hasMany(CartDetails::className(), ['cart_id' => 'id']);\n }", "public function products() {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function skus()\n {\n return $this->hasMany('App\\Models\\Sku');\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public function products()\n\t{\n\t\treturn $this->belongsTo(Product::class);\n\t}", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n// qq($params);\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n $related_products = $this->getRequest()->getParam('related_products');\n $related_qty = $this->getRequest()->getParam('related_qty');\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n \n $in_cart = $cart->getQuoteProductIds();\n if($product->getTypeId() == 'cartproduct') {\n $cart_product_id = $product->getId();\n if(in_array($cart_product_id, $in_cart)) {\n $this->_goBack();\n return;\n }\n }\n\n if($params['qty']) $cart->addProduct($product, $params);\n \n if (!empty($related_qty)) {\n foreach($related_qty as $pid=>$qty){\n if(intval($qty)>0){\n $product = $this->_initProduct(intval($pid));\n $related_params['qty'] = $filter->filter($qty);\n if(isset($related_products[$pid])){\n if($product->getTypeId() == 'bundle') {\n $related_params['bundle_option'] = $related_products[$pid]['bundle_option'];\n// qq($related_params);\n// die('test');\n } else {\n $related_params['super_attribute'] = $related_products[$pid]['super_attribute'];\n }\n }\n $cart->addProduct($product, $related_params);\n }\n }\n }\n \n $collection = Mage::getModel('cartproducts/products')->getCollection()\n ->addAttributeToFilter('type_id', 'cartproduct')\n ->addAttributeToFilter('cartproducts_selected', 1)\n ;\n \n foreach($collection as $p)\n {\n $id = $p->getId();\n if(isset($in_cart[$id])) continue;\n \n $cart = Mage::getSingleton('checkout/cart');\n $quote_id = $cart->getQuote()->getId();\n \n if(Mage::getSingleton('core/session')->getData(\"cartproducts-$quote_id-$id\")) continue;\n \n $p->load($id);\n $cart->getQuote()->addProduct($p, 1);\n }\n \n if($cart->getQuote()->getShippingAddress()->getCountryId() == '') $cart->getQuote()->getShippingAddress()->setCountryId('US');\n $cart->getQuote()->setCollectShippingRates(true);\n $cart->getQuote()->getShippingAddress()->setShippingMethod('maxshipping_standard')->collectTotals()->save();\n \n $cart->save();\n \n Mage::getSingleton('checkout/session')->resetCheckout();\n\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError() && $params['qty'] ){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n $this->getResponse()->setRedirect($url);\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function products_order()\n {\n return $this->hasMany( ProductsOrder::class );\n }", "public function products()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'restaurant_id');\n }", "public function products(): MorphToMany;", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function details()\n {\n\n return $this->hasMany(CartDetail::class);\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function products()\n {\n return $this->belongsToMany(\n Product::class,\n 'order_product',\n 'order_id',\n 'product_id'\n );\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }" ]
[ "0.7310116", "0.71702695", "0.7033012", "0.67832637", "0.66965026", "0.66714704", "0.66714704", "0.66714704", "0.6560388", "0.6287474", "0.6208373", "0.6145253", "0.6129753", "0.611397", "0.6104755", "0.6100701", "0.60864115", "0.60408723", "0.5997292", "0.5988197", "0.598154", "0.5976508", "0.5975479", "0.5972906", "0.59667623", "0.59597206", "0.59597206", "0.5959536", "0.59499943", "0.5948929", "0.5943947", "0.5943947", "0.5943947", "0.5943947", "0.5943947", "0.5943947", "0.5943947", "0.59288454", "0.5925457", "0.5921232", "0.59207606", "0.59181386", "0.5912302", "0.59111327", "0.58960474", "0.58960474", "0.58960474", "0.58960474", "0.58960474", "0.58960474", "0.58960474", "0.5893019", "0.58310306", "0.582974", "0.5817976", "0.58099425", "0.5806032", "0.580025", "0.5782904", "0.5763733", "0.57428133", "0.57393974", "0.57393485", "0.57390887", "0.57280636", "0.57223445", "0.57125205", "0.5704299", "0.5700562", "0.56860477", "0.5682747", "0.5675469", "0.5665739", "0.56612694", "0.56577003", "0.5650314", "0.5641344", "0.56390595", "0.5638259", "0.56315297", "0.5629388", "0.562558", "0.5616513", "0.55919707", "0.5591218", "0.5578448", "0.55737954", "0.5571789", "0.55591", "0.5558935", "0.55585784", "0.5551961", "0.5545001", "0.55448115", "0.5529556", "0.5529077", "0.5515368", "0.55095464", "0.549942", "0.5497864" ]
0.7159343
2
SellerProduct has one SellerStock.
public function sellerStock() { // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasOne('App\SellerStock','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sellerStock()\n {\n \t// belongsTo(RelatedModel, foreignKey = ss_id, keyOnRelatedModel = ss_id)\n \treturn $this->belongsTo('App\\SellerStock','ss_id','ss_id');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "function soldStock($product_id, $count=1) {\n\t\t\t$product=$this->findById($product_id);\n\t\t\t\n\t\t\tif ($product['Product']['stock']) {\n\t\t\t\t$product['Product']['stock_number']--;\n\t\t\t\t\n\t\t\t\t$this->Save($product);\n\t\t\t}\n\t\t}", "public function stock()\n {\n return $this->belongsTo('App\\Inventory\\Models\\InventoryStock', 'stock_id', 'id');\n }", "public function stock()\n {\n return $this->belongsTo(Stock::class);\n }", "public function sellerStockHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\SellerStockHistory','spsd_id','spsd_id');\n }", "public function loadStockData(){\n if (JeproshopTools::isLoadedObject($this, 'product_id')){\n // By default, the product quantity correspond to the available quantity to sell in the current shop\n $this->quantity = JeproshopStockAvailableModelStockAvailable::getQuantityAvailableByProduct($this->product_id, 0);\n $this->out_of_stock = JeproshopStockAvailableModelStockAvailable::outOfStock($this->product_id);\n $this->depends_on_stock = JeproshopStockAvailableModelStockAvailable::dependsOnStock($this->product_id);\n if (JeproshopContext::getContext()->shop->getShopContext() == JeproshopShopModelShop::CONTEXT_GROUP && JeproshopContext::getContext()->shop->getContextShopGroup()->share_stock == 1){\n $this->advanced_stock_management = $this->useAdvancedStockManagement();\n }\n }\n }", "public function stocks()\n {\n return $this->hasMany('App\\Models\\Stock');\n }", "public function stock(){\n return $this->belongsTo( Stock::class );\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = seller_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Seller','seller_id','seller_id');\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = from_seller_id, keyOnRelatedModel = seller_id)\n \treturn $this->belongsTo('App\\Seller','from_seller_id','seller_id');\n }", "public function seller()\n {\n return $this->belongsTo(SellerProxy::modelClass(), 'seller_id');\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getIdstock()\r\n {\r\n return $this->idstock;\r\n }", "public function getStock()\n {\n return $this->Stock;\n }", "public function get_branchwise_product_stock_correction() {\n $branchwise_product_store_list = $this->Branchwise_product_store_Model->get_branchwise_product_store();\n if (!empty($branchwise_product_store_list)) {\n $arr = array();\n foreach ($branchwise_product_store_list as $branchwise_product_store) {\n $branchwise_product_store_from_previous_date_by_product_id_branch_id = $this->Branchwise_product_store_Model->get_branchwise_product_store_from_previous_date_by_product_id_branch_id($branchwise_product_store->product_store_date, $branchwise_product_store->product_id, $branchwise_product_store->branch_id);\n $open_stock = !empty($branchwise_product_store_from_previous_date_by_product_id_branch_id) ? $branchwise_product_store_from_previous_date_by_product_id_branch_id->closing_stock : 0;\n $closing_stock = (int) ($open_stock + $branchwise_product_store->receive_stock - $branchwise_product_store->transfer_stock - $branchwise_product_store->sale_from_stock - $branchwise_product_store->damage_stock);\n $branchwise_product_store_data = array(\n 'id' => $branchwise_product_store->id,\n 'product_store_date' => $branchwise_product_store->product_store_date,\n 'product_id' => $branchwise_product_store->product_id,\n 'branch_id' => $branchwise_product_store->branch_id,\n 'open_stock' => $open_stock,\n 'receive_stock' => $branchwise_product_store->receive_stock,\n 'transfer_stock' => $branchwise_product_store->transfer_stock,\n 'sale_from_stock' => $branchwise_product_store->sale_from_stock,\n 'damage_stock' => $branchwise_product_store->damage_stock,\n 'closing_stock' => $closing_stock,\n );\n array_push($arr, $branchwise_product_store_data);\n //$this->db->where('id', $branchwise_product_store_data['id']);\n //$this->Branchwise_product_store_Model->db->update('branchwise_product_store', $branchwise_product_store_data);\n }\n echo 'branchwise product store';\n echo '<br>';\n echo '<pre>';\n print_r($arr);\n echo '</pre>';\n die();\n }\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function getSellerAvailableGoodsId()\n {\n return $this->seller_available_goods_id;\n }", "public function testIfStockManagementHasProductId()\n {\n $this->assertNotNull($this->stock->getProductId());\n }", "public function getProductSeller()\n {\n $product = $this->coreRegistry->registry('product');\n $productId = $product->getId();\n $sellerId = $this->helper->getSellerIdByProductId($productId);\n return $sellerId;\n }", "public function setStock($stock);", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getSellerId()\n {\n return $this->seller_id;\n }", "public function stockLieu() {\n return $this->belongsTo('App\\StockLieu','lieu_id');\n }", "public function seller(){\n return $this->belongsTo(Seller::class);\n }", "public function ingredientSuppliers(){\n return $this->hasMany(SupplierStock::class);\n }", "function setStockQuantity($id_product, $id_product_attribute, $quantity, $id_shop = null)\n\t{\n\t\tif (!Validate::isUnsignedId($id_product))\n\t\t\treturn false;\n\n\t\t$context = Context::getContext();\n\n\t\t// if there is no $id_shop, gets the context one\n\t\tif ($id_shop === null && Shop::getContext() != Shop::CONTEXT_GROUP)\n\t\t\t$id_shop = (int)$context->shop->id;\n\n\t\t$depends_on_stock = StockAvailable::dependsOnStock($id_product);\n\n\t\t//Try to set available quantity if product does not depend on physical stock\n\t\tif (!$depends_on_stock) {\n\t\t\t$id_stock_available = (int)StockAvailable::getStockAvailableIdByProductId($id_product, $id_product_attribute, $id_shop);\n\t\t\tif ($id_stock_available) {\n\t\t\t\tDB::getInstance()->Execute(\"update \" . _DB_PREFIX_ . \"stock_available set quantity='\". $quantity .\"' where id_stock_available = '\" . $id_stock_available .\"'\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$out_of_stock = StockAvailable::outOfStock($id_product, $id_shop);\n\n\t\t\t\tif ($id_shop === null)\n\t\t\t\t\t$shop_group = Shop::getContextShopGroup();\n\t\t\t\telse\n\t\t\t\t\t$shop_group = new ShopGroup((int)Shop::getGroupFromShop((int)$id_shop));\n\t\t\n\t\t\t\t// if quantities are shared between shops of the group\n\t\t\t\tif ($shop_group->share_stock)\n\t\t\t\t{\n\t\t\t\t\t$id_shop = 0;\n\t\t\t\t\t$id_shop_group = (int)$shop_group->id;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$id_shop_group = 0;\n\t\t\t\t}\n\t\t\t\tDB::getInstance()->Execute(\"insert into \" . _DB_PREFIX_ . \"stock_available (id_product, id_product_attribute, id_shop, id_shop_group, quantity, out_of_stock) values ('\" . (int)$id_product . \"', '\" . (int)$id_product_attribute . \"', '\" . (int)$id_shop . \"', '\" . (int)$id_shop_group . \"', '\" . (int)$quantity . \"', '\" . (int)$out_of_stock . \"')\");\n\t\t\t}\n\t\t\tif ($id_product_attribute != 0) {\n\t\t\t\t// Update total quantity\n\t\t\t\t$total_quantity = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('\n\t\t\t\t\tSELECT SUM(quantity) as quantity\n\t\t\t\t\tFROM '._DB_PREFIX_.'stock_available\n\t\t\t\t\tWHERE id_product = '.$id_product.'\n\t\t\t\t\tAND id_product_attribute <> 0 '.\n\t\t\t\t\tStockAvailable::addSqlShopRestriction(null, $id_shop)\n\t\t\t\t);\n\t\t\t\tsetStockQuantity($id_product, 0, $total_quantity);\n\t\t\t}\n\t\t}\n\t}", "public function stocks(): HasMany\n {\n return $this->hasMany('Ronmrcdo\\Inventory\\Models\\InventoryStock');\n }", "public function getSeller()\n {\n return $this->seller;\n }", "function _get_product_stock_bystkid($stock_id = 0)\r\n {\r\n return @$this->db->query(\"select available_qty as t from t_stock_info where stock_id = ? and available_qty >= 0 \",$stock_id)->row()->t;\r\n }", "public static function usesAdvancedStockManagement($id_product)\n {\n }", "public function stocks()\n {\n return $this->hasMany(InventoryStock::class, 'location_id', 'id');\n }", "public function stockUser()\n {\n return $this->belongsTo(\\App\\Models\\User::class, 'stock_user_id');\n }", "public function getSellerID()\n {\n return $this->sellerID;\n }", "private function selectProductLowStock(){\n\t\t$data = $this->connection->createCommand('select id, sku, name, minimum_quantity, quantity from product where minimum_quantity is not null and quantity <= minimum_quantity and product_type_id = 2 and tenant_id = '. $this->tenant)->queryAll();\n\t\tforeach($data as $key => $value){\t\n\t\t\t$sqlBalance = 'select * from stock_balance where product_id = '. $value['id'];\n\t\t\t$sqlBalance = $this->connection->createCommand($sqlBalance)->queryOne();\n\t\t\tif(!empty($sqlBalance['warehouse_id'])){\n\t\t\t\t$sqlBalance['warehouse_id'] = $this->connection->createCommand('select id,name from warehouse where id = '. $sqlBalance['warehouse_id'])->queryOne();\n\t\t\t\t$data[$key]['balance'] = $sqlBalance;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function sold_prod($prod_id){\n $table_name = \"product\";\n $where = array('prod_id' => $prod_id );\n $data['status'] = $this->Product_model->sold_prod($where);\n\t\t$where = array('seller_id' => $_SESSION['user_id']);\n $data['prod_details'] = $this->Product_model->view_seller_prod($where);\n view_loader($data,'seller/home');\n }", "public function getSellerObject($id)\n {\n if ($sellerDetail = WkMpSeller::getSellerDetailByCustomerId($id)) {\n return $this->obj_seller = new WkMpSeller($sellerDetail['id_seller'], $this->context->language->id);\n }\n\n return false;\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function transferWarehouseProductToMagentoStockItem();", "public function stock_category()\n {\n return $this->belongsTo(StockCategory::class);\n }", "function _get_product_stock($product_id = 0)\r\n {\r\n return @$this->db->query(\"select sum(available_qty) as t from t_stock_info where product_id = ? and available_qty >= 0 \",$product_id)->row()->t;\r\n }", "public function variant(){\n return $this->hasOne('Salesfly\\Salesfly\\Entities\\Variant');\n }", "public function bundle()\n {\n return $this->hasOne(ProductBundle::class, 'id','bundle_id');\n }", "public function getProductStock()\n {\n /** @var \\Magento\\CatalogInventory\\Model\\Stock\\ItemArray $stockItem */\n $stockItem = $this->stockRegistry->getStockItem(\n $this->getCurrentProduct()->getId(),\n $this->getCurrentProduct()->getStore()->getWebsiteId()\n );\n if ($stockItem->getManageStock() == 0) {\n return 1;\n }\n\n $qty = round($stockItem->getQty());\n if ($qty < 1) {\n if ($stockItem->getBackorders() == 1) {\n return 1;\n }\n\n if ($stockItem->getIsInStock()) {\n return '';\n }\n }\n return $qty;\n }", "public static function getSellerByProduct($id_product) {\n if (empty($id_product))\n return null;\n return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('\n SELECT `id_seller`\n FROM `'._DB_PREFIX_.'seller_product`\n WHERE `id_product` = '.(int)$id_product);\n }", "public function stockHold()\n {\n return $this->hasMany('App\\Models\\Stock\\HoldModel', 'stock_id', 'id');\n }", "public function getSellerId()\n {\n return $this->driver->seller_id;\n }", "public function seller()\n {\n return $this->morphTo(__FUNCTION__, 'seller_type', 'seller_id');\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function setStock($stock)\n {\n $this->stock = $stock;\n\n return $this;\n }", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function validateStock($oBasket) \n {\n $oConfig = $this->getConfig();\n $blReduceStockBefore = !(bool) $oConfig->getConfigParam('blFCPOReduceStock');\n $blCheckProduct = (\n $blReduceStockBefore &&\n $this->_isRedirectAfterSave()\n ) ? false : true;\n\n if ($blCheckProduct) {\n parent::validateStock($oBasket);\n }\n\n foreach ($oBasket->getContents() as $key => $oContent) {\n try {\n $oProd = $oContent->getArticle($blCheckProduct);\n } catch (oxNoArticleException $oEx) {\n $oBasket->removeItem($key);\n throw $oEx;\n } catch (oxArticleInputException $oEx) {\n $oBasket->removeItem($key);\n throw $oEx;\n }\n\n if ($blCheckProduct === true) {\n // check if its still available\n $dArtStockAmount = $oBasket->getArtStockInBasket($oProd->getId(), $key);\n $iOnStock = $oProd->checkForStock($oContent->getAmount(), $dArtStockAmount);\n if ($iOnStock !== true) {\n $oEx = oxNew('oxOutOfStockException');\n $oEx->setMessage('EXCEPTION_OUTOFSTOCK_OUTOFSTOCK');\n $oEx->setArticleNr($oProd->oxarticles__oxartnum->value);\n $oEx->setProductId($oProd->getId());\n $oEx->setBasketIndex($key);\n\n if (!is_numeric($iOnStock)) {\n $iOnStock = 0;\n }\n $oEx->setRemainingAmount($iOnStock);\n throw $oEx;\n }\n }\n }\n }", "public function actionStock($ACCESS_GROUP,$PRODUCT_ID,$STORE_ID)\r\n {\r\n $model = new ProductStock();\r\n if ($model->load(Yii::$app->request->post())) {\r\n $models = Product::find()->where(['PRODUCT_ID'=>$PRODUCT_ID])->one();\r\n $model->PRODUCT_ID=$PRODUCT_ID;\r\n $model->ACCESS_GROUP=$ACCESS_GROUP;\r\n $model->STORE_ID=$STORE_ID;\r\n date_default_timezone_set('Asia/Jakarta');\r\n $model->INPUT_TIME=date('H:i:s');\r\n $model->INPUT_DATE=date('Y-m-d');\r\n if ($model->save(false)) {\r\n Yii::$app->session->setFlash('success', \"Penyimpanan Stock Produk <b>\".$models->PRODUCT_NM.\"</b> Berhasil\");\r\n return $this->redirect(['index-stock','productid'=>$PRODUCT_ID]);\r\n }\r\n }\r\n $productdetail = ProductSearch::find()->joinWith('store')->where(['store.ACCESS_GROUP'=>$ACCESS_GROUP,'PRODUCT_ID'=>$PRODUCT_ID,'store.STORE_ID'=>$STORE_ID])->one();\r\n \r\n return $this->renderAjax('_form_stock', [\r\n 'model' => $model,\r\n 'productdetail'=>$productdetail\r\n ]);\r\n }", "public function update_wc_product_stock($product) {\n if(isset($product) && $product->managing_stock()) {\n\n\t if( defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '3.0', '>=' ) ) {\n\t\t if($product instanceof \\WC_Product_Variation) {\n\t $id = $product->get_id();\n\t } else {\n\t $id = $product->get_id();\n\t }\n\n\t\t }\n\t\t else{\n\n\t if($product instanceof \\WC_Product_Variation) {\n\t $id = $product->variation_id;\n\t } else {\n\t $id = $product->get_id();\n\t }\n }\n\n if (isset($_POST[\"product\"])) {\n update_post_meta($id, \"_warehouse_enabled\", 1);\n } else {\n delete_post_meta($id, \"_warehouse_enabled\");\n }\n $repository = new IM_Warehouse_Repository();\n $repository_product_stock_log = new IM_Stock_Log_Repository();\n $repository_product_warehouse = new IM_Product_Warehouse_Repository();\n // create rows for this product\n $repository_product_warehouse->refresh_relations($id);\n $warehouses = $repository->get_all();\n $total = 0;\n foreach ($warehouses as $warehouse) {\n $warehouse_id = $warehouse->id;\n $old_stock = $repository_product_warehouse->getByProductWarehouseID($id, $warehouse_id)->stock;\n $new_stock = ((isset($_POST[\"product\"])) ? $_POST[\"product\"] : null);\n // check if a stock value for the current combination exists..\n if (isset($new_stock[$id][$warehouse_id])) {\n $new_stock = $new_stock[$id][$warehouse_id];\n $repository_product_warehouse->updateStock($id, $warehouse_id, $new_stock);\n $total += $new_stock;\n if($new_stock !== $old_stock){\n // Issue #19\n $repository_product_stock_log->addStockLog($id, $warehouse_id, $new_stock, \"direct change\");\n // end issue #19\n }\n }\n $priority = ((isset($_POST[\"product-priority\"])) ? $_POST[\"product-priority\"] : null);\n // check if a priority value for the current combination exists..\n if (isset($priority[$id][$warehouse_id])) {\n $priority = $priority[$id][$warehouse_id];\n $repository_product_warehouse->updatePriority($id, $warehouse_id, $priority);\n }\n // dummy in case if a plugin tries to check in the database\n update_post_meta($id, \"_warehouse_\" . $warehouse->id, 0);\n }\n //update_post_meta($id, \"_stock\", $total);\n //$product->stock = $total;\n\n // Issue #66\n IM_Online_Warehouse::get_instance()->checkOnlineWarehouseStatus($id);\n // end issue #66\n }\n }", "function kvell_edge_woocommerce_product_out_of_stock() {\n\t\tglobal $product;\n\t\t\n\t\tif ( ! $product->is_in_stock() ) {\n\t\t\tprint '<span class=\"edgtf-out-of-stock\">' . esc_html__( 'Sold', 'kvell' ) . '</span>';\n\t\t}\n\t}", "public function seller()\n {\n return $this->belongsTo(User::class, 'seller_id');\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function actionCreate()\n\t{\n\t\t$model=new ProductStock;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ProductStock']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ProductStock'];\n\t\t\t$model->branch_id = Yii::app()->getModule('user')->user()->profile->getAttribute('branch_id');\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->product__stock_id));\n\t\t}\n\n\t\t$this->render('createStock',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function saveProductStock(ProductStock $product_stock, $remove_all = true)\n {\n $product_id = $product_stock->getProductId();\n\n if ($remove_all) {\n $this->removeProductStocks($product_id);\n }\n\n $warehouses_amounts = $product_stock->getStockAsArray();\n $empty_warehouse_ids = [];\n\n if (empty($warehouses_amounts)) {\n return false;\n }\n\n foreach ($product_stock->getWarehouses() as $product_warehouse) {\n if (!$product_warehouse->isMarkedToRemove()) {\n continue;\n }\n\n $warehouse_id = $product_warehouse->getWarehouseId();\n unset($warehouses_amounts[$warehouse_id]);\n $empty_warehouse_ids[$warehouse_id] = $warehouse_id;\n }\n\n if (!$remove_all && $empty_warehouse_ids) {\n $this->db->query(\n 'DELETE FROM ?:warehouses_products_amount WHERE product_id = ?i AND warehouse_id IN (?n)',\n $product_id,\n $empty_warehouse_ids\n );\n }\n\n if ($warehouses_amounts) {\n $this->db->replaceInto('warehouses_products_amount', $warehouses_amounts, true);\n }\n\n $this->recalculateDestinationProductsStocksByProductIds([$product_id]);\n\n return true;\n }", "public function isInStock()\n {\n return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED;\n }", "public function get_product()\n\t{\n\t\t$product_id = $this->input->post('id');\n\t\t$data = $this->Common->get_details('products',array('product_id'=>$product_id))->row();\n $stock_check = $this->Common->get_details('product_stock',array('product_id'=>$product_id));\n if($stock_check->num_rows()>0)\n {\n $data->stock = $stock_check->row()->stock;\n }\n else\n {\n $data->stock = '0';\n }\n\t\tprint_r(json_encode($data));\n\t}", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function getSellerResource()\n {\n return new SellerResource($this->paymentAdapter->getConfiguration(), new Curl());\n }", "public function show(Stock $stock)\n {\n return $stock;\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function getOfferSellerId()\n {\n return $this->offer_seller_id;\n }", "private function getStock()\n {\n $article = oxNew('oxArticle');\n $article->load($this->testArticleId);\n return $article->oxarticles__oxstock->value;\n }", "public function method()\n {\n return 'PUT'; // /sellerItems/{skuId}/stock\n }", "public function warehouses(): HasManyThrough\n\t{\n\t\treturn $this->hasManyThrough('Ronmrcdo\\Inventory\\Models\\InventoryStock', 'Ronmrcdo\\Inventory\\Models\\ProductSku')->with('warehouse');\n\t}", "public function gettopproductselling($sellerid) {\t\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required')); \t\n\t\t}\n\t\telse{\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t \n\t\t//Select Data from table\n\t\t//$sql3 = \"Select * FROM marketplace_product where seller_id=$sellerid\";\n\t\t$sql3 = \"Select * FROM marketplace_product a, catalog_product_entity b \n\t\twhere \n\t\ta.mageproduct_id=b.entity_id and \n\t\ta.seller_id=$sellerid and \n\t\tb.type_id!='customProductType' \";\n\t\t$result3 = $connection->fetchAll($sql3);\n\t\t\n\t\t$result4='';\n\t\t\n\t\tforeach($result3 as $data)\n\t\t{\n\t\t\t \n\t\t\t $productId =$data['mageproduct_id'];\n\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n\t\t\t\t\t$offfer_tag = $currentproduct->getData('offfer_tag');\n\t\t\t\t\t$attr = $currentproduct->getResource()->getAttribute('offfer_tag');\n\t\t\t\t\t//$optionText='null';\n\t\t\t\t //if ($attr->usesSource()) {\n\t\t\t\t\t $optionText =$attr->getSource()->getOptionText($offfer_tag);\n\t\t\t\t// }\n\t\t\t\tif($optionText=='')\n\t\t\t\t{\n\t\t\t\t\t$optionText='null';\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t $_price=$currentproduct->getPrice();\n\t\t\t\t $_finalPrice=$currentproduct->getFinalPrice();\n\t\t\t\t\t $savetag='null';\n\t\t\t\t\t\tif($_finalPrice < $_price):\n\t\t\t\t\t\t$_savePercent = 100 - round(($_finalPrice / $_price)*100);\n\t\t\t\t\t\t//echo $_savePercent;\n\t\t\t\t\t\t$savetag=$_savePercent;\n endif;\n\n\t\t\t\t $producturl=$currentproduct->getProductUrl();\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $sql_wishlist = \"Select * FROM wishlist a ,wishlist_item b where a.customer_id=$sellerid and a.wishlist_id=b.wishlist_id and b.product_id=$productId \";\n\t\t $result_wishlist = $connection->fetchAll($sql_wishlist);\n\t\t\t\t /* $wish='';\n\t\t\t\t if(!empty($result_wishlist))\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>1); \n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>0);\n\t\t\t\t } */\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $reviewFactory = $objectManager->create('Magento\\Review\\Model\\Review');\n\t\t\t\t $storeId = $this->storeManager->getStore()->getId();\n $reviewFactory->getEntitySummary($currentproduct, $storeId);\n\t\t\t\t $ratingSummary = $currentproduct->getRatingSummary()->getRatingSummary();\n\t\t\t\t if($ratingSummary=='')\n\t\t\t\t{\n\t\t\t\t\t$ratingSummary='null';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//$delivery=array('method'=>'Standard Delivery','price'=>'Free');\n\t\t\t\t\t\n\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"description\"=>$currentproduct->getDescription(),\"price\"=>$currentproduct->getPrice(),\"finalPrice\"=>$currentproduct->getFinalPrice(),\"thumbnail\"=>'http://159.203.151.92/pub/media/catalog/product'.$currentproduct->getthumbnail(),\"offferTag\"=>array(\"shareurl\"=>$producturl,\"Tag\"=>$optionText,'discount'=>$savetag,'rating'=>$ratingSummary));\n\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\t \n\t\t//$result['product']=$result4;\n\t\t\n\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'product'=>$result4);\n\t\t\n\t\treturn $result; \n\t\t\n }\n\t }", "public function getSellerSupplierParty()\n {\n return $this->sellerSupplierParty;\n }", "public function getProductWarehousesStock($product_id)\n {\n $product_warehouses = $this->getProductWarehousesData($product_id);\n $is_stock_split_by_warehouses = $this->isProductStockSplitByWarehouses($product_id);\n\n return new ProductStock($product_id, $product_warehouses, $is_stock_split_by_warehouses);\n }", "public function getStock(): int\n {\n return $this->stock;\n }", "public static function getStock($product_id, $option_id)\n {\n $product_option_id = ProductOption::where('product_id', $product_id)\n ->where('option_id', $option_id)\n ->first()\n ->id;\n $stock = ProductBalance::where('product_option_id', $product_option_id)\n ->first()\n ->stock;\n\n return $stock;\n }", "function addStockStatusToProducts($productCollection, $websiteId = null, $stockId = null) {\n\t\t\tif ($websiteId === null) {\n\t\t\t\t$websiteId = Mage::app( )->getStore( )->getWebsiteId( );\n\n\t\t\t\tif (( (int)$websiteId == 0 && $productCollection->getStoreId( ) )) {\n\t\t\t\t\t$websiteId = Mage::app( )->getStore( $productCollection->getStoreId( ) )->getWebsiteId( );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$productIds = array( );\n\t\t\tforeach ($productCollection as $product) {\n\t\t\t\t$productIds[] = $product->getId( );\n\t\t\t}\n\n\n\t\t\tif (!empty( $$productIds )) {\n\t\t\t\t$stockStatuses = $this->_getResource( )->getProductStatus( $productIds, $websiteId, $stockId );\n\t\t\t\tforeach ($stockStatuses as $productId => $status) {\n\n\t\t\t\t\tif ($product = $productCollection->getItemById( $productId )) {\n\t\t\t\t\t\t$product->setIsSalable( $status );\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($productCollection as $product) {\n\t\t\t\t$object = new Varien_Object( 'is_salable' )( array( 'is_in_stock' => , 'stock_id' => $stockId ) );\n\t\t\t\t$product->setStockItem( $object );\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "public function productStocks($product_id)\n {\n $product_id = Hashids::decode($product_id)[0];\n\n $product = Product::find($product_id);\n\n return view('company.products.stock_history', compact('product'));\n }", "public function setStock($stock)\n {\n $this->stock = $stock;\n\n return $this;\n }", "public function setStock($stock)\n {\n $this->stock = $stock;\n\n return $this;\n }", "public function setStock($stock)\n {\n $this->stock = $stock;\n\n return $this;\n }", "public function sku()\n {\n return $this->belongsTo(Productos::class, 'fk_id_sku', 'id_sku');\n }", "public function updateStock()\n {\n// foreach($this->detalle_compras as $detalle)\n// {\n// $producto= Producto::model()->findByPk($detalle->producto);\n// $producto->stock+=$detalle->cantidad;\n// $producto->save();\n// }\n }", "public function getStockResourceSingleton($stockId = null)\n {\n $stock = Mage::getResourceSingleton('cataloginventory/stock');\n if ($stockId) {\n $stock->setStockId($stockId);\n }\n return $stock;\n }", "public function get_stock($stock_id_pri = null) {\n if($stock_id_pri != null){\n $this->db->where('stock_id_pri', $stock_id_pri); \n }\n $this->db->where('shop_id_pri', $this->session->userdata('shop_id_pri'));\n $this->db->order_by('stock_id_pri');\n return $this->db->get('stock');\n }", "public function getOffer($productId, $sellerId);", "public function validateProductStock($productCart)\n {\n $productStock = $productCart->qty;\n\n $prodCartsSum = Cart::where('user_id', $productCart->user_id)\n ->where('id', '!=', $productCart->id)\n ->where('product_id', $productCart->product_id)\n ->get()->sum('qty');\n\n $prodStock = Product::find($productCart->product_id)->stock;\n $stock_qty = ($prodStock - $prodCartsSum) > 0 ? $prodStock - $prodCartsSum : 0;\n $qty = $productCart->qty >= $stock_qty ? $stock_qty : $productCart->qty;\n\n $productCart->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }", "public function test_product_stocks_deduct_when_order_is_placed()\n {\n $product = Product::factory()->create(['available_stock' => 50]);\n\n $product->orders()->create(['quantity' => 5]);\n\n $product->refresh();\n\n $this->assertTrue($product->available_stock === 45);\n }", "private function createWarrantyProduct()\n {\n /**\n * @var $product Mage_Catalog_Model_Product\n */\n foreach ($this->warrantyProductSkus as $warrantyProductSku => $productName) {\n if (!$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $warrantyProductSku)) {\n $product = Mage::getModel('catalog/product');\n\n $product->setTypeId(Mulberry_Warranty_Model_Product_Type_Warranty::TYPE_ID)\n ->setSku($warrantyProductSku)\n ->setName($productName)\n ->setDescription(sprintf('%s, Product Placeholder', $productName))\n ->setShortDescription(sprintf('%s, Product Placeholder', $productName))\n ->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG)\n ->setAttributeSetId(4)\n ->setTaxClassId(0)\n ->setPrice(10.00)\n ->setStockData(array(\n 'use_config_manage_stock' => 0,\n 'manage_stock' => 0,\n 'is_in_stock' => 1,\n 'qty' => 10,\n ));\n\n $product->save();\n }\n }\n }", "public function getManageStockOfProduct($productId) {\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\n $manageStock = $stockItem->getManageStock();\n if ($stockItem->getUseConfigManageStock()) {\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock', Mage::app()->getStore()->getStoreId());\n }\n return $manageStock;\n }", "public function showStock($id)\n\t{\n\t\treturn $this->stock->where('id',$id)->first();\n\t}", "public function __construct(Stock $stock)\n {\n $this->stock = $stock;\n }", "public function get_single_stock() {\n\n\t\t$inventory = $this->get_inventory();\n\n\t\treturn ! empty( $inventory ) ? current( $inventory ) : null;\n\t}" ]
[ "0.6971997", "0.64563453", "0.6200724", "0.61325955", "0.60344845", "0.59545195", "0.5884657", "0.5825312", "0.5748152", "0.5709969", "0.5658973", "0.5623124", "0.5605115", "0.5605115", "0.55866635", "0.557678", "0.5571025", "0.55648214", "0.5552669", "0.55447763", "0.55434775", "0.5535962", "0.55233324", "0.55233324", "0.55233324", "0.55233324", "0.55233324", "0.55085725", "0.54613507", "0.54011184", "0.5390444", "0.53648627", "0.5360129", "0.5347417", "0.5342396", "0.5340469", "0.53289825", "0.53141165", "0.52948123", "0.52834296", "0.5280718", "0.5276962", "0.52674", "0.52629256", "0.52612275", "0.52577", "0.5255962", "0.52552044", "0.524843", "0.5246408", "0.5245346", "0.524521", "0.52407277", "0.5236578", "0.5226224", "0.5212764", "0.51941735", "0.51932883", "0.5183898", "0.5180379", "0.51779604", "0.51754016", "0.51421297", "0.51421297", "0.51421297", "0.51421297", "0.513584", "0.5134218", "0.51199913", "0.5119676", "0.51181495", "0.5112641", "0.5106684", "0.5103456", "0.5099949", "0.5096905", "0.5092956", "0.5085228", "0.50844204", "0.5065677", "0.5064073", "0.505773", "0.5055422", "0.50541127", "0.5040147", "0.5039828", "0.5039828", "0.5039828", "0.5037956", "0.5031403", "0.5024834", "0.5021928", "0.50155723", "0.5010023", "0.50036967", "0.5002745", "0.4996208", "0.49920338", "0.4986373", "0.4984198" ]
0.7259326
0
SellerProduct has many ProductOptions.
public function productOptions() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\ProductOption','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function options()\n {\n return $this->belongsToMany(Option::class, 'product_options')\n ->using(ProductOption::class)\n ->as('settings')\n ->withPivot(['default_amount', 'max_amount', 'min_amount', 'required']);\n }", "public static function getProductOptions()\n {\n return self::get('product') ?: [];\n }", "public function getProductOption();", "public function getProductCustomOptionsXmlObject(Mage_Catalog_Model_Product $product)\n {\n $xmlModel = Mage::getModel('xmlconnect/simplexml_element', '<product></product>');\n $optionsNode = $xmlModel->addChild('options');\n\n if ($product->hasPreconfiguredValues()) {\n $preConfiguredValues = $product->getPreconfiguredValues();\n $optionData = $preConfiguredValues->getData('options');\n }\n\n if (!$product->getId()) {\n return $xmlModel;\n }\n $xmlModel->addAttribute('id', $product->getId());\n if (!$product->isSaleable() || !sizeof($product->getOptions())) {\n return $xmlModel;\n }\n\n foreach ($product->getOptions() as $option) {\n $optionNode = $optionsNode->addChild('option');\n $type = $this->_getOptionTypeForXmlByRealType($option->getType());\n $code = 'options[' . $option->getId() . ']';\n if ($type == self::OPTION_TYPE_CHECKBOX) {\n $code .= '[]';\n }\n $optionNode->addAttribute('code', $code);\n $optionNode->addAttribute('type', $type);\n $optionNode->addAttribute('label', $xmlModel->escapeXml($option->getTitle()));\n if ($option->getIsRequire()) {\n $optionNode->addAttribute('is_required', 1);\n }\n\n /**\n * Process option price\n */\n $price = $option->getPrice();\n if ($price) {\n $optionNode->addAttribute('price', Mage::helper('xmlconnect')->formatPriceForXml($price));\n $formattedPrice = Mage::app()->getStore($product->getStoreId())->formatPrice($price, false);\n $optionNode->addAttribute('formated_price', $formattedPrice);\n }\n $optionId = $option->getOptionId();\n if ($type == self::OPTION_TYPE_CHECKBOX || $type == self::OPTION_TYPE_SELECT) {\n foreach ($option->getValues() as $value) {\n $code = $value->getId();\n $valueNode = $optionNode->addChild('value');\n $valueNode->addAttribute('code', $code);\n $valueNode->addAttribute('label', $xmlModel->escapeXml($value->getTitle()));\n\n if ($value->getPrice() != 0) {\n $price = Mage::helper('xmlconnect')->formatPriceForXml($value->getPrice());\n $valueNode->addAttribute('price', $price);\n $formattedPrice = $this->_formatPriceString($price, $product);\n $valueNode->addAttribute('formated_price', $formattedPrice);\n }\n if ($product->hasPreconfiguredValues()) {\n $this->_setCartSelectedValue($valueNode, $type, $this->_getPreconfiguredOption(\n $optionData, $optionId, $code\n ));\n }\n }\n } else {\n if ($product->hasPreconfiguredValues() && array_key_exists($option->getOptionId(), $optionData)) {\n $this->_setCartSelectedValue($optionNode, $type, $optionData[$optionId]);\n }\n }\n }\n return $xmlModel;\n }", "protected function _afterLoad()\n {\n parent::_afterLoad();\n /**\n * Load product options\n */\n if ($this->getHasOptions()) {\n foreach ($this->getProductOptionsCollection() as $option) {\n $option->setProduct($this);\n $this->addOption($option);\n }\n }\n return $this;\n }", "public function product()\n {\n return $this->belongsTo(config('inventory.models.product-variant'), 'product_variant_id');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function getProductOptions($pId)\n\t{\n\t\t// Get all SKUs' options and option groups\n\t\t$sql = \"\tSELECT\n\t\t\t\t\ts.`sId` AS skuId,\n\t\t\t\t\tso.`oId` AS skusOptionId,\n\t\t\t\t\ts.`sPrice`,\n\t\t\t\t\ts.`sAllowMultiple`,\n\t\t\t\t\ts.`sInventory`,\n\t\t\t\t\ts.`sTrackInventory`,\n\t\t\t\t\ts.`sRestricted`,\n\t\t\t\t\tog.`ogId`,\n\t\t\t\t\t`oName`,\n\t\t\t\t\t`ogName`\";\n\t\tif ($this->userScope)\n\t\t{\n\t\t\t$sql .= \" \t, pr.`uId`\";\n\t\t}\n\t\t$sql .= \"\tFROM `#__storefront_skus` s\n\t\t\t\t\tLEFT JOIN `#__storefront_sku_options` so ON s.`sId` = so.`sId`\n\t\t\t\t\tLEFT JOIN `#__storefront_options` o ON so.`oId` = o.`oId`\n\t\t\t\t\tLEFT JOIN `#__storefront_option_groups` og ON o.`ogId` = og.`ogId`\";\n\n\t\t// check user scope if needed\n\t\tif ($this->userScope)\n\t\t{\n\t\t\t$sql .= \" LEFT JOIN #__storefront_permissions pr ON (pr.`scope_id` = s.sId AND pr.scope = 'sku' AND pr.uId = '{$this->userScope}')\";\n\t\t}\n\n\t\t$sql .= \"\tWHERE s.`pId` = {$pId} AND s.`sActive` = 1\";\n\t\t$sql .= \" \tAND (s.`publish_up` IS NULL OR s.`publish_up` <= NOW())\";\n\t\t$sql .= \" \tAND (s.`publish_down` IS NULL OR s.`publish_down` = '0000-00-00 00:00:00' OR s.`publish_down` > NOW())\";\n\t\t$sql .= \"\tORDER BY og.`ogId`, o.`oId`\";\n\n\t\t$this->_db->setQuery($sql);\n\t\t$this->_db->query();\n\n\t\t// check some values to figure out what to return\n\t\t$returnObject = new \\stdClass();\n\t\t$returnObject->status = 'ok';\n\n\t\tif (!$this->_db->getNumRows())\n\t\t{\n\t\t\t$returnObject->status = 'error';\n\t\t\t$returnObject->msg = 'not found';\n\t\t\treturn $returnObject;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$results = $this->_db->loadObjectList();\n\t\t\t$res = $results;\n\n\t\t\t// Go through each SKU and do the checks to determine what needs to be returned\n\t\t\t// default value\n\t\t\t$permissionsRestricted = false;\n\n\t\t\trequire_once dirname(__DIR__) . DS . 'admin' . DS . 'helpers' . DS . 'restrictions.php';\n\n\t\t\tforeach ($res as $k => $line)\n\t\t\t{\n\t\t\t\t// see if the user is whitelisted for this SKU\n\t\t\t\t$skuWhitelisted = false;\n\t\t\t\tif ($this->userWhitelistedSkus && in_array($line->skuId, $this->userWhitelistedSkus))\n\t\t\t\t{\n\t\t\t\t\t$skuWhitelisted = true;\n\t\t\t\t}\n\n\t\t\t\tif (!$skuWhitelisted && $line->sRestricted && (!$this->userScope || $line->uId != $this->userScope))\n\t\t\t\t{\n\t\t\t\t\t// Sku is restricted and not available\n\t\t\t\t\t$permissionsRestricted = true;\n\t\t\t\t\t// remove it\n\t\t\t\t\tunset($res[$k]);\n\n\t\t\t\t}\n\t\t\t\telseif ($this->userCannotAccessProduct && !$skuWhitelisted)\n\t\t\t\t{\n\t\t\t\t\t// Sku is restricted and not available\n\t\t\t\t\t$permissionsRestricted = true;\n\t\t\t\t\t// remove it\n\t\t\t\t\tunset($res[$k]);\n\t\t\t\t}\n\n\t\t\t\tif ($line->sTrackInventory && $line->sInventory < 1)\n\t\t\t\t{\n\t\t\t\t\t// remove it\n\t\t\t\t\tunset($res[$k]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (count($res) < 1)\n\t\t\t{\n\t\t\t\t$returnObject->status = 'error';\n\t\t\t\t$returnObject->msg = 'out of stock';\n\t\t\t\t// If at least one SKU is restricted, we cannot return 'out of stock'\n\t\t\t\tif ($permissionsRestricted)\n\t\t\t\t{\n\t\t\t\t\t$returnObject->msg = 'restricted';\n\t\t\t\t}\n\t\t\t\treturn $returnObject;\n\t\t\t}\n\t\t}\n\n\t\t// Initialize array for option groups\n\t\t$options = array();\n\t\t// Array for SKUs\n\t\t$skus = array();\n\n\t\t// Parse result and populate $options with option groups and corresponding options\n\t\t$currentOgId = false;\n\t\tforeach ($res as $line)\n\t\t{\n\t\t\t// Populate options\n\t\t\tif ($line->ogId)\n\t\t\t{\n\t\t\t\t// Keep track of option groups and do not do anything if no options\n\t\t\t\tif ($currentOgId != $line->ogId)\n\t\t\t\t{\n\t\t\t\t\t$currentOgId = $line->ogId;\n\n\t\t\t\t\t$ogInfo = new \\stdClass();\n\t\t\t\t\t$ogInfo->ogId = $line->ogId;\n\t\t\t\t\t$ogInfo->ogName = $line->ogName;\n\n\t\t\t\t\t$options[$currentOgId]['info'] = $ogInfo;\n\t\t\t\t\tunset($ogInfo);\n\t\t\t\t}\n\n\t\t\t\t$oInfo = new \\stdClass();\n\t\t\t\t$oInfo->oId = $line->skusOptionId;\n\t\t\t\t$oInfo->oName = $line->oName;\n\t\t\t\t$options[$currentOgId]['options'][$line->skusOptionId] = $oInfo;\n\t\t\t\tunset($oInfo);\n\t\t\t}\n\n\t\t\t// populate SKUs for JS\n\t\t\t$skusInfo = new \\stdClass();\n\t\t\t$skusInfo->sId = $line->skuId;\n\t\t\t$skusInfo->sPrice = $line->sPrice;\n\t\t\t$skusInfo->sAllowMultiple = $line->sAllowMultiple;\n\t\t\t$skusInfo->sTrackInventory = $line->sTrackInventory;\n\t\t\t$skusInfo->sInventory = $line->sInventory;\n\n\t\t\t$skus[$line->skuId]['info'] = $skusInfo;\n\t\t\t$skus[$line->skuId]['options'][] = $line->skusOptionId;\n\t\t\tunset($skusInfo);\n\n\t\t}\n\n\t\t$ret = new \\stdClass();\n\t\t$ret->options = $options;\n\t\t$ret->skus = $skus;\n\n\t\t$returnObject->options = $ret;\n\t\treturn $returnObject;\n\t}", "public static function getProductsOptions()\n {\n return self::get('products') ?: [];\n }", "public function getProducts_options() {\n\t\treturn $this->products_options;\n\t}", "public function getConfigurableProductOptions($product, $storeId) {\n // get product price\n $finalPrice = $product->getFinalPrice ();\n \n // Load all used configurable attributes\n $configurableAttributeCollection = $product->getTypeInstance ( true )->getConfigurableAttributes ( $product );\n \n $allProducts = $product->getTypeInstance ( true )->getUsedProducts ( null, $product );\n foreach ( $allProducts as $product ) {\n $products [] = $product;\n }\n \n $options = array ();\n $result = array ();\n $i = 0;\n foreach ( $configurableAttributeCollection as $productAttribute ) {\n $options [$i] [static::TITLE] = $productAttribute ['label'];\n $options [$i] ['code'] = $productAttribute->getProductAttribute ()->getAttributeCode ();\n $options [$i] [static::ATTRIBUTE_ID] = $productAttribute [static::ATTRIBUTE_ID];\n $i ++;\n }\n $result ['config'] = $options;\n $resultattr = array ();\n // Get combinations\n foreach ( $products as $product ) {\n $attr = array ();\n // get produt stock qty for simple product\n /**\n *\n * @var $stockItem Mage_CatalogInventory_Model_Stock_Item\n */\n $stockItem = $product->getStockItem ();\n if (! $stockItem) {\n $stockItem = Mage::getModel ( static::CATSTOCK );\n $stockItem->loadByProduct ( $product );\n }\n $stockQty = floor ( $stockItem->getQty () );\n $is_stock = $stockItem->getIsInStock ();\n $j = 0;\n $valuearry ['product_id'] = $product->getId ();\n // get product stock details\n $inventoryDetail = Mage::getModel ( static::LOGIN_FUNCTIONS )->getinventoryDetail ( $product, $storeId );\n // get stock qty\n $valuearry [static::STOCK_QTY] = $inventoryDetail [static::STOCK_QTY];\n $valuearry [static::MIN_SALE_QTY] = $inventoryDetail [static::MIN_SALE_QTY];\n $valuearry [static::MAX_SALE_QTY] = $inventoryDetail [static::MAX_SALE_QTY];\n $valuearry [static::QTY_INCR] = $inventoryDetail [static::QTY_INCR];\n $valuearry [static::IS_QTY_DECIMAL] = $inventoryDetail [static::IS_QTY_DECIMAL];\n foreach ( $configurableAttributeCollection as $attribute ) {\n \n $productAttribute = $attribute->getProductAttribute ();\n $attrCode = $productAttribute->getAttributeCode ();\n $attributeValue = $product->getData ( $attrCode );\n \n /* getting option text value */\n if ($productAttribute->usesSource ()) {\n $label = $productAttribute->setStoreId ( $storeId )->getSource ()->getOptionText ( $attributeValue );\n } else {\n $label = '';\n }\n \n /**\n * Get price for associated product\n */\n $prices = $attribute->getPrices ();\n $value = $product->getData ( $attribute->getProductAttribute ()->getAttributeCode () );\n \n $valuearry ['label'] = $label;\n $valuearry ['code'] = $attrCode;\n $valuearry ['config_id'] = $attributeValue;\n $valuearry [static::ISSTOCK] = $is_stock;\n $valuearry ['stock_qty'] = $stockQty;\n $valuearry [static::PRICE] = $this->calculateCustumPrice ( $prices, $value, $finalPrice );\n \n $val [$options [$j] ['code']] = $attributeValue;\n $j ++;\n array_push ( $attr, $valuearry );\n }\n // get configurable product options\n $attr = $this->getAttrColl ( $val, $attr );\n \n $resultattr = array_merge ( $resultattr, $attr );\n }\n $result ['attr'] = $resultattr;\n return $result;\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function getProductOptionId();", "protected function prepareConfigurableProductOptions()\n {\n $configurableProductOptions = [];\n $configurableProductLinks = $this->getConfigurableProductLinks();\n\n if (isset($this->fields['product']['configurable_attributes_data'])) {\n $configurableAttributesData = $this->fields['product']['configurable_attributes_data'];\n\n foreach ($configurableAttributesData as $attributeId => $attributeData) {\n $attributeValues = [];\n foreach ($attributeData['values'] as $valueData) {\n $attributeValues[] = [\n 'value_index' => $valueData['value_index']\n ];\n }\n\n $configurableProductOptions[] = [\n 'attribute_id' => $attributeId,\n 'label' => $attributeData['label'],\n 'values' => $attributeValues\n ];\n }\n }\n\n $this->fields['product']['extension_attributes']['configurable_product_options'] = $configurableProductOptions;\n $this->fields['product']['extension_attributes']['configurable_product_links'] = $configurableProductLinks;\n unset($this->fields['product']['configurable_attributes_data']);\n unset($this->fields['attributes']);\n unset($this->fields['variations-matrix']);\n unset($this->fields['associated_product_ids']);\n }", "public function getProducts_options_id() {\n\t\treturn $this->products_options_id;\n\t}", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\models\\Product', 'product_variants');\n }", "public function variants()\n {\n return $this->hasMany(Variant::class, 'product_id', 'id');\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function setProducts_options( $products_options ) {\n\t\t$this->products_options = $products_options;\n\t}", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function setProduct(Product $product);", "public function product()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Product', 'n_ProductId_FK')->withDefault();\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function testGetOrderWithProductOption(): void\n {\n $expected = [\n 'extension_attributes' => [\n 'bundle_options' => [\n [\n 'option_id' => 1,\n 'option_selections' => [1],\n 'option_qty' => 1\n ]\n ]\n ]\n ];\n $result = $this->makeServiceCall(self::ORDER_INCREMENT_ID);\n\n $bundleProduct = $this->getBundleProduct($result['items']);\n self::assertNotEmpty($bundleProduct, '\"Bundle Product\" should not be empty.');\n self::assertNotEmpty($bundleProduct['product_option'], '\"Product Option\" should not be empty.');\n self::assertEquals($expected, $bundleProduct['product_option']);\n }", "public function variations()\n {\n return $this->hasMany(ProductVariation::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function options()\n {\n return $this->hasMany('App\\Option');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function optionAction() \n {\n $result = array();\n \n $productIdOrSku = $this->getRequest()->getParam('product');\n $attributeOptionId = $this->getRequest()->getParam('id');\n\n try {\n \n $model = $this->getModel();\n $model->loadOptions($productIdOrSku, $attributeOptionId);\n $options = $model->getApiOptions(); \n \n $result = $options;\n \n \n } catch (Exception $e) {\n \n $result['error'] = true;\n $result['data'] = $e->getMessage();\n } \n \n $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true)->setBody(Mage::helper('core')->jsonEncode($result));\n \n }", "public function salesQuoteItemSetProduct($observer)\n\t{\n\t\t$quoteItem = $observer->getQuoteItem();\n\t\t$product = $observer->getProduct();\n\n\t\tif ($product->isConfigurable() && $quoteItem->getHasChildren())\n\t\t{\n\t\t\tforeach ($quoteItem->getChildren() as $child)\n\t\t\t{\n\t\t\t\tforeach ($child->getProduct()->getProductOptionsCollection() as $option)\n\t\t\t\t{\n\t\t\t\t\t$option->setProduct($product);\n\t\t\t\t\t$product->addOption($option);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function getGallery(){\n return $this->hasMany(ProductGallery::class, 'product_id','id');\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function products()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function product()\n {\n return $this->belongsTo('Modules\\Admin\\Models\\Product','product_id','id');\n }", "public function product()\n {\n // belongsTo(RelatedModel, foreignKey = product_id, keyOnRelatedModel = id)\n return $this->belongsTo(Product::class);\n }", "public function product_galleries() {\n return $this->hasMany(ProductGallery::class, 'product_id', 'id');\n }", "public function getOptionGroupIdsOfSellerProduct($sp_id)\n\t{\n\t\t//options of a product\n\t\t$sp_options = SPOptionRelation::with('option.optionGroup')->where('sp_id','=',$sp_id)->get();\n\t\t$option_groups = [];\n\t\tforeach ($sp_options as $key => $sp_option) {\n\t\t\t$og = ucfirst($sp_option->option->optionGroup->option_g_id);\n // dd($og);\n\t\t\tif(!array_has($option_groups,$og)){\n\t\t\t\t$option_groups[$og]=array();\n\t\t\t}\n\t\t}\n\t}", "public function getOptionGroupsOfSellerProduct($sp_id)\n\t{\n\t\t//options of a product\n\t\t$sp_options = SPOptionRelation::with('option.optionGroup')->where('sp_id','=',$sp_id)->get();\n\t\t$option_groups = [];\n\t\tforeach ($sp_options as $key => $sp_option) {\n\t\t\t$og = ucfirst($sp_option->option->optionGroup->option_g_name);\n // dd($og);\n\t\t\tif(!array_has($option_groups,$og)){\n\t\t\t\t$option_groups[$og]=array();\n\t\t\t}\n\t\t}\n\t}", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function product()\n {\n return $this->hasMany(product::class, 'category_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function getProductOptionsXmlObject(Mage_Catalog_Model_Product $product)\n {\n if ($product->getId()) {\n $type = $product->getTypeId();\n if (isset($this->_renderers[$type])) {\n $renderer = $this->getLayout()->createBlock($this->_renderers[$type]);\n if ($renderer) {\n return $renderer->getProductOptionsXml($product, true);\n }\n }\n }\n return false;\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function getOptionId($product){\n $helper = Mage::helper('provador');\n $_product = Mage::getModel('catalog/product')->load($product->getId());\n foreach ($_product->getOptions() as $_option) {\n if($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX){\n foreach ($_option->getValues() as $_value) {\n $option_id = $_value->getOptionId();\n }\n }\n }\n\n if($helper->getSkuCustomOption($option_id) == $helper->getSku()){\n if($_product->isSaleable()){\n return true;\n }\n }\n\n return false;\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function productos()\n {\n return $this->hasMany('App\\Models\\ProductoPedidoModel', 'id_pedido', 'id');\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(config('laravel-inventory.product'));\n }", "public function product()\n {\n return $this->belongsTo('Laracart\\Product\\Models\\Product', 'product_id');\n\n }", "public function products(): MorphToMany;", "public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }", "public function products()\n {\n return $this->belongsTo('App\\Product', 'product_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function options()\n {\n return $this->belongsToMany('App\\Option');\n }", "public function afterSave(\n ProductResource $productResource,\n ProductResource $result,\n Product $product\n ): ProductResource {\n $options = $product->getData(self::KEY_OPTIONS);\n if (is_array($options) && $options) {\n $toInsert = [];\n $storeId = $product->getStoreId();\n\n foreach ($options as $optionId => $title) {\n if ($title) {\n $toInsert[] = [\n 'option_id' => $optionId,\n 'store_id' => $storeId,\n 'title' => $title\n ];\n } else {\n $this->resourceConnection->getConnection()->delete(\n $this->resourceConnection->getTableName('catalog_product_option_title'),\n \"option_id = $optionId AND store_id = $storeId\"\n );\n }\n }\n\n if ($toInsert) {\n $this->resourceConnection->getConnection()->insertOnDuplicate(\n $this->resourceConnection->getTableName('catalog_product_option_title'),\n $toInsert\n );\n }\n }\n\n return $result;\n }" ]
[ "0.6597222", "0.6564094", "0.6448716", "0.6381053", "0.6249673", "0.6218079", "0.62179035", "0.621208", "0.6119649", "0.6114709", "0.6107237", "0.6070263", "0.60501415", "0.6047612", "0.59973085", "0.59621394", "0.5937758", "0.5925592", "0.59147894", "0.5887193", "0.58756983", "0.58511275", "0.5838666", "0.5833507", "0.5805713", "0.57997125", "0.5797097", "0.57892615", "0.5787097", "0.57707995", "0.57395756", "0.5725964", "0.5721067", "0.57205373", "0.57205373", "0.5710542", "0.5708758", "0.57014996", "0.5700306", "0.5694913", "0.56864524", "0.5681103", "0.5680724", "0.5678458", "0.5675231", "0.5669206", "0.5665555", "0.5665555", "0.5665555", "0.5665555", "0.5665555", "0.5665555", "0.5665555", "0.5663255", "0.5658371", "0.5658371", "0.5658371", "0.5658371", "0.5658371", "0.5658371", "0.5658371", "0.5654817", "0.5650116", "0.56422967", "0.56422365", "0.564199", "0.56340176", "0.5633501", "0.56327325", "0.5630905", "0.5623452", "0.56182796", "0.56182796", "0.56182796", "0.56182796", "0.56122416", "0.5611359", "0.5608026", "0.5594856", "0.55867237", "0.5583158", "0.5577973", "0.55779195", "0.5575214", "0.55546284", "0.55408716", "0.55346334", "0.55345625", "0.55338144", "0.5529185", "0.55274206", "0.5526454", "0.5524859", "0.55236006", "0.5523419", "0.55216634", "0.55128473", "0.550935", "0.55082625", "0.55074775" ]
0.76578766
0
SellerProduct has many SPPaymentRelations.
public function SPPaymentRelations() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\SPPaymentRelation','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function payments()\n {\n return $this -> hasMany( PaymentModel :: class );\n }", "public function pdeductions(){\n return $this->hasMany(Productdeduction::class);\n }", "public function SPOPtionRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany(SPOPtionRelation::class,'sp_id','sp_id');\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function payments(){\n return $this->hasMany('App\\Payment');\n }", "public function order_payment()\n {\n return $this->hasMany('App\\Models\\Sales\\SalesPayment', 'sales_order_id', 'id');\n }", "public function payments()\n {\n return $this->morphMany('App\\Entities\\Payments\\Payment', 'partner');\n }", "public function amountProducts(){\n return $this->hasMany(AmountProduct::class);\n }", "public function getPayments()\n {\n return $this->hasMany(Payments::className(), ['paymentMethodId' => 'paymentMethodId']);\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function payments(): HasMany\n {\n return $this->hasMany(Payment::class);\n }", "public function payments(): HasMany\n {\n return $this->hasMany(Payment::class);\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function payments()\n {\n return $this->hasMany('App\\Payment');\n }", "public function payments()\n {\n return $this->hasMany('App\\Payment');\n }", "public function payments()\n {\n return $this->hasMany('App\\Payment');\n }", "public function payments()\n {\n return $this->hasMany('App\\Payment');\n }", "public function payments()\n {\n return $this->hasMany('App\\Payment');\n }", "public function payments()\n {\n return $this->hasMany('App\\Payment');\n }", "public function getSellingPaymentMethods()\n {\n return $this->hasMany(PaymentMethod::className(), ['id' => 'payment_method_id'])\n ->viaTable('{{%currency_exchange_order_selling_payment_method}}', ['order_id' => 'id']);\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function getPayments()\n {\n return $this->hasMany(Payment::className(), ['user' => 'id']);\n }", "public function payment()\n {\n return $this->hasMany('App\\Models\\Payment', 'user_id', 'user_id');\n }", "public function bills()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\Bill','spsd_id','spsd_id');\n }", "public function payments()\n {\n return $this->hasMany('App\\payment');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function getPayments()\n {\n return $this->hasMany(Payment::className(), ['cust_id' => 'id']);\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function psubscriptions(){\n return $this->hasMany(Psubscription::class);\n }", "public function student(){\n return $this->belongsToMany(Student::class, 'student_payment');\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function relations()\n {\n return $this->belongsToMany(Product::class, 'product_relations', 'product_id', 'related_product_id')\n ->using(ProductRelation::class);\n }", "public function spendings(): HasMany\n {\n return $this->hasMany(Spending::class);\n }", "public function payments()\n {\n return $this->hasMany('App\\Payment','uid', 'id');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function payments()\n {\n return $this->belongsTo('App\\Payment');\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function products(): MorphToMany;", "public function skiApprovals()\n {\n return $this->hasMany('App\\Models\\SkiApproval', 'regno', 'personnel_no');\n }", "public function sellerSales()\n {\n return $this->hasMany('App\\Domains\\Sale\\Sale');\n }", "public function productHold()\n {\n return $this->hasMany('App\\Models\\ProductHold');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function shoppingCarts()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ShoppingCart','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function bookings(){\n return $this->belongsToMany('App\\Booking', 'payments', 'payment_status_id', 'booking_id');\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class, 'state_id', 'id');\n }", "public function SPShippings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPShipping','sp_id','sp_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product', 'royalty_chart', 'vehicle_type_id', 'product_id')->withPivot('amount', 'status');\n }", "public function OderDetails(){\n\t\treturn $this->hasMany('App\\OrderProduct','ID_Product');\n\t}", "public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}", "public function products(){\n return $this->hasMany(InvoiceProduct::class);\n //->leftJoin('invoice_product','products.id','invoice_product.product_id');\n //return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('fooCart\\src\\Product', 'tax_id', 'tax_id');\n }", "public function payments()\n {\n return $this->hasMany(\\Cot\\Payment::class);\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function invmovdet_bodorddesps()\n {\n return $this->hasMany(InvMovDet_BodOrdDesp::class,'despachoorddet_invbodegaproducto_id');\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function productClicks()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductClick','sp_id','sp_id');\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function saleitems()\n {\n return $this->hasMany('App\\SaleItem');\n }", "public function relations() {\n // class name for the relations automatically generated below.\n return array(\n 'product' => array(self::BELONGS_TO, 'Product', 'product_id'),\n );\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function payments()\n {\n return $this->hasMany(InvoicePayment::class, InvoicePayment::FIELD_ID_INVOICE, self::FIELD_ID);\n }", "public function numberPayments(){\n \treturn $this->belongsTo('Modules\\Plan\\Entities\\NumberPayments'); // this matches the Eloquent model\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function detail()\n {\n return $this->hasMany('App\\PaymentDetail');\n }", "public function orders_products(){\n return $this->hasMany(Order_product::class);\n }", "public function getBuyingPaymentMethods()\n {\n return $this->hasMany(PaymentMethod::className(), ['id' => 'payment_method_id'])\n ->viaTable('{{%currency_exchange_order_buying_payment_method}}', ['order_id' => 'id']);\n }", "public function paymentMethod()\r\n {\r\n \treturn $this->belongsTo('App\\PaymentMethod');\r\n }", "public function payments()\n {\n return $this->morphToMany(Payment::class, 'referenceable', 'payment_details')->active();\n }", "public function products()\n {\n return $this->belongsToMany(Product::class, 'product_promotions');\n }", "public function payment()\n {\n return $this->hasOne('App\\Payment');\n }", "public function productOptions()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductOption','sp_id','sp_id');\n }", "public function paymentTypes(){\n return $this->hasMany(PaymentTypes::class);\n }", "public function sellerStock()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\SellerStock','sp_id','sp_id');\n }", "public function categoryProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = cate_id, localKey = cate_id)\n return $this->hasMany('App\\CategoryProductRelation','cate_id','cate_id');\n }" ]
[ "0.7409085", "0.67664045", "0.6140433", "0.60329753", "0.60304254", "0.6016417", "0.59827995", "0.59753376", "0.5960799", "0.59569466", "0.5918691", "0.59050024", "0.59011835", "0.58920586", "0.58920586", "0.5879966", "0.5842273", "0.58295786", "0.58295786", "0.58295786", "0.58295786", "0.58295786", "0.58295786", "0.58208156", "0.5819135", "0.5797384", "0.5795248", "0.57892627", "0.57871854", "0.57672995", "0.5742615", "0.57040364", "0.5656407", "0.56360793", "0.5634557", "0.5609294", "0.5593155", "0.5547452", "0.5546128", "0.5543964", "0.5542712", "0.55350304", "0.5526873", "0.552484", "0.5508601", "0.54969877", "0.549046", "0.5490136", "0.5477078", "0.5468405", "0.54643196", "0.5461676", "0.5456531", "0.5440305", "0.543443", "0.54092914", "0.53978777", "0.5397471", "0.538867", "0.5384114", "0.5375115", "0.53745157", "0.5374403", "0.53721416", "0.5362927", "0.5361005", "0.5360739", "0.5360739", "0.5360739", "0.5360739", "0.5360739", "0.5360739", "0.5360739", "0.5347785", "0.5343703", "0.5334196", "0.53312916", "0.5324551", "0.53243357", "0.53191197", "0.53191197", "0.53159773", "0.530861", "0.53008074", "0.52979845", "0.52957416", "0.5290209", "0.528617", "0.5285229", "0.52781814", "0.52715904", "0.52708477", "0.52698296", "0.52694464", "0.525827", "0.5252473", "0.52458525", "0.52456427", "0.52386177", "0.5238188" ]
0.740858
1
SellerProduct has many SPPhotos.
public function SPPhotos() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\SPPhoto','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function photos() {\n return $this->hasMany('App\\Models\\ProductPhoto');\n }", "public function images()\n {\n return $this->hasMany(ProductImageProxy::modelClass(), 'seller_product_id');\n }", "public function productImage(){\n\t\treturn $this->hasmany('App\\ProductImages','product_id');\n\t}", "public function photo()\n {\n return $this->belongsToMany(Photos::class,'photo_product','photo_id', 'product_id');\n }", "public function images()\n {\n return $this->hasMany('fooCart\\src\\ProductImage', 'product_id', 'product_id');\n }", "public function product_galleries() {\n return $this->hasMany(ProductGallery::class, 'product_id', 'id');\n }", "public function images()\n\t{\n\t\treturn $this->hasMany(ProductImage::class);\n\t}", "public function images(): HasMany\n {\n return $this->hasMany('App\\Models\\ProductImage');\n }", "public function photos()\n {\n return $this->hasMany('App\\Entities\\QuoteOptionHotelRoomPhoto', 'quote_option_room_id', 'quote_option_room_id');\n }", "public function getGallery(){\n return $this->hasMany(ProductGallery::class, 'product_id','id');\n }", "public function photos() {\n return $this->hasMany('\\P4\\Photo');\n }", "public function images()\n {\n return $this->belongsToMany('App\\Models\\Images\\ImagesEloquent', 'shop_images', 'shop_id', 'image_id')->withTimestamps();\n }", "public function getImages()\n {\n return $this->hasMany(ProductImage::class, ['product_id' => 'id']);\n }", "public function photo_product()\n {\n return $this->belongsTo(Photo_product::class);\n }", "public function photographs()\n {\n return $this->hasMany('App\\Photograph');\n }", "public function image()\n {\n\n return $this->hasMany(ProductImage::class);\n \n }", "public function photos(): HasMany\n\t{\n\t\treturn $this->hasMany('App\\Models\\Photo', 'album_id', 'id');\n\t}", "public function photos(){\n\n\t\treturn $this->hasMany('App\\Photo');\n\n\t}", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function photos()\n {\n return $this->hasMany('App\\Photo');\n }", "public function photos()\n {\n return $this->hasMany('App\\Photo');\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function photos()\n {\n return $this->hasMany(ItemsPhoto::class);\n }", "public function products(): MorphToMany;", "public function photos() {\n return $this->hasMany('App\\FlyerPhoto');\n }", "public function photos(){\n return $this->morphMany('cms\\Photo', 'imageable');\n }", "public function pictures() {\n return $this->hasMany('App\\Models\\Picture');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function photos() {\n \treturn $this->morphMany('App\\Photo', 'imageable');\n }", "public function photos(){\n return $this->hasMany('App\\Models\\PhotoNews', 'news_album_id');\n }", "public function photos()\n {\n return $this->hasMany(Photo::class, 'photo_album_id');\n }", "public function photos()\n {\n return $this->hasMany(Photo::class, 'album_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function photos() {\n return $this->morphMany('App\\Models\\Photo', 'imageable'); //'imageable' - method in Photos model\n }", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "public function getImages()\n {\n return $this->hasMany(Image::className(), ['venueId' => 'id']);\n }", "public function bannerPhotos() {\n return $this->hasMany('App\\FlyerBanner');\n }", "public function photos()\n {\n return $this->hasMany('App\\AgentPhoto', 'agent_id');\n }", "public function products()\n {\n return $this->hasMany('App\\ProductLocation', 'productLocation', 'id');\n }", "public function findAllPhoto(){\n $query= $this->getEntityManager()\n ->createQuery(\"Select p FROM PidevFrontOfficeBundle:Galerie p ORDER BY p.idEvennement ASC\");\n return $query->getResult();\n }", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "public function photos(){\n return $this->morphMany('App\\Models\\Photo','image');\n \n }", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function images()\n {\n return $this->hasMany(PropertyImage::class,'property_id', 'id');\n }", "public function pictures()\n {\n return $this->hasMany(Picture::class);\n }", "public function syncImages() {\r\n\r\n /** @var Mage_Catalog_Helper_Product_Flat $helper */\r\n $process = Mage::helper('catalog/product_flat')->getProcess();\r\n $status = $process->getStatus();\r\n $process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);\r\n\r\n // Fetch attribute set id by attribute set name\r\n /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */\r\n $attributeSetId = Mage::getModel('eav/entity_attribute_set')\r\n ->load('Oodji', 'attribute_set_name')\r\n ->getAttributeSetId();\r\n\r\n $website = Mage::getResourceModel('core/website_collection')\r\n ->addFieldToFilter('code', 'oodji')\r\n ->getFirstItem();\r\n\r\n $storeId = Mage::app()->getStore(Mage::app()->getWebsite($website)->getDefaultGroup()->getDefaultStoreId())->getId();\r\n\r\n // Load product model collection filtered by attribute set id\r\n $products = Mage::getResourceModel('catalog/product_collection')\r\n ->setStoreId($storeId)\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToFilter('type_id', 'configurable')\r\n ->addFieldToFilter('attribute_set_id', $attributeSetId)\r\n ->addFieldToFilter('status', 2);\r\n\r\n $process->setStatus($status);\r\n\r\n // Process your product collection as per your bussiness logic\r\n /** @var Agere_PhotoGrabber_Helper_Grabber $grab */\r\n $grab = Mage::helper('photoGrabber/grabber');\r\n\r\n foreach($products as $product){\r\n $grab->searchProduct($product->getSku());\r\n }\r\n }", "protected function _delete()\n {\n $photoTable = Engine_Api::_()->getItemTable('socialstore_product_photo');\n $photoSelect = $photoTable->select()->where('album_id = ?', $this->getIdentity());\n foreach( $photoTable->fetchAll($photoSelect) as $productPhoto ) {\n $productPhoto->delete();\n }\n\n parent::_delete();\n }", "public function images()\n {\n return $this->hasMany(BusinessListingImage::class);\n }", "public function photos()\n {\n return $this->hasOne('App\\Customerfile','customer_id','id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function photos(): BelongsToMany\n {\n return $this->belongsToMany(Photo::class, 'penginapan_photos', 'id_penginapan', 'id_photos');\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function galleries()\n {\n return $this->hasMany(Gallery::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class, 'product_promotions');\n }", "public function actionProductGalleryImages() {\n\t\tif (Yii::$app->request->isAjax) {\n\t\t\tif (!empty($_POST['modelId'])) {\n\t\t\t\t$product_model = Products::findOne($_POST['modelId']);\n\n\t\t\t\tif (!empty($product_model)) {\n\n\t\t\t\t\t$split_folder = Yii::$app->UploadFile->folderName(0, 1000, $product_model->id);\n\t\t\t\t\t$home_path = Yii::$app->homeUrl . '../uploads/products/' . $split_folder . '/' . $product_model->id . '/gallery';\n\t\t\t\t\t$base_path = \\Yii::$app->basePath . '/../uploads/products/' . $split_folder . '/' . $product_model->id;\n\t\t\t\t\tif (file_exists($base_path)) {\n\t\t\t\t\t\t$value = $this->renderPartial('image-preview-update', [\n\t\t\t\t\t\t 'session_id' => Yii::$app->session['tempfolder'],\n\t\t\t\t\t\t 'home_path' => $home_path,\n\t\t\t\t\t\t 'base_path' => $base_path,\n\t\t\t\t\t\t 'model' => $product_model,\n\t\t\t\t\t\t 'split_folder' => $split_folder,\n\t\t\t\t\t\t]);\n\t\t\t\t\t\techo $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function pictures()\n {\n return $this->belongsToMany('App\\Api\\V1\\Models\\Picture');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "private function addProductPhotos(array $request){\n\n if(array_key_exists('photos', $request)){\n \n foreach($request['photos'] as $photos){\n\n $photo = new Photo();\n\n $photoProduct = Product::where('name', $request['name'])->get();\n $path = $photos->store('/storage/products');\n $filename = basename($path);\n $extension = $photos->getClientOriginalExtension();\n \n $photo->product_id = $photoProduct[0]->id; \n $photo->path = $filename;\n $photo->extension = $extension;\n\n $photo->save();\n }\n }\n }", "public function photoshoots()\n {\n return $this->hasMany(Photoshoot::class, 'request_id');\n }", "public function getPhotos()\n {\n return $this->photos;\n }", "public function images()\n {\n return $this->hasMany('Lwv\\BlockSliderExtension\\Image\\ImageModel','block')->orderBy('weight');\n }", "protected function addMediaGallery($productCollection) {\n $ids = array(); \n $products = array();\n foreach($productCollection as $product) {\n $ids[] = $product->getId();\n $products[$product->getId()] = $product;\n }\n if(!$ids) return false;\n \n \n $table = $productCollection->getTable(Mage_Catalog_Model_Resource_Product_Attribute_Backend_Media::GALLERY_TABLE);\n $adapter = $productCollection->getConnection();\n \n $select = $adapter->select()->from($table)->where('entity_id IN (?)',$ids);\n $rows = $adapter->query($select)->fetchAll();\n\n foreach($rows as $row) {\n $product = $products[$row['entity_id']];\n \n $images = (array)$product->getData('images');\n if($row['value']) {\n $images[] = $row['value'];\n }\n $product->setData('images',$images);\n }\n //echo $select.PHP_EOL;\n \n \n \n \n }", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public function multiplePhoto()\n {\n return $this->hasMany('App\\DescriptionPhoto','description_id')->orderBy('id','desc');\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function photographCollections()\n {\n return $this->hasMany(PhotographCollection::class)->orderBy('title', 'asc');\n }", "public function medias()\n\t{\n\t\treturn $this->hasMany('App\\PropertyImages');\n\t}", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function getGalleryImagesCollection($product = null)\n {\n static $images = [];\n if (is_null($product)) {\n $product = $this->getProduct();\n }\n $id = $product->getId();\n if (!isset($images[$id])) {\n $productRepository = \\Magento\\Framework\\App\\ObjectManager::getInstance()->create(\n \\Magento\\Catalog\\Model\\ProductRepository::class\n );\n $product = $productRepository->getById($product->getId());\n\n $images[$id] = $product->getMediaGalleryImages();\n if ($images[$id] instanceof \\Magento\\Framework\\Data\\Collection) {\n $baseMediaUrl = $this->_storeManager->getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA);\n $baseStaticUrl = $this->_storeManager->getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_STATIC);\n foreach ($images[$id] as $image) {\n /* @var \\Magento\\Framework\\DataObject $image */\n\n $mediaType = $image->getMediaType();\n if ($mediaType != 'image' && $mediaType != 'external-video') {\n continue;\n }\n\n $img = $this->_imageHelper->init($product, 'product_page_image_large', ['width' => null, 'height' => null])\n ->setImageFile($image->getFile())\n ->getUrl();\n\n $iPath = $image->getPath();\n if (!is_file($iPath)) {\n if (strpos($img, $baseMediaUrl) === 0) {\n $iPath = str_replace($baseMediaUrl, '', $img);\n $iPath = $this->magicToolboxHelper->getMediaDirectory()->getAbsolutePath($iPath);\n } else {\n $iPath = str_replace($baseStaticUrl, '', $img);\n $iPath = $this->magicToolboxHelper->getStaticDirectory()->getAbsolutePath($iPath);\n }\n }\n try {\n $originalSizeArray = getimagesize($iPath);\n } catch (\\Exception $exception) {\n $originalSizeArray = [0, 0];\n }\n\n if ($mediaType == 'image') {\n if ($this->toolObj->params->checkValue('square-images', 'Yes')) {\n $bigImageSize = ($originalSizeArray[0] > $originalSizeArray[1]) ? $originalSizeArray[0] : $originalSizeArray[1];\n $img = $this->_imageHelper->init($product, 'product_page_image_large')\n ->setImageFile($image->getFile())\n ->resize($bigImageSize)\n ->getUrl();\n }\n $image->setData('large_image_url', $img);\n\n list($w, $h) = $this->magicToolboxHelper->magicToolboxGetSizes('thumb', $originalSizeArray);\n $medium = $this->_imageHelper->init($product, 'product_page_image_medium', ['width' => $w, 'height' => $h])\n ->setImageFile($image->getFile())\n ->getUrl();\n $image->setData('medium_image_url', $medium);\n }\n\n list($w, $h) = $this->magicToolboxHelper->magicToolboxGetSizes('selector', $originalSizeArray);\n $thumb = $this->_imageHelper->init($product, 'product_page_image_small', ['width' => $w, 'height' => $h])\n ->setImageFile($image->getFile())\n ->getUrl();\n $image->setData('small_image_url', $thumb);\n }\n }\n }\n return $images[$id];\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function featuredPhoto() {\n return $this->hasOne('App\\Models\\ProductPhoto')->whereFeatured(true);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function galleries()\n {\n return $this->belongsTo(Gallery::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function getPhotos();", "public function images()\n {\n return $this->HasMany('App\\Models\\Properties\\Image')->orderBy('index', 'asc');\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function thumbs() {\n return $this->hasMany('App\\Thumb');\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function products()\n {\n return $this->belongsToMany('App\\Product');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function images()\n {\n return $this->hasMany('App\\Image');\n }", "public function images()\n {\n return $this->hasMany('App\\Image');\n }", "public function images()\n {\n return $this->hasMany('App\\Image');\n }", "public function images()\n {\n return $this->hasMany('App\\Image');\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function images(): HasManyThrough\n {\n return $this->hasManyThrough(\n Image::class,\n File::class\n );\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }" ]
[ "0.730241", "0.706066", "0.6793256", "0.67062074", "0.66775936", "0.6626541", "0.6593004", "0.6584435", "0.65677917", "0.652716", "0.6386932", "0.63826764", "0.6351952", "0.62405086", "0.62019926", "0.6166767", "0.6162603", "0.61545855", "0.6108691", "0.60884184", "0.60884184", "0.6053989", "0.6045807", "0.59945184", "0.59912974", "0.5985953", "0.59564793", "0.59507686", "0.5915503", "0.5909453", "0.58585966", "0.5855784", "0.5830154", "0.58259165", "0.5825621", "0.58056563", "0.5765522", "0.57588136", "0.57419944", "0.5731424", "0.5727473", "0.5701489", "0.5691572", "0.56877774", "0.5685514", "0.56831515", "0.5680457", "0.5671185", "0.56411064", "0.5633409", "0.56230974", "0.56226826", "0.5610561", "0.55892074", "0.5587139", "0.55776197", "0.5573488", "0.5567168", "0.5558786", "0.55502295", "0.55428493", "0.55423397", "0.55404544", "0.5536118", "0.55159867", "0.5515034", "0.55113626", "0.54949456", "0.549271", "0.54862463", "0.5485553", "0.5483222", "0.5469404", "0.5462823", "0.545638", "0.54517835", "0.54480803", "0.54480803", "0.54480803", "0.54480803", "0.54480803", "0.54480803", "0.54480803", "0.54432225", "0.54285705", "0.5427513", "0.5423629", "0.5423391", "0.5412437", "0.54100305", "0.540917", "0.540917", "0.540917", "0.540917", "0.54061335", "0.5406022", "0.54049087", "0.53995895", "0.53988606", "0.53988606" ]
0.7471601
0
SellerProduct has many PredefinedWholesaleQuantities.
public function predefinedWholesaleQuantities() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\PredefinedWholesaleQuantity','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function customWholesaleQuantities()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\CustomWholesaleQuantity','sp_id','sp_id');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function product()\n\t{\n\t\treturn $this->belongsToMany('App\\Models\\Products','inventory','store_id','product_id')->withPivot('stocks', 'lower_limit', 'higher_limit');\n\t}", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function warehouse()\n {\n return $this->belongsToMany('App\\Warehouse', 'product_has_warehouse', 'product_id', 'warehouse_id');\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function warehouses(): HasManyThrough\n\t{\n\t\treturn $this->hasManyThrough('Ronmrcdo\\Inventory\\Models\\InventoryStock', 'Ronmrcdo\\Inventory\\Models\\ProductSku')->with('warehouse');\n\t}", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public static function usesAdvancedStockManagement($id_product)\n {\n }", "public function ingredientSuppliers(){\n return $this->hasMany(SupplierStock::class);\n }", "public function amountProducts(){\n return $this->hasMany(AmountProduct::class);\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function product_supply(){ return $this->hasMany(ProductSupply::class,'vehicle_id'); }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product', 'royalty_chart', 'vehicle_type_id', 'product_id')->withPivot('amount', 'status');\n }", "public function getPrice(){\n return $this->hasMany(Inventory::class, 'product_id','id');\n}", "public function getProducts()\n {\n return $this->hasMany(Product::className(), ['uomId' => 'uomId']);\n }", "public function stocks(): HasMany\n {\n return $this->hasMany('Ronmrcdo\\Inventory\\Models\\InventoryStock');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "private function createWarrantyProduct()\n {\n /**\n * @var $product Mage_Catalog_Model_Product\n */\n foreach ($this->warrantyProductSkus as $warrantyProductSku => $productName) {\n if (!$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $warrantyProductSku)) {\n $product = Mage::getModel('catalog/product');\n\n $product->setTypeId(Mulberry_Warranty_Model_Product_Type_Warranty::TYPE_ID)\n ->setSku($warrantyProductSku)\n ->setName($productName)\n ->setDescription(sprintf('%s, Product Placeholder', $productName))\n ->setShortDescription(sprintf('%s, Product Placeholder', $productName))\n ->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG)\n ->setAttributeSetId(4)\n ->setTaxClassId(0)\n ->setPrice(10.00)\n ->setStockData(array(\n 'use_config_manage_stock' => 0,\n 'manage_stock' => 0,\n 'is_in_stock' => 1,\n 'qty' => 10,\n ));\n\n $product->save();\n }\n }\n }", "private function _printOrderQuantityBasedWholesalePricingControls( $product_id , $registeredCustomRoles , $classes ) {\r\n\r\n $aelia_currency_switcher_active = WWPP_ACS_Integration_Helper::aelia_currency_switcher_active();\r\n\r\n if ( $aelia_currency_switcher_active ) {\r\n\r\n $currencySymbol = \"\";\r\n\r\n $base_currency = WWPP_ACS_Integration_Helper::get_product_base_currency( $product_id );\r\n\r\n $woocommerce_currencies = get_woocommerce_currencies();\r\n $enabled_currencies = WWPP_ACS_Integration_Helper::enabled_currencies();\r\n\r\n } else\r\n $currencySymbol = \" (\" . get_woocommerce_currency_symbol() . \")\";\r\n\r\n $wholesale_roles_arr = array();\r\n foreach ( $registeredCustomRoles as $roleKey => $role )\r\n $wholesale_roles_arr[ $roleKey ] = $role[ 'roleName' ];\r\n\r\n $pqbwp_enable = get_post_meta( $product_id , WWPP_POST_META_ENABLE_QUANTITY_DISCOUNT_RULE , true );\r\n\r\n $pqbwp_controls_styles = '';\r\n if ( $pqbwp_enable != 'yes' )\r\n $pqbwp_controls_styles = 'display: none;';\r\n\r\n $mapping = get_post_meta( $product_id , WWPP_POST_META_QUANTITY_DISCOUNT_RULE_MAPPING , true );\r\n if ( !is_array( $mapping ) )\r\n $mapping = array(); ?>\r\n\r\n <div class=\"product-quantity-based-wholesale-pricing options_group <?php echo $classes; ?>\" >\r\n\r\n <div>\r\n\r\n <h3 class=\"pqbwp-heading\"><?php _e( 'Product Quantity Based Wholesale Pricing' , 'woocommerce-wholesale-prices-premium' ); ?></h3>\r\n <p class=\"pqbwp-desc\">\r\n <?php _e( 'Specify wholesale price for this current product depending on the quantity being purchased.<br/>Only applies to the wholesale roles that you specify.' , 'woocommerce-wholesale-prices-premium' ); ?>\r\n </p>\r\n\r\n <?php if ($aelia_currency_switcher_active ) { ?>\r\n\r\n <p class=\"pbwp-desc\">\r\n <?php _e( 'Note: If you have not specify mapping for other currencies for a given wholesale role, it will derive its wholesale price automatically by converting the base currency wholesale price to that currency' , 'woocommerce-wholesale-prices-premium' ); ?>\r\n </p>\r\n\r\n <?php } ?>\r\n\r\n </div>\r\n\r\n <p class=\"form-field pqbwp-enable-field-container\">\r\n\r\n <span class=\"hidden post-id\"><?php echo $product_id; ?></span>\r\n <input type=\"checkbox\" class=\"pqbwp-enable checkbox\" value=\"yes\" <?php echo ( $pqbwp_enable == 'yes' ) ? 'checked' : ''; ?>>\r\n <span class=\"description\"><?php _e( \"Enable further wholesale pricing discounts based on quantity purchased?\" , \"woocommerce-wholesale-prices-premium\" ); ?></span>\r\n\r\n </p>\r\n\r\n <div class=\"processing-indicator\"><span class=\"spinner\"></span></div>\r\n\r\n <div class=\"pqbwp-controls\" style=\"<?php echo $pqbwp_controls_styles; ?>\">\r\n\r\n <input type=\"hidden\" class=\"mapping-index\" value=\"\">\r\n\r\n <?php\r\n // The fields below aren't really saved via woocommerce, we just used it here to house our rule controls.\r\n // We use these to add our rule controls to abide with woocommerce styling.\r\n\r\n woocommerce_wp_select(\r\n array(\r\n 'id' => 'pqbwp_registered_wholesale_roles',\r\n 'class' => 'pqbwp_registered_wholesale_roles',\r\n 'label' => __( 'Wholesale Role' , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Select wholesale role to which this rule applies.' , 'woocommerce-wholesale-prices-premium' ),\r\n 'options' => $wholesale_roles_arr\r\n )\r\n );\r\n\r\n woocommerce_wp_text_input(\r\n array(\r\n 'id' => 'pqbwp_minimum_order_quantity',\r\n 'class' => 'pqbwp_minimum_order_quantity',\r\n 'label' => __( 'Starting Qty' , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Minimum order quantity required for this rule. Must be a number.' , 'woocommerce-wholesale-prices-premium' ),\r\n )\r\n );\r\n\r\n woocommerce_wp_text_input(\r\n array(\r\n 'id' => 'pqbwp_maximum_order_quantity',\r\n 'class' => 'pqbwp_maximum_order_quantity',\r\n 'label' => __( 'Ending Qty' , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Maximum order quantity required for this rule. Must be a number. Leave this blank for no maximum quantity.' , 'woocommerce-wholesale-prices-premium' ),\r\n )\r\n );\r\n\r\n woocommerce_wp_text_input(\r\n array(\r\n 'id' => 'pqbwp_wholesale_price',\r\n 'class' => 'pqbwp_wholesale_price',\r\n 'label' => __( 'Wholesale Price' . $currencySymbol , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Wholesale price for this specific rule.' , 'woocommerce-wholesale-prices-premium' ),\r\n 'data_type' => 'price'\r\n )\r\n );\r\n\r\n if ( $aelia_currency_switcher_active ) {\r\n\r\n $currency_select_options = array();\r\n\r\n foreach ( $enabled_currencies as $currency ) {\r\n\r\n if ( $currency == $base_currency )\r\n $text = $woocommerce_currencies[ $currency ] . \" (Base Currency)\";\r\n else\r\n $text = $woocommerce_currencies[ $currency ];\r\n\r\n $currency_select_options[ $currency ] = $text;\r\n\r\n }\r\n\r\n woocommerce_wp_select(\r\n array(\r\n 'id' => 'pqbwp_enabled_currencies',\r\n 'class' => 'pqbwp_enabled_currencies',\r\n 'label' => __( 'Currency' , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Select Currency' , 'woocommerce-wholesale-prices-premium' ),\r\n 'options' => $currency_select_options,\r\n 'value' => $base_currency\r\n )\r\n );\r\n\r\n } ?>\r\n\r\n <p class=\"form-field button-controls add-mode\">\r\n\r\n <input type=\"button\" class=\"pqbwp-cancel button button-secondary\" value=\"<?php _e( 'Cancel' , 'woocommerce-wholesale-prices-premium' ); ?>\">\r\n <input type=\"button\" class=\"pqbwp-save-rule button button-primary\" value=\"<?php _e( 'Save Quantity Discount Rule' , 'woocommerce-wholesale-prices-premium' ); ?>\">\r\n <input type=\"button\" class=\"pqbwp-add-rule button button-primary\" value=\"<?php _e( 'Add Quantity Discount Rule' , 'woocommerce-wholesale-prices-premium' ); ?>\">\r\n <span class=\"spinner\"></span>\r\n\r\n <div style=\"float: none; clear: both; display: block;\"></div>\r\n\r\n </p>\r\n\r\n <div class=\"form-field table-mapping\">\r\n <table class=\"pqbwp-mapping wp-list-table widefat\">\r\n\r\n <thead>\r\n <tr>\r\n <th><?php _e( 'Wholesale Role' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Starting Qty' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Ending Qty' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Wholesale Price' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <?php echo $aelia_currency_switcher_active ? \"<th>\" . __( 'Currency' , 'woocommerce-wholesale-prices-premium' ) . \"</th>\" : \"\"; ?>\r\n <th></th>\r\n </tr>\r\n </thead>\r\n\r\n <tfoot>\r\n <tr>\r\n <th><?php _e( 'Wholesale Role' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Starting Qty' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Ending Qty' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Wholesale Price' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <?php echo $aelia_currency_switcher_active ? \"<th>\" . __( 'Currency' , 'woocommerce-wholesale-prices-premium' ) . \"</th>\" : \"\"; ?>\r\n <th></th>\r\n </tr>\r\n </tfoot>\r\n\r\n <tbody>\r\n\r\n <?php\r\n if ( !empty( $mapping ) ) {\r\n\r\n if ( $aelia_currency_switcher_active ) {\r\n\r\n $itemNumber = 0;\r\n foreach ( $mapping as $index => $map ) {\r\n\r\n foreach ( $enabled_currencies as $currency ) {\r\n\r\n if ( $currency == $base_currency ) {\r\n\r\n $wholesale_role_meta_key = 'wholesale_role';\r\n $wholesale_price_meta_key = 'wholesale_price';\r\n $start_qty_meta_key = 'start_qty';\r\n $end_qty_meta_key = 'end_qty';\r\n\r\n } else {\r\n\r\n $wholesale_role_meta_key = $currency . '_wholesale_role';\r\n $wholesale_price_meta_key = $currency . '_wholesale_price';\r\n $start_qty_meta_key = $currency . '_start_qty';\r\n $end_qty_meta_key = $currency . '_end_qty';\r\n\r\n }\r\n\r\n $args = array( 'currency' => $currency );\r\n\r\n if ( array_key_exists( $wholesale_role_meta_key , $map ) ) {\r\n\r\n $itemNumber++;\r\n\r\n // One key check is enough\r\n $this->_printMappingItem( $itemNumber , $index , $map , $registeredCustomRoles , $wholesale_role_meta_key , $wholesale_price_meta_key , $start_qty_meta_key , $end_qty_meta_key , $aelia_currency_switcher_active , $args , $currency );\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n } else {\r\n\r\n $itemNumber = 0;\r\n foreach ( $mapping as $index => $map ) {\r\n\r\n // Skip none base currency mapping\r\n if ( array_key_exists( 'currency' , $map ) )\r\n continue;\r\n\r\n $itemNumber++;\r\n\r\n $wholesale_role_meta_key = 'wholesale_role';\r\n $wholesale_price_meta_key = 'wholesale_price';\r\n $start_qty_meta_key = 'start_qty';\r\n $end_qty_meta_key = 'end_qty';\r\n $args = array( 'currency' => get_woocommerce_currency() );\r\n\r\n $this->_printMappingItem( $itemNumber , $index , $map , $registeredCustomRoles , $wholesale_role_meta_key , $wholesale_price_meta_key , $start_qty_meta_key , $end_qty_meta_key , false , $args );\r\n\r\n }\r\n\r\n }\r\n\r\n } else { ?>\r\n\r\n <tr class=\"no-items\">\r\n <td class=\"colspanchange\" colspan=\"10\"><?php _e( 'No Quantity Discount Rules Found' , 'woocommerce-wholesale-prices-premium' ); ?></td>\r\n </tr>\r\n\r\n <?php } ?>\r\n\r\n </tbody>\r\n\r\n </table><!--#pqbwp-mapping-->\r\n </div>\r\n\r\n </div>\r\n\r\n </div><!--.product-quantity-based-wholesale-pricing-->\r\n\r\n <?php\r\n\r\n }", "public function companies()\n {\n return $this->belongsToMany('Villato\\Company', 'company_region_product', 'product_id', 'company_id');\n }", "public function getActualOverheadWarehouseCharges(){\n return $this->hasMany(Overhead_warehouse_charges::class, 'mfp_procurement_id', 'id'); \n }", "public function designProfit(){\n\t\treturn $this->campaigns()\n\t\t\t->join('order_detail', 'product_campaign.id', 'order_detail.campaign_id')\n\t\t\t->join('order', 'order_detail.order_id', 'order.id')\n\t\t\t->join('order_status', 'order.id', 'order_status.order_id')\n\t\t\t->where('order_status.value', 4)\n\t\t\t->sum('product_quantity') * 25000;\n\t}", "public function magicMethod(){\n $cart = $this->_getCart();\n $quoteArrayFreeProducts = array();\n $quoteArrayNonFreeProducts = array();\n $AddThisInCart = array();\n $finalAdd = array();\n\n // finding both free and non free products and saving them in array\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n foreach($quote->getAllVisibleItems() as $item) {\n if($item->getData('price') == 0){\n $quoteArrayFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayFreeProducts['qty'][] = $item->getData('qty');\n }else{\n $quoteArrayNonFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayNonFreeProducts['qty'][] = $item->getData('qty');\n }\n }\n \n // print_r($quoteArrayFreeProducts);die;\n // finding free associatied produts and adding them in another array\n for($i = 0; $i < count($quoteArrayNonFreeProducts['item_id']) ;$i++){\n $product = Mage::getModel('catalog/product')->load($quoteArrayNonFreeProducts['item_id'][$i]);\n // print_r($product->getAttributeText('buyxgety'));die;\n if($product->getAttributeText('buyxgety') == 'Enable'){\n $Buyxgety_xqty = $product->getBuyxgety_xqty();\n $Buyxgety_ysku = $product->getBuyxgety_ysku();\n $Buyxgety_yqty = $product->getBuyxgety_yqty();\n\n // $Buyxgety_ydiscount = $product->getBuyxgety_ydiscount();\n if(!empty($Buyxgety_xqty) && !empty($Buyxgety_ysku) && !empty($Buyxgety_yqty) ){\n // die($Buyxgety_ysku);\n $AddThisInCart['item_id'][] = Mage::getModel('catalog/product')->getIdBySku($Buyxgety_ysku);\n $AddThisInCart['qty'][] = (int)($quoteArrayNonFreeProducts['qty'][$i]/$Buyxgety_xqty)*$Buyxgety_yqty;\n }\n }\n }\n for($i = 0; $i < count($AddThisInCart['item_id']) ;$i++){\n if(isset($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']) ;$j++){\n if($AddThisInCart['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i] - $quoteArrayFreeProducts['qty'][$j];\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n for($j = 0; $j < count($quoteArrayNonFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayNonFreeProducts['item_id'][$j]){\n foreach ($quoteArrayFreeProducts['item_id'] as $value) {\n if($value == $finalAdd['item_id'][$i]){\n $flag = 1;\n }else{\n $flag = 0;\n }\n }\n if($flag == 1){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }\n if(!empty($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }else{\n $finalAdd['new_row'][] = 1;\n } \n }\n\n // print_r($finalAdd);die;\n\n if(isset($finalAdd['item_id'])){\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n if($finalAdd['qty'][$i] > 0){\n Mage::getSingleton('core/session')->setMultilineAddingObserver($finalAdd['new_row'][$i]);\n Mage::getSingleton('core/session')->setZeroSettingObserver(1);\n if($finalAdd['new_row'][$i] == 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->magicMethod();\n }\n }\n }else{\n $productToAdd = $product->load($finalAdd['item_id'][$i]);\n $params['qty'] = $finalAdd['qty'][$i];\n $params['product'] = $finalAdd['item_id'][$i];\n $cart->addProduct($productToAdd, $params);\n $cart->save();\n }\n }else if($finalAdd['qty'][$i] < 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->_updateShoppingCart();\n }\n } \n }\n }\n }\n }", "public function productHold()\n {\n return $this->hasMany('App\\Models\\ProductHold');\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function qb_inventory()\n {\n return $this->hasMany('App\\QB_Inventory');\n }", "private function setRecountProduct() {\n\n //$this->model->setDocumentNumber($this->getDocumentNumber);\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n INSERT INTO `productrecount` \n (\n `companyId`,\n `warehouseId`,\n `productCode`,\n `productDescription`,\n `productRecountDate`,\n `productRecountSystemQuantity`,\n `productRecountPhysicalQuantity`,\n `isDefault`,\n `isNew`,\n `isDraft`,\n `isUpdate`,\n `isDelete`,\n `isActive`,\n `isApproved`,\n `isReview`,\n `isPost`,\n `executeBy`,\n `executeTime`\n ) VALUES ( \n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n INSERT INTO [productRecount]\n (\n [productRecountId],\n [companyId],\n [warehouseId],\n [productCode],\n [productDescription],\n [productRecountDate],\n [productRecountSystemQuantity],\n [productRecountPhysicalQuantity],\n [isDefault],\n [isNew],\n [isDraft],\n [isUpdate],\n [isDelete],\n [isActive],\n [isApproved],\n [isReview],\n [isPost],\n [executeBy],\n [executeTime]\n) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n INSERT INTO PRODUCTRECOUNT\n (\n COMPANYID,\n WAREHOUSEID,\n PRODUCTCODE,\n PRODUCTDESCRIPTION,\n PRODUCTRECOUNTDATE,\n PRODUCTRECOUNTSYSTEMQUANTITY,\n PRODUCTRECOUNTPHYSICALQUANTITY,\n ISDEFAULT,\n ISNEW,\n ISDRAFT,\n ISUPDATE,\n ISDELETE,\n ISACTIVE,\n ISAPPROVED,\n ISREVIEW,\n ISPOST,\n EXECUTEBY,\n EXECUTETIME\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n }\n }\n }\n try {\n $this->q->create($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "public function addSimpleProductQuantityBasedWholesalePriceCustomField( $registeredCustomRoles ) {\r\n\r\n global $post;\r\n\r\n $this->_printOrderQuantityBasedWholesalePricingControls( $post->ID , $registeredCustomRoles , 'simple' );\r\n\r\n }", "public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'company_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withPivot('amount', 'data', 'consume');\n }", "public function products(): MorphToMany;", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function applyOrderQuantityBasedWholesalePricing( $wholesalePrice , $productID , $userWholesaleRole , $cartItem ) {\n\n // Quantity based discount depends on a wholesale price being set on the per product level\n // If none is set, then, quantity based discount will not be applied even if it is defined\n if ( !empty( $wholesalePrice ) && !empty( $userWholesaleRole ) ) {\n\n $enabled = get_post_meta( $productID , WWPP_POST_META_ENABLE_QUANTITY_DISCOUNT_RULE , true );\n\n $mapping = get_post_meta( $productID , WWPP_POST_META_QUANTITY_DISCOUNT_RULE_MAPPING , true );\n if ( !is_array( $mapping ) )\n $mapping = array();\n\n if ( $enabled == 'yes' && !empty( $mapping ) ) {\n\n /*\n * Get the base currency mapping. The base currency mapping well determine what wholesale\n * role and range pairing a product has wholesale price with.\n */\n $baseCurrencyMapping = $this->_getBaseCurrencyMapping( $mapping , $userWholesaleRole );\n\n if ( WWPP_ACS_Integration_Helper::aelia_currency_switcher_active() ) {\n\n $baseCurrency = WWPP_ACS_Integration_Helper::get_product_base_currency( $productID );\n $activeCurrency = get_woocommerce_currency();\n\n if ( $baseCurrency == $activeCurrency ) {\n\n $wholesalePrice = $this->_getWholesalePriceFromMapping( $wholesalePrice , $baseCurrencyMapping , array() , $cartItem , $baseCurrency , $activeCurrency , true );\n\n } else {\n\n // Get specific currency mapping\n $specific_currency_mapping = $this->_getSpecificCurrencyMapping( $mapping , $userWholesaleRole , $activeCurrency , $baseCurrencyMapping );\n\n $wholesalePrice = $this->_getWholesalePriceFromMapping( $wholesalePrice , $baseCurrencyMapping , $specific_currency_mapping , $cartItem , $baseCurrency , $activeCurrency , false );\n\n }\n\n } else {\n\n $wholesalePrice = $this->_getWholesalePriceFromMapping( $wholesalePrice , $baseCurrencyMapping , array() , $cartItem , get_woocommerce_currency() , get_woocommerce_currency() , true );\n\n }\n\n } // if ( $enabled == 'yes' && !empty( $mapping ) )\n\n }\n\n return $wholesalePrice;\n\n }", "public function products()\n {\n return $this->hasMany('fooCart\\src\\Product', 'tax_id', 'tax_id');\n }", "public function render_warehouse_stock_fields_product($product_id)\n {\n $repository = new IM_Warehouse_Repository();\n $warehouses = $repository->get_all();\n\n $product = wc_get_product($product_id);\n\n // variations don't show stock table\n if($product instanceof \\WC_Product_Variable)\n return;\n\n $block = true;\n if (current_user_can(\"manage_options\") || current_user_can(\"hellodev_im_product_stock\")) {\n $block = false;\n }\n\n if (isset($product)) { ?>\n<script type=\"text/javascript\">\n jQuery(document).ready(function($) {\n $(\"._stock_field\").remove();\n $(\".input_stock_warehouse\").change(function() {\n var sum = 0;\n $(\".input_stock_warehouse\").each(function(){\n sum += parseFloat(this.value);\n });\n $(\"#_stock\").val(sum);\n });\n\n var block = \"<?php echo $block?>\";\n if(block){\n $(\".input_stock_warehouse\").prop( \"readonly\", true );\n $(\".input_priority_warehouse\").prop( \"readonly\", true );\n }\n\n $(\".show_if_variation_manage_stock .form-row-first\").remove();\n $(\".wc_input_stock\").remove();\n\n $('.input_stock_warehouse').on('input',function(e){\n var product_id = \"<?php echo $product_id; ?>\";\n var totalStock = 0;\n var count = 0;\n $(\".input_stock_warehouse\").each(function() {\n count++;\n if($(this).val() && Math.floor($(this).val()) == $(this).val() && $.isNumeric($(this).val())){\n totalStock += parseInt($(this).val());\n }\n });\n if(count > 0){\n $(\".column-columnname #total_stock_\" + product_id).text(totalStock + ' units');\n }\n });\n\n });\n </script>\n<div class=\"wrap\" style=\"padding-top: 15px; padding-bottom: 15px; width: 75%; margin: 0 auto;\">\n <?php\n if($product instanceof \\WC_Product_Bundle){\n _e(\"It is recommended not to use stock management on bundled products. <br>\n Stock will be managed individually on each product that constitutes the bundle.\n <br>Disable manage stock and set stock status to In Stock to do so.\",\"hellodev-inventory-manager\");\n }\n else{\n $product = wc_get_product($product_id);\n $get_stock = $product->get_stock_quantity();\n $stock_qty = 0;\n ?>\n <div class=\"stock_fields show_if_variation_manage_stock\"\n\t\tstyle=\"display: block;\">\n <?php\n $i = 0;\n $values = array();\n $warehouses_values = array();\n foreach ($warehouses as $warehouse) :\n $warehouse_id = $warehouse->id;\n $repository_product_warehouse = new IM_Product_Warehouse_Repository();\n $product_object = $repository_product_warehouse->getByProductWarehouseID($product_id, $warehouse_id);\n $warehouses_values[$i][\"product_id\"] = $product_id;\n $warehouses_values[$i][\"warehouse\"] = $warehouse;\n $warehouses_values[$i][\"stock\"] = $product_object->getStock();\n $warehouses_values[$i][\"priority\"] = $product_object->getPriority();\n $i ++;\n $stock_qty += $product_object->getStock();\n endforeach\n ;\n $values[\"warehouses\"] = $warehouses_values;\n $values[\"total_stock\"] = $stock_qty;\n $this->viewRender = IM_View_Render::get_instance();\n $this->viewRender->render(\"stock-per-warehouse\", $values);\n\n ?>\n </div>\n <input type=\"hidden\" name=\"_stock\" id=\"_stock\"\n\t\tvalue=\"<?php echo $stock_qty; ?>\" />\n<?php\n }?>\n </div><?php\n }\n }", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "function wc_marketplace_product() {\n global $wmp;\n $wmp->output_report_product();\n }", "public function products(){\n return $this->belongsToMany('App\\Product', 'product_warehouse', 'warehouse_id', 'product_id')\n ->withPivot('quantity') //iot use increment and decrement i added the id column\n ->withTimestamps(); //for the timestamps created_at updated_at, to be maintained.\n }", "protected function _saveProducts()\n {\n $priceIsGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n $entityLinkField = $this->getProductEntityLinkField();\n\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = [];\n $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = [];\n $this->categoriesCache = [];\n $tierPrices = [];\n $mediaGallery = [];\n $labelsForUpdate = [];\n $imagesForChangeVisibility = [];\n $uploadedImages = [];\n $previousType = null;\n $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($bunch);\n\n foreach ($bunch as $rowNum => $rowData) {\n // reset category processor's failed categories array\n $this->categoryProcessor->clearFailedCategories();\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n $rowScope = $this->getRowScope($rowData);\n\n $rowData[self::URL_KEY] = $this->getUrlKey($rowData);\n\n $rowSku = $rowData[self::COL_SKU];\n\n if (null === $rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($rowSku)['attr_set_code'];\n }\n\n // 1. Entity phase\n if ($this->isSkuExist($rowSku)) {\n // existing row\n if (isset($rowData['attribute_set_code'])) {\n $attributeSetId = $this->catalogConfig->getAttributeSetId(\n $this->getEntityTypeId(),\n $rowData['attribute_set_code']\n );\n\n // wrong attribute_set_code was received\n if (!$attributeSetId) {\n throw new LocalizedException(\n __(\n 'Wrong attribute set code \"%1\", please correct it and try again.',\n $rowData['attribute_set_code']\n )\n );\n }\n } else {\n $attributeSetId = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n }\n\n $entityRowsUp[] = [\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'attribute_set_id' => $attributeSetId,\n $entityLinkField => $this->getExistingSku($rowSku)[$entityLinkField]\n ];\n } else {\n if (!$productLimit || $productsQty < $productLimit) {\n $entityRowsIn[strtolower($rowSku)] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($rowSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($rowSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => isset($rowData['has_options']) ? $rowData['has_options'] : 0,\n 'created_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n }\n\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n // 2. Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // 3. Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->processRowCategories($rowData);\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n unset($rowData['rowNum']);\n\n // 4.1. Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => $rowData['_tier_price_price'],\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] ||\n $priceIsGlobal ? 0 : $this->storeResolver->getWebsiteCodeToId($rowData['_tier_price_website']),\n ];\n }\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n\n // 5. Media gallery phase\n list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);\n $storeId = !empty($rowData[self::COL_STORE])\n ? $this->getStoreIdByCode($rowData[self::COL_STORE])\n : Store::DEFAULT_STORE_ID;\n $imageHiddenStates = $this->getImagesHiddenStates($rowData);\n foreach (array_keys($imageHiddenStates) as $image) {\n if (array_key_exists($rowSku, $existingImages)\n && array_key_exists($image, $existingImages[$rowSku])\n ) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n $uploadedImages[$image] = $image;\n }\n\n if (empty($rowImages)) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n }\n }\n\n $rowData[self::COL_MEDIA_IMAGE] = [];\n\n /*\n * Note: to avoid problems with undefined sorting, the value of media gallery items positions\n * must be unique in scope of one product.\n */\n $position = 0;\n foreach ($rowImages as $column => $columnImages) {\n foreach ($columnImages as $columnImageKey => $columnImage) {\n if (!isset($uploadedImages[$columnImage])) {\n $uploadedFile = $this->uploadMediaFiles($columnImage);\n $uploadedFile = $uploadedFile ?: $this->getSystemFile($columnImage);\n if ($uploadedFile) {\n $uploadedImages[$columnImage] = $uploadedFile;\n } else {\n $this->addRowError(\n ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,\n $rowNum,\n null,\n null,\n ProcessingError::ERROR_LEVEL_NOT_CRITICAL\n );\n }\n } else {\n $uploadedFile = $uploadedImages[$columnImage];\n }\n\n if ($uploadedFile && $column !== self::COL_MEDIA_IMAGE) {\n $rowData[$column] = $uploadedFile;\n }\n\n if ($uploadedFile && !isset($mediaGallery[$storeId][$rowSku][$uploadedFile])) {\n if (isset($existingImages[$rowSku][$uploadedFile])) {\n $currentFileData = $existingImages[$rowSku][$uploadedFile];\n if (isset($rowLabels[$column][$columnImageKey])\n && $rowLabels[$column][$columnImageKey] !=\n $currentFileData['label']\n ) {\n $labelsForUpdate[] = [\n 'label' => $rowLabels[$column][$columnImageKey],\n 'imageData' => $currentFileData\n ];\n }\n\n if (array_key_exists($uploadedFile, $imageHiddenStates)\n && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]\n ) {\n $imagesForChangeVisibility[] = [\n 'disabled' => $imageHiddenStates[$uploadedFile],\n 'imageData' => $currentFileData\n ];\n }\n } else {\n if ($column == self::COL_MEDIA_IMAGE) {\n $rowData[$column][] = $uploadedFile;\n }\n $mediaGallery[$storeId][$rowSku][$uploadedFile] = [\n 'attribute_id' => $this->getMediaGalleryAttributeId(),\n 'label' => isset($rowLabels[$column][$columnImageKey])\n ? $rowLabels[$column][$columnImageKey]\n : '',\n 'position' => ++$position,\n 'disabled' => isset($imageHiddenStates[$columnImage])\n ? $imageHiddenStates[$columnImage] : '0',\n 'value' => $uploadedFile,\n ];\n }\n }\n }\n }\n\n // 6. Attributes phase\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n $productType = isset($rowData[self::COL_TYPE]) ? $rowData[self::COL_TYPE] : null;\n if ($productType !== null) {\n $previousType = $productType;\n }\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if ($prevAttributeSet !== null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && $previousType !== null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n\n $productTypeModel = $this->_productTypeModels[$productType];\n if (!empty($rowData['tax_class_name'])) {\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($rowData[self::COL_SKU])\n ) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !$this->isSkuExist($rowSku)\n );\n $product = $this->_proxyProdFactory->create(['data' => $rowData]);\n\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType()\n && (\n in_array($attribute->getAttributeCode(), $this->dateAttrCodes)\n || $attribute->getIsUserDefined()\n )\n ) {\n $attrValue = $this->dateTime->formatDate($attrValue, false);\n } elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = gmdate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n } elseif ($backModel) {\n $attribute->getBackend()->beforeSave($product);\n $attrValue = $product->getData($attribute->getAttributeCode());\n }\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($rowStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$rowStore];\n }\n if (!$this->isSkuExist($rowSku)) {\n $storeIds[] = 0;\n }\n }\n foreach ($storeIds as $storeId) {\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$storeId])) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n }\n\n foreach ($bunch as $rowNum => $rowData) {\n if ($this->getErrorAggregator()->isRowInvalid($rowNum)) {\n unset($bunch[$rowNum]);\n }\n }\n\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n )->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->updateMediaGalleryVisibility(\n $imagesForChangeVisibility\n )->updateMediaGalleryLabels(\n $labelsForUpdate\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $bunch]\n );\n }\n\n return $this;\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function sellerStockHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\SellerStockHistory','spsd_id','spsd_id');\n }", "public function supplies(){\n return $this->hasMany('CValenzuela\\Supply');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function addVariableProductQuantityBasedWholesalePriceCustomField( $loop , $variation_data , $variation , $registeredCustomRoles ) {\r\n\r\n echo \"<hr/>\";\r\n\r\n $this->_printOrderQuantityBasedWholesalePricingControls( $variation->ID , $registeredCustomRoles , 'variable' );\r\n\r\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function product_lists()\n {\n return $this->belongsToMany('App\\ProductVariant', 'shopping_list_products', 'shopping_list_id', 'variant_id')\n ->withPivot('quantity', 'branch_id', 'buying_date', 'buying_price')\n ->withTimestamps();\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function loadStockData(){\n if (JeproshopTools::isLoadedObject($this, 'product_id')){\n // By default, the product quantity correspond to the available quantity to sell in the current shop\n $this->quantity = JeproshopStockAvailableModelStockAvailable::getQuantityAvailableByProduct($this->product_id, 0);\n $this->out_of_stock = JeproshopStockAvailableModelStockAvailable::outOfStock($this->product_id);\n $this->depends_on_stock = JeproshopStockAvailableModelStockAvailable::dependsOnStock($this->product_id);\n if (JeproshopContext::getContext()->shop->getShopContext() == JeproshopShopModelShop::CONTEXT_GROUP && JeproshopContext::getContext()->shop->getContextShopGroup()->share_stock == 1){\n $this->advanced_stock_management = $this->useAdvancedStockManagement();\n }\n }\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function orders_products(){\n return $this->hasMany(Order_product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n// qq($params);\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n $related_products = $this->getRequest()->getParam('related_products');\n $related_qty = $this->getRequest()->getParam('related_qty');\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n \n $in_cart = $cart->getQuoteProductIds();\n if($product->getTypeId() == 'cartproduct') {\n $cart_product_id = $product->getId();\n if(in_array($cart_product_id, $in_cart)) {\n $this->_goBack();\n return;\n }\n }\n\n if($params['qty']) $cart->addProduct($product, $params);\n \n if (!empty($related_qty)) {\n foreach($related_qty as $pid=>$qty){\n if(intval($qty)>0){\n $product = $this->_initProduct(intval($pid));\n $related_params['qty'] = $filter->filter($qty);\n if(isset($related_products[$pid])){\n if($product->getTypeId() == 'bundle') {\n $related_params['bundle_option'] = $related_products[$pid]['bundle_option'];\n// qq($related_params);\n// die('test');\n } else {\n $related_params['super_attribute'] = $related_products[$pid]['super_attribute'];\n }\n }\n $cart->addProduct($product, $related_params);\n }\n }\n }\n \n $collection = Mage::getModel('cartproducts/products')->getCollection()\n ->addAttributeToFilter('type_id', 'cartproduct')\n ->addAttributeToFilter('cartproducts_selected', 1)\n ;\n \n foreach($collection as $p)\n {\n $id = $p->getId();\n if(isset($in_cart[$id])) continue;\n \n $cart = Mage::getSingleton('checkout/cart');\n $quote_id = $cart->getQuote()->getId();\n \n if(Mage::getSingleton('core/session')->getData(\"cartproducts-$quote_id-$id\")) continue;\n \n $p->load($id);\n $cart->getQuote()->addProduct($p, 1);\n }\n \n if($cart->getQuote()->getShippingAddress()->getCountryId() == '') $cart->getQuote()->getShippingAddress()->setCountryId('US');\n $cart->getQuote()->setCollectShippingRates(true);\n $cart->getQuote()->getShippingAddress()->setShippingMethod('maxshipping_standard')->collectTotals()->save();\n \n $cart->save();\n \n Mage::getSingleton('checkout/session')->resetCheckout();\n\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError() && $params['qty'] ){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n $this->getResponse()->setRedirect($url);\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }", "public function ProductItems()\n {\n return $this->belongsToMany('App\\Order','order_product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "private function selectProductLowStock(){\n\t\t$data = $this->connection->createCommand('select id, sku, name, minimum_quantity, quantity from product where minimum_quantity is not null and quantity <= minimum_quantity and product_type_id = 2 and tenant_id = '. $this->tenant)->queryAll();\n\t\tforeach($data as $key => $value){\t\n\t\t\t$sqlBalance = 'select * from stock_balance where product_id = '. $value['id'];\n\t\t\t$sqlBalance = $this->connection->createCommand($sqlBalance)->queryOne();\n\t\t\tif(!empty($sqlBalance['warehouse_id'])){\n\t\t\t\t$sqlBalance['warehouse_id'] = $this->connection->createCommand('select id,name from warehouse where id = '. $sqlBalance['warehouse_id'])->queryOne();\n\t\t\t\t$data[$key]['balance'] = $sqlBalance;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function getProduct();", "public function getSupportProducts()\n {\n return $this->hasMany(SupportProduct::class, ['indigent_id' => 'id']);\n }", "public function displayOrderQuantityBasedWholesalePricing( $wholesalePriceHTML , $price , $product , $userWholesaleRole ) {\n\n // Only apply this to single product pages\n if ( !empty( $userWholesaleRole ) &&\n ( ( get_option( 'wwpp_settings_hide_quantity_discount_table' , false ) !== 'yes' && is_product() && in_array( WWP_Helper_Functions::wwp_get_product_type( $product ) , array( 'simple' , 'composite' , 'bundle' , 'variation' ) ) ) ||\n apply_filters( 'render_order_quantity_based_wholesale_pricing' , false ) ) ) {\n \n $productId = WWP_Helper_Functions::wwp_get_product_id( $product );\n\n // Since quantity based wholesale pricing relies on the presence of the wholesale price at a product level\n // We need to get the original wholesale price ( per product level ), we don't need to filter the wholesale price.\n $wholesalePrice = WWP_Wholesale_Prices::get_product_raw_wholesale_price( $productId , $userWholesaleRole );\n \n if ( !empty( $wholesalePrice ) ) {\n\n $enabled = get_post_meta( $productId , WWPP_POST_META_ENABLE_QUANTITY_DISCOUNT_RULE , true );\n\n $mapping = get_post_meta( $productId , WWPP_POST_META_QUANTITY_DISCOUNT_RULE_MAPPING , true );\n if ( !is_array( $mapping ) )\n $mapping = array();\n\n // Table view\n $mappingTableHtml = '';\n\n if ( $enabled == 'yes' && !empty( $mapping ) ) {\n ob_start();\n\n /*\n * Get the base currency mapping. The base currency mapping well determine what wholesale\n * role and range pairing a product has wholesale price with.\n */\n $baseCurrencyMapping = $this->_getBaseCurrencyMapping( $mapping , $userWholesaleRole );\n\n if ( WWPP_ACS_Integration_Helper::aelia_currency_switcher_active() ) {\n\n $baseCurrency = WWPP_ACS_Integration_Helper::get_product_base_currency( $productId );\n $activeCurrency = get_woocommerce_currency();\n\n // No point on doing anything if have no base currency mapping\n if ( !empty( $baseCurrencyMapping ) ) {\n\n if ( $baseCurrency == $activeCurrency ) {\n\n /*\n * If active currency is equal to base currency, then we just need to pass\n * the base currency mapping.\n */\n $this->_printWholesalePricePerOrderQuantityTable( $wholesalePrice , $baseCurrencyMapping , array() , $mapping , $product , $userWholesaleRole , true , $baseCurrency , $activeCurrency );\n\n } else {\n\n $specific_currency_mapping = $this->_getSpecificCurrencyMapping( $mapping , $userWholesaleRole , $activeCurrency , $baseCurrencyMapping );\n\n $this->_printWholesalePricePerOrderQuantityTable( $wholesalePrice , $baseCurrencyMapping , $specific_currency_mapping , $mapping , $product , $userWholesaleRole , false , $baseCurrency , $activeCurrency );\n\n }\n\n }\n\n } else {\n\n // Default without Aelia currency switcher plugin\n\n if ( !empty( $baseCurrencyMapping ) )\n $this->_printWholesalePricePerOrderQuantityTable( $wholesalePrice , $baseCurrencyMapping , array() , $mapping , $product , $userWholesaleRole , true , get_woocommerce_currency() , get_woocommerce_currency() );\n\n }\n\n $mappingTableHtml = ob_get_clean();\n\n }\n\n $wholesalePriceHTML .= $mappingTableHtml;\n\n }\n\n }\n\n return $wholesalePriceHTML;\n\n }", "public function products()\n {\n return $this->belongsToMany('App\\models\\Product', 'product_variants');\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function gettopproductselling($sellerid) {\t\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required')); \t\n\t\t}\n\t\telse{\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t \n\t\t//Select Data from table\n\t\t//$sql3 = \"Select * FROM marketplace_product where seller_id=$sellerid\";\n\t\t$sql3 = \"Select * FROM marketplace_product a, catalog_product_entity b \n\t\twhere \n\t\ta.mageproduct_id=b.entity_id and \n\t\ta.seller_id=$sellerid and \n\t\tb.type_id!='customProductType' \";\n\t\t$result3 = $connection->fetchAll($sql3);\n\t\t\n\t\t$result4='';\n\t\t\n\t\tforeach($result3 as $data)\n\t\t{\n\t\t\t \n\t\t\t $productId =$data['mageproduct_id'];\n\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n\t\t\t\t\t$offfer_tag = $currentproduct->getData('offfer_tag');\n\t\t\t\t\t$attr = $currentproduct->getResource()->getAttribute('offfer_tag');\n\t\t\t\t\t//$optionText='null';\n\t\t\t\t //if ($attr->usesSource()) {\n\t\t\t\t\t $optionText =$attr->getSource()->getOptionText($offfer_tag);\n\t\t\t\t// }\n\t\t\t\tif($optionText=='')\n\t\t\t\t{\n\t\t\t\t\t$optionText='null';\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t $_price=$currentproduct->getPrice();\n\t\t\t\t $_finalPrice=$currentproduct->getFinalPrice();\n\t\t\t\t\t $savetag='null';\n\t\t\t\t\t\tif($_finalPrice < $_price):\n\t\t\t\t\t\t$_savePercent = 100 - round(($_finalPrice / $_price)*100);\n\t\t\t\t\t\t//echo $_savePercent;\n\t\t\t\t\t\t$savetag=$_savePercent;\n endif;\n\n\t\t\t\t $producturl=$currentproduct->getProductUrl();\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $sql_wishlist = \"Select * FROM wishlist a ,wishlist_item b where a.customer_id=$sellerid and a.wishlist_id=b.wishlist_id and b.product_id=$productId \";\n\t\t $result_wishlist = $connection->fetchAll($sql_wishlist);\n\t\t\t\t /* $wish='';\n\t\t\t\t if(!empty($result_wishlist))\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>1); \n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>0);\n\t\t\t\t } */\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $reviewFactory = $objectManager->create('Magento\\Review\\Model\\Review');\n\t\t\t\t $storeId = $this->storeManager->getStore()->getId();\n $reviewFactory->getEntitySummary($currentproduct, $storeId);\n\t\t\t\t $ratingSummary = $currentproduct->getRatingSummary()->getRatingSummary();\n\t\t\t\t if($ratingSummary=='')\n\t\t\t\t{\n\t\t\t\t\t$ratingSummary='null';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//$delivery=array('method'=>'Standard Delivery','price'=>'Free');\n\t\t\t\t\t\n\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"description\"=>$currentproduct->getDescription(),\"price\"=>$currentproduct->getPrice(),\"finalPrice\"=>$currentproduct->getFinalPrice(),\"thumbnail\"=>'http://159.203.151.92/pub/media/catalog/product'.$currentproduct->getthumbnail(),\"offferTag\"=>array(\"shareurl\"=>$producturl,\"Tag\"=>$optionText,'discount'=>$savetag,'rating'=>$ratingSummary));\n\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\t \n\t\t//$result['product']=$result4;\n\t\t\n\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'product'=>$result4);\n\t\t\n\t\treturn $result; \n\t\t\n }\n\t }", "public function getProductBudgets()\n {\n return $this->productBudgets;\n }", "public function saleitems()\n {\n return $this->hasMany('App\\SaleItem');\n }", "public function exchangeRequests(): HasMany\n {\n return $this->hasMany(ExchangeRequest::class, 'requested_product_id');\n }", "public static function getAllSellPro()\n {\n return DB::table(static::$table)\n ->select('sell_product.*')\n ->where('is_deleted', ACTIVE)\n ->where('display', 0)\n ->where('display_top', 1)\n ->paginate(LIMIT_ITEM_PAGE); \n }" ]
[ "0.74914753", "0.60146946", "0.59918106", "0.5985526", "0.5865959", "0.58240443", "0.58101684", "0.56670266", "0.56603193", "0.563147", "0.5549117", "0.5542257", "0.5506098", "0.5484657", "0.5475101", "0.5472452", "0.5469672", "0.5467794", "0.5436091", "0.543268", "0.54276484", "0.5413946", "0.5393339", "0.5384255", "0.53800017", "0.5369014", "0.5350955", "0.5302659", "0.5270851", "0.52706796", "0.5265206", "0.52617025", "0.5258446", "0.5257301", "0.52529424", "0.52405363", "0.523558", "0.5232533", "0.52312857", "0.5218276", "0.52156216", "0.5213454", "0.5198978", "0.51885104", "0.5187193", "0.5182526", "0.51807934", "0.51775765", "0.51667464", "0.515864", "0.5156389", "0.5148247", "0.51474154", "0.51359004", "0.51325583", "0.5113915", "0.5113761", "0.5111935", "0.510036", "0.5099022", "0.5097763", "0.50941825", "0.50916773", "0.5083694", "0.5083694", "0.5082192", "0.50815904", "0.5079955", "0.5077976", "0.50757146", "0.5072298", "0.50696945", "0.50696945", "0.50696945", "0.50696945", "0.50696945", "0.50696945", "0.50696945", "0.50627637", "0.5061313", "0.5056221", "0.5051221", "0.5044717", "0.50442094", "0.50442094", "0.50442094", "0.50442094", "0.50442094", "0.50442094", "0.50442094", "0.50428003", "0.50339216", "0.50320834", "0.50306326", "0.5028979", "0.5023538", "0.5015322", "0.5014576", "0.5004176", "0.50005585" ]
0.7903302
0
SellerProduct has many CustomWholesaleQuantities.
public function customWholesaleQuantities() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\CustomWholesaleQuantity','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function predefinedWholesaleQuantities()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\PredefinedWholesaleQuantity','sp_id','sp_id');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function product()\n\t{\n\t\treturn $this->belongsToMany('App\\Models\\Products','inventory','store_id','product_id')->withPivot('stocks', 'lower_limit', 'higher_limit');\n\t}", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function amountProducts(){\n return $this->hasMany(AmountProduct::class);\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product', 'royalty_chart', 'vehicle_type_id', 'product_id')->withPivot('amount', 'status');\n }", "public function warehouse()\n {\n return $this->belongsToMany('App\\Warehouse', 'product_has_warehouse', 'product_id', 'warehouse_id');\n }", "public function getPrice(){\n return $this->hasMany(Inventory::class, 'product_id','id');\n}", "public function CustomFields()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = product_id, localKey = id)\n \treturn $this->hasMany(CustomFields::class);\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withPivot('amount', 'data', 'consume');\n }", "public function addSimpleProductQuantityBasedWholesalePriceCustomField( $registeredCustomRoles ) {\r\n\r\n global $post;\r\n\r\n $this->_printOrderQuantityBasedWholesalePricingControls( $post->ID , $registeredCustomRoles , 'simple' );\r\n\r\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function ProductItems()\n {\n return $this->belongsToMany('App\\Order','order_product');\n }", "public function companies()\n {\n return $this->belongsToMany('Villato\\Company', 'company_region_product', 'product_id', 'company_id');\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products(){\n return $this->belongsToMany('App\\Product', 'product_warehouse', 'warehouse_id', 'product_id')\n ->withPivot('quantity') //iot use increment and decrement i added the id column\n ->withTimestamps(); //for the timestamps created_at updated_at, to be maintained.\n }", "public function products()\n {\n return $this->hasMany('fooCart\\src\\Product', 'tax_id', 'tax_id');\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function getProducts()\n {\n return $this->hasMany(Product::className(), ['uomId' => 'uomId']);\n }", "public function warehouses(): HasManyThrough\n\t{\n\t\treturn $this->hasManyThrough('Ronmrcdo\\Inventory\\Models\\InventoryStock', 'Ronmrcdo\\Inventory\\Models\\ProductSku')->with('warehouse');\n\t}", "public function product_supply(){ return $this->hasMany(ProductSupply::class,'vehicle_id'); }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function orders_products(){\n return $this->hasMany(Order_product::class);\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withPivot('quantity');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function saleitems()\n {\n return $this->hasMany('App\\SaleItem');\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function qb_inventory()\n {\n return $this->hasMany('App\\QB_Inventory');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function product_lists()\n {\n return $this->belongsToMany('App\\ProductVariant', 'shopping_list_products', 'shopping_list_id', 'variant_id')\n ->withPivot('quantity', 'branch_id', 'buying_date', 'buying_price')\n ->withTimestamps();\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function products(): MorphToMany;", "public function addons()\n {\n return $this->belongsToMany(Addon::class,'q2_pricing_addons');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function productHold()\n {\n return $this->hasMany('App\\Models\\ProductHold');\n }", "public function stocks(): HasMany\n {\n return $this->hasMany('Ronmrcdo\\Inventory\\Models\\InventoryStock');\n }", "public function products() {\n \treturn $this->belongsToMany(Product::class, 'items_product', 'item_id', 'product_id');\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function products(){\n return $this->hasMany(InvoiceProduct::class);\n //->leftJoin('invoice_product','products.id','invoice_product.product_id');\n //return $this->belongsToMany(Product::class);\n }", "public function skus()\n {\n return $this->hasMany('App\\Models\\Sku');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products(){\n return $this->belongsToMany('App\\Product', 'enumber_products', 'enumber_id', 'products_id');\n }", "public function products() {\n return $this->hasMany('App\\Product', 'category_id', 'id');\n }", "public function products()\n {\n return $this->belongsToMany(\n Product::class,\n 'order_product',\n 'order_id',\n 'product_id'\n );\n }", "public function products()\n {\n return $this->belongsToMany('App\\models\\Product', 'product_variants');\n }", "public function addVariableProductQuantityBasedWholesalePriceCustomField( $loop , $variation_data , $variation , $registeredCustomRoles ) {\r\n\r\n echo \"<hr/>\";\r\n\r\n $this->_printOrderQuantityBasedWholesalePricingControls( $variation->ID , $registeredCustomRoles , 'variable' );\r\n\r\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product');\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function product()\n {\n return $this->hasMany(product::class, 'category_id', 'id');\n }", "public function ingredientSuppliers(){\n return $this->hasMany(SupplierStock::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function categoryProduct(){\n return $this->hasMany(CategoryProduct::class);\n }", "public function products() {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "private function _printOrderQuantityBasedWholesalePricingControls( $product_id , $registeredCustomRoles , $classes ) {\r\n\r\n $aelia_currency_switcher_active = WWPP_ACS_Integration_Helper::aelia_currency_switcher_active();\r\n\r\n if ( $aelia_currency_switcher_active ) {\r\n\r\n $currencySymbol = \"\";\r\n\r\n $base_currency = WWPP_ACS_Integration_Helper::get_product_base_currency( $product_id );\r\n\r\n $woocommerce_currencies = get_woocommerce_currencies();\r\n $enabled_currencies = WWPP_ACS_Integration_Helper::enabled_currencies();\r\n\r\n } else\r\n $currencySymbol = \" (\" . get_woocommerce_currency_symbol() . \")\";\r\n\r\n $wholesale_roles_arr = array();\r\n foreach ( $registeredCustomRoles as $roleKey => $role )\r\n $wholesale_roles_arr[ $roleKey ] = $role[ 'roleName' ];\r\n\r\n $pqbwp_enable = get_post_meta( $product_id , WWPP_POST_META_ENABLE_QUANTITY_DISCOUNT_RULE , true );\r\n\r\n $pqbwp_controls_styles = '';\r\n if ( $pqbwp_enable != 'yes' )\r\n $pqbwp_controls_styles = 'display: none;';\r\n\r\n $mapping = get_post_meta( $product_id , WWPP_POST_META_QUANTITY_DISCOUNT_RULE_MAPPING , true );\r\n if ( !is_array( $mapping ) )\r\n $mapping = array(); ?>\r\n\r\n <div class=\"product-quantity-based-wholesale-pricing options_group <?php echo $classes; ?>\" >\r\n\r\n <div>\r\n\r\n <h3 class=\"pqbwp-heading\"><?php _e( 'Product Quantity Based Wholesale Pricing' , 'woocommerce-wholesale-prices-premium' ); ?></h3>\r\n <p class=\"pqbwp-desc\">\r\n <?php _e( 'Specify wholesale price for this current product depending on the quantity being purchased.<br/>Only applies to the wholesale roles that you specify.' , 'woocommerce-wholesale-prices-premium' ); ?>\r\n </p>\r\n\r\n <?php if ($aelia_currency_switcher_active ) { ?>\r\n\r\n <p class=\"pbwp-desc\">\r\n <?php _e( 'Note: If you have not specify mapping for other currencies for a given wholesale role, it will derive its wholesale price automatically by converting the base currency wholesale price to that currency' , 'woocommerce-wholesale-prices-premium' ); ?>\r\n </p>\r\n\r\n <?php } ?>\r\n\r\n </div>\r\n\r\n <p class=\"form-field pqbwp-enable-field-container\">\r\n\r\n <span class=\"hidden post-id\"><?php echo $product_id; ?></span>\r\n <input type=\"checkbox\" class=\"pqbwp-enable checkbox\" value=\"yes\" <?php echo ( $pqbwp_enable == 'yes' ) ? 'checked' : ''; ?>>\r\n <span class=\"description\"><?php _e( \"Enable further wholesale pricing discounts based on quantity purchased?\" , \"woocommerce-wholesale-prices-premium\" ); ?></span>\r\n\r\n </p>\r\n\r\n <div class=\"processing-indicator\"><span class=\"spinner\"></span></div>\r\n\r\n <div class=\"pqbwp-controls\" style=\"<?php echo $pqbwp_controls_styles; ?>\">\r\n\r\n <input type=\"hidden\" class=\"mapping-index\" value=\"\">\r\n\r\n <?php\r\n // The fields below aren't really saved via woocommerce, we just used it here to house our rule controls.\r\n // We use these to add our rule controls to abide with woocommerce styling.\r\n\r\n woocommerce_wp_select(\r\n array(\r\n 'id' => 'pqbwp_registered_wholesale_roles',\r\n 'class' => 'pqbwp_registered_wholesale_roles',\r\n 'label' => __( 'Wholesale Role' , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Select wholesale role to which this rule applies.' , 'woocommerce-wholesale-prices-premium' ),\r\n 'options' => $wholesale_roles_arr\r\n )\r\n );\r\n\r\n woocommerce_wp_text_input(\r\n array(\r\n 'id' => 'pqbwp_minimum_order_quantity',\r\n 'class' => 'pqbwp_minimum_order_quantity',\r\n 'label' => __( 'Starting Qty' , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Minimum order quantity required for this rule. Must be a number.' , 'woocommerce-wholesale-prices-premium' ),\r\n )\r\n );\r\n\r\n woocommerce_wp_text_input(\r\n array(\r\n 'id' => 'pqbwp_maximum_order_quantity',\r\n 'class' => 'pqbwp_maximum_order_quantity',\r\n 'label' => __( 'Ending Qty' , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Maximum order quantity required for this rule. Must be a number. Leave this blank for no maximum quantity.' , 'woocommerce-wholesale-prices-premium' ),\r\n )\r\n );\r\n\r\n woocommerce_wp_text_input(\r\n array(\r\n 'id' => 'pqbwp_wholesale_price',\r\n 'class' => 'pqbwp_wholesale_price',\r\n 'label' => __( 'Wholesale Price' . $currencySymbol , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Wholesale price for this specific rule.' , 'woocommerce-wholesale-prices-premium' ),\r\n 'data_type' => 'price'\r\n )\r\n );\r\n\r\n if ( $aelia_currency_switcher_active ) {\r\n\r\n $currency_select_options = array();\r\n\r\n foreach ( $enabled_currencies as $currency ) {\r\n\r\n if ( $currency == $base_currency )\r\n $text = $woocommerce_currencies[ $currency ] . \" (Base Currency)\";\r\n else\r\n $text = $woocommerce_currencies[ $currency ];\r\n\r\n $currency_select_options[ $currency ] = $text;\r\n\r\n }\r\n\r\n woocommerce_wp_select(\r\n array(\r\n 'id' => 'pqbwp_enabled_currencies',\r\n 'class' => 'pqbwp_enabled_currencies',\r\n 'label' => __( 'Currency' , 'woocommerce-wholesale-prices-premium' ),\r\n 'placeholder' => '',\r\n 'desc_tip' => 'true',\r\n 'description' => __( 'Select Currency' , 'woocommerce-wholesale-prices-premium' ),\r\n 'options' => $currency_select_options,\r\n 'value' => $base_currency\r\n )\r\n );\r\n\r\n } ?>\r\n\r\n <p class=\"form-field button-controls add-mode\">\r\n\r\n <input type=\"button\" class=\"pqbwp-cancel button button-secondary\" value=\"<?php _e( 'Cancel' , 'woocommerce-wholesale-prices-premium' ); ?>\">\r\n <input type=\"button\" class=\"pqbwp-save-rule button button-primary\" value=\"<?php _e( 'Save Quantity Discount Rule' , 'woocommerce-wholesale-prices-premium' ); ?>\">\r\n <input type=\"button\" class=\"pqbwp-add-rule button button-primary\" value=\"<?php _e( 'Add Quantity Discount Rule' , 'woocommerce-wholesale-prices-premium' ); ?>\">\r\n <span class=\"spinner\"></span>\r\n\r\n <div style=\"float: none; clear: both; display: block;\"></div>\r\n\r\n </p>\r\n\r\n <div class=\"form-field table-mapping\">\r\n <table class=\"pqbwp-mapping wp-list-table widefat\">\r\n\r\n <thead>\r\n <tr>\r\n <th><?php _e( 'Wholesale Role' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Starting Qty' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Ending Qty' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Wholesale Price' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <?php echo $aelia_currency_switcher_active ? \"<th>\" . __( 'Currency' , 'woocommerce-wholesale-prices-premium' ) . \"</th>\" : \"\"; ?>\r\n <th></th>\r\n </tr>\r\n </thead>\r\n\r\n <tfoot>\r\n <tr>\r\n <th><?php _e( 'Wholesale Role' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Starting Qty' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Ending Qty' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <th><?php _e( 'Wholesale Price' , 'woocommerce-wholesale-prices-premium' ); ?></th>\r\n <?php echo $aelia_currency_switcher_active ? \"<th>\" . __( 'Currency' , 'woocommerce-wholesale-prices-premium' ) . \"</th>\" : \"\"; ?>\r\n <th></th>\r\n </tr>\r\n </tfoot>\r\n\r\n <tbody>\r\n\r\n <?php\r\n if ( !empty( $mapping ) ) {\r\n\r\n if ( $aelia_currency_switcher_active ) {\r\n\r\n $itemNumber = 0;\r\n foreach ( $mapping as $index => $map ) {\r\n\r\n foreach ( $enabled_currencies as $currency ) {\r\n\r\n if ( $currency == $base_currency ) {\r\n\r\n $wholesale_role_meta_key = 'wholesale_role';\r\n $wholesale_price_meta_key = 'wholesale_price';\r\n $start_qty_meta_key = 'start_qty';\r\n $end_qty_meta_key = 'end_qty';\r\n\r\n } else {\r\n\r\n $wholesale_role_meta_key = $currency . '_wholesale_role';\r\n $wholesale_price_meta_key = $currency . '_wholesale_price';\r\n $start_qty_meta_key = $currency . '_start_qty';\r\n $end_qty_meta_key = $currency . '_end_qty';\r\n\r\n }\r\n\r\n $args = array( 'currency' => $currency );\r\n\r\n if ( array_key_exists( $wholesale_role_meta_key , $map ) ) {\r\n\r\n $itemNumber++;\r\n\r\n // One key check is enough\r\n $this->_printMappingItem( $itemNumber , $index , $map , $registeredCustomRoles , $wholesale_role_meta_key , $wholesale_price_meta_key , $start_qty_meta_key , $end_qty_meta_key , $aelia_currency_switcher_active , $args , $currency );\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n } else {\r\n\r\n $itemNumber = 0;\r\n foreach ( $mapping as $index => $map ) {\r\n\r\n // Skip none base currency mapping\r\n if ( array_key_exists( 'currency' , $map ) )\r\n continue;\r\n\r\n $itemNumber++;\r\n\r\n $wholesale_role_meta_key = 'wholesale_role';\r\n $wholesale_price_meta_key = 'wholesale_price';\r\n $start_qty_meta_key = 'start_qty';\r\n $end_qty_meta_key = 'end_qty';\r\n $args = array( 'currency' => get_woocommerce_currency() );\r\n\r\n $this->_printMappingItem( $itemNumber , $index , $map , $registeredCustomRoles , $wholesale_role_meta_key , $wholesale_price_meta_key , $start_qty_meta_key , $end_qty_meta_key , false , $args );\r\n\r\n }\r\n\r\n }\r\n\r\n } else { ?>\r\n\r\n <tr class=\"no-items\">\r\n <td class=\"colspanchange\" colspan=\"10\"><?php _e( 'No Quantity Discount Rules Found' , 'woocommerce-wholesale-prices-premium' ); ?></td>\r\n </tr>\r\n\r\n <?php } ?>\r\n\r\n </tbody>\r\n\r\n </table><!--#pqbwp-mapping-->\r\n </div>\r\n\r\n </div>\r\n\r\n </div><!--.product-quantity-based-wholesale-pricing-->\r\n\r\n <?php\r\n\r\n }", "public function orderItems()\n\t{\n\t\t//default primary keys of boths models porduct and model in our case here \n\t\t// we can find these two columns in the table that link these two models \n\t\t// which is the table called order_product and we are defining things\n\t\t// in the order model as said in the video 12 of creating E-commerce website\n\t\treturn $this->belongsToMany(Product::class)->withPivot('total','qty');\n\t}", "public function purchaseItems(): \\Illuminate\\Database\\Eloquent\\Relations\\HasMany\n {\n return $this->hasMany('Easy\\Commerce\\Models\\Supplier\\Purchase\\PurchaseItems', 'purchase_id', 'id');\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function sellerStockHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\SellerStockHistory','spsd_id','spsd_id');\n }", "public function saleItems()\n {\n return $this->hasManyThrough(SaleItem::class, Sale::class);\n }" ]
[ "0.7311532", "0.62186354", "0.61778116", "0.6143212", "0.59896994", "0.5965876", "0.5964255", "0.59542835", "0.5941254", "0.57773113", "0.57771957", "0.5777045", "0.57541513", "0.5752012", "0.5707699", "0.56765556", "0.56744343", "0.5649152", "0.56448627", "0.56391007", "0.55839497", "0.5572219", "0.55709445", "0.55597144", "0.5549289", "0.5534933", "0.5529812", "0.5513991", "0.54796237", "0.54786795", "0.5478639", "0.5476718", "0.5468009", "0.546027", "0.54581225", "0.54521364", "0.5423777", "0.5422817", "0.5422768", "0.54209065", "0.540963", "0.5401681", "0.53980577", "0.53912115", "0.53912115", "0.53843105", "0.538283", "0.53706205", "0.53706205", "0.53706205", "0.53706205", "0.53706205", "0.53706205", "0.53706205", "0.53641987", "0.53639036", "0.53639036", "0.53639036", "0.53639036", "0.53639036", "0.53639036", "0.53639036", "0.5348703", "0.53468937", "0.5326434", "0.53171426", "0.53152114", "0.53068995", "0.53067416", "0.53060913", "0.53043735", "0.529396", "0.52894884", "0.5284152", "0.52836084", "0.52784264", "0.5277887", "0.526994", "0.52691066", "0.52642393", "0.52632886", "0.52592885", "0.5253156", "0.52519244", "0.52498853", "0.52430546", "0.52430546", "0.52430546", "0.52430546", "0.52375734", "0.52374786", "0.52333605", "0.5230117", "0.52146167", "0.52120906", "0.5210878", "0.52083015", "0.5196419", "0.5186896", "0.51853853" ]
0.78493327
0
SellerProduct has many Items.
public function items() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\Item','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function products() {\n \treturn $this->belongsToMany(Product::class, 'items_product', 'item_id', 'product_id');\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function saleitems()\n {\n return $this->hasMany('App\\SaleItem');\n }", "public static function getSellerItems(Request $request)\n {\n $seller=Auth::user();\n $items=Product::where('seller_id',$seller->id)->get();\n if($items){\n return response(['error'=>false,'items'=>$items],200);\n }\n else{\n return response(['error'=>true,'message'=>'no item found'],200);\n }\n }", "public function saleItems()\n {\n return $this->hasManyThrough(SaleItem::class, Sale::class);\n }", "public function ProductItems()\n {\n return $this->belongsToMany('App\\Order','order_product');\n }", "public function products(): MorphToMany;", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function sellItem($seller){\r\n\t}", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function items()\n {\n return $this->hasMany('App\\Models\\PurchaseItem', 'purchase_id', 'id');\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function purchaseItems(): \\Illuminate\\Database\\Eloquent\\Relations\\HasMany\n {\n return $this->hasMany('Easy\\Commerce\\Models\\Supplier\\Purchase\\PurchaseItems', 'purchase_id', 'id');\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function bookshelf_items()\n {\n return $this->hasMany(Bookshelf_item::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function items()\n {\n return $this->hasMany('App\\Models\\Misc\\Equipment\\EquipmentStocktakeItem', 'stocktake_id');\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function eventNotifySeller() {\r\n /**\r\n * Date calculation, Current date and Previous date\r\n */\r\n $currentDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(time()));\r\n $previousDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(strtotime($currentDate . ' -1 day')));\r\n\r\n // Getting all seller ID's whose products updated in from yesterday\r\n\r\n $_sellerCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToSelect('seller_id')\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->groupByAttribute('seller_id')\r\n ->load();\r\n\r\n foreach ($_sellerCollection as $_seller) {\r\n $sellerId = $_seller->getSellerId();\r\n $products = \"\";\r\n\r\n //Loading seller product collection\r\n $_productCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToFilter('seller_id', $_seller->getSellerId())\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->addAttributeToSelect('*')\r\n ->load();\r\n\r\n $i = 1;\r\n foreach ($_productCollection as $_product) {\r\n $small_image = Mage::helper('catalog/image')->init($_product, 'small_image')->resize(51, 68);\r\n $products .= '<tr>';\r\n $products .= '<td style=\"text-align:center; margin:0 0 10px; vertical-align:middle; padding:0 0 10px;\">' . $i . '</td>';\r\n $products .= '<td style=\"text-align:center; padding:0 0 20px;\"><img src=' . $small_image . ' alt=' . $_product->getName() . ' /></td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getName() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getSku() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('seller_product_status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;;\">' . $_product->getPrice() . '</td>';\r\n $products .= '</tr>';\r\n\r\n $i++;\r\n }\r\n $templateId = 9;\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templateId);\r\n\r\n //Getting seller information\r\n\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n\r\n // Setting up default sender information\r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n // Setting email variables\r\n $emailTemplateVariablesValue = (array(\r\n 'sellername' => $sellerName,\r\n 'products' => $products,\r\n 'seller_store' => $sellerStore,\r\n ));\r\n\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n\r\n /**\r\n * Send email to the seller\r\n */\r\n $emailTemplate->send($sellerEmail, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function items()\n {\n return $this->hasMany(\"App\\Model\\Item\");\n }", "public function items(){\n\n\t\t// hasMany(RelatedModel, foreignKeyOnRelatedModel = service_id, localKey = id)\n\t\treturn $this->hasMany(Item::class);\n\t}", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function images()\n {\n return $this->hasMany(ProductImageProxy::modelClass(), 'seller_product_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function bookshelf_item()\n {\n return $this->belongsToMany(Bookshelf_item::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function seller()\n {\n return $this->belongsTo(SellerProxy::modelClass(), 'seller_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product');\n }", "public function getProductItemsBlock()\n {\n $this->waitFormToLoad();\n return $this->blockFactory->create(\n \\Magento\\Wishlist\\Test\\Block\\Customer\\Wishlist\\Items::class,\n ['element' => $this->_rootElement->find($this->productItems)]\n );\n }", "public function item() {\n return $this->belongsToMany('App\\item');\n }", "public function getItem()\n {\n return $this->hasOne(CatalogProduct::className(), ['id' => 'item_id']);\n }", "public function items(){\n \treturn $this->hasMany('mat3am\\Item');\n }", "public function items()\n\t{\n\t\treturn $this->hasMany('Item');\n\t}", "public function items()\n {\n return $this->hasMany('App\\OrderItem');\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = from_seller_id, keyOnRelatedModel = seller_id)\n \treturn $this->belongsTo('App\\Seller','from_seller_id','seller_id');\n }", "public function items(): HasMany\n {\n return $this->hasMany(Item::class);\n }", "public function products(){\n return $this->belongsToMany('App\\Product', 'enumber_products', 'enumber_id', 'products_id');\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function items()\n {\n return $this->hasMany(QuoteItemProxy::modelClass());\n }", "public function products()\n {\n return $this->belongsToMany('App\\models\\Product', 'product_variants');\n }", "function getSellerProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/seller/'.(int)$params['seller_id'].'/product.json',$params),true);\n\t}", "public function items()\n\t{\n\t\treturn $this->hasMany(Item::class);\n\t}", "public function seller(){\n return $this->belongsTo(Seller::class);\n }", "public function items() : HasMany\n {\n return $this->hasMany(OrderItem::class);\n }", "public function getItems()\n {\n return $this->hasMany(Items::className(), ['ingredient_id' => 'id']);\n }", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = seller_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Seller','seller_id','seller_id');\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public static function getSellersItems($sellers)\n {\n return Product::whereIn('seller_id',$sellers)->get()->toArray();\n }", "public function items()\n {\n return $this->hasMany(PayoutItem::class);\n }", "public function getItems()\n {\n return $this->hasMany(Item::className(), ['sales_gl_acc_id' => 'account_id']);\n }", "public function items()\n {\n return $this->hasMany('TechTrader\\Models\\OrderItem');\n }", "public function items()\n {\n return $this->hasMany(OrderItems::class);\n }", "public function productImage(){\n\t\treturn $this->hasmany('App\\ProductImages','product_id');\n\t}" ]
[ "0.74733365", "0.66368073", "0.6556746", "0.6478154", "0.6380802", "0.63720083", "0.62626374", "0.6240741", "0.62312853", "0.622453", "0.62078345", "0.6197497", "0.6178815", "0.6166695", "0.61565965", "0.6151526", "0.60690457", "0.6064608", "0.6058527", "0.6047572", "0.60469514", "0.60394603", "0.60384434", "0.60384434", "0.60384434", "0.60384434", "0.60384434", "0.60384434", "0.60384434", "0.6032436", "0.60212404", "0.60212404", "0.6016808", "0.6011555", "0.5994823", "0.5990069", "0.59765136", "0.59765136", "0.59765136", "0.59765136", "0.59765136", "0.59765136", "0.59765136", "0.5975092", "0.5970277", "0.5957541", "0.5952792", "0.5935361", "0.5934964", "0.59294647", "0.5922003", "0.5913697", "0.5911755", "0.5910436", "0.5882043", "0.5877751", "0.5877688", "0.5875296", "0.5874241", "0.58552736", "0.58492947", "0.58492947", "0.58492947", "0.58492947", "0.58478874", "0.5840258", "0.58376753", "0.5821584", "0.58203375", "0.58165884", "0.5815929", "0.5810922", "0.58071375", "0.579793", "0.579793", "0.579793", "0.579793", "0.579793", "0.5796462", "0.5793143", "0.5791375", "0.5781303", "0.5781095", "0.5765789", "0.57633615", "0.5752322", "0.5744572", "0.57445353", "0.5737343", "0.5725954", "0.5715497", "0.57115096", "0.5710811", "0.5707656", "0.57076234", "0.56923324", "0.5690836", "0.5676074", "0.5670103", "0.56651735" ]
0.6059642
18
SellerProduct has many SPUniqueProperties.
public function SPUniqueProperties() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\SPUniqueProperty','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function productOptions()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductOption','sp_id','sp_id');\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }", "public function getProductIds($sku)\n\t{\n\t\t$tname=$this->tablename(\"catalog_product_entity\");\n\t\t$result=$this->selectAll(\n\t\t\"SELECT sku,entity_id as pid,attribute_set_id as asid FROM $tname WHERE sku=?\",\n\t\t$sku);\n\t\tif(count($result)>0)\n\t\t{\n\t\t\treturn $result[0];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getProductAndVariantAttributes()\n\t{\n\t\treturn array_unique(array_merge($this->arrAttributes, $this->arrVariantAttributes));\n\t}", "function admin_init() {\n\t\t$conditions = array('Product.supplier_id' => array(4, 5)); // Alliance - updatovat sukl a pdk\n\t\t\n\t\t// chci nastavit, ze chci updatovat active a dostupnost\n\t\t$products = $this->ProductPropertiesProduct->Product->find('all', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('Product.id')\n\t\t));\n\n\t\t$productIds = Set::extract('/Product/id', $products);\n\n\t\t$properties = $this->ProductPropertiesProduct->ProductProperty->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'OR' => array(\n\t\t\t\t\tarray('ProductProperty.name' => 'Product.sukl'),\n\t\t\t\t\tarray('ProductProperty.name' => 'Product.pdk_code')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('ProductProperty.id')\n\t\t));\n\n\t\t$save = array();\n\t\t\n\t\tforeach ($products as $product) {\n\t\t\tforeach ($properties as $property) {\n\t\t\t\t$update = true;\n\t\t\t\t$save[] = array(\n\t\t\t\t\t'product_id' => $product['Product']['id'],\n\t\t\t\t\t'product_property_id' => $property['ProductProperty']['id'],\n\t\t\t\t\t'update' => $update\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this->ProductPropertiesProduct->saveAll($save);\n\t\t\n\t\tdie('hotovo');\n\t}", "protected function _saveProducts()\n {\n $priceIsGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n $entityLinkField = $this->getProductEntityLinkField();\n\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = [];\n $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = [];\n $this->categoriesCache = [];\n $tierPrices = [];\n $mediaGallery = [];\n $labelsForUpdate = [];\n $imagesForChangeVisibility = [];\n $uploadedImages = [];\n $previousType = null;\n $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($bunch);\n\n foreach ($bunch as $rowNum => $rowData) {\n // reset category processor's failed categories array\n $this->categoryProcessor->clearFailedCategories();\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n $rowScope = $this->getRowScope($rowData);\n\n $rowData[self::URL_KEY] = $this->getUrlKey($rowData);\n\n $rowSku = $rowData[self::COL_SKU];\n\n if (null === $rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($rowSku)['attr_set_code'];\n }\n\n // 1. Entity phase\n if ($this->isSkuExist($rowSku)) {\n // existing row\n if (isset($rowData['attribute_set_code'])) {\n $attributeSetId = $this->catalogConfig->getAttributeSetId(\n $this->getEntityTypeId(),\n $rowData['attribute_set_code']\n );\n\n // wrong attribute_set_code was received\n if (!$attributeSetId) {\n throw new LocalizedException(\n __(\n 'Wrong attribute set code \"%1\", please correct it and try again.',\n $rowData['attribute_set_code']\n )\n );\n }\n } else {\n $attributeSetId = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n }\n\n $entityRowsUp[] = [\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'attribute_set_id' => $attributeSetId,\n $entityLinkField => $this->getExistingSku($rowSku)[$entityLinkField]\n ];\n } else {\n if (!$productLimit || $productsQty < $productLimit) {\n $entityRowsIn[strtolower($rowSku)] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($rowSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($rowSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => isset($rowData['has_options']) ? $rowData['has_options'] : 0,\n 'created_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n }\n\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n // 2. Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // 3. Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->processRowCategories($rowData);\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n unset($rowData['rowNum']);\n\n // 4.1. Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => $rowData['_tier_price_price'],\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] ||\n $priceIsGlobal ? 0 : $this->storeResolver->getWebsiteCodeToId($rowData['_tier_price_website']),\n ];\n }\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n\n // 5. Media gallery phase\n list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);\n $storeId = !empty($rowData[self::COL_STORE])\n ? $this->getStoreIdByCode($rowData[self::COL_STORE])\n : Store::DEFAULT_STORE_ID;\n $imageHiddenStates = $this->getImagesHiddenStates($rowData);\n foreach (array_keys($imageHiddenStates) as $image) {\n if (array_key_exists($rowSku, $existingImages)\n && array_key_exists($image, $existingImages[$rowSku])\n ) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n $uploadedImages[$image] = $image;\n }\n\n if (empty($rowImages)) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n }\n }\n\n $rowData[self::COL_MEDIA_IMAGE] = [];\n\n /*\n * Note: to avoid problems with undefined sorting, the value of media gallery items positions\n * must be unique in scope of one product.\n */\n $position = 0;\n foreach ($rowImages as $column => $columnImages) {\n foreach ($columnImages as $columnImageKey => $columnImage) {\n if (!isset($uploadedImages[$columnImage])) {\n $uploadedFile = $this->uploadMediaFiles($columnImage);\n $uploadedFile = $uploadedFile ?: $this->getSystemFile($columnImage);\n if ($uploadedFile) {\n $uploadedImages[$columnImage] = $uploadedFile;\n } else {\n $this->addRowError(\n ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,\n $rowNum,\n null,\n null,\n ProcessingError::ERROR_LEVEL_NOT_CRITICAL\n );\n }\n } else {\n $uploadedFile = $uploadedImages[$columnImage];\n }\n\n if ($uploadedFile && $column !== self::COL_MEDIA_IMAGE) {\n $rowData[$column] = $uploadedFile;\n }\n\n if ($uploadedFile && !isset($mediaGallery[$storeId][$rowSku][$uploadedFile])) {\n if (isset($existingImages[$rowSku][$uploadedFile])) {\n $currentFileData = $existingImages[$rowSku][$uploadedFile];\n if (isset($rowLabels[$column][$columnImageKey])\n && $rowLabels[$column][$columnImageKey] !=\n $currentFileData['label']\n ) {\n $labelsForUpdate[] = [\n 'label' => $rowLabels[$column][$columnImageKey],\n 'imageData' => $currentFileData\n ];\n }\n\n if (array_key_exists($uploadedFile, $imageHiddenStates)\n && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]\n ) {\n $imagesForChangeVisibility[] = [\n 'disabled' => $imageHiddenStates[$uploadedFile],\n 'imageData' => $currentFileData\n ];\n }\n } else {\n if ($column == self::COL_MEDIA_IMAGE) {\n $rowData[$column][] = $uploadedFile;\n }\n $mediaGallery[$storeId][$rowSku][$uploadedFile] = [\n 'attribute_id' => $this->getMediaGalleryAttributeId(),\n 'label' => isset($rowLabels[$column][$columnImageKey])\n ? $rowLabels[$column][$columnImageKey]\n : '',\n 'position' => ++$position,\n 'disabled' => isset($imageHiddenStates[$columnImage])\n ? $imageHiddenStates[$columnImage] : '0',\n 'value' => $uploadedFile,\n ];\n }\n }\n }\n }\n\n // 6. Attributes phase\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n $productType = isset($rowData[self::COL_TYPE]) ? $rowData[self::COL_TYPE] : null;\n if ($productType !== null) {\n $previousType = $productType;\n }\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if ($prevAttributeSet !== null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && $previousType !== null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n\n $productTypeModel = $this->_productTypeModels[$productType];\n if (!empty($rowData['tax_class_name'])) {\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($rowData[self::COL_SKU])\n ) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !$this->isSkuExist($rowSku)\n );\n $product = $this->_proxyProdFactory->create(['data' => $rowData]);\n\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType()\n && (\n in_array($attribute->getAttributeCode(), $this->dateAttrCodes)\n || $attribute->getIsUserDefined()\n )\n ) {\n $attrValue = $this->dateTime->formatDate($attrValue, false);\n } elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = gmdate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n } elseif ($backModel) {\n $attribute->getBackend()->beforeSave($product);\n $attrValue = $product->getData($attribute->getAttributeCode());\n }\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($rowStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$rowStore];\n }\n if (!$this->isSkuExist($rowSku)) {\n $storeIds[] = 0;\n }\n }\n foreach ($storeIds as $storeId) {\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$storeId])) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n }\n\n foreach ($bunch as $rowNum => $rowData) {\n if ($this->getErrorAggregator()->isRowInvalid($rowNum)) {\n unset($bunch[$rowNum]);\n }\n }\n\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n )->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->updateMediaGalleryVisibility(\n $imagesForChangeVisibility\n )->updateMediaGalleryLabels(\n $labelsForUpdate\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $bunch]\n );\n }\n\n return $this;\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function products(): MorphToMany;", "public function variants()\n {\n return $this->hasMany(Variant::class, 'product_id', 'id');\n }", "public function getProducts()\n {\n return $this->hasMany(Product::className(), ['uomId' => 'uomId']);\n }", "public function product_lists()\n {\n return $this->belongsToMany('App\\ProductVariant', 'shopping_list_products', 'shopping_list_id', 'variant_id')\n ->withPivot('quantity', 'branch_id', 'buying_date', 'buying_price')\n ->withTimestamps();\n }", "public function productAttributes()\n {\n return $this->belongsToMany(ProductAttribute::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class, 'product_promotions');\n }", "private function generateProductVariants($product, $params) // .. 2\n {\n $configurableAttributes = $this->_attributeRepository->getConfigurableAttributes();\n $variantAttributes = [];\n\n foreach ($configurableAttributes as $attribute) {\n $variantAttributes[$attribute->code] = $params[$attribute->code];\n }\n\n // dd($variantAttributes);\n\n $variants = $this->generateAttributeCombinations($variantAttributes); // .. 3\n\n // echo '<pre>';\n // print_r($variants);\n // exit;\n\n if ($variants) {\n foreach ($variants as $variant) {\n $variantParams = [\n 'parent_id' => $product->id,\n 'user_id' => $params['user_id'],\n 'sku' => $product->sku . '-' . implode('-', array_values($variant)),\n 'type' => 'simple',\n 'name' => $product->name . $this->convertVariantAsName($variant),\n ];\n\n $variantParams['slug'] = Str::slug($variantParams['name']);\n\n $newProductVariant = Product::create($variantParams);\n\n $categoryIds = !empty($params['category_ids']) ? $params['category_ids'] : [];\n $newProductVariant->categories()->sync($categoryIds);\n\n // dd($variantParams);\n\n $this->saveProductAttributeValues($newProductVariant, $variant);\n }\n }\n }", "public function getProperties()\n {\n return [\n 'brandId' => [\n 'type' => self::ES_TYPE_STRING,\n 'belongs' => [self::BELONGS_TO_CONDITION, self::BELONGS_TO_GROUPING],\n // ajax action, that returns entities in JSON format for Select2 form element\n // Example: [{\"id\":\"3\",\"text\":\"sony\"},{\"id\":\"207\",\"text\":\"HP\"}]\n 'source' => ['ajaxUrl' => '/brand/suggestname'],\n 'name' => 'Brand name',\n // SQL query for conversion in name of id\n 'entityNameSQL' => 'SELECT name FROM product_brand WHERE id = :id'\n ],\n 'storageSupplierStatus' => [\n 'type' => self::ES_TYPE_STRING,\n 'belongs' => [self::BELONGS_TO_CONDITION, self::BELONGS_TO_GROUPING],\n // Items for Html::dropDownList\n 'source' => function() {\n return ['Z' => 'Z', 'D' => 'D', 'S' => 'S'];\n },\n 'name' => 'Storage supplier status'\n ],\n 'issetImage' => [\n 'type' => self::ES_TYPE_BOOLEAN,\n 'belongs' => [self::BELONGS_TO_CONDITION],\n 'name' => 'The presence of the image'\n ],\n 'issetManufacturerLink' => [\n 'type' => self::ES_TYPE_BOOLEAN,\n 'belongs' => [self::BELONGS_TO_CONDITION],\n 'name' => 'The presence of the manufacturer link'\n ],\n 'issetCertificateFile' => [\n 'type' => self::ES_TYPE_BOOLEAN,\n 'belongs' => [self::BELONGS_TO_CONDITION],\n 'name' => 'The presence of the certificate'\n ],\n 'totalNumberProperties' => [\n 'type' => self::ES_TYPE_INTEGER,\n 'belongs' => [self::BELONGS_TO_AGGREGATION],\n 'name' => 'The total number of properties'\n ],\n 'totalNumberFilledProperties' => [\n 'type' => self::ES_TYPE_INTEGER,\n 'belongs' => [self::BELONGS_TO_AGGREGATION],\n 'name' => 'The total number of filled properties'\n ],\n 'percentageFilledFeatures' => [\n 'type' => self::ES_TYPE_INTEGER,\n 'belongs' => [self::BELONGS_TO_AGGREGATION],\n 'name' => 'The percentage of filling properties'\n ]\n ];\n }", "public function saveProductProfile($product_id,$metas){\n foreach($metas as $key=>$meta){\n foreach($meta as $v){\n if(isset($v['value'])){\n $model = new self;\n $model->product_id = $product_id;\n $model->profile_id = $key;\n $model->profile_value = $v['value'];\n if(isset($v['profile_image'])){\n $model->profile_image = $v['profile_image'];\n }else{\n $model->profile_image == \"\";\n }\n $model->save(false);\n }\n }\n }\n //save default product stock\n $colors = Product::model()->getAllcolorsById($product_id);\n $sizes = Product::model()->getAllsizesById($product_id);\n $arr = array();\n foreach($colors as $key => $color){\n foreach ($sizes as $size) {\n $arr[$key][$size->profile_value][] = $color->profile_value;\n }\n }\n foreach($arr as $value){\n foreach($value as $k=>$v){\n $model = new ProductStock;\n $model->product_id = $product_id;\n $model->color = $v[0];\n $model->size = $k;\n $model->save(false);\n }\n }\n return true;\n }", "public function hasProductsUsingPropValues(Property $property) {\r\n /* @var $propertyValue \\US\\CatalogBundle\\Entity\\PropertyValue */\r\n foreach ($property->getPropertyValues() as $propertyValue) {\r\n if ($propertyValue->getProducts()->count()) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function callbackValidateProduct($args)\n {\n $product = clone $args['product'];\n $product->setData($args['row']);\n $websites = $this->_getWebsitesMap();\n foreach ($websites as $websiteId => $defaultStoreId) {\n $product->setStoreId($defaultStoreId);\n if ($this->getConditions()->validate($product)) {\n $this->_productIds[] = $product->getId();\n }\n }\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\models\\Product', 'product_variants');\n }", "public function getProductId(){\n return $this->product_id;\n }", "public function getOverstrandSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 113\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function product()\n {\n return $this->belongsTo(config('inventory.models.product-variant'), 'product_variant_id');\n }", "private function setRecountProduct() {\n\n //$this->model->setDocumentNumber($this->getDocumentNumber);\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n INSERT INTO `productrecount` \n (\n `companyId`,\n `warehouseId`,\n `productCode`,\n `productDescription`,\n `productRecountDate`,\n `productRecountSystemQuantity`,\n `productRecountPhysicalQuantity`,\n `isDefault`,\n `isNew`,\n `isDraft`,\n `isUpdate`,\n `isDelete`,\n `isActive`,\n `isApproved`,\n `isReview`,\n `isPost`,\n `executeBy`,\n `executeTime`\n ) VALUES ( \n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n INSERT INTO [productRecount]\n (\n [productRecountId],\n [companyId],\n [warehouseId],\n [productCode],\n [productDescription],\n [productRecountDate],\n [productRecountSystemQuantity],\n [productRecountPhysicalQuantity],\n [isDefault],\n [isNew],\n [isDraft],\n [isUpdate],\n [isDelete],\n [isActive],\n [isApproved],\n [isReview],\n [isPost],\n [executeBy],\n [executeTime]\n) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n INSERT INTO PRODUCTRECOUNT\n (\n COMPANYID,\n WAREHOUSEID,\n PRODUCTCODE,\n PRODUCTDESCRIPTION,\n PRODUCTRECOUNTDATE,\n PRODUCTRECOUNTSYSTEMQUANTITY,\n PRODUCTRECOUNTPHYSICALQUANTITY,\n ISDEFAULT,\n ISNEW,\n ISDRAFT,\n ISUPDATE,\n ISDELETE,\n ISACTIVE,\n ISAPPROVED,\n ISREVIEW,\n ISPOST,\n EXECUTEBY,\n EXECUTETIME\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n }\n }\n }\n try {\n $this->q->create($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "public function getOudtshoornSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 102\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "private function setup_products() {\n\t\tglobal $wpdb;\n\n\t\t$ids = [];\n\t\t$d = $wpdb->get_results( \"SELECT distinct `products` FROM `{$wpdb->prefix}thespa_data`\", ARRAY_A );\n\t\tforeach ( $d as $datum ) {\n\t\t\t$prs = explode( \",\", $datum['products'] );\n\t\t\tforeach ( $prs as $pr ) {\n\t\t\t\tif ( !isset( $ids[$pr] ) ) {\n\t\t\t\t\tarray_push($ids, $pr );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$i = 0;\n\t\tforeach ( $ids as $id ) {\n\t\t\t$product = wc_get_product( $id );\n\t\t\tif ( is_object( $product ) ) {\n\t\t\t\t$this->products[$i] = [\n\t\t\t\t\t'id' => $id,\n\t\t\t\t\t'name' => $product->get_title(),\n\t\t\t\t\t'url' => $product->get_permalink(),\n\t\t\t\t\t'img' => wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'medium', true )[0],\n\t\t\t\t\t'cost' => $product->get_price_html(),\n\t\t\t\t];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}", "public function get_product_attributes() : array {\n\t\t$sku_wrapper = $this->dom->find( '#j-product-info-sku' );\n\t\tif ( 1 > count( $sku_wrapper ) ) {\n\t\t\treturn [\n\t\t\t\t'attributes' => [],\n\t\t\t];\n\t\t}\n\n\t\t$sku_sets = $sku_wrapper[0]->find( '.p-property-item' );\n\t\t$sku_data = [];\n\t\tfor ( $i = 0; $i < count( $sku_sets ); $i++ ) { // @codingStandardsIgnoreLine Count is lightweight\n\t\t\t// Drop it into a var so it can be looped.\n\t\t\t$sku_set = $sku_sets[ $i ];\n\n\t\t\t// Get the variation label.\n\t\t\t$label = $sku_set->find( '.p-item-title' )[0]->text();\n\t\t\t$label = trim( str_replace( ':', '', $label ) );\n\n\t\t\t// Get the error now.\n\t\t\t$msg_error = trim( $sku_set->find( '.sku-msg-error' )[0]->text() );\n\n\t\t\t// Get all sku props\n\t\t\t$sku_props = $sku_set->find( '.sku-attr-list' );\n\n\t\t\t// Get the sku prop ID, for later use.\n\t\t\t$sku_prop_id = $sku_props[0]->attr( 'data-sku-prop-id' );\n\n\t\t\t$skus = [];\n\t\t\t$sku_children = $sku_props[0]->find( 'li' );\n\t\t\tfor ( $y = 0; $y < count( $sku_children ); $y++ ) { // @codingStandardsIgnoreLine Count is lightweight\n\t\t\t\t// Saves typing later.\n\t\t\t\t$child = $sku_children[ $y ];\n\n\t\t\t\t// Get the anchor object.\n\t\t\t\t$anchor = $child->find( 'a[^data-role=sku]' );\n\t\t\t\tif ( 1 > count( $anchor ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Get the sku properties from the anchor.\n\t\t\t\t$id = $anchor[0]->getAttribute( 'data-sku-id' );\n\n\t\t\t\t// @TODO: Seems to be auto-updated somehow through the JS.\n\t\t\t\t$spm_anchor_id = $anchor[0]->getAttribute( 'data-spm-anchor-id' );\n\n\t\t\t\t$image = $anchor[0]->find( 'img' );\n\t\t\t\tif ( 1 > count( $image ) ) {\n\t\t\t\t\t// This isn't an image-based SKU.\n\t\t\t\t\t$sku_label = trim( $anchor[0]->text() );\n\t\t\t\t} else {\n\t\t\t\t\t// This is an image-based SKU, return the image URL and additional data.\n\t\t\t\t\t$sku_label = $image[0]->getAttribute( 'title' );\n\n\t\t\t\t\t// @TODO: Seems to be auto-updated somehow through the JS.\n\t\t\t\t\t$img_spm_anchor_id = $image[0]->getAttribute( 'data-spm-anchor-id' );\n\t\t\t\t\t$src = $image[0]->getAttribute( 'src' );\n\t\t\t\t\t$big_pic = $image[0]->getAttribute( 'bigpic' );\n\t\t\t\t}\n\n\t\t\t\t$sku = compact( 'id', 'sku_label', 'spm_anchor_id' );\n\t\t\t\tif ( 1 <= count( $image ) ) {\n\t\t\t\t\t$sku['image'] = compact( 'src', 'big_pic', 'img_spm_anchor_id' );\n\t\t\t\t}\n\n\t\t\t\t$skus[] = $sku;\n\t\t\t}\n\n\t\t\t$sku_data[] = compact( 'sku_prop_id', 'label', 'msg_error', 'skus' );\n\t\t}\n\t\treturn [ 'attributes' => $sku_data ];\n\t}", "public function products()\n {\n return $this->belongsToMany(Product::class, 'attribute_product')\n ->withPivot('attribute_id')\n ->withTimestamps();\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function getProduct_Id() {\n return $this->product_Id;\n }", "public function getProducts(): Collection \n { return $this->products;\n //on fait ensuite un make:migration. C'est la migration qui sert a exprimer le lien many to many\n }", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function getProductID()\n {\n }", "protected function addSkuPkMapping(array $product)\n {\n $this->addSkuEntityIdMapping($product[MemberNames::SKU], $product[MemberNames::ENTITY_ID]);\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function afterSave()\n {\n // from the product. Otherwise we will end up with duplicated values.\n if ($this->getOriginal('inventory_management_method') === 'single' && $this->inventory_management_method === 'variant') {\n $this->forceReindex = true;\n $properties = $this->categories->flatMap->properties->filter(function ($q) {\n return $q->pivot->use_for_variants;\n })->pluck('id');\n\n PropertyValue\n ::where('product_id', $this->id)\n ->whereNull('variant_id')\n ->whereIn('property_id', $properties)\n ->delete();\n }\n\n if ($this->forceReindex) {\n $this->forceReindex = false;\n (new ProductObserver(app(Index::class)))->updated($this);\n }\n }", "public function getSwellendamSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 114\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getStellenboschSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 99\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getProductsId()\n {\n return $this->productsId;\n }", "public function getShopStoreProperty()\n {\n return $this->hasOne(ShopStoreProperty::className(), ['id' => 'shop_store_property_id']);\n }", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "function setSyncItemsCodeProduct()\n {\n }", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function createnewproduct()\n {\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $product = Mage::getModel('catalog/product');\n $websiteId = Mage::app()->getWebsite('base')->getId();\n $storeId = Mage::app()->getStore('default')->getId();\n\n //Set SKU dynamically over here\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSort('created_at', 'desc');\n $collection->getSelect()->limit(1);\n $latestItemId = $collection->getLastItem()->getId();\n if($latestItemId) {\n $nextProid = $latestItemId + 1;\n } else {\n $nextProid = 1;\n }\n $SampleSKU = 'titechPro'.$nextProid;\n\n try {\n $product\n ->setStoreId($storeId) //you can set data in store scope\n ->setWebsiteIds(array($websiteId)) //website ID the product is assigned to, as an array\n ->setAttributeSetId(4) //ID of a attribute set named 'default'\n ->setTypeId('simple') //product type\n ->setCreatedAt(strtotime('now')) //product creation time\n ->setUpdatedAt(strtotime('now')) //product update time\n ->setSku($SampleSKU) //SKU\n ->setName('Titech sample product') //product name\n ->setWeight(4.0000)\n ->setStatus(1) //product status (1 - enabled, 2 - disabled)\n ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility\n //->setManufacturer(28) //manufacturer id\n //->setColor(24)\n //->setNewsFromDate('06/26/2014') //product set as new from\n //->setNewsToDate('06/30/2014') //product set as new to\n ->setCountryOfManufacture('IN') //country of manufacture (2-letter country code)\n ->setPrice(11.22) //price in form 11.22\n ->setCost(22.33) //price in form 11.22\n //->setSpecialPrice(00.44) //special price in form 11.22\n //->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)\n //->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)\n ->setMsrpEnabled(1) //enable MAP\n ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)\n ->setMsrp(99.99) //Manufacturer's Suggested Retail Price\n ->setMetaTitle('Sample meta title 2')\n ->setMetaKeyword('Sample meta keyword 2')\n ->setMetaDescription('Sample meta description 2')\n ->setDescription('This is a long description for sample product')\n ->setShortDescription('This is a short description for sample product')\n ->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization\n ->addImageToMediaGallery('media/catalog/product/ti/ti_logo.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery\n ->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'=>1, //manage stock\n 'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart\n 'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' => 1, //Stock Availability\n 'qty' => 999 //qty\n )\n )\n ->setCategoryIds(array(2)); //assign product to categories - Set to Default\n\n $product->save();\n return $product->getIdBySku($SampleSKU);\n } catch(Exception $e) {\n Mage::log($e->getMessage());\n }\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function getProductSKU()\n {\n }", "public function productBrandMap(){\n\t\treturn $this->hasOne('App\\ProductBrandMaps','product_id');\n\t}", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function products()\n {\n return $this->hasMany('App\\ProductLocation', 'productLocation', 'id');\n }", "private function initProducts()\n {\n $productIds = $this->getRequestProductIds();\n if ($productIds) {\n try {\n return $this->productCollectionFactory\n ->create()\n ->addIdFilter($productIds)\n ->addAttributeToFilter(ProductInterface::TYPE_ID, ConfigurableModel::TYPE_CODE);\n } catch (NoSuchEntityException $e) {\n return false;\n }\n }\n\n return false;\n }", "public function getKnysnaSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 111\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function products() {\n \treturn $this->belongsToMany(Product::class, 'items_product', 'item_id', 'product_id');\n }", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function getHessequaSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 109\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function customWholesaleQuantities()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\CustomWholesaleQuantity','sp_id','sp_id');\n }", "public function productImage(){\n\t\treturn $this->hasmany('App\\ProductImages','product_id');\n\t}", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function products(){\n return $this->belongsToMany('App\\Product', 'enumber_products', 'enumber_id', 'products_id');\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function product()\n {\n return $this->belongsToMany(Product::class,'product_id','id');\n \n }", "public function catalogProductSaveAfterEvent($observer) {\n if (Mage::registry('INVENTORY_SUPPLIER_CREATE_PRODUCT'))\n return;\n Mage::register('INVENTORY_SUPPLIER_CREATE_PRODUCT', true);\n\n $product = $observer->getProduct();\n $productId = $product->getId();\n\n if (in_array($product->getTypeId(), array('configurable', 'bundle', 'grouped')))\n return;\n if (Mage::getModel('admin/session')->getData('inventory_catalog_product_duplicate')) {\n $currentProductId = Mage::getModel('admin/session')->getData('inventory_catalog_product_duplicate');\n $supplierProducts = Mage::getModel('inventorypurchasing/supplier_product')->getCollection()\n ->addFieldToFilter('product_id', $currentProductId);\n foreach ($supplierProducts as $supplierProduct) {\n\n $newSupplierProduct = Mage::getModel('inventorypurchasing/supplier_product');\n $newSupplierProduct->setData('product_id', $productId)\n ->setData('supplier_id', $supplierProduct->getSupplierId())\n ->setData('cost', $supplierProduct->getCost())\n ->setData('discount', $supplierProduct->getDiscount())\n ->setData('tax', $supplierProduct->getTax())\n ->setData('supplier_sku', $supplierProduct->getSupplierSku())\n ->save();\n }\n Mage::getModel('admin/session')->setData('inventory_catalog_product_duplicate', false);\n }\n\n $post = Mage::app()->getRequest()->getPost();\n $isInStock = 0;\n\n if (isset($post['product']['stock_data']['is_in_stock']))\n $isInStock = $post['product']['stock_data']['is_in_stock'];\n if (isset($post['simple_product']))\n if (isset($post['simple_product']['stock_data']['is_in_stock']))\n $isInStock = $post['simple_product']['stock_data']['is_in_stock'];\n if (isset($post['inventory_select_supplier'])) {\n $suppliers = $post['inventory_select_supplier'];\n try {\n foreach ($suppliers as $supplier) {\n $warehouseProductModel = Mage::getModel('inventorypurchasing/supplier_product');\n $warehouseProductModel->setSupplierId($supplier['supplier_id'])\n ->setProductId($productId)\n ->setCost($supplier['cost'])\n ->setDiscount($supplier['discount'])\n ->setTax($supplier['tax'])\n ->setSupplierSku($supplier['supplier_sku'])\n ->save();\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(), null, 'inventory_management.log');\n }\n }\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function SPOPtionRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany(SPOPtionRelation::class,'sp_id','sp_id');\n }", "public function getProdIds() \n {\n return array_keys($this->_products);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function normalizeModelProducts() : array\n {\n\n // Init empty array\n $return = [];\n\n // Loop on every Model's products\n foreach ($this->getProducts() as $product) {\n\n // Store ProductSubresource in new $return index\n $return[] = $product->normalizeProductCollection(true, false, false, false);\n }\n\n return $return;\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "static function get_affiliates_for_product_meta(){\t\t \t\t\t \t\t \t\t\t\t\t\t \t\n\t\t \tglobal $post;\n\t\t \t\t\t \t\n\t\t\t$keywords = self::get_keywords($post->ID); //keywords saved against each post/product\n\t\t\t$options = WpLinkRewriter::get_options(); //global options for link rewrite\n\t\t\t\t\t\t\t\t\t\n\t\t\t$affiliate_links = self::get_affiliate_links($post->post_title, $keywords, $post->ID); //get affliates links\n\t\t\t\n\t\t\t$affiliates = array();\n\t\t\tforeach($affiliate_links as $brand => $link){\t\t\t\t\n\t\t\t\t$affiliates[$brand] = array(\n\t\t\t\t\t'url' => $link,\n\t\t\t\t\t'title' => self::$affiliates_options[$brand]['title'],\n\t\t\t\t\t'button_text' => $options[$brand]['button_text'],\n\t\t\t\t\t'store_info' => $options[$brand]['url']\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\n\t\t\treturn $affiliates;\t\n\t\t\t\t\t\n\t\t }", "public function catalogProductSaveBefore($productType,$product){\n /**\n * Check $productType has been set to 'property'\n */\n if ($productType == 'property') {\n /**\n * Getting Product's user Id\n */\n $customerId = $product->getUserid ();\n /**\n * Loading customer Details\n */\n $customer = Mage::getModel ( 'customer/customer' )->load ( $customerId );\n /**\n * checking empty or not\n */\n if ($customer->getId () == '') {\n $product->setCanSaveCustomOptions ( true );\n Mage::throwException ( Mage::helper ( 'adminhtml' )->__ ( 'User id was invalid' ) );\n }\n }\n }", "public function addProductInfo()\n {\n $attribute = $this->attributeRepository->get('name');\n\n $this->getSelect()->joinLeft(\n ['product_table' => $this->getTable('catalog_product_entity_varchar')],\n \"main_table.product_id = product_table.entity_id AND product_table.store_id = 0\",['product_name' => 'product_table.value']\n )->where('product_table.attribute_id = ?', $attribute->getAttributeId());\n\n return $this;\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product');\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function products()\n {\n return $this->hasMany('fooCart\\src\\Product', 'tax_id', 'tax_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "function getProducts()\n {\n $db = $this->getPearDb();\n\n // The query is big, but it does use indexes. Anyway, the involved\n // tables almost never change, so we utilize MySQL's query cache\n $sql = \"(\n # User permissions\n SELECT DISTINCT pe_u.parameterValue AS productId\n FROM user u\n JOIN permission pe_u\n ON pe_u.doerId = u.id\n AND pe_u.allowed = '1'\n AND pe_u.actionId = 6 # 6 = use_product\n WHERE u.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Customer permissions\n SELECT DISTINCT pe_c.parameterValue AS productId\n FROM permission pe_c\n WHERE pe_c.doerId = \" . $this->id . \"\n AND pe_c.allowed = '1'\n AND pe_c.actionId = 6 # 6 = use_product\n\n ) UNION (\n\n SELECT productId\n FROM site s\n WHERE s.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Kollage is always on\n SELECT 1\n\n )\";\n $productIds = $db->getCol($sql);\n $productIds = array_filter(array_unique($productIds), 'intval');\n\n $product = new Vip_Product;\n $product->columnIn('id', $productIds);\n // Customer-specific products are only enabled for that customer.\n $product->addWhereSql('customerId IN (0, ' . $this->id . ')');\n $product->setOrderBySql('sortOrder,title');\n $products = $product->findAll();\n foreach ($products as $product) {\n $product->setCustomer($this);\n }\n\n return $products;\n }", "public function setRelatedBundlesForSimpleProducts($bundleProduct)\n {\n $selectionCollection = $bundleProduct->getTypeInstance(true)->getSelectionsCollection(\n $bundleProduct->getTypeInstance(true)->getOptionsIds($bundleProduct), $bundleProduct\n );\n foreach($selectionCollection as $option) {\n try {\n $_product = Mage::getModel('catalog/product')->load($option->getEntityId());\n if($_product->getId()) {\n $customLinkData = array();\n foreach($_product->getRelatedBundleCollection() as $customLink) {\n $customLinkData[$customLink->getLinkedProductId()]['position'] = $customLink->getPosition();\n }\n $customLinkData[$bundleProduct->getId()] = array('position' => 0);\n $_product->setRelatedBundleData($customLinkData)->save();\n Mage::getSingleton('adminhtml/session')->addSuccess('Added ' . $bundleProduct->getSku() . ' as a Related Bundle to product ' . $_product->getSku());\n }\n } catch(Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError('Could not set bundled product as Related Bundle for product ' . $option->getSku() . '; ' . $e->getMessage());\n }\n }\n\n }", "public function initUrlKeys()\n {\n try {\n $entityLinkField = $this->getEntity()->_getProductEntityLinkField();\n $joinCondition = 'cpe.' . $entityLinkField . ' = attr.' . $entityLinkField;\n $urlKeyAttribute = $this->getEntity()\n ->retrieveAttributeByCode(Product::URL_KEY);\n $connection = $this->getEntity()->getConnection();\n\n $select = $connection->select()\n ->from(['attr' => $urlKeyAttribute->getBackendTable()], ['url_key' => 'value', 'store_id'])\n ->joinLeft(\n ['cpe' => $this->_resource->getTableName('catalog_product_entity')],\n $joinCondition,\n ['sku']\n )\n ->where('attribute_id = (?)', $urlKeyAttribute->getAttributeId());\n\n foreach ($connection->fetchAll($select) as $value) {\n if (!isset($value[Product::COL_SKU])) {\n continue;\n }\n $this->addUrlKeys($value[Product::COL_SKU], $value[Product::URL_KEY], $value['store_id']);\n }\n } catch (Exception $exception) {\n $this->addLogWriteln($exception->getMessage(), 'error');\n }\n return $this;\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function eventNotifySeller() {\r\n /**\r\n * Date calculation, Current date and Previous date\r\n */\r\n $currentDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(time()));\r\n $previousDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(strtotime($currentDate . ' -1 day')));\r\n\r\n // Getting all seller ID's whose products updated in from yesterday\r\n\r\n $_sellerCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToSelect('seller_id')\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->groupByAttribute('seller_id')\r\n ->load();\r\n\r\n foreach ($_sellerCollection as $_seller) {\r\n $sellerId = $_seller->getSellerId();\r\n $products = \"\";\r\n\r\n //Loading seller product collection\r\n $_productCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToFilter('seller_id', $_seller->getSellerId())\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->addAttributeToSelect('*')\r\n ->load();\r\n\r\n $i = 1;\r\n foreach ($_productCollection as $_product) {\r\n $small_image = Mage::helper('catalog/image')->init($_product, 'small_image')->resize(51, 68);\r\n $products .= '<tr>';\r\n $products .= '<td style=\"text-align:center; margin:0 0 10px; vertical-align:middle; padding:0 0 10px;\">' . $i . '</td>';\r\n $products .= '<td style=\"text-align:center; padding:0 0 20px;\"><img src=' . $small_image . ' alt=' . $_product->getName() . ' /></td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getName() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getSku() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('seller_product_status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;;\">' . $_product->getPrice() . '</td>';\r\n $products .= '</tr>';\r\n\r\n $i++;\r\n }\r\n $templateId = 9;\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templateId);\r\n\r\n //Getting seller information\r\n\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n\r\n // Setting up default sender information\r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n // Setting email variables\r\n $emailTemplateVariablesValue = (array(\r\n 'sellername' => $sellerName,\r\n 'products' => $products,\r\n 'seller_store' => $sellerStore,\r\n ));\r\n\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n\r\n /**\r\n * Send email to the seller\r\n */\r\n $emailTemplate->send($sellerEmail, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }", "public function skus()\n {\n return $this->hasMany('App\\Models\\Sku');\n }", "function os2forms_nemid_form_builder_webform_form_builder_properties_component() {\n return array(\n 'unique' => array(\n 'form' => 'form_builder_webform_property_unique_form',\n ),\n );\n}", "public function getProductIds(): array\n {\n return $this->product_ids;\n }" ]
[ "0.59428227", "0.5513796", "0.5511107", "0.53811073", "0.53474885", "0.5319242", "0.5303642", "0.5255887", "0.52552146", "0.5237946", "0.5228003", "0.5201633", "0.5193404", "0.5186786", "0.51812434", "0.5161191", "0.5147681", "0.5133808", "0.51296973", "0.51292044", "0.5127861", "0.51135826", "0.51008636", "0.5100053", "0.50876755", "0.50787276", "0.50721043", "0.5069921", "0.50661683", "0.5063469", "0.5058074", "0.50553733", "0.5044654", "0.50277066", "0.5027625", "0.5021347", "0.5017119", "0.50161755", "0.5005171", "0.50013006", "0.49863935", "0.49767798", "0.4976668", "0.49687138", "0.49646363", "0.49559084", "0.49531138", "0.4951417", "0.4944904", "0.4943751", "0.49380168", "0.49372342", "0.49354708", "0.4932657", "0.4929166", "0.49206656", "0.49206656", "0.49206656", "0.49206656", "0.4917347", "0.4914026", "0.49125853", "0.49116474", "0.4884316", "0.48832178", "0.4871418", "0.48609942", "0.48503017", "0.48479947", "0.4838265", "0.4833717", "0.48317438", "0.4830492", "0.4827961", "0.482553", "0.4823488", "0.4822745", "0.48212847", "0.4819318", "0.48177433", "0.481657", "0.48127264", "0.4811965", "0.48055765", "0.48039195", "0.48037568", "0.48031688", "0.48010197", "0.48010197", "0.48010197", "0.4797376", "0.47967917", "0.47965008", "0.47955295", "0.4795252", "0.4793365", "0.47881082", "0.47858682", "0.47844672", "0.47824517" ]
0.72402287
0
SellerProduct has one AutoProductDivision.
public function autoProductDivision() { // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasOne('App\AutoProductDivision','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function division(){\n return $this->hasOne(Division::class);\n }", "public function order_product(){\n return $this->hasOne(Order_product::class);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }", "public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function vendor()\n {\n // A product can only belong to one vendor\n return $this->belongs_to('Vendor');\n }", "public function product()\n {\n return $this->belongsTo(config('inventory.models.product-variant'), 'product_variant_id');\n }", "function Product() {\r\n\t\treturn $this->owner;\r\n\t}", "public function product()\n {\n return $this->hasOne('App\\Models\\Product');\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function product()\n {\n return $this->belongsTo('App\\Entities\\Product');\n }", "public function product()\n {\n return $this->belongsTo(BaseProduct::class);\n }", "public function division()\n {\n return $this->belongsTo('App\\Models\\Admin\\Location\\Division');\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Product', 'n_ProductId_FK')->withDefault();\n }", "public function owner()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Products\\Models\\Product', 'product_id');\n }", "public function owner()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Products\\Models\\Product', 'product_id');\n }", "public function product() {\n return $this->belongsTo('App\\Entity\\Product');\n }", "public function productcategory(){\n return $this->belongsTo(Productdivision::class,'productdivision_id');\n }", "public function product()\n {\n return $this->belongsTo('Modules\\Admin\\Models\\Product','product_id','id');\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function product()\n {\n // belongsTo(RelatedModel, foreignKey = product_id, keyOnRelatedModel = id)\n return $this->belongsTo(Product::class);\n }", "public function getProductOptionId();", "public function product()\n\t{\n\t\treturn $this->belongsTo('Tricks\\Product');\n\t}", "public function sellerStock()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\SellerStock','sp_id','sp_id');\n }", "public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }", "public function product()\n {\n return $this->belongsTo(Product::Class());\n }", "public function product()\n {\n return $this->belongsTo('App\\CatalogProduct', 'product_id');\n }", "public function SPSubDivision()\n {\n \t// belongsTo(RelatedModel, foreignKey = spsd_id, keyOnRelatedModel = spsd_id)\n \treturn $this->belongsTo('App\\SPSubDivision','spsd_id','spsd_id');\n }", "public function product() : BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function primaryProduct() : object\n {\n return $this->hasOne(Species::class, 'id');\n }", "public function product()\n {\n return $this->belongsTo( Product::class );\n }", "public function variation()\n {\n return $this->belongsTo(ProductVariation::class);\n }", "public function product()\n {\n return $this->belongsTo('TechTrader\\Models\\Product');\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class);\n }", "public function Product()\n\t{\n\t\treturn $this->belongsTo('App\\Product');\n\t}", "public function coupon_product()\n {\n return $this->belongsTo(Coupon_product::class);\n }", "public function setProduct(Product $product);", "public function getProductSeller()\n {\n $product = $this->coreRegistry->registry('product');\n $productId = $product->getId();\n $sellerId = $this->helper->getSellerIdByProductId($productId);\n return $sellerId;\n }", "public function product()\n {\n return $this->belongsTo('Laracart\\Product\\Models\\Product', 'product_id');\n\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(config('laravel-inventory.product'));\n }", "protected abstract function isSingleProduct();", "public function getVendor()\n {\n return $this->hasOne(VendorServiceExt::className(), ['vendor_id' => 'vendor_id']);\n }", "public function getShowInProduct()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_presentation/show_product', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "public function product()\n {\n \treturn $this->belongsTo(Product::class);\n }", "public function Category_id()\n {\n return $this->hasOne(Product::class);\n }", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "public function product_detail()\n {\n return $this->has_one('Product_Detail');\n }", "public function getDivision() { \n if(!$this->department || !$this->department->department || !$this->department->department->division)\n return false;\n\n return $this->department->department->division;\n }", "public function getProduct()\r\n {\r\n return $this->product;\r\n }", "public function product()\n {\n return $this->belongsTo('App\\Product');\n\t}", "public function getId0()\n {\n return $this->hasOne(Product::className(), ['category_id' => 'id']);\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class, 'id_product', 'id_product');\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function product()\n {\n \treturn $this->belongsTo('App\\Product');\n }", "public function scientificArea()\n {\n return $this->belongsTo('App\\ScientificArea');\n }", "private function createWarrantyProduct()\n {\n /**\n * @var $product Mage_Catalog_Model_Product\n */\n foreach ($this->warrantyProductSkus as $warrantyProductSku => $productName) {\n if (!$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $warrantyProductSku)) {\n $product = Mage::getModel('catalog/product');\n\n $product->setTypeId(Mulberry_Warranty_Model_Product_Type_Warranty::TYPE_ID)\n ->setSku($warrantyProductSku)\n ->setName($productName)\n ->setDescription(sprintf('%s, Product Placeholder', $productName))\n ->setShortDescription(sprintf('%s, Product Placeholder', $productName))\n ->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG)\n ->setAttributeSetId(4)\n ->setTaxClassId(0)\n ->setPrice(10.00)\n ->setStockData(array(\n 'use_config_manage_stock' => 0,\n 'manage_stock' => 0,\n 'is_in_stock' => 1,\n 'qty' => 10,\n ));\n\n $product->save();\n }\n }\n }", "public function getProduct_Id() {\n return $this->product_Id;\n }", "public function product()\n {\n return $this->belongsTo(Product::class);\n\n }", "public function category_product()\n {\n return $this->belongsTo(Category_product::class);\n }", "public function getProduct();", "public function product()\n {\n return $this->belongsTo('App\\Product');\n }", "public function product()\n {\n return $this->belongsTo('App\\Product');\n }", "public function producto() {\n return $this->belongsTo(Producto::class);\n }", "public function product(){\n return $this->belongsTo(Product::class);\n }", "public function photo_product()\n {\n return $this->belongsTo(Photo_product::class);\n }", "public function variant(){\n return $this->hasOne('Salesfly\\Salesfly\\Entities\\Variant');\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function product() \n\t{\n\t\treturn $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n\t}", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "function GetDivisionID () {\n return $this->hunt_division;\n }", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(Product::class, $this->primaryKey);\n\t}", "public function eventProduct()\n {\n return $this->belongsTo(\\App\\Models\\EventProduct::class, 'event_product_id');\n }", "public function unit()\n {\n return $this->hasOneThrough(\n Unit::class,\n Product::class,\n 'id',\n 'id',\n 'product_id',\n 'unit_id',\n );\n }", "public function product()\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id', 'id');\n }", "public function product(){\n\n return $this->belongsTo(Product::class);\n\n }", "public function product()\n {\n return $this->belongsTo('App\\Models\\Product', 'product_id');\n }", "public function industry()\r\n {\r\n if($this->industry_id!=0)\r\n return $this->belongsTo('App\\Models\\Industry');\r\n return null;\r\n }", "public function producteur()\n {\n return $this->belongsTo(Producteur::class, 'id_producteur', 'id_producteur');\n }", "public function getProduct() {\r\n return $this->_product;\r\n }", "public function getAssignProduct() {\n return $this->scopeConfig->getValue ( static::XML_ASSIGN_PRODUCT, ScopeInterface::SCOPE_STORE );\n }" ]
[ "0.5678987", "0.5487072", "0.54531544", "0.54531544", "0.54531544", "0.54531544", "0.5403631", "0.536735", "0.5341711", "0.52218884", "0.5216027", "0.5195785", "0.51852185", "0.5168378", "0.5159933", "0.51240855", "0.51034296", "0.51024693", "0.51024693", "0.5070226", "0.5067059", "0.5027696", "0.5022673", "0.49465856", "0.4934689", "0.4933841", "0.49320677", "0.49250594", "0.49105456", "0.49066058", "0.49034917", "0.4891444", "0.4889081", "0.48887414", "0.48833293", "0.48690125", "0.48688266", "0.48630446", "0.48617905", "0.48617905", "0.48617905", "0.48617905", "0.48615944", "0.48570487", "0.48542956", "0.4845798", "0.4844769", "0.48440364", "0.48433304", "0.48301464", "0.48287967", "0.48276055", "0.4815827", "0.48130098", "0.48099956", "0.48027372", "0.4796764", "0.47880405", "0.47879416", "0.4786597", "0.4784121", "0.47749653", "0.47743407", "0.47743407", "0.4773318", "0.4769401", "0.47644478", "0.47642145", "0.475962", "0.4757205", "0.47566286", "0.47566286", "0.47513163", "0.47434157", "0.47371244", "0.4728566", "0.47266358", "0.47266358", "0.47266358", "0.47266358", "0.47266358", "0.47266358", "0.4725643", "0.4725643", "0.4725643", "0.47177225", "0.47074798", "0.46992874", "0.46932778", "0.46928918", "0.4692688", "0.46904206", "0.46890783", "0.4688041", "0.4685441", "0.46851197", "0.46803167", "0.46744138", "0.4670794", "0.4662572" ]
0.7097879
0
SellerProduct has many SPFeatureLists.
public function SPFeatureLists() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\SPFeatureList','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function product_features()\n {\n return $this->belongsToMany('App\\Models\\ProductFeature', 'feature_product');\n }", "public function features()\n {\n return $this->hasMany('App\\Feature');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function getSupportProducts()\n {\n return $this->hasMany(SupportProduct::class, ['indigent_id' => 'id']);\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function actionFeatureproduct()\n {\n $route = 'merchant.getFeatureProduct';\n $request = new getFeatureProductsRequest();\n $request->setCustomerId($this->customer_id);\n $request->setAuthToken($this->auth_token);\n $request->setWholesalerId(3);\n $result = Proxy::sendRequest($route, $request);\n $header = $result->getHeader();\n $body = getFeatureProductsResponse::parseFromString($result->getPackageBody());\n return $this->render('index',[\n 'request' => $request->toArray(),\n 'route' => $route,\n 'header' => $header,\n 'body' => $body\n ]);\n }", "public function getFeaturesList(){\n return $this->_get(1);\n }", "public function product_lists()\n {\n return $this->belongsToMany('App\\ProductVariant', 'shopping_list_products', 'shopping_list_id', 'variant_id')\n ->withPivot('quantity', 'branch_id', 'buying_date', 'buying_price')\n ->withTimestamps();\n }", "public function productOptions()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductOption','sp_id','sp_id');\n }", "public function offers()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n \treturn $this->hasMany('App\\Offer','sp_id','sp_id');\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function getFeaturedProductCollection()\n {\n return $this->_getProductCollection();\n }", "public function wishlists()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\Wishlists','sp_id','sp_id');\n }", "public function getManageFeaturedSellers()\n\t{\n\t\t$d_arr = array();\n\t\t$d_arr['pageTitle'] = trans('featuredsellers::featuredsellers.featured_sellers');\n\t\t$d_arr['allow_to_change_status'] = true;\n\t\t$user_list = $user_details = array();\n\t\t$shop_action = array('' => trans('common.select_option'), 'deactivate' => trans('admin/manageMembers.deactivate_shop'), 'activate' => trans('admin/manageMembers.activate_shop'));\n\n\t\t$is_shop_owner = array('' => trans('common.select_option'), 'Yes' => trans('common.yes'), 'No' => trans('common.no'));\n\t\t$is_allowed_to_add_product = array('' => trans('common.select_option'), 'Yes' => trans('common.yes'), 'No' => trans('common.no'));\n\t\t$status = array('' => trans('common.select_option'), 'blocked' => Lang::get('common.blocked'), 'active' => Lang::get('common.active'), 'inactive' => Lang::get('common.inactive'));\n\t\t$shop_status = array('' => trans('common.select_option'), 'active' => Lang::get('common.active'), 'inactive' => Lang::get('common.inactive'), 'inactive' => Lang::get('common.inactive'));\n\n\t\t$this->featured_sellers_service->setFeaturedSellersFilterArr();\n\t\t$this->featured_sellers_service->setFeaturedSellersSrchArr(Input::All());\n\n\t\t$q = $this->featured_sellers_service->buildFeaturedSellersQuery();\n\n\t\t$page \t\t= (Input::has('page')) ? Input::get('page') : 1;\n\t\t$start \t\t= (Input::has('start')) ? Input::get('start') : Config::get('featuredsellers::featuredsellers.featured_sellers_list_per_row');\n\t\t$perPage\t= Config::get('featuredsellers::featuredsellers.featured_sellers_list_per_row');\n\t\t$user_list \t= $q->paginate($perPage);\n\n\t\t///Get all group details\n\t\t$group_details = array();\n\t\t$groups = \\Sentry::findAllGroups();\n\t\tif(count($groups) > 0) {\n\t\t\tforeach($groups as $key => $values) {\n\t\t\t\t$group_details[$values->id] = $values->name;\n\t\t\t}\n\t\t}\n\n\t\t//$this->header->setMetaTitle(trans('meta.admin_manage_shops_title'));\n\t\treturn View::make('featuredsellers::admin.featuredSellers', compact('d_arr', 'user_list', 'shop_action', 'is_shop_owner', 'is_allowed_to_add_product', 'status', 'shop_status'));\n\t}", "public function favorites()\n {\n return $this->belongsToMany(Product::class, 'favorites');\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function getproductlistofseller($sellerid) {\t\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required')); \t\n\t\t}\n\t\telse{\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t \n\t\t//Select Data from table\n\t\t//$sql3 = \"Select * FROM marketplace_product where seller_id=$sellerid\";\n\t\t$sql3 = \"Select * FROM marketplace_product a, catalog_product_entity b \n\t\twhere \n\t\ta.mageproduct_id=b.entity_id and \n\t\ta.seller_id=$sellerid and \n\t\tb.type_id!='customProductType' \";\n\t\t$result3 = $connection->fetchAll($sql3);\n\t\t$result4='';\n\t\t\n\t\tforeach($result3 as $data)\n\t\t{\n\t\t\t \n\t\t\t $productId =$data['mageproduct_id'];\n\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$offfer_tag = $currentproduct->getData('offfer_tag');\n\t\t\t\t\t$attr = $currentproduct->getResource()->getAttribute('offfer_tag');\n\t\t\t\t\t\n\t\t\t\t\t $optionText =$attr->getSource()->getOptionText($offfer_tag);\n\t\t\t\n\t\t\t\tif($optionText=='')\n\t\t\t\t{\n\t\t\t\t\t$optionText='null';\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t $_price=$currentproduct->getPrice();\n\t\t\t\t $_finalPrice=$currentproduct->getFinalPrice();\n\t\t\t\t\t $savetag='null';\n\t\t\t\t\t\tif($_finalPrice < $_price):\n\t\t\t\t\t\t$_savePercent = 100 - round(($_finalPrice / $_price)*100);\n\t\t\t\t\t\t//echo $_savePercent;\n\t\t\t\t\t\t$savetag=$_savePercent;\n endif;\n\n\t\t\t\t $producturl=$currentproduct->getProductUrl();\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $sql_wishlist = \"Select * FROM wishlist a ,wishlist_item b where a.customer_id=$sellerid and a.wishlist_id=b.wishlist_id and b.product_id=$productId \";\n\t\t $result_wishlist = $connection->fetchAll($sql_wishlist);\n\t\t\t\t /* $wish='';\n\t\t\t\t if(!empty($result_wishlist))\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>1); \n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>0);\n\t\t\t\t } */\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $reviewFactory = $objectManager->create('Magento\\Review\\Model\\Review');\n\t\t\t\t $storeId = $this->storeManager->getStore()->getId();\n $reviewFactory->getEntitySummary($currentproduct, $storeId);\n\t\t\t\t $ratingSummary = $currentproduct->getRatingSummary()->getRatingSummary();\n\t\t\t\t if($ratingSummary=='')\n\t\t\t\t{\n\t\t\t\t\t$ratingSummary='null';\n\t\t\t\t}\n\t\t\t\t //print_r($ratingSummary);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"description\"=>$currentproduct->getDescription(),\"price\"=>$currentproduct->getPrice(),\"finalPrice\"=>$currentproduct->getFinalPrice(),\"thumbnail\"=>'http://159.203.151.92/pub/media/catalog/product'.$currentproduct->getthumbnail(),\"offferTag\"=>array(\"shareurl\"=>$producturl,\"Tag\"=>$optionText,'discount'=>$savetag,'rating'=>$ratingSummary));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t \n\t\t} \n\t\t\n\t\treturn $result4;\n\t\t\n }\n\t }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function ingredientSuppliers(){\n return $this->hasMany(SupplierStock::class);\n }", "public function getservicelistofseller($sellerid) {\t\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required')); \t\n\t\t}\n\t\telse{\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t \n\t\t//Select Data from table\n\t\t//$sql3 = \"Select * FROM marketplace_product where seller_id=$sellerid\";\n\t\t$sql3 = \"Select * FROM marketplace_product a, catalog_product_entity b \n\t\twhere \n\t\ta.mageproduct_id=b.entity_id and \n\t\ta.seller_id=$sellerid and \n\t\tb.type_id='customProductType' \";\n\t\t$result3 = $connection->fetchAll($sql3);\n\t\t$result4='';\n\t\t\n\t\tforeach($result3 as $data)\n\t\t{\n\t\t\t \n\t\t\t $productId =$data['mageproduct_id'];\n\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$offfer_tag = $currentproduct->getData('offfer_tag');\n\t\t\t\t\t$attr = $currentproduct->getResource()->getAttribute('offfer_tag');\n\t\t\t\t\t\n\t\t\t\t\t $optionText =$attr->getSource()->getOptionText($offfer_tag);\n\t\t\t\n\t\t\t\tif($optionText=='')\n\t\t\t\t{\n\t\t\t\t\t$optionText='null';\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t $_price=$currentproduct->getPrice();\n\t\t\t\t $_finalPrice=$currentproduct->getFinalPrice();\n\t\t\t\t\t $savetag='null';\n\t\t\t\t\t\tif($_finalPrice < $_price):\n\t\t\t\t\t\t$_savePercent = 100 - round(($_finalPrice / $_price)*100);\n\t\t\t\t\t\t//echo $_savePercent;\n\t\t\t\t\t\t$savetag=$_savePercent;\n endif;\n\n\t\t\t\t $producturl=$currentproduct->getProductUrl();\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $sql_wishlist = \"Select * FROM wishlist a ,wishlist_item b where a.customer_id=$sellerid and a.wishlist_id=b.wishlist_id and b.product_id=$productId \";\n\t\t $result_wishlist = $connection->fetchAll($sql_wishlist);\n\t\t\t\t /* $wish='';\n\t\t\t\t if(!empty($result_wishlist))\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>1); \n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>0);\n\t\t\t\t } */\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $reviewFactory = $objectManager->create('Magento\\Review\\Model\\Review');\n\t\t\t\t $storeId = $this->storeManager->getStore()->getId();\n $reviewFactory->getEntitySummary($currentproduct, $storeId);\n\t\t\t\t $ratingSummary = $currentproduct->getRatingSummary()->getRatingSummary();\n\t\t\t\t if($ratingSummary=='')\n\t\t\t\t{\n\t\t\t\t\t$ratingSummary='null';\n\t\t\t\t}\n\t\t\t\t //print_r($ratingSummary);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"description\"=>$currentproduct->getDescription(),\"price\"=>$currentproduct->getPrice(),\"finalPrice\"=>$currentproduct->getFinalPrice(),\"thumbnail\"=>'http://159.203.151.92/pub/media/catalog/product'.$currentproduct->getthumbnail(),\"offferTag\"=>array(\"shareurl\"=>$producturl,\"Tag\"=>$optionText,'discount'=>$savetag,'rating'=>$ratingSummary));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t \n\t\t} \n\t\t\n\t\treturn $result4;\n\t\t\n }\n\t }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function products()\n {\n return $this->hasMany('App\\ProductLocation', 'productLocation', 'id');\n }", "function productList() {\n\t$categoryIds = array_merge ( [ \n\t\t\t$this->id \n\t], $this->subcategoryIds () );\n\tprint_r ( $categoryIds );\n\t// Find all products that match the retrieved category IDs\n\treturn Product::whereIn ( 'cate_id', $categoryIds )->get ();\n}", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }", "public function getFeaturedbrand(){\n\t\t \n\t\t $collections = Mage::getModel('brand/brand')->getCollection()\n\t\t\t\t\t\t->addFieldToFilter('is_feature',1);\n\t\t\t\t\n\t\treturn $collections;\n\t }", "public function getFeaturedProducts(): Collection\n\t{\n\t\treturn $this->db->filter(fn (Product $product) => $product->isFeatured);\n\t}", "public function productClicks()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductClick','sp_id','sp_id');\n }", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function wishlist_products()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'company_id');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function products()\n {\n return $this->hasMany('App\\Product', 'restaurant_id');\n }", "public function products()\n {\n return $this->morphedByMany('App\\Models\\Product', 'taggable');\n }", "public function products()\n {\n return $this->belongsToMany('App\\models\\Product', 'product_variants');\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function skus()\n {\n return $this->hasMany('App\\Models\\Sku');\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function getProductList(){\n\n $productModel = new ProductModel();\n $products = $productModel->getProductList();\n $this->JsonCall($products);\n }", "protected function getProducts()\r\n {\r\n $category = new Category((int)Configuration::get('FIELD_FEATUREDPSL_CAT'), (int)Context::getContext()->language->id);\r\n\r\n $searchProvider = new CategoryProductSearchProvider(\r\n $this->context->getTranslator(),\r\n $category\r\n );\r\n\r\n $context = new ProductSearchContext($this->context);\r\n\r\n $query = new ProductSearchQuery();\r\n\r\n $nProducts = (int)Configuration::get('FIELD_FEATUREDPSL_NBR');\r\n if ($nProducts < 0) {\r\n $nProducts = 12;\r\n }\r\n\r\n $query\r\n ->setResultsPerPage($nProducts)\r\n ->setPage(1)\r\n ;\r\n $query->setSortOrder(new SortOrder('product', 'position', 'asc'));\r\n $result = $searchProvider->runQuery(\r\n $context,\r\n $query\r\n );\r\n\r\n $assembler = new ProductAssembler($this->context);\r\n\r\n $presenterFactory = new ProductPresenterFactory($this->context);\r\n $presentationSettings = $presenterFactory->getPresentationSettings();\r\n $presenter = new ProductListingPresenter(\r\n new ImageRetriever(\r\n $this->context->link\r\n ),\r\n $this->context->link,\r\n new PriceFormatter(),\r\n new ProductColorsRetriever(),\r\n $this->context->getTranslator()\r\n );\r\n\r\n $products_for_template = [];\r\n\t\t$products_features=$result->getProducts();\r\n\t\tif(is_array($products_features)){\r\n\t\t\tforeach ($products_features as $rawProduct) {\r\n\t\t\t\t$products_for_template[] = $presenter->present(\r\n\t\t\t\t\t$presentationSettings,\r\n\t\t\t\t\t$assembler->assembleProduct($rawProduct),\r\n\t\t\t\t\t$this->context->language\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n return $products_for_template;\r\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product')->withPivot('feature_value');\n }", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function favorite()\n {\n return $this->hasMany(Favorite::class, 'product_id', 'id');\n }", "function save_features($product_id)\n\t{\n\t\t$features = $this->features_model->all_features();\n\t\t\n\t\tif($features->num_rows() > 0)\n\t\t{\n\t\t\t$feature = $features->result();\n\t\t\t\n\t\t\tforeach($feature as $feat)\n\t\t\t{\n\t\t\t\t$feature_id = $feat->feature_id;\n\t\t\t\t\n\t\t\t\tif(isset($_SESSION['name'.$feature_id]))\n\t\t\t\t{\n\t\t\t\t\t$total_features = count($_SESSION['name'.$feature_id]);\n\t\t\t\t\t\n\t\t\t\t\tif($total_features > 0)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tfor($r = 0; $r < $total_features; $r++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(isset($_SESSION['name'.$feature_id][$r]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$name = $_SESSION['name'.$feature_id][$r];\n\t\t\t\t\t\t\t\t$quantity = $_SESSION['quantity'.$feature_id][$r];\n\t\t\t\t\t\t\t\t$price = $_SESSION['price'.$feature_id][$r];\n\t\t\t\t\t\t\t\t$image = $_SESSION['image'.$feature_id][$r];\n\t\t\t\t\t\t\t\t$thumb = $_SESSION['thumb'.$feature_id][$r];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t\t\t'feature_id'=>$feature_id,\n\t\t\t\t\t\t\t\t\t\t'product_id'=>$product_id,\n\t\t\t\t\t\t\t\t\t\t'feature_value'=>$name,\n\t\t\t\t\t\t\t\t\t\t'quantity'=>$quantity,\n\t\t\t\t\t\t\t\t\t\t'price'=>$price,\n\t\t\t\t\t\t\t\t\t\t'image'=>$image,\n\t\t\t\t\t\t\t\t\t\t'thumb'=>$thumb\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->db->insert('product_feature', $data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsession_unset();\n\t\treturn TRUE;\n\t}", "private function initialiseProductListCollection()\n {\n $numberOfProductsToShow = $this->helper->getNumberOfProductsToShow();\n if ($numberOfProductsToShow) {\n $this->productCollection\n ->addAttributeToSelect('*')\n ->addAttributeToFilter(InstallData::PRODUCT_LIST_ATTRIBUTE, 1)\n ->setPageSize($numberOfProductsToShow)\n ->load();\n } else {\n $this->productCollection\n ->addFieldToFilter('entity_id', 0)\n ->load();\n }\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function features()\n {\n// ->join('plans', 'plans.id', '=', 'subscriptions.stripe_plan')\n// ->join('feature_plan', 'feature_plan.plan_id', '=', 'plans.id')\n// ->join('features', 'features.id', '=', 'feature_plan.feature_id')\n// ->where('users.id', '=', $this->id)\n// ->get();\n if ($this->sub) {\n return $this->sub->plan->features;\n }\n return null;\n }", "public function wishlist()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\Wishlist','spsd_id','spsd_id');\n }", "public function SPShippings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPShipping','sp_id','sp_id');\n }", "protected function forProductsFeatures($router)\n\t{\n\t\t$router->resource('features', 'Features\\FeaturesController');\n\t}", "public function products(): MorphToMany;", "public function setFeatures($features): self\n {\n return $this->setParameter('features', $features);\n }", "public function getProductOffers($productId);", "public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'user_id');\n }", "protected function _getProductCollection()\n {\n $collection = parent::_getProductCollection();\n\t\t$helper = Mage::helper('catalogMembersonly/productsFilter');\n\t\t$collection = $helper->filterProductCollection($collection);\n\n return $collection;\t\t\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function display_product_list(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$this->data['heading'] = 'Selling Product List';\r\n\t\t\t$this->data['productList'] = $this->product_model->view_product_details(' where u.group=\"Seller\" and u.status=\"Active\" or p.user_id=0 order by p.created desc');\r\n\t\t\t$this->load->view('admin/product/display_product_list',$this->data);\r\n\t\t}\r\n\t}", "public function products()\n {\n return $this->hasMany(Product::class, 'state_id', 'id');\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function get_featured_products()\n\t{\n\t\t$this->db->select('product.*, category.category_name, brand.brand_name')->from('product, category, brand')->where(\"product.product_status = 1 AND product.category_id = category.category_id AND product.brand_id = brand.brand_id AND product.featured = 1 AND product.product_balance > 0\")->order_by(\"created\", 'DESC');\n\t\t$query = $this->db->get('',8);\n\t\t\n\t\treturn $query;\n\t}", "public function swc_best_sellers_product_args( $args ) {\n\t\t$title \t\t\t\t\t= get_theme_mod( 'swc_homepage_best_sellers_products_title', __( 'On sale Products', 'storefront-woocommerce-customiser' ) );\n\t\t$columns \t\t\t\t= get_theme_mod( 'swc_homepage_best_sellers_products_columns', '4' );\n\t\t$limit \t\t\t\t\t= get_theme_mod( 'swc_homepage_best_sellers_products_limit', '4' );\n\n\t\t$args['title']\t\t\t= $title;\n\t\t$args['columns'] \t\t= $columns;\n\t\t$args['limit'] \t\t\t= $limit;\n\n\t\treturn $args;\n\t}", "public function predefinedWholesaleQuantities()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\PredefinedWholesaleQuantity','sp_id','sp_id');\n }", "public function getProducts()\n {\n return $this->hasMany(Product::className(), ['uomId' => 'uomId']);\n }", "public function getAllProductLists(): ProductListCollectionTransfer;", "public function getNewProdLists()\n\t\t{\n\t\t\t$newLists=\\DB::table('products')\n\t\t\t\n\t\t\t->join('prod_groups','prod_groups.Group_ID','=','products.Group_ID')\n\t\t\t->join('prod_segment', 'prod_segment.Seg_ID','=','prod_groups.Seg_ID')\n\t\t\t->select('products.Prod_ID','products.Prod_Name','prod_groups.Seg_ID', 'prod_segment.Seg_Name', 'products.UnitofMeasure')\n\t\t\t->where('products.RateStatus','1')\n\t\t\t->get();\n\t\t\t\n\t\t\t$newProdResp=array($newLists);\n\t\t\treturn $newProdResp;\n\t\t}", "function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }", "public function product_galleries() {\n return $this->hasMany(ProductGallery::class, 'product_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function sellerStockHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\SellerStockHistory','spsd_id','spsd_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function getFilterProducts()\n {\n return $this->filterProducts;\n }" ]
[ "0.6805389", "0.594594", "0.57588005", "0.5727211", "0.5680217", "0.56647533", "0.5539746", "0.5460278", "0.5441034", "0.5413192", "0.54101145", "0.5404321", "0.53708506", "0.53683335", "0.53675747", "0.5358915", "0.5355847", "0.534663", "0.5318546", "0.5306623", "0.52630097", "0.5253466", "0.52254176", "0.5213082", "0.52088106", "0.5164333", "0.51337904", "0.5126934", "0.511437", "0.5102465", "0.510201", "0.5074679", "0.50679135", "0.5062903", "0.5048764", "0.5041137", "0.5016755", "0.5015097", "0.5005618", "0.49976128", "0.499391", "0.49904266", "0.4986564", "0.49601606", "0.49559024", "0.49486712", "0.49486712", "0.49486712", "0.49486712", "0.49429697", "0.49419647", "0.49416924", "0.49395785", "0.49359202", "0.49356076", "0.49316263", "0.49288628", "0.4924262", "0.49202603", "0.49152124", "0.49127647", "0.4908154", "0.49047455", "0.48964563", "0.48946348", "0.48924735", "0.48846963", "0.4881867", "0.4878972", "0.48722345", "0.48593", "0.4858543", "0.4848283", "0.4848283", "0.4843218", "0.4843218", "0.4843218", "0.4843218", "0.4843218", "0.4843218", "0.4843218", "0.4842413", "0.48374242", "0.48281857", "0.48238036", "0.48236132", "0.48232538", "0.48224023", "0.48222595", "0.48137304", "0.48049995", "0.48042563", "0.48041835", "0.48041835", "0.48041835", "0.48041835", "0.48041835", "0.48041835", "0.48041835", "0.48006" ]
0.7415108
0
SellerProduct has many SPShippings.
public function SPShippings() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\SPShipping','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function sellerStock()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\SellerStock','sp_id','sp_id');\n }", "public function order_shipping()\n {\n return $this->hasMany('App\\Models\\Sales\\SalesShipping', 'sales_order_id', 'id');\n }", "public function SPOPtionRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany(SPOPtionRelation::class,'sp_id','sp_id');\n }", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function shoppingCarts()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ShoppingCart','sp_id','sp_id');\n }", "public function ship()\n {\n return $this->belongsTo('Tradewars\\Ship', 'ship_id');\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function productClicks()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductClick','sp_id','sp_id');\n }", "public function ingredientSuppliers(){\n return $this->hasMany(SupplierStock::class);\n }", "public function shippingMethod()\n {\n return $this->belongsTo('App\\ShippingMethod');\n }", "public function SPPaymentRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPPaymentRelation','sp_id','sp_id');\n }", "public function offers()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n \treturn $this->hasMany('App\\Offer','sp_id','sp_id');\n }", "public function sponsorships()\n {\n return $this->hasMany('App\\Sponsorship');\n }", "public function sharings() {\n return $this->hasMany('Rockit\\Models\\Sharing');\n }", "public function sellerStock()\n {\n \t// belongsTo(RelatedModel, foreignKey = ss_id, keyOnRelatedModel = ss_id)\n \treturn $this->belongsTo('App\\SellerStock','ss_id','ss_id');\n }", "public function sellerStockHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\SellerStockHistory','spsd_id','spsd_id');\n }", "public function shippingMethod()\n {\n return $this->belongsTo(ShippingMethod::class);\n }", "public function shops()\n {\n return $this->hasMany(Shop::class);\n }", "public function shippingMethod()\n {\n return $this->belongsTo('ShippingMethod');\n }", "function getShippingChoicesList() {\n\t\tApp::import('Model', 'CartsProduct');\n\t\t$this->CartsProduct = &new CartsProduct;\n\t\t$cart_stats = $this->CartsProduct->getStats($this->CartsProduct->Cart->get_id());\n\n\t\t// pokud nesplnuju podminky pro dopravy doporucenym psanim, zakazu si tyto zpusoby dopravy vykreslit zakaznikovi\n\t\t$conditions = array();\n\t\tif (!$this->isRecommendedLetterPossible()) {\n\t\t\t$conditions = array('Shipping.id NOT IN (' . implode(',', $this->Shipping->getRecommendedLetterShippingIds()) . ')');\n\t\t}\n\n\t\t$shipping_choices = $this->Shipping->find('all', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('id', 'name', 'price', 'free'),\n\t\t\t'order' => array('Shipping.order' => 'asc')\n\t\t));\n\t\t\n\t\t// pokud mam v kosiku produkty, definovane v Cart->free_shipping_products v dostatecnem mnozstvi, je doprava zdarma\n\t\tApp::import('Model', 'Cart');\n\t\t$this->Cart = &new Cart;\n\t\tif ($this->Cart->isFreeShipping()) {\n\t\t\t// udelam to tak, ze nastavim hodnotu kosiku na strasne moc a tim padem budu mit v kosiku vzdycky vic, nez je\n\t\t\t// minimalni hodnota kosiku pro dopravu zdarma\n\t\t\t$cart_stats['total_price'] = 99999;\n\t\t}\n\n\t\t// v selectu chci mit, kolik stoji doprava\n\t\tforeach ($shipping_choices as $shipping_choice) {\n\t\t\t$shipping_item = $shipping_choice['Shipping']['name'] . ' - ' . $shipping_choice['Shipping']['price'] . ' Kč';\n\t\t\tif ($cart_stats['total_price'] > $shipping_choice['Shipping']['free']) {\n\t\t\t\t$shipping_item = $shipping_choice['Shipping']['name'] . ' - zdarma';\n\t\t\t}\n\t\t\t$shipping_choices_list[$shipping_choice['Shipping']['id']] = $shipping_item;\n\t\t}\n\t\t\n\t\treturn $shipping_choices_list;\n\t}", "public function getSellerShipping() {\r\n return Mage::getResourceModel ( 'eav/entity_attribute' )->getIdByCode ( 'catalog_product', 'seller_shipping_option' );\r\n }", "public function seller()\n {\n return $this->belongsTo(SellerProxy::modelClass(), 'seller_id');\n }", "public function spendings(): HasMany\n {\n return $this->hasMany(Spending::class);\n }", "public function bills()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\Bill','spsd_id','spsd_id');\n }", "public function shippingMethod()\n {\n return $this->belongsTo('App\\Models\\ShippingMethod', 'shipping_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\ProductLocation', 'productLocation', 'id');\n }", "public function productOptions()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductOption','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function swps() {\n return $this->hasMany(Swp::class);\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function updateProductShipp(Request $request)\n {\n $carts = Cart::where('user_id',auth()->user()->id?? '')->get();\n foreach ($carts as $key => $cart) {\n if ($cart->product_id) {\n $data = Product::where('id',$cart->product_id)->update([\n 'shipp_des'=>$request->val\n ]);\n }\n if ($cart->vendor_product_id) {\n $data = VendorProduct::where('id',$cart->vendor_product_id)->update([\n 'shipp_des'=>$request->val\n ]);\n }\n\n\n }\n\n return response()->json([\n 'msg'=>'success'\n ]);\n }", "public function soldBooks()\n {\n return $this->hasManyThrough(Order::class, Book::class, 'user_id', 'book_id', 'id');\n }", "public function spots()\n {\n return $this->belongsToMany(Spot::class);\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function wishlist()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\Wishlist','spsd_id','spsd_id');\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = from_seller_id, keyOnRelatedModel = seller_id)\n \treturn $this->belongsTo('App\\Seller','from_seller_id','seller_id');\n }", "public function wishlists()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\Wishlists','sp_id','sp_id');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function initializeShippings()\r\n {\r\n // check if there is orders without register of new order\r\n $sql = 'SELECT o.`id_order` '\r\n . 'FROM `' . _DB_PREFIX_ . 'orders` o '\r\n . 'LEFT JOIN `' . _DB_PREFIX_ . 'carrier` c ON c.`id_carrier` = o.`id_carrier` '\r\n . 'LEFT OUTER JOIN `' . _DB_PREFIX_ . 'tipsa_envios` tp ON tp.`id_envio_order` = o.`id_order` '\r\n . 'WHERE c.`external_module_name` = \"tipsacarrier\" AND tp.`id_envio_order` is NULL';\r\n $shippings = Db::getInstance()->executeS($sql);\r\n\r\n foreach ($shippings as $shipping) {\r\n Db::getInstance()->execute(\r\n 'INSERT INTO `' . _DB_PREFIX_ . 'tipsa_envios` (`id_envio_order`,`codigo_envio`,`url_track`,`num_albaran`) '\r\n . 'VALUES (\"' . $shipping['id_order'] . '\",\"\",\"\",\"\")'\r\n );\r\n }\r\n }", "public function SPFeatureLists()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPFeatureList','sp_id','sp_id');\n }", "public function setShippable($shippable)\n {\n $this->shippable = $shippable;\n\n return $this;\n }", "public function getSorders()\n {\n return $this->hasMany(Sorder::className(), ['currency_id' => 'currency_id']);\n }", "public function predefinedWholesaleQuantities()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\PredefinedWholesaleQuantity','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function getShippable()\n {\n return $this->shippable;\n }", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = seller_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Seller','seller_id','seller_id');\n }", "public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'company_id');\n }", "public function destinationPrices()\n {\n return $this->hasMany('App\\Price', 'destination_country_id');\n }", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function sellerSales()\n {\n return $this->hasMany('App\\Domains\\Sale\\Sale');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function supplies(){\n return $this->hasMany('CValenzuela\\Supply');\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function show(Shipper $shipper)\n {\n //\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function skis()\n {\n return $this->hasMany('App\\Models\\Ski', 'personnel_no', 'personnel_no');\n }", "public function warehouses(): HasManyThrough\n\t{\n\t\treturn $this->hasManyThrough('Ronmrcdo\\Inventory\\Models\\InventoryStock', 'Ronmrcdo\\Inventory\\Models\\ProductSku')->with('warehouse');\n\t}", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'user_id');\n }", "public function skus()\n {\n return $this->hasMany('App\\Models\\Sku');\n }", "public function originPrices()\n {\n return $this->hasMany('App\\Price', 'origin_country_id');\n }", "public function autoProductDivision()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\AutoProductDivision','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany(Product::class, 'state_id', 'id');\n }", "public function supplies()\n {\n return $this->hasMany(Supply::class);\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function shipping(): BelongsTo\n {\n return $this->belongsTo(Shipping::class)->withDefault(function($shipping){\n $shipping->sameAsBilling($this->user->customer);\n });\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function shippingaddress()\n {\n return $this->belongsTo('App\\Models\\BookAddress','shipping_address_id');\n }", "public function orders_products(){\n return $this->hasMany(Order_product::class);\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }", "public function getPrice(){\n return $this->hasMany(Inventory::class, 'product_id','id');\n}", "public function wishlist_products()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function isShipping()\n {\n return $this->product->isShipping();\n }", "public function getBookings()\n {\n return $this->hasMany(Booking::className(), ['id_sotrudnik' => 'id_sotrudnik']);\n }", "public function product_supply(){ return $this->hasMany(ProductSupply::class,'vehicle_id'); }", "public function getShippingAddresses()\n {\n return $this->morphMany(Address::class, 'addressable', ['type' => Address::TYPE_SHIPPING]);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }" ]
[ "0.6748908", "0.66820747", "0.61754847", "0.61055756", "0.61038196", "0.6031154", "0.5994232", "0.598643", "0.58941364", "0.5851768", "0.5793844", "0.57406825", "0.5710332", "0.56711763", "0.56683743", "0.56298554", "0.5629117", "0.56046665", "0.56046206", "0.5561337", "0.5512642", "0.548428", "0.54798174", "0.5441897", "0.543253", "0.5425119", "0.542318", "0.54187715", "0.54166836", "0.5390689", "0.5390079", "0.5382535", "0.537463", "0.5365923", "0.53610784", "0.53564537", "0.5347346", "0.5340125", "0.5337683", "0.5316075", "0.530883", "0.53020656", "0.5298318", "0.5278989", "0.5277285", "0.52667385", "0.5261073", "0.5248078", "0.52401835", "0.52279675", "0.522783", "0.5215044", "0.5206342", "0.5202257", "0.5198609", "0.51980156", "0.5195101", "0.5190165", "0.5188515", "0.51880306", "0.51863426", "0.51841736", "0.51822954", "0.51803446", "0.5177962", "0.5171165", "0.51680315", "0.51620704", "0.51500505", "0.51415914", "0.5122902", "0.5114471", "0.5113156", "0.51130915", "0.51125264", "0.51062006", "0.50987583", "0.5097462", "0.5091254", "0.508757", "0.50867695", "0.50838345", "0.5081732", "0.50817275", "0.5077571", "0.5074996", "0.5070103", "0.5068366", "0.5059263", "0.50575763", "0.50541943", "0.50539124", "0.50539124", "0.50531965", "0.50531965", "0.50531965", "0.50531965", "0.50531965", "0.50531965", "0.50531965" ]
0.78254163
0
SellerProduct has many Wishlists.
public function wishlists() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany('App\Wishlists','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function wishLists()\n {\n return $this->hasMany(WishList::class);\n }", "public function wishlist()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\Wishlist','spsd_id','spsd_id');\n }", "public function wishlist()\n {\n return $this->hasMany('App\\Wishlist', 'user_id');\n }", "public function wishlist_products()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function wishListUsers()\n {\n return $this->belongsToMany(User::class, 'wish_lists', 'product_id', 'user_id');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function all() {\n $wishList = WishList::with([\"product\",\"user:id,name\"])->get();\n return $wishList;\n }", "function setWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products == null or $products == \"\") {\n $wishlist->setProductIds($productId);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productId);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n\n return new Response('wishlist saved');\n }", "protected function addWishListMethod($obProductList)\n {\n $obProductList->addDynamicMethod('wishList', function () use ($obProductList) {\n /** @var WishListHelper $obWishListHelper */\n $obWishListHelper = app(WishListHelper::class);\n\n $arProductIDList = $obWishListHelper->getList();\n\n return $obProductList->intersect($arProductIDList);\n });\n }", "public function actionAddProductToWishlist()\n {\n // set wishlistId variable from params\n $productId = craft()->request->getRequiredParam('productId');\n $wishlistId = craft()->request->getRequiredParam('wishlistId');\n $redirectUrl = craft()->request->getRequiredParam('redirect');\n\n // Create a new wishlist with above title\n craft()->wishlist->addProductToWishlist($productId, $wishlistId);\n\n // Set Flash message\n craft()->userSession->setFlash('addProductToWishlistSuccess', 'Product has been added to wishlist!');\n\n // Redirect to plugin index page\n $this->redirect($redirectUrl);\n }", "public function getLikesByProductId($sellerId,$productId);", "public function getWishlist()\n {\n// 'cust_id' => 'required',\n// ]);\n//\n// if ($validator->fails()) {\n// return response()->json(array('status' => false, 'message' => $validator->messages()), 500);\n// }\n try{\n\n $wishlist = Wishlist::where('user_id','=',auth('api')->user()->id)->get()->pluck('prod_id');\n\n\n if(count($wishlist) > 0){\n $products = array();\n $i = 0;\n $pro = Product::whereIn('id',$wishlist)->get();\n\n foreach ($pro as $prod) {\n\n $prodBrand = Brand::where('id', '=', $prod->brand)->first();\n\n $products[$i] = $prod;\n $prod->color = $prod->color()->pluck('colour')->implode('colour');\n $prod->size = $prod->size()->pluck('size')->implode('size');\n $prod->image = $prod->image()->pluck('image');\n\n if ($prodBrand == null) {\n $products[$i]['brand'] = \"No Brand\";\n } else {\n $products[$i]['brand'] = $prodBrand->name;\n }\n\n\n $i++;\n\n }\n return response()->json(array('status' => true,'wishlist' => $products), 200);\n }else{\n return response()->json(array('status' => false,'message' => 'no wishlist found.'), 200);\n }\n }catch (\\Exception $e){\n return response()->json(array('error'=>'something went wrong','message'=> $e->getMessage()));\n }\n\n\n }", "public function get($id) {\n $wishList = WishList::where(\"users_id\",$id)->with(\"product\")->get();\n return $wishList;\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'prod_id' => 'required',\n ]);\n\n if ($validator->fails()) {\n return response()->json(array('status' => false, 'message' => $validator->messages()), 500);\n }\n if(!Wishlist::where('user_id',auth('api')->user()->id)->where('prod_id',$request->prod_id)->exists()){\n $wishlist = new Wishlist();\n $wishlist->user_id = auth('api')->user()->id;\n $wishlist->prod_id = $request->prod_id;\n $wishlist->save();\n $userWishlist = Wishlist::where('user_id','=',auth('api')->user()->id)->get()->pluck('prod_id');\n\n $products = array();\n $i = 0;\n $pro = Product::whereIn('id',$userWishlist)->get();\n\n foreach ($pro as $prod) {\n\n $prodBrand = Brand::where('id', '=', $prod->brand)->first();\n\n $products[$i] = $prod;\n $prod->color = $prod->color()->pluck('colour')->implode('colour');\n $prod->size = $prod->size()->pluck('size')->implode('size');\n $prod->image = $prod->image()->pluck('image');\n\n if ($prodBrand == null) {\n $products[$i]['brand'] = \"No Brand\";\n } else {\n $products[$i]['brand'] = $prodBrand->name;\n }\n\n\n $i++;\n\n }\n $userWishlist = $products;\n\n }else{\n $wish = Wishlist::where('user_id',auth('api')->user()->id)->where('prod_id',$request->prod_id)->first();\n Wishlist::find($wish->id)->delete();\n if(count(Wishlist::where('user_id','=',auth('api')->user()->id)->get()) > 0){\n $userWishlist= Wishlist::where('user_id','=',auth('api')->user()->id)->get()->pluck('prod_id');\n\n $products = array();\n $i = 0;\n $pro = Product::whereIn('id',$userWishlist)->get();\n\n foreach ($pro as $prod) {\n\n $prodBrand = Brand::where('id', '=', $prod->brand)->first();\n\n $products[$i] = $prod;\n $prod->color = $prod->color()->pluck('colour')->implode('colour');\n $prod->size = $prod->size()->pluck('size')->implode('size');\n $prod->image = $prod->image()->pluck('image');\n\n if ($prodBrand == null) {\n $products[$i]['brand'] = \"No Brand\";\n } else {\n $products[$i]['brand'] = $prodBrand->name;\n }\n\n\n $i++;\n\n }\n $userWishlist = $products;\n\n }else{\n $userWishlist= 'Your Wishlist is empty!';\n }\n }\n\n\n\n return response()->json(array('status' => true,'message' => 'wishlist saved.','records'=>$userWishlist), 200);\n }", "public function wishlistAdd($requestParams,$wishlist,$productId){\n $response = array();\n if (! $productId) {\n /**\n * Set product not fount error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Product Not Found' );\n } else {\n /**\n * Get product collection\n * @var $product\n */\n $product = Mage::getModel ( 'catalog/product' )->load ( $productId );\n if (! $product->getId () || ! $product->isVisibleInCatalog ()) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Cannot specify product.' );\n } else {\n try {\n /**\n * Get parameters.\n */\n $buyRequest = new Varien_Object ( $requestParams );\n /**\n * Whislist add new product.\n */\n $result = $wishlist->addNewItem ( $product, $buyRequest );\n if (is_string ( $result )) {\n Mage::throwException ( $result );\n }\n $wishlist->save ();\n Mage::dispatchEvent ( 'wishlist_add_product', array (\n 'wishlist' => $wishlist,\n 'product' => $product,\n 'item' => $result\n ) );\n /**\n * Set success message.\n */\n Mage::helper ( 'wishlist' )->calculate ();\n $message = $product->getName ().' has been added to your wishlist.';\n $response ['status'] = 'SUCCESS';\n $response ['message'] = $message;\n /**\n * Unset registry.\n */\n Mage::unregister ( 'wishlist' );\n return $response;\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'An error occurred while adding item to wishlist: %s', $e->getMessage () );\n return $response;\n }\n }\n }\n }", "function removeWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n $wishlistExploded = explode(',', $wishlist->getProductIds());\n $productIds = [];\n foreach ($wishlistExploded as $product) {\n if($product !== $productId) {\n $productIds[] = $product;\n }\n }\n $wishlistImploded = implode(',', $productIds);\n $wishlist->setProductIds($wishlistImploded);\n $em->flush();\n\n return new Response('product removed from the wishlist');\n }", "public function warehouse()\n {\n return $this->belongsToMany('App\\Warehouse', 'product_has_warehouse', 'product_id', 'warehouse_id');\n }", "public function showWishList(){\n $i = 1;\n $books = Book::join('book_library', 'book_library.book_id', '=', 'books.id')\n ->join('libraries', 'book_library.library_id', '=', 'libraries.id')\n ->where('libraries.user_id', '=', Auth::user()->id)\n ->where('do', '=', 0)\n ->select('books.*')\n ->get();\n return view('library.showWishList', ['books' => $books, 'i' => $i]);\n }", "public function actionRemoveProductFromWishlist()\n {\n // set wishlistId variable from params\n $wishlistId = craft()->request->getRequiredParam('wishlistId');\n $productId = craft()->request->getRequiredParam('productId');\n $redirectUrl = craft()->request->getRequiredParam('redirect');\n\n // Create a new wishlist with above title\n craft()->wishlist->removeProductFromWishlist($wishlistId, $productId);\n\n // Set Flash message\n craft()->userSession->setFlash('removeProductFromWishlistSuccess', 'Product has been removed from wishlist!');\n\n // Redirect to plugin index page\n $this->redirect($redirectUrl);\n }", "function get($user_id, $product_entity_id) {\n return $this->find('first', array(\n 'conditions' => array(\n 'Wishlist.user_id' => $user_id,\n 'Wishlist.product_entity_id' => $product_entity_id\n )\n ));\n }", "public function setMultipleWishlistId($id);", "public function setWishlistId(int $id);", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "protected function addToWishlist($product)\n\t{\n\t\treturn $this->wishlist->add([\n\t\t\t'id' => $product->id,\n\t\t\t'name' => $product->name,\n\t\t\t'price' => $product->price,\n\t\t\t'quantity' => 1,\n\t\t]);\n\t}", "public function wishlist(Request $request)\n\t{\n\t\t\n\n\t\t\t$maincategorys = Maincategory::all(); \n\t\t\t$wishlists = Wishlist::where('userid', $request->user()->id)->groupBy('productid')->get();\t\n\t\t\t\n\n\t\t\treturn view('pages.wishlist')\n\t\t\t->with('maincategorys', $maincategorys)\n\t\t\t->with('wishlists', $wishlists);\n\t\n\t}", "public function warehouses(): HasManyThrough\n\t{\n\t\treturn $this->hasManyThrough('Ronmrcdo\\Inventory\\Models\\InventoryStock', 'Ronmrcdo\\Inventory\\Models\\ProductSku')->with('warehouse');\n\t}", "public function getproductlistofseller($sellerid) {\t\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required')); \t\n\t\t}\n\t\telse{\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t \n\t\t//Select Data from table\n\t\t//$sql3 = \"Select * FROM marketplace_product where seller_id=$sellerid\";\n\t\t$sql3 = \"Select * FROM marketplace_product a, catalog_product_entity b \n\t\twhere \n\t\ta.mageproduct_id=b.entity_id and \n\t\ta.seller_id=$sellerid and \n\t\tb.type_id!='customProductType' \";\n\t\t$result3 = $connection->fetchAll($sql3);\n\t\t$result4='';\n\t\t\n\t\tforeach($result3 as $data)\n\t\t{\n\t\t\t \n\t\t\t $productId =$data['mageproduct_id'];\n\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$offfer_tag = $currentproduct->getData('offfer_tag');\n\t\t\t\t\t$attr = $currentproduct->getResource()->getAttribute('offfer_tag');\n\t\t\t\t\t\n\t\t\t\t\t $optionText =$attr->getSource()->getOptionText($offfer_tag);\n\t\t\t\n\t\t\t\tif($optionText=='')\n\t\t\t\t{\n\t\t\t\t\t$optionText='null';\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t $_price=$currentproduct->getPrice();\n\t\t\t\t $_finalPrice=$currentproduct->getFinalPrice();\n\t\t\t\t\t $savetag='null';\n\t\t\t\t\t\tif($_finalPrice < $_price):\n\t\t\t\t\t\t$_savePercent = 100 - round(($_finalPrice / $_price)*100);\n\t\t\t\t\t\t//echo $_savePercent;\n\t\t\t\t\t\t$savetag=$_savePercent;\n endif;\n\n\t\t\t\t $producturl=$currentproduct->getProductUrl();\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $sql_wishlist = \"Select * FROM wishlist a ,wishlist_item b where a.customer_id=$sellerid and a.wishlist_id=b.wishlist_id and b.product_id=$productId \";\n\t\t $result_wishlist = $connection->fetchAll($sql_wishlist);\n\t\t\t\t /* $wish='';\n\t\t\t\t if(!empty($result_wishlist))\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>1); \n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $wish=array(\"productId\"=>$productId,\"sellerid\"=>$sellerid,\"status\"=>0);\n\t\t\t\t } */\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t $reviewFactory = $objectManager->create('Magento\\Review\\Model\\Review');\n\t\t\t\t $storeId = $this->storeManager->getStore()->getId();\n $reviewFactory->getEntitySummary($currentproduct, $storeId);\n\t\t\t\t $ratingSummary = $currentproduct->getRatingSummary()->getRatingSummary();\n\t\t\t\t if($ratingSummary=='')\n\t\t\t\t{\n\t\t\t\t\t$ratingSummary='null';\n\t\t\t\t}\n\t\t\t\t //print_r($ratingSummary);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"description\"=>$currentproduct->getDescription(),\"price\"=>$currentproduct->getPrice(),\"finalPrice\"=>$currentproduct->getFinalPrice(),\"thumbnail\"=>'http://159.203.151.92/pub/media/catalog/product'.$currentproduct->getthumbnail(),\"offferTag\"=>array(\"shareurl\"=>$producturl,\"Tag\"=>$optionText,'discount'=>$savetag,'rating'=>$ratingSummary));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t \n\t\t} \n\t\t\n\t\treturn $result4;\n\t\t\n }\n\t }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function sellerWishList(Request $request){\n $wishes = Wish::all();\n return view('seller.wish-list', compact('wishes'));\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "public function buyerWishList(Request $request){\n $wishes = Wish::where('user_id', '=', $request->user()->id)->get();\n return view('buyer.wish-list', compact('wishes'));\n }", "function getWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n\n if ($wishlist) {\n $result = $wishlist->getProductIds();\n } else {\n $result = null;\n }\n\n return new Response($result);\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "public function wishlist_users()\n {\n return $this->belongsTo(User::class, 'user_id', 'id');\n }", "public function addWishlist($id){\n if (Auth::check()) {\n if (Wishlist::where('product_id',$id)->where('user_id',Auth::id())->exists()) {\n return response()->json([\n 'error' => \"This Product Already Add Wishlist\",\n ]);\n }\n else {\n Wishlist::insert([\n 'user_id' => Auth::id(),\n 'product_id' => $id,\n 'created_at' => Carbon::now()\n ]);\n return response()->json([\n 'success' => \"Add Wishlist Successfully\"\n ]);\n }\n }\n else {\n return response()->json([\n 'error' => \"Please Login First\"\n ]);\n }\n }", "public function createAction() {\r\n\r\n //SET LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //ONLY LOGGED IN USER CAN CREATE\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //CREATION PRIVACY\r\n if (!$this->_helper->requireAuth()->setAuthParams('sitestoreproduct_wishlist', null, \"create\")->isValid())\r\n return;\r\n\r\n //GET VIEWER INFORMATION\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $this->view->viewer_id = $viewer_id = $viewer->getIdentity();\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitestoreproduct_Form_Wishlist_Create();\r\n\r\n if (!$this->getRequest()->isPost() || !$form->isValid($this->getRequest()->getPost())) {\r\n return;\r\n }\r\n\r\n //GET WISHLIST TABLE\r\n $wishlistTable = Engine_Api::_()->getItemTable('sitestoreproduct_wishlist');\r\n $db = $wishlistTable->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n\r\n //GET FORM VALUES\r\n $values = $form->getValues();\r\n $values['owner_id'] = $viewer->getIdentity();\r\n\r\n //CREATE WISHLIST\r\n $wishlist = $wishlistTable->createRow();\r\n $wishlist->setFromArray($values);\r\n $wishlist->save();\r\n\r\n //PRIVACY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n\r\n if (empty($values['auth_view'])) {\r\n $values['auth_view'] = array('everyone');\r\n }\r\n $viewMax = array_search($values['auth_view'], $roles);\r\n\r\n $values['auth_comment'] = array('everyone');\r\n $commentMax = array_search($values['auth_comment'], $roles);\r\n\r\n foreach ($roles as $i => $role) {\r\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\r\n $auth->setAllowed($wishlist, $role, 'comment', ($i <= $commentMax));\r\n }\r\n\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollback();\r\n throw $e;\r\n }\r\n\r\n //GET URL\r\n $url = $this->_helper->url->url(array('wishlist_id' => $wishlist->wishlist_id, 'slug' => $wishlist->getSlug()), \"sitestoreproduct_wishlist_view\", true);\r\n\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'smoothboxClose' => 10,\r\n 'parentRedirect' => $url,\r\n 'parentRedirectTime' => 10,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your wishlist has been created successfully.'))\r\n ));\r\n }", "public function actionAddToWishlist($product_id, $user_id) {\n $saveArr['product_id'] = $product_id;\n $saveArr['user_id'] = $user_id;\n $saveArr['created_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_by'] = $user_id;\n $saveArr['status'] = '1';\n Yii::$app->db->createCommand()->insert('wishlist', $saveArr)->execute();\n exit;\n }", "public function store()\n {\n if (!auth()->user()->wishlistHas(request('productId'))) {\n auth()->user()->wishlist()->attach(request('productId'));\n }\n\n return response()->json([\n 'message' => trans('fleetcart_api::validation.wishlist_added')\n ], Response::HTTP_CREATED);\n }", "function getByUserID($user_id) {\n return $this->find('list', array(\n 'conditions' => array(\n 'Wishlist.user_id' => $user_id\n ),\n 'fields' => array(\n 'Wishlist.product_entity_id'\n )\n ));\n }", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "function removeProductFromWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productIdToDelete = $request->request->get('productId');\n $wishlist = $this->getMetafieldCustomer($customerId,'wishlist-products');\n $wishlistDecoded = json_decode($wishlist, true);\n $productIds = '';\n if(count($wishlistDecoded['metafields']) !== 0) {\n if($wishlistDecoded['metafields'][0]['value'] !== \"\") {\n if(strpos($wishlistDecoded['metafields'][0]['value'], ',') !== false) {\n $productIdTab = explode(',' , $wishlistDecoded['metafields'][0]['value']);\n foreach ($productIdTab as $value) {\n if((string) $productIdToDelete !== (string) $value) {\n if($productIds == '') {\n $productIds .= $value;\n } else {\n $productIds .= ',' . $value;\n }\n }\n }\n }\n\n if($productIds === '') {\n $productIds = \"null\";\n }\n\n $data = [\n \"metafield\" => [\n \"id\" => $wishlistDecoded['metafields'][0]['id'],\n \"value\" => '' . $productIds . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('PUT', shopifyApiurl . 'metafields/'.$wishlistDecoded['metafields'][0]['id'].'.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n }\n\n return new Response('wishlist saved');\n }", "public function registerWishlistChange(Varien_Event_Observer $observer)\n {\n if (Mage::helper('core')->isModuleEnabled('Enterprise_Wishlist') &&\n Mage::helper('enterprise_wishlist')->isMultipleEnabled()) {\n /** @var Mage_Wishlist_Model_Wishlist $wishlist */\n $wishlist = $observer->getEvent()->getObject();\n $wishlistId = $wishlist->getId();\n if ($wishlistId) {\n try {\n $websiteId = $this->getWishlistOwnerWebsiteId($wishlist);\n /** @var Oro_Api_Model_Wishlist_Status $wishlistStatus */\n $wishlistStatus = Mage::getModel('oro_api/wishlist_status')\n ->setWishlistId($wishlistId)\n ->setWebsiteId($websiteId)\n ->setDeletedAt(Mage::getSingleton('core/date')->gmtDate());\n $wishlistStatus->save();\n } catch (Exception $e) {\n Mage::log($e->getMessage());\n }\n }\n }\n\n return $this;\n }", "public function getWishlistId();", "public function setWishlistItemId(int $id);", "public function onMenuInitialize_SitegroupGutterWishlist($row) {\n\t\t\n\t\t//GET VIEWER DETAIL\n $viewer = Engine_Api::_()->user()->getViewer();\n\t\t$viewer_id = $viewer->getIdentity();\n\n\t\tif(empty($viewer_id)) {\n\t\t\treturn false;\n\t\t}\n\n $canView = Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitegroupwishlist_wishlist', 'view');\n\t\tif(empty($canView)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//RETURN FALSE IF SUBJECT IS NOT SET\n $subject = Engine_Api::_()->core()->getSubject();\n if ($subject->getType() !== 'sitegroup_group') {\n return false;\n }\n\n\t\t//SHOW ADD TO WISHLIST LINK IF SITEPAGWISHLIST MODULES IS ENABLED\n\t\t$sitegroupWishlistEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitegroupwishlist');\n if (!$viewer->getIdentity() || empty($sitegroupWishlistEnabled)) {\n return false;\n }\n\n return array(\n 'class' => 'icon_sitegroupwishlist_add buttonlink',\n 'route' => 'default',\n 'params' => array(\n 'module' => 'sitegroupwishlist',\n 'controller' => 'index',\n 'action' => 'add',\n 'group_id' => $subject->getIdentity(),\n ),\n );\n }", "public function soldBooks()\n {\n return $this->hasManyThrough(Order::class, Book::class, 'user_id', 'book_id', 'id');\n }", "public function hasWishlistItems()\n {\n return $this->getWishlistItemsCount() > 0;\n }", "public function editAction() {\r\n\r\n //SET LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //ONLY LOGGED IN USER CAN CREATE\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //GET WISHLIST ID AND CHECK VALIDATION\r\n $wishlist_id = $this->_getParam('wishlist_id');\r\n if (empty($wishlist_id)) {\r\n return $this->_forward('notfound', 'error', 'core');\r\n }\r\n\r\n //GET WISHLIST OBJECT\r\n $wishlist = Engine_Api::_()->getItem('sitestoreproduct_wishlist', $wishlist_id);\r\n\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewer_id = $viewer->getIdentity();\r\n $level_id = $viewer->level_id;\r\n\r\n if ($level_id != 1 && $wishlist->owner_id != $viewer_id) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitestoreproduct_Form_Wishlist_Edit();\r\n\r\n if (!$this->getRequest()->isPost()) {\r\n\r\n //PRIVACY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n $perms = array();\r\n foreach ($roles as $roleString) {\r\n $role = $roleString;\r\n if ($auth->isAllowed($wishlist, $role, 'view')) {\r\n $perms['auth_view'] = $roleString;\r\n }\r\n }\r\n\r\n $form->populate($wishlist->toArray());\r\n $form->populate($perms);\r\n return;\r\n }\r\n\r\n //FORM VALIDATION\r\n if (!$form->isValid($this->getRequest()->getPost())) {\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getItemTable('sitestoreproduct_wishlist')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n\r\n //GET FORM VALUES\r\n $values = $form->getValues();\r\n\r\n //SAVE DATA\r\n $wishlist->setFromArray($values);\r\n $wishlist->save();\r\n\r\n //PRIVACTY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n\r\n if (empty($values['auth_view'])) {\r\n $values['auth_view'] = array('everyone');\r\n }\r\n\r\n $viewMax = array_search($values['auth_view'], $roles);\r\n foreach ($roles as $i => $role) {\r\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\r\n }\r\n\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n\r\n //GET URL\r\n $url = $this->_helper->url->url(array('wishlist_id' => $wishlist->wishlist_id, 'slug' => $wishlist->getSlug()), \"sitestoreproduct_wishlist_view\", true);\r\n\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'smoothboxClose' => 10,\r\n 'parentRedirect' => $url,\r\n 'parentRedirectTime' => 10,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your wishlist has been edited successfully.'))\r\n ));\r\n }", "public function getMultipleWishlistId();", "function add_wishlist($_id_member,$_id_product,$_id_source)\n\t\t{\n\t\t\t//must make a rule to get different product detail depend on id_source\n\t\t\t\n\t\t\t$_id_member_session = $this->CI->session->userdata('id_member');\n\t\t\t//Must relate with model wishlist return must an integer\n\t\t\t$_wishlist_already_added = $this->CI->model_product->is_added_stuff($_id_product,$_id_member);\n\t\t\t/*if(!$_wishlist_already_added)\n\t\t\t{\n\t\t\t\t$this->model_zhout->update_wishlist_status($_id_product);\n\t\t\t\t$this->model_wishlist->insert_wishlist($_id_member,$_id_product);\n\t\t\t\t$data['message'] = ''\n\t\t\t\treturn \n\t\t\t}*/\n\t\t}", "public function product_lists()\n {\n return $this->belongsToMany('App\\ProductVariant', 'shopping_list_products', 'shopping_list_id', 'variant_id')\n ->withPivot('quantity', 'branch_id', 'buying_date', 'buying_price')\n ->withTimestamps();\n }", "function remove_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n $wished_new = array();\n foreach ($wished as $row) {\n if ($row !== $product_id) {\n $wished_new[] = $row;\n }\n }\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished_new)\n ));\n }", "function addToWishList()\n {\n $idMobile = null;\n $param = getParameter();\n if (!empty($param[0])) {\n $idMobile = $param[0];\n $result = $this->model->khachhang->addToWishList($idMobile);\n }\n $this->layout->set('null');\n $this->view->load('frontend/addWishListResult', [\n 'result' => $result\n ]);\n }", "protected function canCreateWishlists()\n {\n $customerId = $this->currentCustomer->getCustomerId();\n return !$this->wishlistHelper->isWishlistLimitReached($this->wishlistHelper->getCustomerWishlists())\n && $customerId;\n }", "public function products(): MorphToMany;", "public function favorites()\n {\n return $this->belongsToMany(Product::class, 'favorites');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function toggle(): JsonResponse\n {\n if (auth()->user()->wishlistHas(request('productId'))) {\n return $this->destroy(request('productId'));\n }\n\n return $this->store();\n }", "public function getWishlist(){\n\t\t$wishlists = \\App\\Wishlist::where('user_id', '=', \\Auth::id())->orderBy('id', 'DESC')->get();\n\t\t$circles = \\App\\Circle::where('circle_email', '=', \\Auth::user()->email)->orderBy('id', 'DESC')->get();\n\t\treturn view('wishlist.home')\n\t\t\t->with('circles', $circles)\n\t\t\t->with('wishlists', $wishlists);\n\t}", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function getwishlistbyuser(){\n\t\t$this->db->where('UserID', $this->session->userdata('userid'));\n\t\t$this->db->select('Product_Id,ProductName,ProductAuther,ProductSellingPrice,ProductThumbImage');\n\t\t$this->db->from('tbl_wishlist');\n\t\t$this->db->join('tbl_products', 'tbl_wishlist.Product_Id=tbl_products.ProductId', 'INNER');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "function remove_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n $wished_new = array();\n foreach ($wished as $row) {\n if ($row !== $product_id) {\n $wished_new[] = $row;\n }\n }\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished_new)\n ));\n }", "public function getProductItemsBlock()\n {\n $this->waitFormToLoad();\n return $this->blockFactory->create(\n \\Magento\\Wishlist\\Test\\Block\\Customer\\Wishlist\\Items::class,\n ['element' => $this->_rootElement->find($this->productItems)]\n );\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function getSellerOffers($sellerId);", "public function changeShelfWish($id){\n $library = Library::find(Auth::user()->library->id);\n $do = ['do'=> 0];\n $library->books()->attach($id, $do);\n return redirect('/library/showWishList');\n }", "public function show(Wishlist $wishlist)\n {\n //\n }", "public function show(Wishlist $wishlist)\n {\n //\n }", "public function wishlist($action = null, $id = null) {\n $company_id = $this->Session->read('CompanyLoggedIn.Company.id');\n\n // verifica se vai cadastrar uma oferta especifica para usuario\n if ($action == 'offer_user') {\n $this->Session->write('CadOfferUser.id_linha_wishlist', $id);\n $this->redirect(array(\n 'controller' => 'companies',\n 'action' => 'addOffer',\n 'plugin' => 'companies',\n 'detalhes'\n ));\n }\n\n // verifica post e se vai inserir uma oferta especifica p/ usuario\n if ($this->request->is('post')) {\n\n if ($this->request->data ['excluir_wishlist'] == true) {\n $render = true;\n $this->layout = '';\n\n // faz update de wishlist para excluir desejo\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'INACTIVE'\n )\n );\n\n $desejosDel = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if (!$desejosDel ['status'] == 'SAVE_OK') {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else if ($this->request->data ['id_oferta'] > 0) {\n\n // faz update de oferta para usuario na linha do wishlist\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'ACTIVE',\n 'offer_id' => $this->request->data ['id_oferta']\n )\n );\n\n $desejosOfferUpdate = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if ($desejosOfferUpdate ['status'] == 'SAVE_OK') {\n\n // verifica se usuario ja tem esta oferta\n $params = array(\n 'OffersUser' => array(\n 'conditions' => array(\n 'offer_id' => $desejosOfferUpdate ['data'] ['UsersWishlistCompany'] ['offer_id'],\n 'user_id' => $desejosOfferUpdate ['data'] ['User'] ['id']\n )\n )\n );\n $offer_user = $this->Utility->urlRequestToGetData('users', 'first', $params);\n\n if (!is_array($offer_user)) {\n // salvando oferta para usuario\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$desejosOfferUpdate['data']['UsersWishlistCompany']['offer_id']}', '{$desejosOfferUpdate['data']['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n } else {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else {\n $mensagem = \"Voce nao selecinou nenhuma oferta para este desejo. Tente novamente\";\n }\n }\n\n $limit = 6;\n $update = true;\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n )\n )\n );\n $contador = $this->Utility->urlRequestToGetData('companies', 'count', $params);\n\n // verifica se esta fazendo uma requisicao ajax\n if (!empty($this->request->data ['limit'])) {\n $render = true;\n $this->layout = '';\n $limit = $_POST ['limit'] + 2;\n if ($limit >= $contador) {\n $limit = $contador;\n $update = false;\n }\n }\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n ),\n 'limit' => $limit\n ),\n 'User',\n 'UsersWishlist',\n 'CompaniesCategory'\n );\n $desejos = $this->Utility->urlRequestToGetData('companies', 'all', $params);\n\n // pegando ofertas de empresa\n $params = array(\n 'Offer' => array(\n 'fields' => array(\n 'Offer.id',\n 'Offer.title'\n ),\n 'conditions' => array(\n 'Offer.company_id' => $company_id,\n 'Offer.status' => 'ACTIVE'\n ),\n 'order' => array(\n 'Offer.id' => 'DESC'\n )\n )\n );\n $ofertas = $this->Utility->urlRequestToGetData('offers', 'all', $params);\n\n $this->set(compact('ofertas', 'desejos', 'limit', 'contador', 'update', 'mensagem'));\n\n if (!empty($render))\n $this->render('Elements/ajax_desejos');\n }", "public function DeleteWishList()\n\t{\n\t\tif ($this->checkLogin('U') == '') {\n\t\t\tredirect(base_url());\n\t\t} else {\n\t\t\t$product_id = $this->input->post('pid');\n\t\t\t$id = $this->input->post('wid');\n\t\t\t$condition = array('id' => $id);\n\t\t\t$this->data['WishListCat'] = $this->product_model->get_all_details(LISTS_DETAILS, $condition);\n\t\t\tif ($this->data['WishListCat']->row()->product_id != '') {\n\t\t\t\t$WishListCatArr = @explode(',', $this->data['WishListCat']->row()->product_id);\n\t\t\t\t$my_array = array_filter($WishListCatArr);\n\t\t\t\t$to_remove = (array)$product_id;\n\t\t\t\t$result = array_diff($my_array, $to_remove);\n\t\t\t\t$resultStr = implode(',', $result);\n\t\t\t\tif ($resultStr != '') {\n\t\t\t\t\t$this->product_model->updateWishlistRentals(array('product_id' => $resultStr), $condition);\n\t\t\t\t\t$res['result'] = '0';\n\t\t\t\t} else {\n\t\t\t\t\t$this->product_model->updateWishlistRentals(array('product_id' => $resultStr), $condition);\n\t\t\t\t\t$res['result'] = '1';\n\t\t\t\t}\n\t\t\t\t//print_r($result);die;\n\t\t\t}\n\t\t\t//$this->setErrorMessage('success','Wish list deleted successfully');\n\t\t\t/*echo '<script>window.history.go(-1);</script>';*/\n\t\t}\n\t\techo json_encode($res);\n\t}", "public function whimseys() {\n\t\treturn $this->hasMany('Whimsey');\n\t}", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function isItemInWishlist(int $productId, int $variantId = 0)\r\n {\r\n return $this->getItems()\r\n ->where('zbozi_id', $productId)\r\n ->where('variant_id', $variantId)\r\n ->count();\r\n }", "public function show(WishList $wishList)\n {\n //\n }", "public function onMenuInitialize_SitepageGutterWishlist($row) {\n\t\t\n\t\t//GET VIEWER DETAIL\n $viewer = Engine_Api::_()->user()->getViewer();\n\t\t$viewer_id = $viewer->getIdentity();\n\n\t\tif(empty($viewer_id)) {\n\t\t\treturn false;\n\t\t}\n\n $canView = Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitepagewishlist_wishlist', 'view');\n\t\tif(empty($canView)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//RETURN FALSE IF SUBJECT IS NOT SET\n $subject = Engine_Api::_()->core()->getSubject();\n if ($subject->getType() !== 'sitepage_page') {\n return false;\n }\n\n\t\t//SHOW ADD TO WISHLIST LINK IF SITEPAGWISHLIST MODULES IS ENABLED\n\t\t$sitepageWishlistEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitepagewishlist');\n if (!$viewer->getIdentity() || empty($sitepageWishlistEnabled)) {\n return false;\n }\n\n return array(\n 'class' => 'icon_sitepagewishlist_add buttonlink',\n 'route' => 'default',\n 'params' => array(\n 'module' => 'sitepagewishlist',\n 'controller' => 'index',\n 'action' => 'add',\n 'page_id' => $subject->getIdentity(),\n ),\n );\n }", "private function checkwishlist($productId){\n\t\t$this->db->where('UserID', $this->session->userdata('userid'));\n\t\t$this->db->where('Product_Id', $productId);\n\t\t$query=$this->db->get('tbl_wishlist');\n\t\tif($query->num_rows()>0){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}", "public function likes()\n {\n return $this->hasMany(Like::class);\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function likes()\n {\n return $this->hasMany('App\\Like');\n }", "public function likes()\n {\n return $this->hasMany('App\\Like');\n }", "public function getItems()\r\n {\r\n return $this->user->wishlistItems;\r\n }", "public function getAllWearprices()\n {\n $select = $this->createEntity('WearPriser')->getSelect();\n $select->setOrder('wear_id','asc');\n $select->setOrder('brugerkategori_id','asc');\n return $this->createEntity('WearPriser')->findBySelectMany($select);\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function seller()\n {\n \t// belongsTo(RelatedModel, foreignKey = from_seller_id, keyOnRelatedModel = seller_id)\n \treturn $this->belongsTo('App\\Seller','from_seller_id','seller_id');\n }", "public function getWishlistItems()\n {\n if ($this->_collection === null) {\n $this->_collection = $this->_createWishlistItemCollection();\n $this->_prepareCollection($this->_collection);\n }\n\n return $this->_collection;\n }", "function setMetafieldWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n $wishlist = $this->getMetafieldCustomer($customerId,'');\n $wishlistDecoded = json_decode($wishlist, true);\n $productIds = '';\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products !== null or $products !== \"\") {\n $wishlist->setProductIds($productIds);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productIds);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n if(count($wishlistDecoded['metafields']) !== 0) {\n if($wishlistDecoded['metafields'][0]['value'] !== \"\") {\n if(strpos($wishlistDecoded['metafields'][0]['value'], ',') !== false) {\n $productIdTab = explode(',' , $wishlistDecoded['metafields'][0]['value']);\n foreach ($productIdTab as $value) {\n if($value !== \"null\") {\n $productIds .= ',' . $value;\n }\n }\n } else {\n if($wishlistDecoded['metafields'][0]['value'] === \"null\") {\n $productIds = $productId;\n } else {\n $productIds = $wishlistDecoded['metafields'][0]['value'] .',' . $productId;\n }\n\n }\n\n $data = [\n \"metafield\" => [\n \"id\" => $wishlistDecoded['metafields'][0]['id'],\n \"value\" => '' . $productIds . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('PUT', shopifyApiurl . 'metafields/'.$wishlistDecoded['metafields'][0]['id'].'.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n } else {\n $data = [\n \"metafield\" => [\n \"namespace\" => \"wishlist\",\n \"key\" => \"wishlist-products\",\n \"value\" => '' . $productId . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('POST', shopifyApiurl . 'customers/'.$customerId.'/metafields.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n\n return new Response('wishlist saved');\n }", "public function index($wishlistid)\n {\n $wish['wishlistid'] = $wishlistid;\n\n $validation = Validator::make($wish,[\n 'wishlistid'=>'exists:wishes,wishlistid',\n ]);\n\n if($validation->fails())\n {\n $failedRules = $validation->failed();\n $field = '';\n\n if(isset($failedRules['wishlistid']['Exists']))\n {\n $message = 'Wishlist id not found.';\n $field = 'wishlistid';\n }\n\n return response()->json(['status'=>'400','message'=>$message,'field'=>$field]);\n }\n else\n {\n $wishes = $this->wish->getWishesByWishlistId($wishlistid);\n $userid = $this->wishlist->getCreatedById($wishlistid);\n\n $getFavoriteBookmarkForStream = $this->favoritebookmark->getFavoriteBookmarkForStream($userid);\n foreach($wishes as $w)\n {\n $w->favorited = '0';\n $w->bookmarked = '0';\n foreach($getFavoriteBookmarkForStream as $gfbfs)\n {\n if($w->id == $gfbfs['wishid'])\n {\n if($gfbfs['type'] == '2')\n {\n $w->favorited = '1';\n }\n if($gfbfs['type'] == '1')\n {\n $w->bookmarked = '1';\n }\n }\n }\n $w->favoritecount = $this->favoritebookmark->countFavoriteBookmark($w->id, '2');\n $w->bookmarkcount = $this->favoritebookmark->countFavoriteBookmark($w->id, '1');\n }\n\n return response()->json(['status'=>'200','message'=>'Ok','wishes'=>$wishes]);\n }\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }" ]
[ "0.70857936", "0.6677293", "0.665782", "0.66139364", "0.6497405", "0.646726", "0.60313374", "0.592544", "0.58536696", "0.5760578", "0.57301694", "0.57004946", "0.56753546", "0.5633458", "0.56279117", "0.5575236", "0.5566451", "0.55495656", "0.55447644", "0.5532937", "0.5528356", "0.55112314", "0.5507413", "0.5480278", "0.54601467", "0.54174787", "0.5416288", "0.5409791", "0.5380683", "0.5372671", "0.5368947", "0.5366931", "0.5338719", "0.53355646", "0.53253615", "0.5299865", "0.52907634", "0.52877176", "0.5277828", "0.52264875", "0.5224801", "0.51980215", "0.51769084", "0.5168536", "0.5151092", "0.5137965", "0.5128917", "0.51215863", "0.51214266", "0.5091823", "0.50875163", "0.50724626", "0.5065655", "0.50588834", "0.50588673", "0.50565064", "0.50533473", "0.5049415", "0.5046342", "0.5045461", "0.5043063", "0.50361955", "0.50346833", "0.50286055", "0.5024955", "0.5022637", "0.5016918", "0.5016323", "0.5016323", "0.5013862", "0.50097984", "0.5002915", "0.49994594", "0.4994034", "0.4993456", "0.49868104", "0.49864024", "0.49699563", "0.49699146", "0.49673155", "0.49673155", "0.49603194", "0.4958457", "0.49576315", "0.49410963", "0.49410963", "0.49410963", "0.49410963", "0.49410963", "0.49410963", "0.49410963", "0.49399397", "0.49301735", "0.49294084", "0.4928517", "0.49262437", "0.49227434", "0.49203116", "0.49187177", "0.49187177" ]
0.706539
1
SellerProduct has many SPOPtionRelations.
public function SPOPtionRelations() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id) return $this->hasMany(SPOPtionRelation::class,'sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function productOptions()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductOption','sp_id','sp_id');\n }", "public function products(): MorphToMany;", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function SPPaymentRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPPaymentRelation','sp_id','sp_id');\n }", "public function products()\n {\n return $this->belongsToMany(Product::class, 'product_promotions');\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function relations()\n {\n return $this->belongsToMany(Product::class, 'product_relations', 'product_id', 'related_product_id')\n ->using(ProductRelation::class);\n }", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function productClicks()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductClick','sp_id','sp_id');\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product');\n }", "public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }", "public function products()\n {\n return $this->hasMany('App\\ProductLocation', 'productLocation', 'id');\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function products() {\n\t\treturn $this->hasOne('App\\Product', 'id', 'product_id');\n\t}", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function products()\n {\n return $this->belongsToMany('App\\models\\Product', 'product_variants');\n }", "public function productos()\n {\n return $this->hasMany('App\\Models\\ProductoPedidoModel', 'id_pedido', 'id');\n }", "public function products() {\n \treturn $this->belongsToMany(Product::class, 'items_product', 'item_id', 'product_id');\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function products()\n {\n return $this->belongsToMany(\n Product::class,\n 'order_product',\n 'order_id',\n 'product_id'\n );\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function products()\n {\n return $this->hasMany('fooCart\\src\\Product', 'tax_id', 'tax_id');\n }", "public function product_galleries() {\n return $this->hasMany(ProductGallery::class, 'product_id', 'id');\n }", "public function getProducts()\n {\n return $this->hasMany(Products::className(), ['brand' => 'id']);\n }", "public function products(){\n return $this->belongsToMany('App\\Product', 'enumber_products', 'enumber_id', 'products_id');\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function products()\n {\n return $this->belongsTo('App\\Models\\Product');\n }", "public function products()\n {\n return $this->morphedByMany('App\\Models\\Product', 'taggable');\n }", "public function product_lists()\n {\n return $this->belongsToMany('App\\ProductVariant', 'shopping_list_products', 'shopping_list_id', 'variant_id')\n ->withPivot('quantity', 'branch_id', 'buying_date', 'buying_price')\n ->withTimestamps();\n }", "public function shoppingCarts()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ShoppingCart','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'restaurant_id');\n }", "public function pdeductions(){\n return $this->hasMany(Productdeduction::class);\n }", "public function ProductItems()\n {\n return $this->belongsToMany('App\\Order','order_product');\n }", "public function variations()\n {\n return $this->hasMany(ProductVariation::class);\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function relations() {\n // class name for the relations automatically generated below.\n return array(\n 'product' => array(self::BELONGS_TO, 'Product', 'product_id'),\n );\n }", "public function products()\n {\n // if the intermediate table is called differently an SQl error is raised\n // to use a custom table name it should be passed to \"belongsToMany\" method as the second argument\n return $this->belongsToMany(Product::class, 'cars__products');\n }", "public function relatedProductsAction()\n {\n $productId = Mage::app()->getRequest()->getParam('productId');\n $relatedProducts = [];\n\n if ($productId != null) {\n $product = Mage::getModel('catalog/product')->load($productId);\n $relatedProductsId = $product->getRelatedProductIds();\n foreach ($relatedProductsId as $relatedProductId) {\n $relatedProducts[] = Mage::getModel('catalog/product')->load($relatedProductId)->getData();\n }\n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($relatedProducts));\n $this->getResponse()->setHeader('Content-type', 'application/json');\n }", "public function getProducts()\n {\n return $this->hasMany(Product::className(), ['uomId' => 'uomId']);\n }", "public function OderDetails(){\n\t\treturn $this->hasMany('App\\OrderProduct','ID_Product');\n\t}", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product', 'royalty_chart', 'vehicle_type_id', 'product_id')->withPivot('amount', 'status');\n }", "public function SPShippings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPShipping','sp_id','sp_id');\n }", "public function offers()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n \treturn $this->hasMany('App\\Offer','sp_id','sp_id');\n }", "public function sellerStock()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\SellerStock','sp_id','sp_id');\n }", "public function getProductInOffers()\n {\n return $this->hasMany(ProductInOffer::className(), ['id_offer' => 'id_offer']);\n }", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function products()\n\t{\n\t\treturn $this->belongsTo(Product::class);\n\t}", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function wishlist_products()\n {\n return $this->belongsTo(Product::class, 'product_id', 'id');\n }", "public function products() {\n return $this->hasMany('App\\Models\\Product', 'category_id', 'id');\n }" ]
[ "0.79731506", "0.7286745", "0.6581661", "0.6417445", "0.6340585", "0.63296694", "0.6300131", "0.6229335", "0.6221153", "0.61976343", "0.6172708", "0.61533993", "0.61496294", "0.6132897", "0.61279565", "0.6123936", "0.61087537", "0.6078971", "0.6060232", "0.60508865", "0.60496444", "0.60489196", "0.6046995", "0.6018273", "0.6018273", "0.6018273", "0.6018273", "0.6018273", "0.6018273", "0.6018273", "0.600951", "0.6009318", "0.60050017", "0.6001971", "0.5996017", "0.59787333", "0.5976099", "0.5976099", "0.5960182", "0.59245795", "0.5916026", "0.59146285", "0.5911466", "0.5911466", "0.5911466", "0.5911466", "0.5911466", "0.5911466", "0.5911466", "0.5910096", "0.5902518", "0.5897793", "0.5894767", "0.58795255", "0.5874907", "0.58712703", "0.58535635", "0.5851577", "0.5851246", "0.58495766", "0.5841092", "0.58377856", "0.58061016", "0.5802279", "0.5802279", "0.5802279", "0.5802279", "0.57878494", "0.57743853", "0.5764507", "0.5743022", "0.5730154", "0.5722215", "0.57110304", "0.57063586", "0.5684973", "0.56824493", "0.56610006", "0.5651773", "0.56447464", "0.56422824", "0.56418025", "0.5641789", "0.56405556", "0.5639067", "0.5635038", "0.5632972", "0.5627448", "0.5622445", "0.56088287", "0.5604559", "0.56006414", "0.5589394", "0.55868095", "0.5582819", "0.5579192", "0.55778474", "0.55763525", "0.5566558", "0.55575967" ]
0.68150604
2
SellerProduct has many SPPriceHistory.
public function SPPriceHistory() { // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id) return $this->hasMany('App\SPPriceHitory','sp_id','sp_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sellerStockHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\SellerStockHistory','spsd_id','spsd_id');\n }", "public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "public function history_product($product_id = null) {\n\t\t$this->Sell->Product->recursive = -1;\n\t\t$this->set('products', $this->Sell->Product->find('all'));\n\t\t$this->set('years', $this->Sell->Year->find('list',array('fields'=>'Year.year,Year.year')));\n\t\t\n\t\t\n\t\t$product = null;\n\t\t$this->Sell->Product->id = $product_id;\n\t\tif (!$this->Sell->Product->exists()) {\n\t\t\t$p = $this->Sell->Product->find('first');\n\t\t\t$product_id = $p['Product']['id'];\n\t\t\tif(!$product_id) {\n\t\t\t\t$this->Session->setFlash(__('Cadastre um produto antes de continuar'));\n\t\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t\n\t\t//checando ano\n\t\t$year = null;\n\t\tif(isset($this->request->query['year']))\n\t\t\t$year = $this->request->query['year'];\n\t\telse {\n\t\t\t$y = $this->Sell->Year->find('first',array('order'=>'Year.year DESC'));\n\t\t\tif(isset($y['Year']['year']) && $y['Year']['year'])\n\t\t\t\t$year = $y['Year']['year'];\n\t\t\tif($year) {\n\t\t\t\t$this->redirect(array('controller'=>'sells','action'=>'history_product',$product_id,'?' => array('year' => $year)));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(!$year) {\n\t\t\t$this->Session->setFlash(__('Cadastre um ano antes de continuar'));\n\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t\treturn;\n\t\t}\n\n\t\t//construindo dados\n\t\t$product = $this->Sell->Product->read(null, $product_id);\n\n\t\t$sells = $this->Sell->find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Sell.product_id' => $product_id,\n\t\t\t\t\t\t'Year.year' => $year\n\t\t\t\t),\n\t\t\t\t'order' => 'Year.year DESC'\n\t\t));\n\n\t\t$this->Sell->Month->recursive = -1;\n\t\t$months = $this->Sell->Month->find('all');\n\n\t\t$graph = array(\n\t\t\t\t'title' => \"Vendas de {$product['Product']['name']} por Mês - {$year}\",\n\t\t\t\t'label_x' => 'mês',\n\t\t\t\t'label_y' => 'unidades',\n\t\t\t\t'axis_y' => array(\n\t\t\t\t\t\t'model' => 'Month',\n\t\t\t\t\t\t'field' => 'name',\n\t\t\t\t\t\t'data' => $months\n\t\t\t\t),\n\t\t\t\t'axis_x' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'label' => $product['Product']['name'],\n\t\t\t\t\t\t\t\t'model' => 'Sell',\n\t\t\t\t\t\t\t\t'field' => 'quantity',\n\t\t\t\t\t\t\t\t'data' => $sells\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t);\n\t\t$this->set(compact('graph','year','product'));\n\t}", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "public function productRatings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductRating','sp_id','sp_id');\n }", "public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}", "public function productClicks()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ProductClick','sp_id','sp_id');\n }", "public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}", "public function product()\n\t{\n\t\treturn $this->belongsToMany('App\\Models\\Products','inventory','store_id','product_id')->withPivot('stocks', 'lower_limit', 'higher_limit');\n\t}", "public function getPriceHistory() { return array($this->getPrice()); }", "public function product()\n {\n return $this->hasMany(ProductM::class,'store_no','store_no');\n }", "public function productHold()\n {\n return $this->hasMany('App\\Models\\ProductHold');\n }", "public function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function eventNotifySeller() {\r\n /**\r\n * Date calculation, Current date and Previous date\r\n */\r\n $currentDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(time()));\r\n $previousDate = date(\"Y-m-d \", Mage::getModel('core/date')->timestamp(strtotime($currentDate . ' -1 day')));\r\n\r\n // Getting all seller ID's whose products updated in from yesterday\r\n\r\n $_sellerCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToSelect('seller_id')\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->groupByAttribute('seller_id')\r\n ->load();\r\n\r\n foreach ($_sellerCollection as $_seller) {\r\n $sellerId = $_seller->getSellerId();\r\n $products = \"\";\r\n\r\n //Loading seller product collection\r\n $_productCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToFilter('updated_at', array(\r\n 'from' => $previousDate,\r\n 'date' => true,\r\n ))\r\n ->addAttributeToFilter('seller_id', $_seller->getSellerId())\r\n ->addAttributeToFilter('status', array('eq' => 1))// added publish stauts filter\r\n ->addAttributeToFilter('seller_product_status', array('eq' => 1023))// added Seller product status\r\n ->addAttributeToSelect('*')\r\n ->load();\r\n\r\n $i = 1;\r\n foreach ($_productCollection as $_product) {\r\n $small_image = Mage::helper('catalog/image')->init($_product, 'small_image')->resize(51, 68);\r\n $products .= '<tr>';\r\n $products .= '<td style=\"text-align:center; margin:0 0 10px; vertical-align:middle; padding:0 0 10px;\">' . $i . '</td>';\r\n $products .= '<td style=\"text-align:center; padding:0 0 20px;\"><img src=' . $small_image . ' alt=' . $_product->getName() . ' /></td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getName() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getSku() . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;\">' . $_product->getAttributeText('seller_product_status') . '</td>';\r\n $products .= '<td style=\"text-align:center; vertical-align:middle; padding:0 0 10px;;\">' . $_product->getPrice() . '</td>';\r\n $products .= '</tr>';\r\n\r\n $i++;\r\n }\r\n $templateId = 9;\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templateId);\r\n\r\n //Getting seller information\r\n\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n\r\n // Setting up default sender information\r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId));\r\n\r\n // Setting email variables\r\n $emailTemplateVariablesValue = (array(\r\n 'sellername' => $sellerName,\r\n 'products' => $products,\r\n 'seller_store' => $sellerStore,\r\n ));\r\n\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n\r\n /**\r\n * Send email to the seller\r\n */\r\n $emailTemplate->send($sellerEmail, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }", "public function sellerStock()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\SellerStock','sp_id','sp_id');\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "protected function products()\r\n {\r\n return $this->hasMany('App\\Models\\Product');\r\n }", "public function products(): HasMany\n {\n return $this->hasMany(Product::class);\n }", "public function amountProducts(){\n return $this->hasMany(AmountProduct::class);\n }", "public function products(){\n\t\treturn $this->hasMany('Product');\t\n\t}", "public function sellerStock()\n {\n \t// belongsTo(RelatedModel, foreignKey = ss_id, keyOnRelatedModel = ss_id)\n \treturn $this->belongsTo('App\\SellerStock','ss_id','ss_id');\n }", "public function products(){\n return $this->hasMany('App\\Product');\n }", "public function purchase_products()\n {\n return $this->hasMany('App\\Client\\Purchase\\Product');\n\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function products()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = brand_id, localKey = id)\n return $this->hasMany(Product::class);\n }", "public function prices()\n {\n return $this->hasMany(Price::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function products()\n {\n return $this->hasMany('App\\Product');\n }", "public function shoppingCarts()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ShoppingCart','sp_id','sp_id');\n }", "public function getPrice(){\n return $this->hasMany(Inventory::class, 'product_id','id');\n}", "public function products(){\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withPivot('amount', 'data', 'consume');\n }", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products() {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'id');\n }", "public function exportProducts()\n\t{\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProductExportEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProductHistoryEvent' );\n\t\t\n\t\t$baseURL = Yii::app()->request->hostInfo;\n\t\t$pageSize = 20;\n\t\t\n\t\t$allProducts = Yii::app()->db->createCommand()\n\t ->select('p.id, p.parent, p.url, p.name, p.articul, p.price, p.notice, p.visible, p.discount, p.date_create, i.name AS img, s.name AS section')\n\t ->from('kalitniki_product AS p')\n\t ->join('kalitniki_product_img AS i', 'p.id = i.parent')\n\t ->join('kalitniki_product_assignment AS a', 'p.id = a.product_id')\n\t ->join('kalitniki_product_section AS s', 's.id = a.section_id')\n\t ->group('p.id')\n\t ->order('IF(p.position=0, 1, 0), p.position ASC ');\n\t\n\t $allProducts = $allProducts->queryAll();\n\t $productCount = count( $allProducts );\n\t \n\t $pages = ( $productCount % $pageSize ) > 0 ? floor( $productCount / $pageSize ) + 1 : $productCount / $pageSize;\n\t \n\t for ( $currentPage = 0; $currentPage <= $pages - 1; $currentPage++ )\n\t {\n\t \t$dataExport = new ProductHistoryEvent;\n\t \t\n\t \t$offset = $currentPage * $pageSize;\n\t \t$collection = array_slice( $allProducts, $offset, $pageSize );\n\t \t\n\t \tforeach ( $collection as $productItem )\n\t \t{\n\t \t\t$productPrices = array();\n\t\t\t\tif ( $productItem['discount'] )\n\t\t\t\t{\n\t\t\t\t $productPrice = array(\n\t\t\t 'price_id' => \"\",\n\t\t\t 'price_value' => Utils::calcDiscountPrice($productItem['price'], $productItem['discount']),\n\t\t\t 'price_priority' => null,\n\t\t\t 'price_active_from' => \"\",\n\t\t\t 'price_active_to' => \"\",\n\t\t\t 'price_customer_group' => \"\",\n\t\t\t 'price_quantity' => \"\"\n\t\t\t );\n\t\t\t \n\t\t\t $productPrices[] = $productPrice;\n\t\t\t\t}\n\t \t\t\n\t \t\t$productCategories = array();\n \t\t$productCategories[] = $productItem['section'];\n\t \t\t\n\t \t\t$product = new ProductExportEvent;\n $product->product_id = $productItem['id'];\n $product->parent_id = $productItem['parent'] ? $productItem['parent'] : \"\";\n $product->product_name = isset( $productItem['name'] ) ? $productItem['name'] : \"\";\n $product->product_desc = $productItem['notice'];\n $product->product_create_date = $productItem['date_create'];\n $product->product_sku = $productItem['articul'] ? $productItem['articul'] : \"\";\n $product->product_image = $baseURL . '/' . $productItem['img'];\n $product->product_url = $baseURL . '/' . $productItem['url'];\n $product->product_qty = \"\";\n $product->product_default_price = $productItem['price'];\n $product->product_prices = $productPrices;\n $product->product_categories = $productCategories;\n $product->product_relations = \"\";\n $product->product_is_removed = \"\";\n $product->product_is_active = $productItem['visible'];\n $product->product_active_from = \"\";\n $product->product_active_to = \"\";\n $product->product_show_as_new_from = \"\";\n $product->product_show_as_new_to = \"\";\n \n $dataExport->products[] = $product;\n\t \t}\n\n\t \t$this->client->sendEvent( $dataExport );\n\t }\n\t}", "public function products()\n {\n return $this->hasMany('App\\Models\\Products');\n }", "public function history_product_last_tree_years($product_id = null) {\n\t\t$this->Sell->Product->recursive = -1;\n\t\t$this->set('products', $this->Sell->Product->find('all'));\n\t\t\n\t\t$year = $this->Sell->Year->find('first',array('order'=>'Year.year DESC'));\n\t\tif(!isset($year['Year']['year']) || !$year['Year']['year']) {\n\t\t\t\t$this->Session->setFlash(__('Cadastre um ano antes de continuar'));\n\t\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t}\n\t\t$year = $year['Year']['year'];\n\t\t\n\t\t$this->Sell->Product->id = $product_id;\n\t\tif (!$this->Sell->Product->exists()) {\n\t\t\t$p = $this->Sell->Product->find('first');\n\t\t\t$product_id = $p['Product']['id'];\n\t\t\tif(!$product_id) {\n\t\t\t\t$this->Session->setFlash(__('Cadastre um produto antes de continuar'));\n\t\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\n\t\t//construindo dados\n\t\t$product = $this->Sell->Product->read(null, $product_id);\n\n\t\t\n\t\t$year1 = $year-2;\n\t\t$year2 = $year-1;\n\t\t$year3 = $year;\n\t\t\n\t\t$sells1 = $this->Sell->find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Sell.product_id' => $product_id,\n\t\t\t\t\t\t'Year.year = ' . $year1\n\t\t\t\t),\n\t\t\t\t'order' => 'Year.year DESC'\n\t\t));\n\t\t$sells2 = $this->Sell->find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Sell.product_id' => $product_id,\n\t\t\t\t\t\t'Year.year = ' . $year2\n\t\t\t\t),\n\t\t\t\t'order' => 'Year.year DESC'\n\t\t));\n\t\t$sells3 = $this->Sell->find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Sell.product_id' => $product_id,\n\t\t\t\t\t\t'Year.year = ' . $year3\n\t\t\t\t),\n\t\t\t\t'order' => 'Year.year DESC'\n\t\t));\n\n\t\t$this->Sell->Month->recursive = -1;\n\t\t$months = $this->Sell->Month->find('all');\n\n\t\t$graph = array(\n\t\t\t\t'title' => \"Vendas de {$product['Product']['name']} por Mês - {$year1}, {$year2} e {$year3}\",\n\t\t\t\t'label_x' => 'mês',\n\t\t\t\t'label_y' => 'unidades',\n\t\t\t\t'axis_y' => array(\n\t\t\t\t\t\t'model' => 'Month',\n\t\t\t\t\t\t'field' => 'name',\n\t\t\t\t\t\t'data' => $months\n\t\t\t\t),\n\t\t\t\t'axis_x' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'label' => $year1,\n\t\t\t\t\t\t\t\t'model' => 'Sell',\n\t\t\t\t\t\t\t\t'field' => 'quantity',\n\t\t\t\t\t\t\t\t'data' => $sells1\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'label' => $year2,\n\t\t\t\t\t\t\t\t'model' => 'Sell',\n\t\t\t\t\t\t\t\t'field' => 'quantity',\n\t\t\t\t\t\t\t\t'data' => $sells2\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'label' => $year3,\n\t\t\t\t\t\t\t\t'model' => 'Sell',\n\t\t\t\t\t\t\t\t'field' => 'quantity',\n\t\t\t\t\t\t\t\t'data' => $sells3\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t);\n\t\t$this->set(compact('graph','year','product'));\n\t}", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product', 'royalty_chart', 'vehicle_type_id', 'product_id')->withPivot('amount', 'status');\n }", "public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }", "public function transistionHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\TransistionHistory','spsd_id','spsd_id');\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products()\n {\n return $this->hasMany(Product::class);\n }", "public function products(){\n return $this->belongsToMany('App\\Product', 'product_warehouse', 'warehouse_id', 'product_id')\n ->withPivot('quantity') //iot use increment and decrement i added the id column\n ->withTimestamps(); //for the timestamps created_at updated_at, to be maintained.\n }", "public function reviews() {\n return $this->hasMany('App\\Models\\ProductReview');\n }", "public function products()\n\t{\n\t\treturn $this->hasMany('Product');\n\t}", "public function prices(){\n \t return this->belongsToMany('App\\prices','price_service_time');\n }", "public function products()\n {\n return $this->hasMany('App\\Models\\Product', 'gproduct_id', 'id');\n }", "public function products(){\n \t\n \treturn $this->hasMany(Product::class);\n }", "public function transistionHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\TransistionHistory','sp_id','sp_id');\n }", "public function products() {\r\n return $this->belongsToMany('App\\Product');\r\n }", "public function products()\n {\n return $this->hasMany(Product::class, 'state_id', 'id');\n }", "public function prices() {\n return $this->hasMany('Auction_price'); // this matches the Eloquent model\n }", "public function AuctionProduct()\n {\n return $this->hasMany('App\\AuctionProduct');\n }", "public function product_lists()\n {\n return $this->belongsToMany('App\\ProductVariant', 'shopping_list_products', 'shopping_list_id', 'variant_id')\n ->withPivot('quantity', 'branch_id', 'buying_date', 'buying_price')\n ->withTimestamps();\n }", "public function products() {\n return $this->hasMany(Product::class, 'invoice_id', 'id');\n }", "public function Products()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Product');\n\t}", "protected function _saveProducts()\n {\n $priceIsGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n $entityLinkField = $this->getProductEntityLinkField();\n\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = [];\n $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = [];\n $this->categoriesCache = [];\n $tierPrices = [];\n $mediaGallery = [];\n $labelsForUpdate = [];\n $imagesForChangeVisibility = [];\n $uploadedImages = [];\n $previousType = null;\n $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($bunch);\n\n foreach ($bunch as $rowNum => $rowData) {\n // reset category processor's failed categories array\n $this->categoryProcessor->clearFailedCategories();\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n $rowScope = $this->getRowScope($rowData);\n\n $rowData[self::URL_KEY] = $this->getUrlKey($rowData);\n\n $rowSku = $rowData[self::COL_SKU];\n\n if (null === $rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($rowSku)['attr_set_code'];\n }\n\n // 1. Entity phase\n if ($this->isSkuExist($rowSku)) {\n // existing row\n if (isset($rowData['attribute_set_code'])) {\n $attributeSetId = $this->catalogConfig->getAttributeSetId(\n $this->getEntityTypeId(),\n $rowData['attribute_set_code']\n );\n\n // wrong attribute_set_code was received\n if (!$attributeSetId) {\n throw new LocalizedException(\n __(\n 'Wrong attribute set code \"%1\", please correct it and try again.',\n $rowData['attribute_set_code']\n )\n );\n }\n } else {\n $attributeSetId = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n }\n\n $entityRowsUp[] = [\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'attribute_set_id' => $attributeSetId,\n $entityLinkField => $this->getExistingSku($rowSku)[$entityLinkField]\n ];\n } else {\n if (!$productLimit || $productsQty < $productLimit) {\n $entityRowsIn[strtolower($rowSku)] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($rowSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($rowSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => isset($rowData['has_options']) ? $rowData['has_options'] : 0,\n 'created_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n }\n\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n // 2. Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // 3. Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->processRowCategories($rowData);\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n unset($rowData['rowNum']);\n\n // 4.1. Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => $rowData['_tier_price_price'],\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] ||\n $priceIsGlobal ? 0 : $this->storeResolver->getWebsiteCodeToId($rowData['_tier_price_website']),\n ];\n }\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n\n // 5. Media gallery phase\n list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);\n $storeId = !empty($rowData[self::COL_STORE])\n ? $this->getStoreIdByCode($rowData[self::COL_STORE])\n : Store::DEFAULT_STORE_ID;\n $imageHiddenStates = $this->getImagesHiddenStates($rowData);\n foreach (array_keys($imageHiddenStates) as $image) {\n if (array_key_exists($rowSku, $existingImages)\n && array_key_exists($image, $existingImages[$rowSku])\n ) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n $uploadedImages[$image] = $image;\n }\n\n if (empty($rowImages)) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n }\n }\n\n $rowData[self::COL_MEDIA_IMAGE] = [];\n\n /*\n * Note: to avoid problems with undefined sorting, the value of media gallery items positions\n * must be unique in scope of one product.\n */\n $position = 0;\n foreach ($rowImages as $column => $columnImages) {\n foreach ($columnImages as $columnImageKey => $columnImage) {\n if (!isset($uploadedImages[$columnImage])) {\n $uploadedFile = $this->uploadMediaFiles($columnImage);\n $uploadedFile = $uploadedFile ?: $this->getSystemFile($columnImage);\n if ($uploadedFile) {\n $uploadedImages[$columnImage] = $uploadedFile;\n } else {\n $this->addRowError(\n ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,\n $rowNum,\n null,\n null,\n ProcessingError::ERROR_LEVEL_NOT_CRITICAL\n );\n }\n } else {\n $uploadedFile = $uploadedImages[$columnImage];\n }\n\n if ($uploadedFile && $column !== self::COL_MEDIA_IMAGE) {\n $rowData[$column] = $uploadedFile;\n }\n\n if ($uploadedFile && !isset($mediaGallery[$storeId][$rowSku][$uploadedFile])) {\n if (isset($existingImages[$rowSku][$uploadedFile])) {\n $currentFileData = $existingImages[$rowSku][$uploadedFile];\n if (isset($rowLabels[$column][$columnImageKey])\n && $rowLabels[$column][$columnImageKey] !=\n $currentFileData['label']\n ) {\n $labelsForUpdate[] = [\n 'label' => $rowLabels[$column][$columnImageKey],\n 'imageData' => $currentFileData\n ];\n }\n\n if (array_key_exists($uploadedFile, $imageHiddenStates)\n && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]\n ) {\n $imagesForChangeVisibility[] = [\n 'disabled' => $imageHiddenStates[$uploadedFile],\n 'imageData' => $currentFileData\n ];\n }\n } else {\n if ($column == self::COL_MEDIA_IMAGE) {\n $rowData[$column][] = $uploadedFile;\n }\n $mediaGallery[$storeId][$rowSku][$uploadedFile] = [\n 'attribute_id' => $this->getMediaGalleryAttributeId(),\n 'label' => isset($rowLabels[$column][$columnImageKey])\n ? $rowLabels[$column][$columnImageKey]\n : '',\n 'position' => ++$position,\n 'disabled' => isset($imageHiddenStates[$columnImage])\n ? $imageHiddenStates[$columnImage] : '0',\n 'value' => $uploadedFile,\n ];\n }\n }\n }\n }\n\n // 6. Attributes phase\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n $productType = isset($rowData[self::COL_TYPE]) ? $rowData[self::COL_TYPE] : null;\n if ($productType !== null) {\n $previousType = $productType;\n }\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if ($prevAttributeSet !== null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && $previousType !== null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n\n $productTypeModel = $this->_productTypeModels[$productType];\n if (!empty($rowData['tax_class_name'])) {\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($rowData[self::COL_SKU])\n ) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !$this->isSkuExist($rowSku)\n );\n $product = $this->_proxyProdFactory->create(['data' => $rowData]);\n\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType()\n && (\n in_array($attribute->getAttributeCode(), $this->dateAttrCodes)\n || $attribute->getIsUserDefined()\n )\n ) {\n $attrValue = $this->dateTime->formatDate($attrValue, false);\n } elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = gmdate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n } elseif ($backModel) {\n $attribute->getBackend()->beforeSave($product);\n $attrValue = $product->getData($attribute->getAttributeCode());\n }\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($rowStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$rowStore];\n }\n if (!$this->isSkuExist($rowSku)) {\n $storeIds[] = 0;\n }\n }\n foreach ($storeIds as $storeId) {\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$storeId])) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n }\n\n foreach ($bunch as $rowNum => $rowData) {\n if ($this->getErrorAggregator()->isRowInvalid($rowNum)) {\n unset($bunch[$rowNum]);\n }\n }\n\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n )->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->updateMediaGalleryVisibility(\n $imagesForChangeVisibility\n )->updateMediaGalleryLabels(\n $labelsForUpdate\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $bunch]\n );\n }\n\n return $this;\n }", "public function orderProduct()\n {\n return $this->hasMany('App\\OrderProduct');\n }", "public function OderDetails(){\n\t\treturn $this->hasMany('App\\OrderProduct','ID_Product');\n\t}", "public function products(){\n return $this->belongsToMany('App\\Product', 'enumber_products', 'enumber_id', 'products_id');\n }", "public function products()\n {\n \t// y dinh : phuong thuc se lien ket quan he one - to - many voi bang product\n \treturn $this->hasMany('App\\Models\\Products');\n }", "public function products_order()\n {\n return $this->hasMany( ProductsOrder::class );\n }", "public function product()\n {\n // return $this->hasMany(product::class, 'orders_has_products', 'odrders_id', 'products_id');\n return $this->belongsToMany(product::class, 'orders_has_products', 'orders_id', 'products_id');\n }", "public function stocks(): HasMany\n {\n return $this->hasMany('Ronmrcdo\\Inventory\\Models\\InventoryStock');\n }", "public function getProductReviews()\n {\n return $this->hasMany(ProductReview::className(), ['review_uuid' => 'uuid']);\n }", "public function products()\n {\n // if the intermediate table is called differently an SQl error is raised\n // to use a custom table name it should be passed to \"belongsToMany\" method as the second argument\n return $this->belongsToMany(Product::class, 'cars__products');\n }", "public function originPrices()\n {\n return $this->hasMany('App\\Price', 'origin_country_id');\n }", "public function details()\n {\n return $this->hasMany('App\\ProductDetail', 'product_id');\n }", "public function gradesHistory()\n {\n return $this->hasMany('App\\Models\\GradesHistory');\n }", "public function product()\n\t{\n\t\treturn $this->belongsTo(StoreProduct::class);\n\t}", "public function products() \n {\n return $this->belongsToMany(Product::class);\n }", "public function products()\n {\n return $this->belongsToMany(Product::class);\n }", "public function stocks()\n {\n return $this->hasMany('App\\Models\\Stock');\n }", "function soldStock($product_id, $count=1) {\n\t\t\t$product=$this->findById($product_id);\n\t\t\t\n\t\t\tif ($product['Product']['stock']) {\n\t\t\t\t$product['Product']['stock_number']--;\n\t\t\t\t\n\t\t\t\t$this->Save($product);\n\t\t\t}\n\t\t}", "public function ingredientSuppliers(){\n return $this->hasMany(SupplierStock::class);\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withTimestamps();\n }", "public function images()\n {\n return $this->hasMany(ProductImageProxy::modelClass(), 'seller_product_id');\n }", "public function views()\n {\n return $this->hasManyThrough('App\\View', 'App\\Product');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Product')->withPivot('quantity');\n }", "public function soldBooks()\n {\n return $this->hasManyThrough(Order::class, Book::class, 'user_id', 'book_id', 'id');\n }", "public function products()\n {\n return $this->hasMany('App\\Product', 'main_supplier_id')->orderby('name', 'asc');\n }", "public function products()\n {\n return $this->belongsToMany('App\\Models\\Product');\n }", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }" ]
[ "0.67225367", "0.6498215", "0.63216645", "0.6256579", "0.6218503", "0.62021136", "0.60915935", "0.60755974", "0.6001262", "0.5849131", "0.5764692", "0.5763904", "0.571381", "0.5664875", "0.5641425", "0.5637534", "0.5579778", "0.5577001", "0.5573937", "0.5570963", "0.5565152", "0.5561273", "0.5539836", "0.551364", "0.5506556", "0.5500074", "0.54847354", "0.5478563", "0.5474868", "0.5474494", "0.5454918", "0.5442787", "0.5442787", "0.5442787", "0.5442787", "0.5442787", "0.5442787", "0.5442787", "0.5426664", "0.54239273", "0.540801", "0.54042417", "0.53998333", "0.53996867", "0.53996867", "0.5397873", "0.53898054", "0.5388901", "0.53866994", "0.53834194", "0.53666335", "0.53557664", "0.5353368", "0.5353368", "0.5353368", "0.5353368", "0.5353368", "0.5353368", "0.5353368", "0.53340703", "0.5333504", "0.5333454", "0.53247887", "0.53212225", "0.53010744", "0.5297129", "0.52906513", "0.528822", "0.5284833", "0.52845037", "0.52783906", "0.52678746", "0.5267214", "0.52627426", "0.5251301", "0.5247355", "0.5239049", "0.5237957", "0.5229223", "0.5227534", "0.521602", "0.52112025", "0.52014923", "0.518634", "0.51842076", "0.5176412", "0.5168704", "0.5162452", "0.51399386", "0.5135479", "0.5124753", "0.51075226", "0.5103655", "0.5103316", "0.51004136", "0.5100046", "0.50980425", "0.5089127", "0.50790143", "0.50635785" ]
0.7939953
0
Display a listing of the resource.
public function index() { $dh = DonHang::all(); return view('admin.donhang.index')->with('dh',$dh); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create(Request $request) { if(empty($request->start)){ $date_start = Carbon::create(2002,1,1,0,0,0); $donhang = DonHang::whereBetween('created_at',[$date_start, $request->end])->get(); return view('admin.donhang.index')->with('dh',$donhang); } if(empty($request->end)){ $temp = Carbon::now(); $date_end = date_time_set($temp, 23,59,59); $donhang = DonHang::whereBetween('created_at',[$request->start, $date_end])->get(); return view('admin.donhang.index')->with('dh',$donhang); } if(!empty($request->start) && !empty($request->end)){ $temp = new DateTime($request->end); $date_end = date_time_set($temp, 23,59,59); $donhang = DonHang::whereBetween('created_at',[$request->start, $date_end])->get(); return view('admin.donhang.index')->with('dh',$donhang); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $donhang = DonHang::where('madh',$id)->get(); return view('admin.donhang.ctdh')->with('donhang',$donhang); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233183", "0.81894475", "0.6830127", "0.6498529", "0.6496276", "0.6469191", "0.64627224", "0.63619924", "0.6308743", "0.62809277", "0.6218707", "0.61915004", "0.617914", "0.6172935", "0.6137578", "0.6118736", "0.6107122", "0.6106576", "0.60931313", "0.60798067", "0.6046669", "0.60386544", "0.60193497", "0.59882426", "0.5963477", "0.59618807", "0.5952755", "0.5929829", "0.59192723", "0.59065384", "0.59065384", "0.59065384", "0.590592", "0.58923435", "0.5870325", "0.5868533", "0.58685124", "0.5851443", "0.5815833", "0.58149886", "0.58143586", "0.580419", "0.58004224", "0.5793256", "0.57887405", "0.57840455", "0.5782294", "0.5760476", "0.5757928", "0.57578564", "0.57453394", "0.5745187", "0.5741311", "0.5738201", "0.5738201", "0.5730195", "0.5727921", "0.5727622", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5720258", "0.5714068", "0.57106924", "0.5709095", "0.57058644", "0.57057875", "0.5704414", "0.5704414", "0.57021624", "0.56991994", "0.5692151", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $dh = DonHang::where('madh',$id)->first(); $dh->trangthai= $request->cb_trangthai; if($dh->update()){ return redirect('http://localhost:8888/WebBanSach/public/dh/'); }else{ return redirect('http://localhost:8888/WebBanSach/public/dh/'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Default authentification name Initialising class htaccess
function htaccess(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function addLogin(){\r\n\t $file=fopen($this->fHtaccess,\"w+\");\r\n\t fputs($file,\"Order allow,deny\\n\");\r\n\t fputs($file,\"Allow from all\\n\");\r\n\t fputs($file,\"AuthType \".$this->authType.\"\\n\");\r\n\t fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\r\n\t fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\r\n\t fputs($file,\"require valid-user\\n\");\r\n\t fclose($file);\r\n\t}", "public function initialize()\n {\n parent::initialize();\n $this->Auth->allow(['logout','nfsaLogin','home', 'login', 'ercmsRequest', 'index']);\n }", "public function __construct() {\r\n $host = $_SERVER['HTTP_HOST'];\r\n $this->routes['default'] = \"http://$host/index.php\";\r\n $this->routes['login'] = \"http://$host/login.php\";\r\n }", "function htaccess($htaccess, $htpass, $htgroup=null){\n\t \n\t $this->setFHtaccess($htaccess);\n\t\t$this->setFPasswd($htpass);\n\t\t\n\t\tif ($htgroup)\n\t\t $this->setFHtgroup($htgroup);\n }", "public function __construct() {\n\n\t\t# Make twig extend\n\t\tTwig::init();\n\n\t\t# Get path\n\t\t$path = Request::getPath();\n\n\t\t# Check if available\n\t\tif(!empty(Sky::$config[\"authenticate\"][\"use\"]) && !Auth::isLoggedIn())\n\t\t\tforeach($this->authPages as $page)\n\t\t\t\tif(preg_match(\"/$page/\", $path))\n\t\t\t\t\tRequest::setAddress('/login');\n\n\t}", "function __construct(){\n\t\tif(!$this->is_debug()) $this->error_view(404);\n\t\tif(!preg_match('/security/i',$_SERVER['REQUEST_URI'])) parent::__construct();\n\t}", "abstract protected function auth();", "abstract protected function auth_url();", "public function __construct(){\r\n\r\n\t\t\t$typelist = array('login','do_login');\r\n\r\n\r\n\t\t\tif(empty($_SESSION['admin'])){\r\n\t\t\t\t//\r\n\t\t\t\tif(@!in_array($_GET['a'],$typelist)){\r\n\r\n\t\t\r\n\t\t\t\t\techo header('location:./index.php?m=index&a=login');\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "function __construct(){\n\t\t//htaccess设置\n\t\t//路由分析 / index.php/Home/Index/index/id/1\t\t\n\t\t$path = $_SERVER['REQUEST_URI'];\n //p($_REQUEST);\t\n\t\tif(isset($path) && $path!='/'){\n\t\t\t$pathArr = explode('/', ltrim($path,'/'));\t\t\n\t\t\t//重置路由\n\t\t\tif(isset($pathArr[0])){\n\t\t\t\t$this->module = $pathArr[0];\n\t\t\t\tunset($pathArr[0]);\n\t\t\t}\n\t\t\tif(isset($pathArr[1])){\n\t\t\t\t$this->ctrl = $pathArr[1];\n\t\t\t\tunset($pathArr[1]);\n\t\t\t}\n\t\t\tif(isset($pathArr[2])){\n\t\t\t\t$this->action = $pathArr[2];\n\t\t\t\tunset($pathArr[2]);\n\t\t\t}\n\t\t\t//参数解析\n\t\t\t$count = count($pathArr);\n\t\t\t//$paras = array();\n\t\t\t//p($pathArr);\n\t\t\tfor($i=3;$i<$count+3;$i=$i+2){\n\t\t\t\tif(isset($pathArr[$i+1])){//处理参数不匹配的\n\t\t\t\t\t$_GET[$pathArr[$i]] = $pathArr[$i+1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//$_GET['paras'] = $paras;\n\t\t\t\n\t\t }else{\n\t\t $this->module = Conf::get('MODULE','config');\n\t\t\t $this->ctrl = Conf::get('CTRL','config');\n\t\t\t $this->action = Conf::get('ACTION','config');\n\t\t }\n\t}", "function htaccess(){\r\n\t}", "function __construct() {\n\t\t\n\t\tparent::__construct(array('Waccess'), 8);\n\t\t\n\t}", "public function __construct()\n {\n parent::__construct();\n\n //check auth\n if (!is_admin() && !is_author()) {\n redirect('login');\n }\n }", "function __construct() {\r\n parent::__construct(false, $name = 'CSH Login');\t\r\n }", "public function __construct() {\n parent::__construct();\n if (!isset($_SESSION[\"login\"])) {\n redirect(HOSTURL);\n }\n }", "public function __construct()\n {\n $this->middlewere('api.auth', ['except'=>['index','show']]);\n }", "function __construct()\n {\n parent::__construct();\n check_access('admin');\n }", "function __construct()\n {\n parent::__construct();\n check_access('admin');\n }", "private function changeAuthenticationRedirect()\n {\n $this->line('Change default authentication redirect');\n\n $file = app_path('Http/Middleware/Authenticate.php');\n $content = $this->files->get($file);\n\n $this->files->replace($file, Str::replaceArray(\"route('login')\", [\"config('admin.url')\"], $content));\n }", "protected function writehtaccess()\n {\n $content = '# Deny access to supersake\n<Files supersake>\n\tOrder allow,deny\n\tDeny from all\n</Files>';\n }", "function auth_redirect()\n {\n }", "public function __construct()\n {\n $this->protocol = api_get_setting('sso_authentication_protocol');\n // There can be multiple domains, so make sure to take only the first\n // This might be later extended with a decision process\n $domains = explode(',', api_get_setting('sso_authentication_domain'));\n $this->domain = trim($domains[0]);\n $this->auth_uri = api_get_setting('sso_authentication_auth_uri');\n $this->deauth_uri = api_get_setting('sso_authentication_unauth_uri');\n //cut the string to avoid recursive URL construction in case of failure\n $this->referer = $this->protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],'sso'));\n $this->deauth_url = $this->protocol.$this->domain.$this->deauth_uri;\n $this->master_url = $this->protocol.$this->domain.$this->auth_uri;\n $this->referrer_uri = base64_encode($_SERVER['REQUEST_URI']);\n $this->target = api_get_path(WEB_PATH);\n }", "public function __construct()\n {\n $this->middleware('auth', ['except' => ['homepage', 'deny']]);\n }", "function __construct()\n {\n if(!$this->isLoggedIn())\n return redirect('/login');\n\n }", "public function doAuthentication();", "public function __construct()\n {\n $this->urltoparent = url(\"User\\RolePerm\");\n $this->urltoview = \"User.RolePerm\";\n }", "public function init()\n {\n $authorization =Zend_Auth::getInstance();\n if(!$authorization->hasIdentity() && $this->_request->getActionName()!='login'){\n $this->redirect(\"Users/login\");\n }\n \n }", "public function __construct()\n {\n parent::__construct();\n\n /** Comprobamos que tenga hecho el login */\n $url='entrar';\n $this->redirect = $this->input->server(\"REQUEST_URI\");\n if (($this->redirect != '/') && ($this->redirect != '')) {\n $url .= '?redirect='.$this->redirect;\n }\n\n if ($this->is_logged == false) {\n redirect(base_url($url));\n }\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\tif ($_SESSION['login']['check'] == FALSE) { redirect(base_url()); }\n\t}", "public function __construct() {\n parent::__construct();\n\n \t$this->must_login();\n }", "function create_htaccess($ip,$root,$ts_shop_folder) {\t\t\t\t\t\t\n$htaccess = 'AuthType Basic\nAuthName \"OpenShop Administration\"\nAuthUserFile '.$root.'/'.$ts_shop_folder.'/administration/.htpasswd\nRequire valid-user\nOrder Deny,Allow\nDeny from all\nAllow from '.$ip.'\n';\n\n\t\t\t\tif(!is_writable(\"administration/.htaccess\")) {\n\t\t\t\t\tchmod(\"administration/.htaccess\",0777);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$hta = fopen(\"administration/.htaccess\", \"w+\") or die(\"<div class=\\\"installer-message\\\">Unable to open administration .htaccess</div>\");\n\t\t\t\t\tfwrite($hta, $htaccess);\n\t\t\t\t\tfclose($hta);\n\t\t\t\t}", "public function __construct()\n {\n if (setting('private_site')) {\n $this->middleware('auth');\n }\n }", "public function authentication()\n {\n }", "abstract public function url_authorize();", "public function use_authentication()\n {\n }", "function __construct() {\n\t\tparent::__construct();\n\t\tif ($this->session->userdata('is_login') != TRUE) {\n\t\t\tredirect('auth');\n\t\t}\n\t}", "public static function _init()\n {\n \\Module::load('authentication');\n }", "public function init()\n {\n $authorization = Zend_Auth::getInstance();\n $storage = $authorization->getStorage();\n $sessionRead = $storage->read();\n if ($authorization->hasIdentity())\n {\n $admin = $sessionRead->name;\n if ($this->_request->getActionName() != 'login' && $admin != 'admin')\n {\n $this->redirect(\"admin/login\");\n } \n }\n else {\n if ($this->_request->getActionName() != 'login') {\n $this->redirect(\"admin/login\");\n }\n }\n }", "function create_class_htaccess($student_class_path) {\n $class_htaccess = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options +Indexes\n</Files>\n\";\n $file_path = \"${student_class_path}/.htaccess\";\n if (file_exists($file_path))\n return \"<!-- Class htaccess already exists -->\";\n if (file_put_contents($file_path, $class_htaccess))\n return \"<!-- Created class htaccess -->\";\n return \"<!-- Unable to create class htaccess -->\";\n}", "public function __construct(){\n\t\t$u = new Login();\n\n\t\tif(!$u->isLogged()){\n\t\t\theader(\"Location: \".BASE_URL.\"login\");\n\t\t}\n\n\t}", "function setFHtaccess($filename){\r\n\t\t$this->fHtaccess=$filename;\r\n\t}", "public function __construct(){\n\t\t\t$this->authentication();\n\t\t}", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "public function __construct() {\r\n\t\tif(!$this->isLoggedIn()) {\r\n\t\t\theader('location: ' . URL . 'authentication/index');\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t $this->loadModel($this->modelToLoad);\r\n\t $this->model->setAuth($_SESSION['ID'], $_SESSION['PASSWORD']);\r\n\t\t\r\n\t\tparent::__construct();\r\n\t}", "public function init()\n {\n\t$auth = Zend_Auth::getInstance();\n \tif (!$auth->hasIdentity() || ($auth->getIdentity()->role != 'admin')) {\n $this->_helper->redirector('index', 'index', 'default');\n }\n\n }", "public function __construct()\n {\n $guard = backpack_guard_name();\n \n $this->middleware(\"guest:$guard\", ['except' => 'logout']);\n // ----------------------------------\n // Use the admin prefix in all routes\n // ----------------------------------\n\n // If not logged in redirect here.\n $this->loginPath = property_exists($this, 'loginPath') ? $this->loginPath\n : backpack_url('login');\n\n // Redirect here after successful login.\n $this->redirectTo = property_exists($this, 'redirectTo') ? $this->redirectTo\n : backpack_url('dashboard');\n\n // Redirect here after logout.\n $this->redirectAfterLogout = property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout\n : backpack_url();\n // $this->loginPath = \"/users/login\";\n // $this->redirectTo = '/users/login';\n // $this->redirectAfterLogout = '/users/login';\n \n }", "public function __construct () {\n\t\t\tif (!$_SESSION['isLogged']) {\n\t\t\t\theader('Location: '.BASE_URL.'/?controller=login&action=login');\n\t\t\t}\n\t\t\t// set view folder\n\t\t\t$this->folder = \"users\";\n\t\t}", "public function __construct(){\n\t\t$this->middleware('auth', [ 'except' => [\n\t\t\t'show'\t\n\t\t]]);\n\t}", "function __construct(){\n\t\tparent::__construct();\t\n\t\t\n\t\t// validate user sessions if not set then redirect to login page\n\t\tif( $this->bims->auth_session() === FALSE)\n\t\t\tredirect(base_url()); \n\t}", "public function __construct() {\n $this->redirectTo = config('lyra.routes.web.prefix');\n parent::__construct();\n }", "public function __construct(){\n\t\t$this->request = $_REQUEST;\n\t\t$this->get = $_GET;\n\t\t$this->post = $_POST;\n\t\t$this->checkHtaccess();\n\t}", "public function __construct()\r\n {\r\n //Auth Security\r\n loginSecurity();\r\n }", "function auth();", "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "private function htaccessinitialize() {\n\t\t// get .htaccess\n\t\t$this->htaccessfile = str_replace('typo3conf' . DIRECTORY_SEPARATOR .\n\t\t\t\t'ext' . DIRECTORY_SEPARATOR . 'cyberpeace' . DIRECTORY_SEPARATOR . 'pi1', '', realpath(dirname(__FILE__))) . '.htaccess';\n\t\t$denyarr = 'no .htaccess';\n\t\tif (file_exists($this->htaccessfile)) {\n\t\t\t$denyarr = array();\n\t\t\t// get contents\n\t\t\t$this->htaccesscontent = file_get_contents($this->htaccessfile);\n\t\t\t// get line ##cyberpeace START\n\t\t\tif (str_replace('##cyberpeace START', '', $this->htaccesscontent) == $this->htaccesscontent) {\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t// get line ##cyberpeace END\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace START';\n\t\t\t\t$this->htaccesscontent = str_replace('##cyberpeace END', '', $this->htaccesscontent);\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace END';\n\t\t\t}\n\n\t\t\t// get lines between ##cyberpeace START and END\n\t\t\t$this->arrtostart = explode(\"\\n\" . '##cyberpeace START', $this->htaccesscontent);\n\t\t\t$this->arrtoend = explode(\"\\n\" . '##cyberpeace END', $this->arrtostart[1]);\n\n\t\t\t// explode by '\\ndeny from '\n\t\t\t$denyarr = explode(\"\\n\" . 'deny from ', $this->arrtoend[0]);\n\n\t\t}\n\n\t\treturn $denyarr;\n\t}", "public function __construct()\n {\n # auth.basic.once will use basic authentication, and it will be a stateless authentication\n $this->middleware('auth.basic.once');\n $this->stateFulGuard = Auth::guard('web');\n }", "public function __construct()\n {\n $this->middleware('auth', ['except' => ['index','aboutMe','downloadFile','generateSitemap']] );\n }", "function __construct(){\n\t\t$this->middleware('auth', ['only' => ['add', 'index']]);\n\t}", "public function __construct() {\n // Use FS over PHP for this as it may need to search deep.\n $htaccess = array();\n exec('locate .htaccess', $htaccess);\n\n $htaccess = array_filter($htaccess, function($item) {\n return strpos($item, DRUPAL_ROOT) !== FALSE;\n });\n\n $this->setData($htaccess);\n }", "public function init()\n {\n \t$auth = Zend_Auth::getInstance();\n \t\n \tif(!$auth->hasIdentity()){\n \t\t$this->_redirect('/login');\n \t}\n }", "public function __construct()\n {\n if((strpos(\\Helpers\\Session::get('ROLES'),'A')||strpos(\\Helpers\\Session::get('ROLES'),'Z'))===false)\n \\Helpers\\Url::redirect('login');\n parent::__construct();\n $this -> _model_ = new \\Models\\Admin();\n }", "public function __construct()\n {\n\t\t$this->site_name = isset(getAppConfig()->site_name)?ucfirst(getAppConfig()->site_name):'';\n $this->middleware('auth');\n SEOMeta::addKeyword($this->site_name);\n OpenGraph::setTitle($this->site_name);\n OpenGraph::setDescription($this->site_name);\n OpenGraph::setUrl($this->site_name);\n Twitter::setTitle($this->site_name);\n Twitter::setSite('@'.$this->site_name);\n\t\tApp::setLocale('en');\n }", "public static function setRedirectUponAuthentication(){\n\n /**\n * Make sure we redirect to the requested page\n */\n if(isset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]) && !empty($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY])){\n CoreHeaders::setRedirect($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n unset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n }else{\n CoreHeaders::setRedirect('/');\n }\n\n }", "public function initialize()\n {\n parent::initialize();\n $this->Auth->allow(\n [\n 'login',\n 'logout',\n 'register',\n 'recover'\n ]\n );\n }", "function _route()\n\t{\n\t\t// if the user login redirect to base\n\t\tif(\\lib\\permission::access('enter:another:session'))\n\t\t{\n\t\t\t// the admin can login by another session\n\t\t\t// never redirect to main\n\t\t}\n\t\telse\n\t\t{\n\t\t\tparent::if_login_not_route();\n\t\t}\n\n\t\t// check remeber me is set\n\t\t// if remeber me is set: login!\n\t\tparent::check_remember_me();\n\n\t\t// save all param-* | param_* in $_GET | $_POST\n\t\t$this->save_param();\n\n\t\tif(self::get_request_method() === 'get')\n\t\t{\n\t\t\t$this->get(false, 'enter')->ALL();\n\t\t}\n\t\telseif(self::get_request_method() === 'post')\n\t\t{\n\t\t\t$this->post('enter')->ALL();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::error_method('home');\n\t\t}\n\t}", "public function __construct()\n {\n // auth here\n }", "public function __construct () {\n\t\t\tif (isset($_COOKIE['username']) && isset($_COOKIE['remember_token'])) {\n\t\t\t\t$username = $_COOKIE['username'];\n\t\t\t\t$remember_token = $_COOKIE['remember_token'];\n\t\t\t\t$user = User::findByName($username);\n\t\t\t\tif ($user->remember_token == $remember_token) {\n\t\t\t\t\t$_SESSION['username'] = $username;\n\t\t\t\t\t$_SESSION['isLogged'] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_SESSION['isLogged']) && $_SESSION['isLogged'] == true) {\n\t\t\t\theader('Location: '.BASE_URL.'/index.php?controller=product&action=list');\n\t\t\t}\n\t\t\t// set view folder\n\t\t\t$this->folder = 'auth';\n\t\t}", "public function indexController()\n\t{\n\t\t$auth = new Authentification();\n\t}", "function auth_namespace()\n{\n return LC_NAMESPACE ? 'AuthUser.' . LC_NAMESPACE : 'AuthUser.default';\n}", "function __construct() {\n \tparent::__construct();\n if($this->session->userdata('status') != \"login\") {\n \t\t\tredirect('user/protect');\n \t\t}\n }", "public function __construct()\r\n\t{\r\n\t\t//require(BATH_PATH.'/view/login.php');\r\n\t}", "public function init() {\n $authorization = Zend_Auth::getInstance();\n if(!$authorization->hasIdentity() && $this->_request->getActionName() != \"loginuser\"&& $this->_request->getActionName() != \"forgetpassword\")\n {\n $this->redirect('user/loginuser');\n } \n\n }", "public function __construct (){\n\t\tif ($_GET[\"action\"]==\"home\") {\n\t\t\tif (!isset($_SESSION[\"Usuarios\"])) {\n\t\t\t\techo \"No hay sesion\";\n\t\t\t\theader(\"Location:/Proyecto/index.php?controller=Usuario&action=vistahome\");\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function __construct()\n\t{\n\t\tparent:: __construct();\n\t\tif ($this->session->userdata('admin')) {\n\t\t\tredirect(base_url('admin'));\n\t\t}\n\t\tif ($this->session->userdata('teacher')) {\n\t\t\tredirect(base_url('teacher'));\n\t\t}\n\t}", "function __construct()\n\t{\n\t parent::__construct();\n\t if (!isset($_SESSION['usuario']))\n\t { \n\t \theader(\"Location: \".base_url().\"login\");\n\t }\n\t}", "function authGet() { }", "public function __construct(){\n $this-> middleware('auth:admin');\n }", "public function __construct() {\n // Pass in the base for all the views\n parent::__construct();\n\n // Tell what is the base for all login\n $this->view_base = 'accounts/passwords/';\n $this->section = 'accounts';\n }", "public function __construct()\n {\n /*permitir que usuarios autenticados accedan a una ruta determinada\n si estan autenticados redirecciona a home*/\n $this->middleware('auth');\n }", "public function __construct()\n {\n //therefore the below function can be used to access it\n //https://stackoverflow.com/questions/39175252/cant-call-authuser-on-controllers-constructor\n $this->middleware(function ($request, $next) {\n $this->user = Auth::user();\n //i.e not logged in\n\n\n if (is_null($this->user)) {\n return redirect(\"/login\");\n }\n\n if ($this->user->privelleges != \"admin\") {\n return redirect()->route('general.restricted');\n }\n\n //maybe update redirct to\n //Redirect::to('/login?attempt='. true) or something liek that\n return $next($request);\n });\n }", "protected function initialize(){\n\t\tif (!$this->session->has(\"admin_name\")){\n\t\t\t$this->dispatcher->forward(array(\n\t\t\t\"controller\" => \"login\",\n\t\t\t\"action\" => \"login\",\t\t\t\n\t\t\t)\n\t\t);\n\t\t}\n\t}", "public function __construct() {\n\t\t$this->middleware ( 'auth' );\n\t}", "public function __construct()\n {\n $this->beforefilter('auth', array('except'=>array('index','show','sitemap')));\n }", "public function __construct(){\n\t\t$this->middleware( 'auth' );\n\t}", "public function __construct()\n {\n $this->middleware('auth', ['except' => ['loginAs', 'robot']]);\n }", "public function getDefaultAccessRules();", "function template_redirect() {\r\n\t\tappthemes_auth_redirect_login();\r\n\t}", "public function __construct() {\n parent::__construct();\n // Verifica se está logado, se não vai para pagina de login \n $u = new Users();\n if($u->isLogged() == false) {\n header(\"Location:\".BASE_URL.\"/login\");\n exit;\n }\n }", "public function __construct()\n {\n $this->addRole(new Zend_Acl_Role('unregistered'))\n ->add(new Zend_Acl_Resource('public'))\n ->add(new Zend_Acl_Resource('error'))\n ->add(new Zend_Acl_Resource('index'))\n ->allow('unregistered', array('public', 'error', 'index'));\n\n // ACL for user\n $this->addRole(new Zend_Acl_Role('user'), 'unregistered')\n ->add(new Zend_Acl_Resource('user'))\n ->allow('user', 'user');\n\n\n // ACL for operatore\n $this->addRole(new Zend_Acl_Role('operatore'), 'unregistered')\n ->add(new Zend_Acl_Resource('operatore'))\n ->allow('operatore', 'operatore');\n\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\tis_logged_in();\t\n\t}", "public function __construct()\n\t{\n\t\t//$this->middleware('auth');\n\t\t //$this->middleware('auth', array('only'=>array('index')));\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\t\t\t\n\t\tif ($this->session->userdata('astrosession') == FALSE) {\n\t\t\tredirect(base_url('authenticate'));\t\t\t\n\t\t}\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\t\t\t\n\t\tif ($this->session->userdata('astrosession') == FALSE) {\n\t\t\tredirect(base_url('authenticate'));\t\t\t\n\t\t}\n\t}", "public function authHospital(){\n\n\t}", "public function init() {\n \n $this->_helper->acl->allow('public',null);\n }", "public function __construct()\n\t{\n\t\t$this->beforeFilter('auth'); //bloqueo de acceso\n\t}", "function __construct() {\n\n $this->addRole(new Zend_Acl_Role('guests'));\n $this->addRole(new Zend_Acl_Role('admins'), 'guests');\n\n // >>>>>>>>>>>> Adding Resources <<<<<<<<<<<<<<<\n \n // **** Resources for module Default *****\n\n $this->add(new Zend_Acl_Resource('default'));\n $this->add(new Zend_Acl_Resource('default:index'), 'default');\n \n\n // **** Resources for module Admin *****\n\n $this->add(new Zend_Acl_Resource('admin'));\n $this->add(new Zend_Acl_Resource('admin:index'), 'admin');\n $this->add(new Zend_Acl_Resource('admin:devis'), 'admin');\n\n // >>>>>>>>>>>> Affecting Resources <<<<<<<<<<<<<<<\n \n // ------- >> module Default << -------\n $this->allow('guests', 'default:index');\n \n \n // ------- >> module Admin << -------\n $this->allow('guests', 'admin:index');\n $this->allow('guests', 'admin:devis');\n \n \n }" ]
[ "0.68765026", "0.68765026", "0.6863218", "0.6246467", "0.6233371", "0.62299633", "0.61967534", "0.6190129", "0.6143394", "0.6138507", "0.61142564", "0.60587054", "0.60552216", "0.6041025", "0.596401", "0.5852622", "0.584752", "0.5847249", "0.5817079", "0.5817079", "0.5794862", "0.57231945", "0.57231194", "0.5720823", "0.5708336", "0.5695418", "0.5694665", "0.56942886", "0.5684117", "0.56822556", "0.568124", "0.5680029", "0.567064", "0.5667714", "0.5652649", "0.56407773", "0.56364876", "0.5627702", "0.56137514", "0.5612313", "0.56099427", "0.5609812", "0.55931073", "0.55870086", "0.5584159", "0.5584159", "0.5582621", "0.55667424", "0.55665046", "0.55622625", "0.5554547", "0.5534021", "0.55327755", "0.55262136", "0.55246836", "0.55222815", "0.55218655", "0.5520546", "0.55163985", "0.55104476", "0.5510432", "0.55015314", "0.5500182", "0.5489046", "0.5486049", "0.5471171", "0.5459321", "0.54591143", "0.5457659", "0.54510427", "0.54506594", "0.54460186", "0.54450905", "0.5440528", "0.5436408", "0.54348123", "0.5433979", "0.5428564", "0.5427983", "0.54241216", "0.54231", "0.5422163", "0.5420778", "0.5417611", "0.54163235", "0.5416148", "0.5415038", "0.54104084", "0.5408454", "0.5404924", "0.539904", "0.53969896", "0.53950804", "0.5395069", "0.53903973", "0.53903973", "0.5389663", "0.5378133", "0.53727967", "0.53687036" ]
0.58723235
15
Sets the filename and path of .htaccess to work with
function setFHtaccess($filename){ $this->fHtaccess=$filename; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFHtaccess($filename){\r\n\t\t$this->fHtaccess=$filename;\r\n\t}", "public function createHtaccessFile() {\n $oModule = oxNew(Module::class);\n $oConfig = $this->getConfig();\n // get modules path\n $sModulesDir = $oConfig->getModulesDir();\n // get cache path\n $sCacheDir = $oConfig->getConfigParam('sCompileDir');\n // check if the default .htaccess file is in config folder\n if(file_exists($sModulesDir.$oModule->getModulePath('suaboclearcache').'/Config/.htaccess.tmp')) {\n // copy .htaccess to cache folder\n copy($sModulesDir . $oModule->getModulePath('suaboclearcache') . '/Config/.htaccess.tmp', $sCacheDir . '/.htaccess');\n }\n }", "function wpsc_product_files_htaccess() {\n if(!is_file(WPSC_FILE_DIR.\".htaccess\")) {\n\t\t$htaccess = \"order deny,allow\\n\\r\";\n\t\t$htaccess .= \"deny from all\\n\\r\";\n\t\t$htaccess .= \"allow from none\\n\\r\";\n\t\t$filename = WPSC_FILE_DIR.\".htaccess\";\n\t\t$file_handle = @ fopen($filename, 'w+');\n\t\t@ fwrite($file_handle, $htaccess);\n\t\t@ fclose($file_handle);\n\t\t@ chmod($file_handle, 665);\n }\n}", "protected function writehtaccess()\n {\n $content = '# Deny access to supersake\n<Files supersake>\n\tOrder allow,deny\n\tDeny from all\n</Files>';\n }", "public function htaccessGen($path = \"\") {\n if($this->option(\"htaccess\") == true) {\n\n if(!file_exists($path.DIRECTORY_SEPARATOR.\".htaccess\")) {\n // echo \"write me\";\n $html = \"order deny, allow \\r\\n\ndeny from all \\r\\n\nallow from 127.0.0.1\";\n\n $f = @fopen($path.DIRECTORY_SEPARATOR.\".htaccess\",\"w+\");\n if(!$f) {\n return false;\n }\n fwrite($f,$html);\n fclose($f);\n\n\n }\n }\n\n }", "function update_htaccess($unused, $value) {\r\n\t\t$this->htaccess_recovery = $value;\r\n\t\t\r\n\t\t//Overwrite the file\r\n\t\t$htaccess = get_home_path().'.htaccess';\r\n\t\t$fp = fopen($htaccess, 'w');\r\n\t\tfwrite($fp, $value);\r\n\t\tfclose($fp);\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function create_htaccess($ip,$root,$ts_shop_folder) {\t\t\t\t\t\t\n$htaccess = 'AuthType Basic\nAuthName \"OpenShop Administration\"\nAuthUserFile '.$root.'/'.$ts_shop_folder.'/administration/.htpasswd\nRequire valid-user\nOrder Deny,Allow\nDeny from all\nAllow from '.$ip.'\n';\n\n\t\t\t\tif(!is_writable(\"administration/.htaccess\")) {\n\t\t\t\t\tchmod(\"administration/.htaccess\",0777);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$hta = fopen(\"administration/.htaccess\", \"w+\") or die(\"<div class=\\\"installer-message\\\">Unable to open administration .htaccess</div>\");\n\t\t\t\t\tfwrite($hta, $htaccess);\n\t\t\t\t\tfclose($hta);\n\t\t\t\t}", "protected function htaccess()\n\t{\n\t\t$error = \"\";\n\t\t\t\n\t\tif(!file_exists(\".htaccess\"))\n\t\t{\n\t\t\tif(!rename(\"e107.htaccess\",\".htaccess\"))\n\t\t\t{\n\t\t\t\t$error = LANINS_142;\n\t\t\t}\n\t\t\telseif($_SERVER['QUERY_STRING'] == \"debug\")\n\t\t\t{\n\t\t\t\trename(\".htaccess\",\"e107.htaccess\");\n\t\t\t\t$error = \"DEBUG: Rename from e107.htaccess to .htaccess was successful\";\t\t\n\t\t\t}\n\t\t}\n\t\telseif(file_exists(\"e107.htaccess\"))\n\t\t{\n\t\t\t$srch = array('[b]','[/b]');\n\t\t\t$repl = array('<b>','</b>');\n\t\t\t$error = str_replace($srch,$repl, LANINS_144); // too early to use e107::getParser() so use str_replace();\n\t\t}\t\t\n\t\treturn $error;\t\n\t}", "public function __construct() {\n // Use FS over PHP for this as it may need to search deep.\n $htaccess = array();\n exec('locate .htaccess', $htaccess);\n\n $htaccess = array_filter($htaccess, function($item) {\n return strpos($item, DRUPAL_ROOT) !== FALSE;\n });\n\n $this->setData($htaccess);\n }", "function htaccess(){\r\n\t}", "function ahr_handle_htaccess_errors() {\r\n \r\n $root_dir = get_home_path();\r\n $htaccess_filename_path = $root_dir . '.htaccess';\r\n \r\n $is_htaccess = file_exists( $htaccess_filename_path );\r\n \r\n if ( !$is_htaccess ) {\r\n echo '<p>There is no htaccess file in your root directory, it could be that you are not using Apache as a server, or that your server does not use htaccess files.</p>\r\n\t\t<p>If you are using Apache, you can try to create a new htaccess file, then try changing static resources redirection and see if it works.</p>';\r\n return;\r\n }\r\n \r\n $is_htaccess_writable = is_writable( $htaccess_filename_path );\r\n \r\n if ( !$is_htaccess_writable )\r\n echo '<p>Htaccess is not writable check your permissions.</p>';\r\n \r\n}", "public function setFilename($filename) {\n\n\t\t$basename = basename($filename); \n\n\t\tif(DIRECTORY_SEPARATOR != '/') {\n\t\t\t// To correct issue with XAMPP in Windows\n\t\t\t$filename = str_replace('\\\\' . $basename, '/' . $basename, $filename); \n\t\t}\n\t\n\t\tif($basename != $filename && strpos($filename, $this->pagefiles->path()) !== 0) {\n\t\t\t$this->install($filename); \n\t\t} else {\n\t\t\t$this->set('basename', $basename); \n\t\t}\n\n\t}", "protected function setCachePath(): void\n {\n $filename = basename($this->pathFile);\n\n $this->pathCache = $this->cacheDir.'/'.$filename;\n }", "static function write_to_htaccess()\r\n {\r\n global $aio_wp_security;\r\n //figure out what server is being used\r\n if (AIOWPSecurity_Utility::get_server_type() == -1) {\r\n $aio_wp_security->debug_logger->log_debug(\"Unable to write to .htaccess - server type not supported!\", 4);\r\n return false; //unable to write to the file\r\n }\r\n\r\n //clean up old rules first\r\n if (AIOWPSecurity_Utility_Htaccess::delete_from_htaccess() == -1) {\r\n $aio_wp_security->debug_logger->log_debug(\"Delete operation of .htaccess file failed!\", 4);\r\n return false; //unable to write to the file\r\n }\r\n\r\n $htaccess = ABSPATH . '.htaccess';\r\n\r\n if (!$f = @fopen($htaccess, 'a+')) {\r\n @chmod($htaccess, 0644);\r\n if (!$f = @fopen($htaccess, 'a+')) {\r\n $aio_wp_security->debug_logger->log_debug(\"chmod operation on .htaccess failed!\", 4);\r\n return false;\r\n }\r\n }\r\n AIOWPSecurity_Utility_File::backup_and_rename_htaccess($htaccess); //TODO - we dont want to continually be backing up the htaccess file\r\n @ini_set('auto_detect_line_endings', true);\r\n $ht = explode(PHP_EOL, implode('', file($htaccess))); //parse each line of file into array\r\n\r\n $rules = AIOWPSecurity_Utility_Htaccess::getrules();\r\n\r\n $rulesarray = explode(PHP_EOL, $rules);\r\n $rulesarray = apply_filters('aiowps_htaccess_rules_before_writing', $rulesarray);\r\n $contents = array_merge($rulesarray, $ht);\r\n\r\n if (!$f = @fopen($htaccess, 'w+')) {\r\n $aio_wp_security->debug_logger->log_debug(\"Write operation on .htaccess failed!\", 4);\r\n return false; //we can't write to the file\r\n }\r\n\r\n $blank = false;\r\n\r\n //write each line to file\r\n foreach ($contents as $insertline) {\r\n if (trim($insertline) == '') {\r\n if ($blank == false) {\r\n fwrite($f, PHP_EOL . trim($insertline));\r\n }\r\n $blank = true;\r\n } else {\r\n $blank = false;\r\n fwrite($f, PHP_EOL . trim($insertline));\r\n }\r\n }\r\n @fclose($f);\r\n return true; //success\r\n }", "function create_class_htaccess($student_class_path) {\n $class_htaccess = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options +Indexes\n</Files>\n\";\n $file_path = \"${student_class_path}/.htaccess\";\n if (file_exists($file_path))\n return \"<!-- Class htaccess already exists -->\";\n if (file_put_contents($file_path, $class_htaccess))\n return \"<!-- Created class htaccess -->\";\n return \"<!-- Unable to create class htaccess -->\";\n}", "function htaccess($htaccess, $htpass, $htgroup=null){\n\t \n\t $this->setFHtaccess($htaccess);\n\t\t$this->setFPasswd($htpass);\n\t\t\n\t\tif ($htgroup)\n\t\t $this->setFHtgroup($htgroup);\n }", "function htaccess(){\n }", "function htaccess_rewrite(){\n\n global $SETTINGS;\n\n require_once HOME . '_inc/function/defaults.php';\n\n\t$Plugins = Plugins::getInstance( );\n\n\t/**\n\t * if the apache_get_modules function is\n\t * available, make sure that the apache\n\t * rewrite module is loaded\n\t */\n\tif( function_exists( 'apache_get_modules' ) ){\n\t\t$modules=apache_get_modules();\n\n\t\tif(!in_array('mod_rewrite',$modules))\n\t\t\terror(\n\t\t\t\t'The apache module mod_rewrite must be installed. Please visit <a href=\"http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html\">'\n\t\t\t\t. 'Apache Module mod_rewrite</a> for more details.'\n\t\t\t\t,'Apache Error'\n\t\t\t);\n\t}\n\n\t/**\n\t * build up array of rewrite rules and filter\n\t * through the plugin filter\n\t */\n $rules = defaults_htaccess_rules( SITE_URL );\n \n\t$rules = $Plugins->filter( 'general', 'filter_htaccess', $rules );\n\n $htaccess = defaults_htaccess_content( $rules );\n\n\t/**\n\t * write htaccess file or throw error\n\t */\n\tfile_put_contents( HOME . '.htaccess', $htaccess ) \n\t\tor error(\n\t\t\t'You must grant <i>0777</i> write access to the <i>' . HOME . \n\t\t\t'</i> directory for <a href=\"http://furasta.org\">Furasta.Org</a> to function correctly.' .\n\t\t\t'Please do so then reload this page to save the settings.'\n\t\t\t,'Runtime Error'\n\t\t);\n\n\tif( $SETTINGS[ 'index' ] == 0 ){\n $robots = defaults_robots_content( 0, SITE_URL );\n\n\t\t$robots = $Plugins->filter( 'general', 'filter_robots', $robots );\n\t}\n else{\n $robots = defaults_robots_content( 1, SITE_URL );\n $file=HOME.'sitemap.xml';\n if(file_exists($file))\n unlink($file);\n\n\t}\n\n\t/**\n\t * write robots.txt or throw error\n\t */\n\tfile_put_contents( HOME. 'robots.txt', $robots );\n\n\treturn true;\n}", "function rex_com_mediaaccess_htaccess_update()\n{\n global $REX;\n \n $unsecure_fileext = implode('|',explode(',',$REX['ADDON']['community']['plugin_mediaaccess']['unsecure_fileext']));\n $get_varname = $REX['ADDON']['community']['plugin_mediaaccess']['request']['file'];\n \n ## build new content\n $new_content = '### MEDIAACCESS'.PHP_EOL;\n $new_content .= 'RewriteCond %{HTTPS} off'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/.*/.*'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/(.*).('.$unsecure_fileext.')$'.PHP_EOL;\n $new_content .= 'RewriteRule ^(.*)$ http://%{HTTP_HOST}/?'.$get_varname.'=\\$1 [R=301,L]'.PHP_EOL;\n $new_content .= 'RewriteCond %{HTTPS} on'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/.*/.*'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/(.*).('.$unsecure_fileext.')$'.PHP_EOL;\n $new_content .= 'RewriteRule ^(.*)$ https://%{HTTP_HOST}/?'.$get_varname.'=\\$1 [R=301,L]'.PHP_EOL;\n $new_content .= '### /MEDIAACCESS'.PHP_EOL;\n \n ## write to htaccess\n $path = $REX['HTDOCS_PATH'].'files/.htaccess';\n $old_content = rex_get_file_contents($path);\n \n if(preg_match(\"@(### MEDIAACCESS.*### /MEDIAACCESS)@s\",$old_content) == 1)\n { \n $new_content = preg_replace(\"@(### MEDIAACCESS.*### /MEDIAACCESS)@s\", $new_content, $old_content);\n return rex_put_file_contents($path, $new_content);\n }\n \n return false;\n}", "function setFilename($filename);", "function htaccess($rules, $directory, $before='') {\n\t$htaccess = $directory.'.htaccess';\n\tswitch($rules) {\n\t\tcase 'static':\n\t\t\t$rules = '<Files .*>'.\"\\n\".\n\t\t\t\t\t 'order allow,deny'.\"\\n\".\n\t\t\t\t\t 'deny from all'.\"\\n\".\n\t\t\t\t\t '</Files>'.\"\\n\\n\". \n\t\t\t\t\t 'AddHandler cgi-script .php .php3 .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi .fcgi'.\"\\n\".\n\t\t\t\t\t 'Options -ExecCGI';\n\t\tbreak;\n\t\tcase 'deny':\n\t\t\t$rules = 'deny from all';\n\t\tbreak;\n\t}\n\t\n\tif(file_exists($htaccess)) {\n\t\t$fgc = file_get_contents($htaccess);\n\t\tif(strpos($fgc, $rules)) {\n\t\t\t$done = true;\n\t\t} else {\n\t\t\tif(check_value($before)) {\n\t\t\t\t$rules = str_replace($before, $rules.\"\\n\".$before, $fgc);\n\t\t\t\t$f = 'w';\n\t\t\t} else {\n\t\t\t\t$rules = \"\\n\\n\".$rules;\n\t\t\t\t$f = 'a';\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$f = 'w';\n\t}\n\t\n\tif(!$done) {\n\t\t$fh = @fopen($htaccess, $f);\n\t\tif(!$fh) return false;\n\t\tif(fwrite($fh, $rules)) {\n\t\t\t@fclose($fh); return true;\n\t\t} else {\n\t\t\t@fclose($fh); return false;\n\t\t}\n\t} else {\n\t\treturn true;\n\t}\n}", "function iis7_add_rewrite_rule($filename, $rewrite_rule)\n {\n }", "public static function addModRewriteConfig()\n {\n try {\n $apache_modules = \\WP_CLI_CONFIG::get('apache_modules');\n } catch (\\Exception $e) {\n $apache_modules = array();\n }\n if ( ! in_array(\"mod_rewrite\", $apache_modules)) {\n $apache_modules[] = \"mod_rewrite\";\n $wp_cli_config = new \\WP_CLI_CONFIG('global');\n $current_config = $wp_cli_config->load_config_file();\n $current_config['apache_modules'] = $apache_modules;\n $wp_cli_config->save_config_file($current_config);\n sleep(2);\n }\n }", "private function htaccessinitialize() {\n\t\t// get .htaccess\n\t\t$this->htaccessfile = str_replace('typo3conf' . DIRECTORY_SEPARATOR .\n\t\t\t\t'ext' . DIRECTORY_SEPARATOR . 'cyberpeace' . DIRECTORY_SEPARATOR . 'pi1', '', realpath(dirname(__FILE__))) . '.htaccess';\n\t\t$denyarr = 'no .htaccess';\n\t\tif (file_exists($this->htaccessfile)) {\n\t\t\t$denyarr = array();\n\t\t\t// get contents\n\t\t\t$this->htaccesscontent = file_get_contents($this->htaccessfile);\n\t\t\t// get line ##cyberpeace START\n\t\t\tif (str_replace('##cyberpeace START', '', $this->htaccesscontent) == $this->htaccesscontent) {\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t// get line ##cyberpeace END\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace START';\n\t\t\t\t$this->htaccesscontent = str_replace('##cyberpeace END', '', $this->htaccesscontent);\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace END';\n\t\t\t}\n\n\t\t\t// get lines between ##cyberpeace START and END\n\t\t\t$this->arrtostart = explode(\"\\n\" . '##cyberpeace START', $this->htaccesscontent);\n\t\t\t$this->arrtoend = explode(\"\\n\" . '##cyberpeace END', $this->arrtostart[1]);\n\n\t\t\t// explode by '\\ndeny from '\n\t\t\t$denyarr = explode(\"\\n\" . 'deny from ', $this->arrtoend[0]);\n\n\t\t}\n\n\t\treturn $denyarr;\n\t}", "function ahr_write_htaccess( $redirection_status, $redirection_type ) {\r\n \r\n $random_anchor_number = get_option( 'ahr-random-anchor-number' );\r\n \r\n $https_status = $redirection_status === 'https' ? 'off' : 'on';\r\n \r\n $written_rules = \"\\n\\n\" . \"# Begin Advanced https redirection \" . $random_anchor_number . \"\\n\" . \"<IfModule mod_rewrite.c> \\n\" . \"RewriteEngine On \\n\" . \"RewriteCond %{HTTPS} $https_status \\n\" . \"RewriteCond %{REQUEST_FILENAME} -f \\n\" . \"RewriteCond %{REQUEST_FILENAME} !\\.php$ \\n\" . \"RewriteRule .* $redirection_status://%{HTTP_HOST}%{REQUEST_URI} [L,R=$redirection_type] \\n\" . \"</IfModule> \\n\" . \"# End Advanced https redirection \" . $random_anchor_number . \"\\n\";\r\n \r\n \r\n $root_dir = get_home_path();\r\n $htaccess_filename_path = $root_dir . '.htaccess';\r\n \r\n \r\n $write_result = file_put_contents( $htaccess_filename_path, $written_rules . PHP_EOL, FILE_APPEND | LOCK_EX );\r\n \r\n if ( $write_result ) {\r\n return true;\r\n }\r\n \r\n return false;\r\n \r\n}", "public function setFilename($filename) {\n if (is_writable(dirname($filename))) {\n $this->filename = $filename;\n } else {\n die('Directory ' . dirname($filename) . ' is not writable');\n }\n }", "protected function _initFilesystem() {\n $this->_createWriteableDir($this->getTargetDir());\n $this->_createWriteableDir($this->getQuoteTargetDir());\n\n // Directory listing and hotlink secure\n $io = new Varien_Io_File();\n $io->cd($this->getTargetDir());\n if (!$io->fileExists($this->getTargetDir() . DS . '.htaccess')) {\n $io->streamOpen($this->getTargetDir() . DS . '.htaccess');\n $io->streamLock(true);\n $io->streamWrite(\"Order deny,allow\\nAllow from all\");\n $io->streamUnlock();\n $io->streamClose();\n }\n }", "public function setFileName($filename = '')\n\t{\n\t\tif( ! empty($filename))\n\t\t{\n\t\t\tif( ! file_exists($filename))\n\t\t\t{\n\t\t\t\tthrow new RoutesException('Fichier de routes introuvable');\n\t\t\t}\n\t\n\t\t\t$this->filename = $filename;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filename = \\base_dir().'app/Config/routes.xml';\n\t\t}\n\t}", "private function appendTurnOnEngine(){\n\t\t$string = 'RewriteEngine on';\n\t\t$this->appendLineToRewrites($string);\n\t}", "public function setCacheDir($file_path)\n {\n if (\\substr($file_path, -1, 1) != '/') {\n $file_path .= '/';\n }\n\n $this->file_path = $file_path;\n }", "function SetFileName(){\n\t\t$this->FindRootFile();\n\t\t$this->BookLink = $_SERVER['DOCUMENT_ROOT'].'/'.$this->BookLink.'/'.$this->RootFile;\n\t}", "public function add_rewrite_rule() {\n\t\t\tadd_rewrite_rule(\n\t\t\t\t'photo/([a-z0-9-_]+)/?', // ([^/]+)\n\t\t\t\t'index.php?attachment=$matches[1]',\n\t\t\t\t'top'\n\t\t\t);\n\t\t}", "private function spiltUrl()\n {\n // the .htaccess file.\n // TODO: create .htaccess file and add rule.\n if (isset($_GET['url'])) {\n // echo $_GET['url'];\n \n // Trim the last '/' from the url\n // so the http://example.com/sample/ will be http://example.com/sample\n $url = rtrim($_GET['url'], '/');\n \n $url = filter_var($url, FILTER_SANITIZE_URL);\n \n $url = explode('/', $url);\n \n // Put URL parts into the appropiate properties.\n $this->url_controller = (isset($url[0])) ? $url[0] : null;\n $this->url_action = (isset($url[1])) ? $url[1] : null;\n $this->url_parameter_1 = (isset($url[2])) ? $url[2] : null;\n $this->url_parameter_2 = (isset($url[3])) ? $url[3] : null;\n $this->url_parameter_3 = (isset($url[4])) ? $url[4] : null;\n }\n }", "public function setPath($file);", "function setFHtgroup($filename){\n $this->fHtgroup=$filename;\n }", "function setFHtgroup($filename){\n $this->fHtgroup=$filename;\n }", "public function setFilename($filename);", "public static function createHtaccess($base_dir='', $receiver_file='index.php')\n {\n if(!empty($base_dir) AND substr($base_dir, -1) == '/')\n $base_dir = substr($base_dir, 0, -1); // we delete the ending /\n \n $receiver_file = implode('/', array($base_dir, $receiver_file));\n \n return <<<TXT\n<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteBase /\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . $receiver_file [L]\n</IfModule>\nTXT;\n }", "private static function setScriptFilename() {\n\t\tif ( self::getIsCli() ) {\n\t\t\tself::$_ScriptFilename = basename($_SERVER['SCRIPT_NAME']);\n\t\t} else {\n\t\t\tself::$_ScriptFilename = basename($_SERVER['SCRIPT_FILENAME']);\n\t\t}\n\t}", "public function checkHtaccess(){\n\t\t$this->htaccess = false;\n\t\tif(realpath(dirname(__DIR__ . \"/../core.php\")) == realpath($_SERVER['DOCUMENT_ROOT']) && is_file(__DIR__ . \"/../.htaccess\")){\n\t\t\t$this->htaccess = true;\n\t\t}\n\t}", "function setFHtgroup($filename){\r\n\t\t$this->fHtgroup=$filename;\r\n\t}", "function update_admin_htaccess($student_admin_path) {\n global $users;\n $output = \"\";\n $existing_contents = \"\";\n\n $file_path = \"${student_admin_path}/.htaccess\";\n if (file_exists($file_path)) {\n $existing_contents = file_get_contents($file_path);\n }\n // Create a list of users who can view this admin page, begining with the user\n $split = explode('@', filter_input(INPUT_SERVER, 'SERVER_ADMIN'));\n $users .= ' ' . $split[0];\n\n $htaccess_contents = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options -Indexes\n AuthType WebAuth\n require user $users\n satisfy any\n order allow,deny\n</Files>\n\";\n // If there is an update, then write our new admin htaccess. Otherwise\n if ($htaccess_contents == $existing_contents)\n return \"${output}\\n<!-- No changes needed to ${file_path} -->\";\n if (file_put_contents($file_path, $htaccess_contents))\n return \"${output}\\n<!-- Synchronized ${file_path} -->\";\n return \"${output}\\n<!-- Failed sync on ${file_path} -->\";\n}", "function setFilename($key);", "public function setFileName($file);", "public function setFilepath($filepath);", "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function rewrite_static_tags() {\n\tadd_rewrite_tag('%proxy%', '([^&]+)');\n add_rewrite_tag('%manual%', '([^&]+)');\n add_rewrite_tag('%manual_file%', '([^&]+)');\n add_rewrite_tag('%file_name%', '([^&]+)');\n add_rewrite_tag('%file_dir%', '([^&]+)');\n}", "function save_mod_rewrite_rules()\n {\n }", "function addLogin(){\r\n\t $file=fopen($this->fHtaccess,\"w+\");\r\n\t fputs($file,\"Order allow,deny\\n\");\r\n\t fputs($file,\"Allow from all\\n\");\r\n\t fputs($file,\"AuthType \".$this->authType.\"\\n\");\r\n\t fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\r\n\t fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\r\n\t fputs($file,\"require valid-user\\n\");\r\n\t fclose($file);\r\n\t}", "public function setPath($filename)\n {\n $this->_path = (string) $filename;\n return $this;\n }", "function setPath() {\n\n // Wp installation path\n $wp_install_path = str_replace( 'http://' . $_SERVER['HTTP_HOST'], '', site_url());\n\n // Set the instance starting path\n $this->path = $wp_install_path . App::getOption('path');\n\n // Grab the server-passed \"REQUEST_URI\"\n $this->current_uri = $this->request->server()->get('REQUEST_URI');\n\n // Remove the starting URI from the equation\n // ex. /wp/cocoon/mypage -> /mypage\n $this->request->server()->set(\n 'REQUEST_URI', substr($this->current_uri, strlen($this->path))\n );\n\n }", "function ahr_remove_rules_htaccess() {\r\n \r\n $root_dir = get_home_path();\r\n $file = $root_dir . '.htaccess';\r\n $file_content = file_get_contents( $file );\r\n \r\n $random_anchor_number = get_option( 'ahr-random-anchor-number' );\r\n $start_string = \"# Begin Advanced https redirection $random_anchor_number\";\r\n $end_string = \"# End Advanced https redirection $random_anchor_number\";\r\n $regex_pattern = \"/$start_string(.*?)$end_string/s\";\r\n \r\n preg_match( $regex_pattern, $file_content, $match );\r\n \r\n if ( $match[ 1 ] !== null ) {\r\n \r\n $file_content = str_replace( $match[ 1 ], '', $file_content );\r\n $file_content = str_replace( $start_string, '', $file_content );\r\n $file_content = str_replace( $end_string, '', $file_content );\r\n \r\n }\r\n \r\n $file_content = rtrim( $file_content );\r\n file_put_contents( $file, $file_content );\r\n \r\n}", "public function set( $path ) {\n\t\t$this->path = $path;\n\n\t\t$path_info = pathinfo( $this->path );\n\n\t\t$this->file = $path_info['basename'];\n\t\t$this->extension = $path_info['extension'] == 'jpg' ? 'jpeg' : $path_info['extension'];\n\t\t$this->filename = $path_info['filename'];\n\n\t\t$this->server = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];\n\n\t\t$this->url = $this->server.str_replace( $this->base_dir, '', $this->path );\n\t}", "public function set_filename($filepath) {\r\n\t\t$this->filepath = $filepath;\r\n\t}", "function update_htacess_protection($credentials)\n\t{\n\t\tif ( $_POST['enableHtaccess'] == 'true' ) //Add/Update the .htaccess and .htpasswd files\n\t\t{\n\t\t\tif ( !isset($credentials['username']) || !isset($credentials['password']) ) return FALSE;\n\n\t\t\t$username = $credentials['username'];\n\t\t\t$password = crypt_apr1_md5($credentials['password']);\n\n\t\t\t$fileLocation = str_replace('\\\\', '/', dirname(__FILE__));\n\t\t\t$fileLocation = explode('functions', $fileLocation);\n\t\t\t$fileLocation = $fileLocation[0];\n\t\t\t\n\t\t\t//Create the .htpasswd file\n\t\t\t$content = $username . ':' . $password;\n\t\t\t$file = fopen('../.htpasswd', \"w\");\n\t\t\tif ($file === FALSE) return FALSE;\n\t\t\tfwrite($file, $content);\n\t\t\tfclose($file);\n\n\t\t\t// Create the .htaccess file\n\t\t\t$content = 'AuthName \"Please login to proceed\"\n\t\t\tAuthType Basic\n\t\t\tAuthUserFile ' . $fileLocation . '.htpasswd\n\t\t\tRequire valid-user';\n\t\t\t$file = fopen('../.htaccess', \"w\");\n\t\t\tif ($file === FALSE) return FALSE;\n\t\t\tfwrite($file, $content);\n\t\t\tfclose($file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//delete the .htaccess and .htpasswd files\n\t\t\tif ( file_exists('../.htpasswd') ) unlink('../.htpasswd');\n\t\t\tif ( file_exists('../.htaccess') ) unlink('../.htaccess');\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public static function setFile($file) {}", "protected function setFilename( $filename ){\n \n $this->filename = $filename;\n \n }", "public function setFileNameAsPath($value)\n {\n $this->setProperty(\"FileNameAsPath\", $value, true);\n }", "function setLogFilename($value)\n {\n $this->_props['LogFilename'] = $value;\n }", "function FileChmod()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$nChmodParam = 0755;\n\t\n\tif(isset($_REQUEST['chmod']) === false)\n\t{\n\t\techo '<fail>no chmodparametr</fail>';\n\t\treturn;\n\t}\n\t$nChmodParam = trim($_REQUEST['chmod']);\n\t\n\tif($nChmodParam[0] === '0')\n\t{\n\t\t$nChmodParam[0] = ' ';\n\t\t$nChmodParam = trim($nChmodParam);\n\t}\n\t\n\t$nChmodParam = (int) $nChmodParam;\n\t$nChmodParam = octdec($nChmodParam);\n\n\t\n\t\n\t\n\t$bIsChmodCreate = true;\n\t$bIsChmodCreate = chmod($sFileUrl, $nChmodParam);\n\t\n\tif($bIsChmodCreate === true)\n\t{\n\t\techo '<correct>update chmod correct</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create chmod</fail>';\n\t}\n}", "function got_mod_rewrite()\n {\n }", "public function setFile($file) {\t\t\n\t\t// set file\n\t\t$this->file = $file;\n\t\t\n\t\t// set extension\n\t\t$file_parts = explode('.', $this->file['name']);\n\t\t$this->extension = strtolower(end($file_parts));\n\n\t}", "private function setFilename($username){\n $file = $this->cacheDir.'/'.$username.\".json\";\n $this->cacheFile = $file;\n }", "function setDir()\n{\n\t// This script is sometimes called from the other directories - for auto sending, so we need to change the directory\n\t$pos = strrpos(__FILE__, '/');\n\tif ($pos === false)\n\t{\n\t\t$pos = strrpos(__FILE__, '\\\\');\n\t\tif ($pos === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t$dir = substr(__FILE__, 0, $pos);\n\tchdir($dir);\n}", "public function setRewrite($rewrite = true){\n\t\t$this->rewrite = $rewrite;\n\t}", "function setFileNameRegex($fileNameRegex) {\n $this->fileNameRegex = $fileNameRegex;\n }", "private function setFileName() {\n $FileName = Uteis::Name($this->Name) . strrchr($this->File->name, '.');\n if (file_exists(self::$BaseDir . $this->Send . $FileName)):\n $FileName = Uteis::Name($this->Name) . '-' . time() . strrchr($this->File->name, '.');\n endif;\n $this->Name = $FileName;\n }", "private function setFile($file)\n {\n $format = $this->format; // fallback\n $extension = '.'.$format;\n\n // don't use strrpos, because files could have dots in their name\n foreach($this->config['valid_formats'] as $ext)\n {\n $ext_pos = strpos($file, '.'.$ext);\n if ($ext_pos !== false)\n {\n $format = strtolower(substr($file, $ext_pos+1));\n $extension = '';\n continue;\n }\n }\n\n $file .= $extension;\n $this->file = $file;\n $this->format = $format;\n }", "function RepairHtmlHtaccess($sHtaccessPath, $sScriptFilePath)\n{\n\t$sOldHtaccessContent = '';\n\t$sNewHtaccessContent = '';\n\tif(file_exists($sHtaccessPath) === true)\n\t{\n\t\t$sOldHtaccessContent = file_get_contents($sHtaccessPath);\n\t\t\n\t\t$sNewHtaccessContent = $sOldHtaccessContent;\n\t\t$sNewHtaccessContent = preg_replace(\"/\\s*\\#Start\\sSpec\\scheck\\srewrite\\srule.*#End\\sSpecial\\scheck\\srewrite\\srule\\s*/is\", \"\\n\", $sNewHtaccessContent);\n\t\t$sNewHtaccessContent = trim($sNewHtaccessContent);\n\t}\n\t\n\t$sTemplate = '';\n\t$sTemplate = '#Start Spec check rewrite rule\nRewriteEngine On\nRewriteCond %{DOCUMENT_ROOT}<%PATH_TO_SCRIPT%> -f\nRewriteCond %{QUERY_STRING} ^(.*)$\nRewriteRule ^(.*\\.htm(:?l?))$ .<%PATH_TO_SCRIPT%>?old-path=$1&%1 [L]\nRewriteCond %{DOCUMENT_ROOT}<%PATH_TO_SCRIPT%> -f\nRewriteCond %{QUERY_STRING} ^(.*)$\nRewriteRule ^(.*\\.pdf)$ .<%PATH_TO_SCRIPT%>?old-path=$1&%1 [L]\n#End Special check rewrite rule';\n\t\n\t$sTemplate = str_replace('<%PATH_TO_SCRIPT%>', $sScriptFilePath, $sTemplate);\n\t\n\t$sNewHtaccessContent .= \"\\n\\n\".$sTemplate.\"\\n\";\n\t$sNewHtaccessContent = trim($sNewHtaccessContent);\n\t\n\t$stOutFileHandle = false;\n\t$stOutFileHandle = fopen($sHtaccessPath, 'w');\n\tif($stOutFileHandle === false)\n\t{\n\t\techo '<fail>cant open htaccess file for writing</fail>';\n\t\treturn false;\n\t}\n\t\tfwrite($stOutFileHandle, $sNewHtaccessContent);\n\tfclose($stOutFileHandle);\n\t\n\t\n\techo '<correct>correct repair htaccess</correct>';\n\treturn true;\n}", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "function __construct(){\n\t\t//htaccess设置\n\t\t//路由分析 / index.php/Home/Index/index/id/1\t\t\n\t\t$path = $_SERVER['REQUEST_URI'];\n //p($_REQUEST);\t\n\t\tif(isset($path) && $path!='/'){\n\t\t\t$pathArr = explode('/', ltrim($path,'/'));\t\t\n\t\t\t//重置路由\n\t\t\tif(isset($pathArr[0])){\n\t\t\t\t$this->module = $pathArr[0];\n\t\t\t\tunset($pathArr[0]);\n\t\t\t}\n\t\t\tif(isset($pathArr[1])){\n\t\t\t\t$this->ctrl = $pathArr[1];\n\t\t\t\tunset($pathArr[1]);\n\t\t\t}\n\t\t\tif(isset($pathArr[2])){\n\t\t\t\t$this->action = $pathArr[2];\n\t\t\t\tunset($pathArr[2]);\n\t\t\t}\n\t\t\t//参数解析\n\t\t\t$count = count($pathArr);\n\t\t\t//$paras = array();\n\t\t\t//p($pathArr);\n\t\t\tfor($i=3;$i<$count+3;$i=$i+2){\n\t\t\t\tif(isset($pathArr[$i+1])){//处理参数不匹配的\n\t\t\t\t\t$_GET[$pathArr[$i]] = $pathArr[$i+1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//$_GET['paras'] = $paras;\n\t\t\t\n\t\t }else{\n\t\t $this->module = Conf::get('MODULE','config');\n\t\t\t $this->ctrl = Conf::get('CTRL','config');\n\t\t\t $this->action = Conf::get('ACTION','config');\n\t\t }\n\t}", "private function get_filename() {\n \n $md5 = md5($_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"]);\n return CACHE_DIR . \"/\" . $md5;\n }", "public static function generateHtAccess()\n {\n\n // open template file for reading and store the content to variable\n $fp_template = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/htaccess.template', 'r');\n $template = fread($fp_template, filesize($_SERVER[\"DOCUMENT_ROOT\"] . \"/htaccess.template\"));\n fclose($fp_template);\n\n $app_rewrites = \"\";\n // get all the registered applications\n $app_repo = new ApplicationRepository();\n $app_listings = $app_repo->getAll();\n\n $app_domain_repo = new DomainWhitelistRepository();\n foreach ($app_listings as $app) {\n\n $app_rewrites .= \" # app = $app->name\" . \"\\n\";\n // if application have any whitelisting\n $app_whitelists = $app_domain_repo->getByApplicationId($app->id);\n if ($app_whitelists != null) {\n $isOr = sizeof($app_whitelists) > 0 ? \"[OR]\" : \"\";\n $cnt = 0;\n foreach ($app_whitelists as $listing) {\n\n // dont add [OR] in last condition\n if ($cnt == sizeof($app_whitelists) - 1) $isOr = \"\";\n\n if (!empty($listing->domain)) {\n\n $app_rewrites .= \" RewriteCond %{HTTP_HOST} =$listing->domain $isOr\" . \"\\n\";\n\n } else if (!empty($listing->ip_address)) {\n\n $escaped_ip = str_replace(\".\", \"\\.\", $listing->ip_address);\n $app_rewrites .= \" RewriteCond %{REMOTE_ADDR} =^$escaped_ip$ $isOr\" . \"\\n\";\n\n }\n\n $cnt++;\n }\n }\n\n $app_rewrites .= \" RewriteRule api/$app->app_api_slug/(.*)$ api/generic/api.php [QSA,NC,L]\" . \"\\n\\r\";\n\n }\n\n $template = str_replace(\"{app_rewrites}\", $app_rewrites, $template);\n\n // write the final template to .htaccess file and close it.\n $fp = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/.htaccess', 'w+');\n if ($fp) {\n fwrite($fp, $template);\n fclose($fp);\n }\n }", "public function set_file($path='',$filename='') {\n\t\t$this->_init($path,$filename);\n\t}", "public function setFilename($filename)\n {\n $pathInfo = UnicodeFunctions::pathinfo($filename);\n $extension = (isset($pathInfo['extension']) ? '.' . strtolower($pathInfo['extension']) : '');\n $this->filename = $pathInfo['filename'] . $extension;\n $this->mediaType = MediaTypes::getMediaTypeFromFilename($this->filename);\n }", "private function allowDirectoryIndex() {\n $directory = $this->getArchiveDirectory();\n $fileName = '.htaccess';\n // @todo needs security review\n $content = <<<EOF\nOptions +Indexes\n# Unset Drupal_Security_Do_Not_Remove_See_SA_2006_006\nSetHandler None\n<Files *>\n # Unset Drupal_Security_Do_Not_Remove_See_SA_2013_003\n SetHandler None\n ForceType text/plain\n</Files>\nEOF;\n\n if (!file_put_contents($directory . '/' . $fileName, $content)) {\n $this->messenger->addError(t('File @file_name could not be created', [\n '@file_name' => $fileName,\n ]));\n }\n }", "public function setFileName($fileName);", "function sURL($filename){\r\n\t\t$ext = pathinfo($filename, PATHINFO_EXTENSION);\r\n\t\tswitch (strtolower($ext)){\r\n\t\t\tcase 'css':\r\n\t\t\t\t$filename = 'css/'.$filename;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'js':\r\n\t\t\t\t$filename = 'js/'.$filename;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\t$filename = 'images/'.$filename;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $this->env['web_root'].'static/'.$filename;\r\n\t}", "public function setScriptPath()\n\t{\n\t\t$this->scriptPath = Yii::getPathOfAlias('webroot').$this->ds.$this->suffix.$this->ds;\n\t}", "public static function add_rewrite_rule()\n {\n }", "function setFilenameExtension()\n\t{\n\t\t$sOldFilenameExtension = substr($this->filename, strlen($this->filename) - 4, 4);\n\t\tif (($sOldFilenameExtension != '.gif') &&\n\t\t\t\t($sOldFilenameExtension != '.jpg') &&\n\t\t\t\t($sOldFilenameExtension != '.png')) {\n\t\t\t$this->printError('invalid filename extension');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.gif';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.png';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "public function setFileName($filename) {\n\t $this->fileName = $filename;\n\t }", "function cemhub_check_htaccess_in_private_system_path($set_message = TRUE) {\n $is_created = FALSE;\n\n $file_private_path = variable_get('file_private_path', FALSE);\n if ($file_private_path) {\n file_create_htaccess('private://', TRUE);\n\n if (file_exists($file_private_path . '/.htaccess')) {\n $is_created = TRUE;\n }\n elseif ($set_message) {\n drupal_set_message(t(\"Security warning: Couldn't write .htaccess file.\"), 'warning');\n }\n }\n\n return $is_created;\n}", "public static function set($target_file)\r\n\r\n {\r\n header('Location: index.php?page=display&filename=' .$target_file );\r\n \r\n }", "public function setDirname($dirname);", "public function mod_rewrite_rules()\n {\n }", "function iis7_save_url_rewrite_rules()\n {\n }", "public function setFileName($value)\n {\n $this->setProperty(\"FileName\", $value, true);\n }", "public function setTargetFileName($value)\n {\n $this->targetFileName = strval(trim($value));\n }", "protected function defineSitePath() {}", "private function setFileName(){\n if($this->customFileName !== ''){\n $prefix = $this->customFileName.'_';\n $this->finalFileName = uniqid($prefix).'.'.$this->fileExt;\n }else{\n $this->finalFileName = basename($this->fileName, \".\".$this->fileExt ).md5(microtime()).'.'.$this->fileExt;\n } \n }", "public function setFileName($filename)\n {\n $this->filename = $filename;\n }", "public function setFileName($filename)\n {\n $this->filename = $filename;\n }", "public function setPath( $path );", "public function setFile($file) {}", "function setDocFileName($docfile)\n\t\t{\n\t\t\t$this->docFile=$docfile;\n\t\t\tif(!preg_match(\"/\\.doc$/i\",$this->docFile))\n\t\t\t\t$this->docFile.=\".doc\";\n\t\t\treturn;\t\t\n\t\t}", "public function setFilename($filename) {\n\t\t$this->filename = $filename;\n\t}", "public function setFilename($filename) {\n\t\t$this->filename = $filename;\n\t}" ]
[ "0.74515116", "0.7008224", "0.6627939", "0.6318802", "0.62891024", "0.6196582", "0.6088691", "0.6046433", "0.6027368", "0.6021579", "0.59651047", "0.5956435", "0.59158754", "0.59066135", "0.58405495", "0.5818566", "0.5784172", "0.5719726", "0.57171345", "0.56993055", "0.5638648", "0.56207734", "0.56194127", "0.5582165", "0.5576777", "0.5488006", "0.53687006", "0.53404385", "0.5277304", "0.5236667", "0.52273333", "0.5225499", "0.52151024", "0.5208271", "0.51913446", "0.51913446", "0.51863474", "0.5183547", "0.5183133", "0.5166151", "0.51368684", "0.51173013", "0.51153505", "0.51130474", "0.50927377", "0.50871634", "0.50871634", "0.5084268", "0.5069877", "0.50608176", "0.504951", "0.50490296", "0.50478685", "0.50338936", "0.5030276", "0.5008632", "0.49991316", "0.49899906", "0.49734923", "0.49676582", "0.4961013", "0.49594486", "0.49573275", "0.494469", "0.4934276", "0.4928289", "0.49249104", "0.49241802", "0.49177474", "0.49159852", "0.490317", "0.4898257", "0.4870752", "0.48638058", "0.4846909", "0.48355183", "0.48338804", "0.4816323", "0.4811657", "0.47956815", "0.47941273", "0.47807977", "0.47664824", "0.47605196", "0.47550735", "0.4752232", "0.474921", "0.47456935", "0.47452724", "0.47410253", "0.4740337", "0.47363552", "0.472493", "0.472493", "0.47244856", "0.47237688", "0.47234312", "0.47106624", "0.47106624" ]
0.7480921
1
Sets the filename and path of the htgroup file for the htaccess file
function setFHtgroup($filename){ $this->fHtgroup=$filename; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFHtgroup($filename){\r\n\t\t$this->fHtgroup=$filename;\r\n\t}", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "public function createHtaccessFile() {\n $oModule = oxNew(Module::class);\n $oConfig = $this->getConfig();\n // get modules path\n $sModulesDir = $oConfig->getModulesDir();\n // get cache path\n $sCacheDir = $oConfig->getConfigParam('sCompileDir');\n // check if the default .htaccess file is in config folder\n if(file_exists($sModulesDir.$oModule->getModulePath('suaboclearcache').'/Config/.htaccess.tmp')) {\n // copy .htaccess to cache folder\n copy($sModulesDir . $oModule->getModulePath('suaboclearcache') . '/Config/.htaccess.tmp', $sCacheDir . '/.htaccess');\n }\n }", "function setFHtaccess($filename){\r\n\t\t$this->fHtaccess=$filename;\r\n\t}", "function htaccess($htaccess, $htpass, $htgroup=null){\n\t \n\t $this->setFHtaccess($htaccess);\n\t\t$this->setFPasswd($htpass);\n\t\t\n\t\tif ($htgroup)\n\t\t $this->setFHtgroup($htgroup);\n }", "function addGroup($groupname){\r\n\t\t$file=fopen($this->fHtgroup,\"a\");\r\n\t\tfclose($file);\r\n\t}", "function addGroup($groupname){\n $file=fopen($this->fHtgroup,\"a\");\n fclose($file);\n }", "function addGroup($groupname){\n $file=fopen($this->fHtgroup,\"a\");\n fclose($file);\n }", "protected function writehtaccess()\n {\n $content = '# Deny access to supersake\n<Files supersake>\n\tOrder allow,deny\n\tDeny from all\n</Files>';\n }", "function create_htaccess($ip,$root,$ts_shop_folder) {\t\t\t\t\t\t\n$htaccess = 'AuthType Basic\nAuthName \"OpenShop Administration\"\nAuthUserFile '.$root.'/'.$ts_shop_folder.'/administration/.htpasswd\nRequire valid-user\nOrder Deny,Allow\nDeny from all\nAllow from '.$ip.'\n';\n\n\t\t\t\tif(!is_writable(\"administration/.htaccess\")) {\n\t\t\t\t\tchmod(\"administration/.htaccess\",0777);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$hta = fopen(\"administration/.htaccess\", \"w+\") or die(\"<div class=\\\"installer-message\\\">Unable to open administration .htaccess</div>\");\n\t\t\t\t\tfwrite($hta, $htaccess);\n\t\t\t\t\tfclose($hta);\n\t\t\t\t}", "public function htaccessGen($path = \"\") {\n if($this->option(\"htaccess\") == true) {\n\n if(!file_exists($path.DIRECTORY_SEPARATOR.\".htaccess\")) {\n // echo \"write me\";\n $html = \"order deny, allow \\r\\n\ndeny from all \\r\\n\nallow from 127.0.0.1\";\n\n $f = @fopen($path.DIRECTORY_SEPARATOR.\".htaccess\",\"w+\");\n if(!$f) {\n return false;\n }\n fwrite($f,$html);\n fclose($f);\n\n\n }\n }\n\n }", "function wpsc_product_files_htaccess() {\n if(!is_file(WPSC_FILE_DIR.\".htaccess\")) {\n\t\t$htaccess = \"order deny,allow\\n\\r\";\n\t\t$htaccess .= \"deny from all\\n\\r\";\n\t\t$htaccess .= \"allow from none\\n\\r\";\n\t\t$filename = WPSC_FILE_DIR.\".htaccess\";\n\t\t$file_handle = @ fopen($filename, 'w+');\n\t\t@ fwrite($file_handle, $htaccess);\n\t\t@ fclose($file_handle);\n\t\t@ chmod($file_handle, 665);\n }\n}", "function create_class_htaccess($student_class_path) {\n $class_htaccess = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options +Indexes\n</Files>\n\";\n $file_path = \"${student_class_path}/.htaccess\";\n if (file_exists($file_path))\n return \"<!-- Class htaccess already exists -->\";\n if (file_put_contents($file_path, $class_htaccess))\n return \"<!-- Created class htaccess -->\";\n return \"<!-- Unable to create class htaccess -->\";\n}", "public function group($file)\n {\n }", "public function group($file)\n {\n }", "public function group($file)\n {\n }", "public function group($file)\n {\n }", "public function group($file)\n {\n }", "function htaccess(){\r\n\t}", "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function addLogin(){\r\n\t $file=fopen($this->fHtaccess,\"w+\");\r\n\t fputs($file,\"Order allow,deny\\n\");\r\n\t fputs($file,\"Allow from all\\n\");\r\n\t fputs($file,\"AuthType \".$this->authType.\"\\n\");\r\n\t fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\r\n\t fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\r\n\t fputs($file,\"require valid-user\\n\");\r\n\t fclose($file);\r\n\t}", "function update_htaccess($unused, $value) {\r\n\t\t$this->htaccess_recovery = $value;\r\n\t\t\r\n\t\t//Overwrite the file\r\n\t\t$htaccess = get_home_path().'.htaccess';\r\n\t\t$fp = fopen($htaccess, 'w');\r\n\t\tfwrite($fp, $value);\r\n\t\tfclose($fp);\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "function htaccess(){\n }", "function SetFileName(){\n\t\t$this->FindRootFile();\n\t\t$this->BookLink = $_SERVER['DOCUMENT_ROOT'].'/'.$this->BookLink.'/'.$this->RootFile;\n\t}", "private function htaccessinitialize() {\n\t\t// get .htaccess\n\t\t$this->htaccessfile = str_replace('typo3conf' . DIRECTORY_SEPARATOR .\n\t\t\t\t'ext' . DIRECTORY_SEPARATOR . 'cyberpeace' . DIRECTORY_SEPARATOR . 'pi1', '', realpath(dirname(__FILE__))) . '.htaccess';\n\t\t$denyarr = 'no .htaccess';\n\t\tif (file_exists($this->htaccessfile)) {\n\t\t\t$denyarr = array();\n\t\t\t// get contents\n\t\t\t$this->htaccesscontent = file_get_contents($this->htaccessfile);\n\t\t\t// get line ##cyberpeace START\n\t\t\tif (str_replace('##cyberpeace START', '', $this->htaccesscontent) == $this->htaccesscontent) {\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t// get line ##cyberpeace END\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace START';\n\t\t\t\t$this->htaccesscontent = str_replace('##cyberpeace END', '', $this->htaccesscontent);\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace END';\n\t\t\t}\n\n\t\t\t// get lines between ##cyberpeace START and END\n\t\t\t$this->arrtostart = explode(\"\\n\" . '##cyberpeace START', $this->htaccesscontent);\n\t\t\t$this->arrtoend = explode(\"\\n\" . '##cyberpeace END', $this->arrtostart[1]);\n\n\t\t\t// explode by '\\ndeny from '\n\t\t\t$denyarr = explode(\"\\n\" . 'deny from ', $this->arrtoend[0]);\n\n\t\t}\n\n\t\treturn $denyarr;\n\t}", "function setFilePermission (string $path) : void {\n\n\tif (PHP_OS_FAMILY === \"Windows\") return;\n\t$iterator = null;\n\tif (!is_dir($path)) {\n\t\t$iterator = [$path];\n\t} else {\n\t\t$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));\n\t}\n\n\tforeach ($iterator as $item) {\n\t\t@chmod($item, octdec(getConfig(\"UNIX_FILE_PERMISSIONS\")));\n\t\t@chgrp($item, getConfig(\"UNIX_FILE_GROUP\"));\n\t}\n}", "function ahr_handle_htaccess_errors() {\r\n \r\n $root_dir = get_home_path();\r\n $htaccess_filename_path = $root_dir . '.htaccess';\r\n \r\n $is_htaccess = file_exists( $htaccess_filename_path );\r\n \r\n if ( !$is_htaccess ) {\r\n echo '<p>There is no htaccess file in your root directory, it could be that you are not using Apache as a server, or that your server does not use htaccess files.</p>\r\n\t\t<p>If you are using Apache, you can try to create a new htaccess file, then try changing static resources redirection and see if it works.</p>';\r\n return;\r\n }\r\n \r\n $is_htaccess_writable = is_writable( $htaccess_filename_path );\r\n \r\n if ( !$is_htaccess_writable )\r\n echo '<p>Htaccess is not writable check your permissions.</p>';\r\n \r\n}", "public function setFileName($file);", "public static function setFile($file) {}", "static function write_to_htaccess()\r\n {\r\n global $aio_wp_security;\r\n //figure out what server is being used\r\n if (AIOWPSecurity_Utility::get_server_type() == -1) {\r\n $aio_wp_security->debug_logger->log_debug(\"Unable to write to .htaccess - server type not supported!\", 4);\r\n return false; //unable to write to the file\r\n }\r\n\r\n //clean up old rules first\r\n if (AIOWPSecurity_Utility_Htaccess::delete_from_htaccess() == -1) {\r\n $aio_wp_security->debug_logger->log_debug(\"Delete operation of .htaccess file failed!\", 4);\r\n return false; //unable to write to the file\r\n }\r\n\r\n $htaccess = ABSPATH . '.htaccess';\r\n\r\n if (!$f = @fopen($htaccess, 'a+')) {\r\n @chmod($htaccess, 0644);\r\n if (!$f = @fopen($htaccess, 'a+')) {\r\n $aio_wp_security->debug_logger->log_debug(\"chmod operation on .htaccess failed!\", 4);\r\n return false;\r\n }\r\n }\r\n AIOWPSecurity_Utility_File::backup_and_rename_htaccess($htaccess); //TODO - we dont want to continually be backing up the htaccess file\r\n @ini_set('auto_detect_line_endings', true);\r\n $ht = explode(PHP_EOL, implode('', file($htaccess))); //parse each line of file into array\r\n\r\n $rules = AIOWPSecurity_Utility_Htaccess::getrules();\r\n\r\n $rulesarray = explode(PHP_EOL, $rules);\r\n $rulesarray = apply_filters('aiowps_htaccess_rules_before_writing', $rulesarray);\r\n $contents = array_merge($rulesarray, $ht);\r\n\r\n if (!$f = @fopen($htaccess, 'w+')) {\r\n $aio_wp_security->debug_logger->log_debug(\"Write operation on .htaccess failed!\", 4);\r\n return false; //we can't write to the file\r\n }\r\n\r\n $blank = false;\r\n\r\n //write each line to file\r\n foreach ($contents as $insertline) {\r\n if (trim($insertline) == '') {\r\n if ($blank == false) {\r\n fwrite($f, PHP_EOL . trim($insertline));\r\n }\r\n $blank = true;\r\n } else {\r\n $blank = false;\r\n fwrite($f, PHP_EOL . trim($insertline));\r\n }\r\n }\r\n @fclose($f);\r\n return true; //success\r\n }", "public function __construct() {\n // Use FS over PHP for this as it may need to search deep.\n $htaccess = array();\n exec('locate .htaccess', $htaccess);\n\n $htaccess = array_filter($htaccess, function($item) {\n return strpos($item, DRUPAL_ROOT) !== FALSE;\n });\n\n $this->setData($htaccess);\n }", "protected function setCachePath(): void\n {\n $filename = basename($this->pathFile);\n\n $this->pathCache = $this->cacheDir.'/'.$filename;\n }", "function iis7_add_rewrite_rule($filename, $rewrite_rule)\n {\n }", "public function setFilename($filename) {\n if (is_writable(dirname($filename))) {\n $this->filename = $filename;\n } else {\n die('Directory ' . dirname($filename) . ' is not writable');\n }\n }", "function setFilename($filename);", "public static function addModRewriteConfig()\n {\n try {\n $apache_modules = \\WP_CLI_CONFIG::get('apache_modules');\n } catch (\\Exception $e) {\n $apache_modules = array();\n }\n if ( ! in_array(\"mod_rewrite\", $apache_modules)) {\n $apache_modules[] = \"mod_rewrite\";\n $wp_cli_config = new \\WP_CLI_CONFIG('global');\n $current_config = $wp_cli_config->load_config_file();\n $current_config['apache_modules'] = $apache_modules;\n $wp_cli_config->save_config_file($current_config);\n sleep(2);\n }\n }", "function setFilename($key);", "public function save_file($key, $field_group)\n {\n }", "private function setFileName() {\n $FileName = Uteis::Name($this->Name) . strrchr($this->File->name, '.');\n if (file_exists(self::$BaseDir . $this->Send . $FileName)):\n $FileName = Uteis::Name($this->Name) . '-' . time() . strrchr($this->File->name, '.');\n endif;\n $this->Name = $FileName;\n }", "public function setFile($file) {}", "public function setFilename($filename) {\n\n\t\t$basename = basename($filename); \n\n\t\tif(DIRECTORY_SEPARATOR != '/') {\n\t\t\t// To correct issue with XAMPP in Windows\n\t\t\t$filename = str_replace('\\\\' . $basename, '/' . $basename, $filename); \n\t\t}\n\t\n\t\tif($basename != $filename && strpos($filename, $this->pagefiles->path()) !== 0) {\n\t\t\t$this->install($filename); \n\t\t} else {\n\t\t\t$this->set('basename', $basename); \n\t\t}\n\n\t}", "protected function htaccess()\n\t{\n\t\t$error = \"\";\n\t\t\t\n\t\tif(!file_exists(\".htaccess\"))\n\t\t{\n\t\t\tif(!rename(\"e107.htaccess\",\".htaccess\"))\n\t\t\t{\n\t\t\t\t$error = LANINS_142;\n\t\t\t}\n\t\t\telseif($_SERVER['QUERY_STRING'] == \"debug\")\n\t\t\t{\n\t\t\t\trename(\".htaccess\",\"e107.htaccess\");\n\t\t\t\t$error = \"DEBUG: Rename from e107.htaccess to .htaccess was successful\";\t\t\n\t\t\t}\n\t\t}\n\t\telseif(file_exists(\"e107.htaccess\"))\n\t\t{\n\t\t\t$srch = array('[b]','[/b]');\n\t\t\t$repl = array('<b>','</b>');\n\t\t\t$error = str_replace($srch,$repl, LANINS_144); // too early to use e107::getParser() so use str_replace();\n\t\t}\t\t\n\t\treturn $error;\t\n\t}", "public function gethchmod($file)\n {\n }", "function rex_com_mediaaccess_htaccess_update()\n{\n global $REX;\n \n $unsecure_fileext = implode('|',explode(',',$REX['ADDON']['community']['plugin_mediaaccess']['unsecure_fileext']));\n $get_varname = $REX['ADDON']['community']['plugin_mediaaccess']['request']['file'];\n \n ## build new content\n $new_content = '### MEDIAACCESS'.PHP_EOL;\n $new_content .= 'RewriteCond %{HTTPS} off'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/.*/.*'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/(.*).('.$unsecure_fileext.')$'.PHP_EOL;\n $new_content .= 'RewriteRule ^(.*)$ http://%{HTTP_HOST}/?'.$get_varname.'=\\$1 [R=301,L]'.PHP_EOL;\n $new_content .= 'RewriteCond %{HTTPS} on'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/.*/.*'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/(.*).('.$unsecure_fileext.')$'.PHP_EOL;\n $new_content .= 'RewriteRule ^(.*)$ https://%{HTTP_HOST}/?'.$get_varname.'=\\$1 [R=301,L]'.PHP_EOL;\n $new_content .= '### /MEDIAACCESS'.PHP_EOL;\n \n ## write to htaccess\n $path = $REX['HTDOCS_PATH'].'files/.htaccess';\n $old_content = rex_get_file_contents($path);\n \n if(preg_match(\"@(### MEDIAACCESS.*### /MEDIAACCESS)@s\",$old_content) == 1)\n { \n $new_content = preg_replace(\"@(### MEDIAACCESS.*### /MEDIAACCESS)@s\", $new_content, $old_content);\n return rex_put_file_contents($path, $new_content);\n }\n \n return false;\n}", "public function setFile($file) {\t\t\n\t\t// set file\n\t\t$this->file = $file;\n\t\t\n\t\t// set extension\n\t\t$file_parts = explode('.', $this->file['name']);\n\t\t$this->extension = strtolower(end($file_parts));\n\n\t}", "private function addGroup($line, $group) {\n\t//--\n\tif($group[0] == '&') {\n\t\t$this->yaml_contains_group_anchor = substr($group, 1);\n\t} //end if\n\tif($group[0] == '*') {\n\t\t$this->yaml_contains_group_alias = substr($group, 1);\n\t} //end if\n\t//print_r($this->path);\n\t//--\n}", "function ahr_remove_rules_htaccess() {\r\n \r\n $root_dir = get_home_path();\r\n $file = $root_dir . '.htaccess';\r\n $file_content = file_get_contents( $file );\r\n \r\n $random_anchor_number = get_option( 'ahr-random-anchor-number' );\r\n $start_string = \"# Begin Advanced https redirection $random_anchor_number\";\r\n $end_string = \"# End Advanced https redirection $random_anchor_number\";\r\n $regex_pattern = \"/$start_string(.*?)$end_string/s\";\r\n \r\n preg_match( $regex_pattern, $file_content, $match );\r\n \r\n if ( $match[ 1 ] !== null ) {\r\n \r\n $file_content = str_replace( $match[ 1 ], '', $file_content );\r\n $file_content = str_replace( $start_string, '', $file_content );\r\n $file_content = str_replace( $end_string, '', $file_content );\r\n \r\n }\r\n \r\n $file_content = rtrim( $file_content );\r\n file_put_contents( $file, $file_content );\r\n \r\n}", "public static function set($target_file)\r\n\r\n {\r\n header('Location: index.php?page=display&filename=' .$target_file );\r\n \r\n }", "private function resetStorageFile(){\n $newFile = self::STORAGE_FILE_TEMPLATE_HEADER.self::STORAGE_FILE_TEMPLATE_BODY.self::STORAGE_FILE_TEMPLATE_FOOTER;\n if(!file_exists(realpath($newFile))){\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n if(!is_dir($dirName)){\n mkdir($dirName,\"640\",true);\n }\n }\n if(false === @file_put_contents(self::STORAGE_FILE,$newFile)){\n die(\"Could not reset storage file\");\n }else{\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n file_put_contents($dirName.\"/.htaccess\",self::STORAGE_FILE_TEMPLATE_HTACCESS);\n }\n }", "public function setPath($file);", "function htaccess_rewrite(){\n\n global $SETTINGS;\n\n require_once HOME . '_inc/function/defaults.php';\n\n\t$Plugins = Plugins::getInstance( );\n\n\t/**\n\t * if the apache_get_modules function is\n\t * available, make sure that the apache\n\t * rewrite module is loaded\n\t */\n\tif( function_exists( 'apache_get_modules' ) ){\n\t\t$modules=apache_get_modules();\n\n\t\tif(!in_array('mod_rewrite',$modules))\n\t\t\terror(\n\t\t\t\t'The apache module mod_rewrite must be installed. Please visit <a href=\"http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html\">'\n\t\t\t\t. 'Apache Module mod_rewrite</a> for more details.'\n\t\t\t\t,'Apache Error'\n\t\t\t);\n\t}\n\n\t/**\n\t * build up array of rewrite rules and filter\n\t * through the plugin filter\n\t */\n $rules = defaults_htaccess_rules( SITE_URL );\n \n\t$rules = $Plugins->filter( 'general', 'filter_htaccess', $rules );\n\n $htaccess = defaults_htaccess_content( $rules );\n\n\t/**\n\t * write htaccess file or throw error\n\t */\n\tfile_put_contents( HOME . '.htaccess', $htaccess ) \n\t\tor error(\n\t\t\t'You must grant <i>0777</i> write access to the <i>' . HOME . \n\t\t\t'</i> directory for <a href=\"http://furasta.org\">Furasta.Org</a> to function correctly.' .\n\t\t\t'Please do so then reload this page to save the settings.'\n\t\t\t,'Runtime Error'\n\t\t);\n\n\tif( $SETTINGS[ 'index' ] == 0 ){\n $robots = defaults_robots_content( 0, SITE_URL );\n\n\t\t$robots = $Plugins->filter( 'general', 'filter_robots', $robots );\n\t}\n else{\n $robots = defaults_robots_content( 1, SITE_URL );\n $file=HOME.'sitemap.xml';\n if(file_exists($file))\n unlink($file);\n\n\t}\n\n\t/**\n\t * write robots.txt or throw error\n\t */\n\tfile_put_contents( HOME. 'robots.txt', $robots );\n\n\treturn true;\n}", "private function setFile($file)\n {\n $format = $this->format; // fallback\n $extension = '.'.$format;\n\n // don't use strrpos, because files could have dots in their name\n foreach($this->config['valid_formats'] as $ext)\n {\n $ext_pos = strpos($file, '.'.$ext);\n if ($ext_pos !== false)\n {\n $format = strtolower(substr($file, $ext_pos+1));\n $extension = '';\n continue;\n }\n }\n\n $file .= $extension;\n $this->file = $file;\n $this->format = $format;\n }", "public function setFile(File $file)\n\t{\n\t\t$this->file=$file; \n\t\t$this->keyModified['file'] = 1; \n\n\t}", "function ahr_write_htaccess( $redirection_status, $redirection_type ) {\r\n \r\n $random_anchor_number = get_option( 'ahr-random-anchor-number' );\r\n \r\n $https_status = $redirection_status === 'https' ? 'off' : 'on';\r\n \r\n $written_rules = \"\\n\\n\" . \"# Begin Advanced https redirection \" . $random_anchor_number . \"\\n\" . \"<IfModule mod_rewrite.c> \\n\" . \"RewriteEngine On \\n\" . \"RewriteCond %{HTTPS} $https_status \\n\" . \"RewriteCond %{REQUEST_FILENAME} -f \\n\" . \"RewriteCond %{REQUEST_FILENAME} !\\.php$ \\n\" . \"RewriteRule .* $redirection_status://%{HTTP_HOST}%{REQUEST_URI} [L,R=$redirection_type] \\n\" . \"</IfModule> \\n\" . \"# End Advanced https redirection \" . $random_anchor_number . \"\\n\";\r\n \r\n \r\n $root_dir = get_home_path();\r\n $htaccess_filename_path = $root_dir . '.htaccess';\r\n \r\n \r\n $write_result = file_put_contents( $htaccess_filename_path, $written_rules . PHP_EOL, FILE_APPEND | LOCK_EX );\r\n \r\n if ( $write_result ) {\r\n return true;\r\n }\r\n \r\n return false;\r\n \r\n}", "public function setUsersFile($htpasswd)\n {\n $this->htpasswdFile = $htpasswd;\n if (!file_exists($this->htpasswdFile)) {\n return;\n }\n\n $handle = fopen($this->htpasswdFile, \"r\");\n if ($handle) {\n while (($line = fgets($handle)) !== false) {\n if (strpos($line, ':') !== false) {\n list($user, $passwd) = explode(':', $line);\n $this->users[$user] = trim($passwd);\n }\n }\n fclose($handle);\n }\n }", "private function setFileName(){\n if($this->customFileName !== ''){\n $prefix = $this->customFileName.'_';\n $this->finalFileName = uniqid($prefix).'.'.$this->fileExt;\n }else{\n $this->finalFileName = basename($this->fileName, \".\".$this->fileExt ).md5(microtime()).'.'.$this->fileExt;\n } \n }", "protected function _initFilesystem() {\n $this->_createWriteableDir($this->getTargetDir());\n $this->_createWriteableDir($this->getQuoteTargetDir());\n\n // Directory listing and hotlink secure\n $io = new Varien_Io_File();\n $io->cd($this->getTargetDir());\n if (!$io->fileExists($this->getTargetDir() . DS . '.htaccess')) {\n $io->streamOpen($this->getTargetDir() . DS . '.htaccess');\n $io->streamLock(true);\n $io->streamWrite(\"Order deny,allow\\nAllow from all\");\n $io->streamUnlock();\n $io->streamClose();\n }\n }", "public function setFilename($filename);", "function setFileNameRegex($fileNameRegex) {\n $this->fileNameRegex = $fileNameRegex;\n }", "function FileChmod()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$nChmodParam = 0755;\n\t\n\tif(isset($_REQUEST['chmod']) === false)\n\t{\n\t\techo '<fail>no chmodparametr</fail>';\n\t\treturn;\n\t}\n\t$nChmodParam = trim($_REQUEST['chmod']);\n\t\n\tif($nChmodParam[0] === '0')\n\t{\n\t\t$nChmodParam[0] = ' ';\n\t\t$nChmodParam = trim($nChmodParam);\n\t}\n\t\n\t$nChmodParam = (int) $nChmodParam;\n\t$nChmodParam = octdec($nChmodParam);\n\n\t\n\t\n\t\n\t$bIsChmodCreate = true;\n\t$bIsChmodCreate = chmod($sFileUrl, $nChmodParam);\n\t\n\tif($bIsChmodCreate === true)\n\t{\n\t\techo '<correct>update chmod correct</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create chmod</fail>';\n\t}\n}", "public function setIndexFile($index_file) {\n $this->index_file = $index_file;\n }", "function cemhub_check_htaccess_in_private_system_path($set_message = TRUE) {\n $is_created = FALSE;\n\n $file_private_path = variable_get('file_private_path', FALSE);\n if ($file_private_path) {\n file_create_htaccess('private://', TRUE);\n\n if (file_exists($file_private_path . '/.htaccess')) {\n $is_created = TRUE;\n }\n elseif ($set_message) {\n drupal_set_message(t(\"Security warning: Couldn't write .htaccess file.\"), 'warning');\n }\n }\n\n return $is_created;\n}", "public function setFileName($fileName);", "function setLogFilename($value)\n {\n $this->_props['LogFilename'] = $value;\n }", "private function setFilename($username){\n $file = $this->cacheDir.'/'.$username.\".json\";\n $this->cacheFile = $file;\n }", "public function setLogfile( $file ) {\t\t\n\t\t$this->logfile = fopen($file, 'a+');\n\t}", "public static function createHtaccess($base_dir='', $receiver_file='index.php')\n {\n if(!empty($base_dir) AND substr($base_dir, -1) == '/')\n $base_dir = substr($base_dir, 0, -1); // we delete the ending /\n \n $receiver_file = implode('/', array($base_dir, $receiver_file));\n \n return <<<TXT\n<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteBase /\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . $receiver_file [L]\n</IfModule>\nTXT;\n }", "public function setFileName($val)\n {\n $this->_propDict[\"fileName\"] = $val;\n return $this;\n }", "private function __construct(){\n\t\tif(!is_dir($this->HTML_FILEPATH)){\n\t\t\tmkdir($this->HTML_FILEPATH);\n\t\t}\n\t}", "public function setNewName(): ParseFile\n {\n $slugName = $this->slug($this->getFilename());\n $hashName = bin2hex(random_bytes(8));\n $this->newName = \"{$slugName}_{$hashName}.{$this->getExtension()}\";\n return $this;\n }", "public function setFileName($filename = '')\n\t{\n\t\tif( ! empty($filename))\n\t\t{\n\t\t\tif( ! file_exists($filename))\n\t\t\t{\n\t\t\t\tthrow new RoutesException('Fichier de routes introuvable');\n\t\t\t}\n\t\n\t\t\t$this->filename = $filename;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filename = \\base_dir().'app/Config/routes.xml';\n\t\t}\n\t}", "public function setFileName($value)\n {\n $this->setProperty(\"FileName\", $value, true);\n }", "public function setFile(string $path): void\n {\n $this->fileHandle = fopen($path, \"w\");\n \\curl_setopt($this->connection, CURLOPT_RETURNTRANSFER, true);\n \\curl_setopt($this->connection, CURLOPT_FILE, $this->fileHandle);\n }", "public function set_file_path($global_var){\r\n $gb = $GLOBALS[$global_var];\r\n $root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';\r\n echo \"<br />\" . $root . \"<br />\";\r\n \r\n if($this->local == 'true'){\r\n return \"https://\" . $_SERVER[\"HOME\"] . $gb . $this->file_path;\r\n }else{\r\n return $this->file_path;\r\n }\r\n \r\n }", "function update_admin_htaccess($student_admin_path) {\n global $users;\n $output = \"\";\n $existing_contents = \"\";\n\n $file_path = \"${student_admin_path}/.htaccess\";\n if (file_exists($file_path)) {\n $existing_contents = file_get_contents($file_path);\n }\n // Create a list of users who can view this admin page, begining with the user\n $split = explode('@', filter_input(INPUT_SERVER, 'SERVER_ADMIN'));\n $users .= ' ' . $split[0];\n\n $htaccess_contents = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options -Indexes\n AuthType WebAuth\n require user $users\n satisfy any\n order allow,deny\n</Files>\n\";\n // If there is an update, then write our new admin htaccess. Otherwise\n if ($htaccess_contents == $existing_contents)\n return \"${output}\\n<!-- No changes needed to ${file_path} -->\";\n if (file_put_contents($file_path, $htaccess_contents))\n return \"${output}\\n<!-- Synchronized ${file_path} -->\";\n return \"${output}\\n<!-- Failed sync on ${file_path} -->\";\n}", "public function setFile(HttpFile $file)\r\n {\r\n $this->file = $file;\r\n $this->mime = $file->getMimeType();\r\n $this->date = new \\DateTime('NOW');\r\n }", "function htaccess($rules, $directory, $before='') {\n\t$htaccess = $directory.'.htaccess';\n\tswitch($rules) {\n\t\tcase 'static':\n\t\t\t$rules = '<Files .*>'.\"\\n\".\n\t\t\t\t\t 'order allow,deny'.\"\\n\".\n\t\t\t\t\t 'deny from all'.\"\\n\".\n\t\t\t\t\t '</Files>'.\"\\n\\n\". \n\t\t\t\t\t 'AddHandler cgi-script .php .php3 .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi .fcgi'.\"\\n\".\n\t\t\t\t\t 'Options -ExecCGI';\n\t\tbreak;\n\t\tcase 'deny':\n\t\t\t$rules = 'deny from all';\n\t\tbreak;\n\t}\n\t\n\tif(file_exists($htaccess)) {\n\t\t$fgc = file_get_contents($htaccess);\n\t\tif(strpos($fgc, $rules)) {\n\t\t\t$done = true;\n\t\t} else {\n\t\t\tif(check_value($before)) {\n\t\t\t\t$rules = str_replace($before, $rules.\"\\n\".$before, $fgc);\n\t\t\t\t$f = 'w';\n\t\t\t} else {\n\t\t\t\t$rules = \"\\n\\n\".$rules;\n\t\t\t\t$f = 'a';\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$f = 'w';\n\t}\n\t\n\tif(!$done) {\n\t\t$fh = @fopen($htaccess, $f);\n\t\tif(!$fh) return false;\n\t\tif(fwrite($fh, $rules)) {\n\t\t\t@fclose($fh); return true;\n\t\t} else {\n\t\t\t@fclose($fh); return false;\n\t\t}\n\t} else {\n\t\treturn true;\n\t}\n}", "public function setGroupTemplatePath($path) {\n\t\t\n\t\tif (is_file($path)) {\n\t\t\t$this->groupTemplate = file_get_contents($path);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function setOutputFile($file);", "public static function generateHtAccess()\n {\n\n // open template file for reading and store the content to variable\n $fp_template = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/htaccess.template', 'r');\n $template = fread($fp_template, filesize($_SERVER[\"DOCUMENT_ROOT\"] . \"/htaccess.template\"));\n fclose($fp_template);\n\n $app_rewrites = \"\";\n // get all the registered applications\n $app_repo = new ApplicationRepository();\n $app_listings = $app_repo->getAll();\n\n $app_domain_repo = new DomainWhitelistRepository();\n foreach ($app_listings as $app) {\n\n $app_rewrites .= \" # app = $app->name\" . \"\\n\";\n // if application have any whitelisting\n $app_whitelists = $app_domain_repo->getByApplicationId($app->id);\n if ($app_whitelists != null) {\n $isOr = sizeof($app_whitelists) > 0 ? \"[OR]\" : \"\";\n $cnt = 0;\n foreach ($app_whitelists as $listing) {\n\n // dont add [OR] in last condition\n if ($cnt == sizeof($app_whitelists) - 1) $isOr = \"\";\n\n if (!empty($listing->domain)) {\n\n $app_rewrites .= \" RewriteCond %{HTTP_HOST} =$listing->domain $isOr\" . \"\\n\";\n\n } else if (!empty($listing->ip_address)) {\n\n $escaped_ip = str_replace(\".\", \"\\.\", $listing->ip_address);\n $app_rewrites .= \" RewriteCond %{REMOTE_ADDR} =^$escaped_ip$ $isOr\" . \"\\n\";\n\n }\n\n $cnt++;\n }\n }\n\n $app_rewrites .= \" RewriteRule api/$app->app_api_slug/(.*)$ api/generic/api.php [QSA,NC,L]\" . \"\\n\\r\";\n\n }\n\n $template = str_replace(\"{app_rewrites}\", $app_rewrites, $template);\n\n // write the final template to .htaccess file and close it.\n $fp = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/.htaccess', 'w+');\n if ($fp) {\n fwrite($fp, $template);\n fclose($fp);\n }\n }", "public function setFiles()\n {\n $this->files = [];\n $path = $this->getValue();\n\n if (!preg_match('#^/#', $path)) {\n $path = $this->parser->getServer()->getPrefix().'/'.$path;\n }\n\n $iterator = new GlobIterator($path);\n foreach ($iterator as $path) {\n $this->files[] = $path;\n }\n\n return $this;\n }", "private function allowDirectoryIndex() {\n $directory = $this->getArchiveDirectory();\n $fileName = '.htaccess';\n // @todo needs security review\n $content = <<<EOF\nOptions +Indexes\n# Unset Drupal_Security_Do_Not_Remove_See_SA_2006_006\nSetHandler None\n<Files *>\n # Unset Drupal_Security_Do_Not_Remove_See_SA_2013_003\n SetHandler None\n ForceType text/plain\n</Files>\nEOF;\n\n if (!file_put_contents($directory . '/' . $fileName, $content)) {\n $this->messenger->addError(t('File @file_name could not be created', [\n '@file_name' => $fileName,\n ]));\n }\n }", "public function setHeadFile($file)\n {\n $this->file_head = $file;\n }", "public function setFileName( $file = null){\n\t\tif(is_null($file)){\n\t\t\t$file = 'ACHFile_' . date('Y_m_d_H_i') . '.txt';\n\t\t}\n\n\t\t$this->fileName = $file;\n\t}", "public function set( $path ) {\n\t\t$this->path = $path;\n\n\t\t$path_info = pathinfo( $this->path );\n\n\t\t$this->file = $path_info['basename'];\n\t\t$this->extension = $path_info['extension'] == 'jpg' ? 'jpeg' : $path_info['extension'];\n\t\t$this->filename = $path_info['filename'];\n\n\t\t$this->server = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];\n\n\t\t$this->url = $this->server.str_replace( $this->base_dir, '', $this->path );\n\t}", "public function setFilepath($filepath);", "public static function set_file($file) {\n self::set_logfile($file);\n }", "public function setCacheDir($file_path)\n {\n if (\\substr($file_path, -1, 1) != '/') {\n $file_path .= '/';\n }\n\n $this->file_path = $file_path;\n }", "public function setFile($v)\r\n\t{\r\n\t\t$this->_file = $v;\r\n\t}", "public function setFileName($value)\n {\n return $this->set(self::FILENAME, $value);\n }", "public function setFull_Filename(){\n \t $this->filename = $this->setDestination().'/'.$this->id.'.'.$this->ext;; \n\t}", "function setBufferFile()\r\n\t {\r\n\t \t//$this->_bufferFile = '/tmp/fabrik_package-' . $this->label . '.xml';\r\n\t\t$this->_bufferFile = JPATH_SITE . \"/administrator/components/com_fabrik/fabrik_package-\". $this->label . '.xml';\r\n\t }", "public function set_filename($filepath) {\r\n\t\t$this->filepath = $filepath;\r\n\t}", "private function get_filename() {\n \n $md5 = md5($_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"]);\n return CACHE_DIR . \"/\" . $md5;\n }", "public function setFile($file)\n {\n $this->file = __DIR__ . '/../../../res/' . $file;\n\n if (!is_file($this->file)) {\n header(\"HTTP/1.0 404 Not Found\");\n exit;\n }\n\n return $this;\n }", "public function setFile($file){\n $this->file = $file;\n }" ]
[ "0.7456132", "0.6594482", "0.6594482", "0.65299255", "0.65117747", "0.60701984", "0.60481924", "0.6004976", "0.6004976", "0.5822717", "0.5770194", "0.56891537", "0.5386682", "0.5380016", "0.53605556", "0.53605556", "0.53605556", "0.5360422", "0.5360422", "0.5258312", "0.5250901", "0.5250901", "0.5170187", "0.5124361", "0.5117146", "0.50971866", "0.5081559", "0.5054019", "0.50160044", "0.5002521", "0.5001105", "0.49771854", "0.4975496", "0.4946402", "0.4938669", "0.49306738", "0.49106166", "0.49048093", "0.48471564", "0.48277712", "0.48249507", "0.4820607", "0.4812816", "0.48104712", "0.479151", "0.47808918", "0.47625738", "0.47463825", "0.4744381", "0.47418287", "0.47388342", "0.47331905", "0.4724405", "0.4702665", "0.46873355", "0.46850896", "0.46818858", "0.46769106", "0.46687895", "0.46423033", "0.46344203", "0.46328893", "0.46231782", "0.45924142", "0.45893753", "0.4589073", "0.45887935", "0.4586621", "0.4582329", "0.457866", "0.4578319", "0.45761582", "0.4568944", "0.45634994", "0.4562473", "0.45621923", "0.45611778", "0.4557833", "0.45500514", "0.4549495", "0.45423502", "0.4541342", "0.45410308", "0.45381922", "0.4522208", "0.45196348", "0.4519278", "0.45185146", "0.4506091", "0.4493971", "0.44915313", "0.4489575", "0.44891846", "0.4487886", "0.44877532", "0.44869626", "0.4466666", "0.4461159", "0.44548357" ]
0.75066364
1
Sets the filename and path of the password file for the htaccess file
function setFPasswd($filename){ $this->fPasswd=$filename; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFPasswd($filename){\r\n\t\t$this->fPasswd=$filename;\r\n\t}", "public function createHtaccessFile() {\n $oModule = oxNew(Module::class);\n $oConfig = $this->getConfig();\n // get modules path\n $sModulesDir = $oConfig->getModulesDir();\n // get cache path\n $sCacheDir = $oConfig->getConfigParam('sCompileDir');\n // check if the default .htaccess file is in config folder\n if(file_exists($sModulesDir.$oModule->getModulePath('suaboclearcache').'/Config/.htaccess.tmp')) {\n // copy .htaccess to cache folder\n copy($sModulesDir . $oModule->getModulePath('suaboclearcache') . '/Config/.htaccess.tmp', $sCacheDir . '/.htaccess');\n }\n }", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "function setFHtaccess($filename){\r\n\t\t$this->fHtaccess=$filename;\r\n\t}", "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function create_htpasswd($username,$password) {\n\n\t$encrypted_password = crypt($password, base64_encode($password));\n\t$data = $username.\":\".$encrypted_password;\n\t\t\t\t\t\n\t$ht = fopen(\"administration/.htpasswd\", \"w\") or die(\"<div class=\\\"installer-message\\\">Could not open .htpassword for writing. Please make sure that the server is allowed to write to the administration folder. In Apache, the folder should be chowned to www-data. </div>\");\n\tfwrite($ht, $data);\n\tfclose($ht);\n}", "function addLogin(){\r\n\t $file=fopen($this->fHtaccess,\"w+\");\r\n\t fputs($file,\"Order allow,deny\\n\");\r\n\t fputs($file,\"Allow from all\\n\");\r\n\t fputs($file,\"AuthType \".$this->authType.\"\\n\");\r\n\t fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\r\n\t fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\r\n\t fputs($file,\"require valid-user\\n\");\r\n\t fclose($file);\r\n\t}", "public function savePasswdFile($htpasswd = null)\n {\n if (is_null($htpasswd)) {\n $htpasswd = $this->htpasswdFile;\n }\n $handle = fopen($this->htpasswdFile, \"w\");\n if ($handle) {\n foreach ($this->users as $name => $passwd) {\n if (!empty($name) && !empty($passwd)) {\n fwrite($handle, \"{$name}:{$passwd}\\n\");\n }\n }\n fclose($handle);\n }\n }", "function update_htacess_protection($credentials)\n\t{\n\t\tif ( $_POST['enableHtaccess'] == 'true' ) //Add/Update the .htaccess and .htpasswd files\n\t\t{\n\t\t\tif ( !isset($credentials['username']) || !isset($credentials['password']) ) return FALSE;\n\n\t\t\t$username = $credentials['username'];\n\t\t\t$password = crypt_apr1_md5($credentials['password']);\n\n\t\t\t$fileLocation = str_replace('\\\\', '/', dirname(__FILE__));\n\t\t\t$fileLocation = explode('functions', $fileLocation);\n\t\t\t$fileLocation = $fileLocation[0];\n\t\t\t\n\t\t\t//Create the .htpasswd file\n\t\t\t$content = $username . ':' . $password;\n\t\t\t$file = fopen('../.htpasswd', \"w\");\n\t\t\tif ($file === FALSE) return FALSE;\n\t\t\tfwrite($file, $content);\n\t\t\tfclose($file);\n\n\t\t\t// Create the .htaccess file\n\t\t\t$content = 'AuthName \"Please login to proceed\"\n\t\t\tAuthType Basic\n\t\t\tAuthUserFile ' . $fileLocation . '.htpasswd\n\t\t\tRequire valid-user';\n\t\t\t$file = fopen('../.htaccess', \"w\");\n\t\t\tif ($file === FALSE) return FALSE;\n\t\t\tfwrite($file, $content);\n\t\t\tfclose($file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//delete the .htaccess and .htpasswd files\n\t\t\tif ( file_exists('../.htpasswd') ) unlink('../.htpasswd');\n\t\t\tif ( file_exists('../.htaccess') ) unlink('../.htaccess');\n\t\t}\n\n\t\treturn TRUE;\n\t}", "protected function writehtaccess()\n {\n $content = '# Deny access to supersake\n<Files supersake>\n\tOrder allow,deny\n\tDeny from all\n</Files>';\n }", "function create_htaccess($ip,$root,$ts_shop_folder) {\t\t\t\t\t\t\n$htaccess = 'AuthType Basic\nAuthName \"OpenShop Administration\"\nAuthUserFile '.$root.'/'.$ts_shop_folder.'/administration/.htpasswd\nRequire valid-user\nOrder Deny,Allow\nDeny from all\nAllow from '.$ip.'\n';\n\n\t\t\t\tif(!is_writable(\"administration/.htaccess\")) {\n\t\t\t\t\tchmod(\"administration/.htaccess\",0777);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$hta = fopen(\"administration/.htaccess\", \"w+\") or die(\"<div class=\\\"installer-message\\\">Unable to open administration .htaccess</div>\");\n\t\t\t\t\tfwrite($hta, $htaccess);\n\t\t\t\t\tfclose($hta);\n\t\t\t\t}", "function wpsc_product_files_htaccess() {\n if(!is_file(WPSC_FILE_DIR.\".htaccess\")) {\n\t\t$htaccess = \"order deny,allow\\n\\r\";\n\t\t$htaccess .= \"deny from all\\n\\r\";\n\t\t$htaccess .= \"allow from none\\n\\r\";\n\t\t$filename = WPSC_FILE_DIR.\".htaccess\";\n\t\t$file_handle = @ fopen($filename, 'w+');\n\t\t@ fwrite($file_handle, $htaccess);\n\t\t@ fclose($file_handle);\n\t\t@ chmod($file_handle, 665);\n }\n}", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function setUsersFile($htpasswd)\n {\n $this->htpasswdFile = $htpasswd;\n if (!file_exists($this->htpasswdFile)) {\n return;\n }\n\n $handle = fopen($this->htpasswdFile, \"r\");\n if ($handle) {\n while (($line = fgets($handle)) !== false) {\n if (strpos($line, ':') !== false) {\n list($user, $passwd) = explode(':', $line);\n $this->users[$user] = trim($passwd);\n }\n }\n fclose($handle);\n }\n }", "public function setPassfile(PhingFile $passFile)\n {\n $this->passFile = $passFile;\n }", "public function htaccessGen($path = \"\") {\n if($this->option(\"htaccess\") == true) {\n\n if(!file_exists($path.DIRECTORY_SEPARATOR.\".htaccess\")) {\n // echo \"write me\";\n $html = \"order deny, allow \\r\\n\ndeny from all \\r\\n\nallow from 127.0.0.1\";\n\n $f = @fopen($path.DIRECTORY_SEPARATOR.\".htaccess\",\"w+\");\n if(!$f) {\n return false;\n }\n fwrite($f,$html);\n fclose($f);\n\n\n }\n }\n\n }", "function update_htaccess($unused, $value) {\r\n\t\t$this->htaccess_recovery = $value;\r\n\t\t\r\n\t\t//Overwrite the file\r\n\t\t$htaccess = get_home_path().'.htaccess';\r\n\t\t$fp = fopen($htaccess, 'w');\r\n\t\tfwrite($fp, $value);\r\n\t\tfclose($fp);\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function File_Passwd($file, $lock = 0, $lockfile = \"\") {\n $this->filename = $file;\n if( !empty( $lockfile) ) {\n $this->lockfile = $lockfile ;\n }\n\n if($lock) {\n $this->fplock = fopen($this->lockfile, 'w');\n flock($this->fplock, LOCK_EX);\n $this->locked = true;\n }\n \n $fp = fopen($file,'r') ;\n if( !$fp) {\n return new PEAR_Error( \"Couldn't open '$file'!\", 1, PEAR_ERROR_RETURN) ;\n }\n while(!feof($fp)) {\n $line = fgets($fp, 128);\n list($user, $pass, $cvsuser) = explode(':', $line);\n if(strlen($user)) {\n $this->users[$user] = trim($pass);\n $this->cvs[$user] = trim($cvsuser);\t\n }\n }\n fclose($fp);\n }", "function htaccess($htaccess, $htpass, $htgroup=null){\n\t \n\t $this->setFHtaccess($htaccess);\n\t\t$this->setFPasswd($htpass);\n\t\t\n\t\tif ($htgroup)\n\t\t $this->setFHtgroup($htgroup);\n }", "function create_file($password_path, $password_file_path)\n{\n if (!file_exists($password_path)) {\n mkdir($password_path);\n }\n\n // Create file if not exist\n if (!file_exists($password_file_path)) {\n file_put_contents($password_file_path, '');\n }\n}", "function setPass($pwd) \n {\n\t\t\t$this->pass = $pwd;\n\t\t}", "public function setPassword(){\n\t}", "public function modifpassword($user,$passwd){\n \n }", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "private function setCacheForPasswordProtected() : void {\n $post = get_post();\n\n if (!empty($post->post_password)) {\n $this->disableCache();\n }\n }", "protected function _initFilesystem() {\n $this->_createWriteableDir($this->getTargetDir());\n $this->_createWriteableDir($this->getQuoteTargetDir());\n\n // Directory listing and hotlink secure\n $io = new Varien_Io_File();\n $io->cd($this->getTargetDir());\n if (!$io->fileExists($this->getTargetDir() . DS . '.htaccess')) {\n $io->streamOpen($this->getTargetDir() . DS . '.htaccess');\n $io->streamLock(true);\n $io->streamWrite(\"Order deny,allow\\nAllow from all\");\n $io->streamUnlock();\n $io->streamClose();\n }\n }", "function set_pass($pass)\n\t{\n\t\t$this->pass =$pass;\n\t}", "private function initialize( $passwd_file ) {\r\n $this->FILE = $passwd_file;\r\n srand( (double) microtime() * 1000000 ); // Seed the random number gen\r\n if ( empty( $passwd_file ) ) {\r\n // PHP is going to bitch about this, this is here just because\r\n $this->error( \"Invalid initialize() or new() method: No file specified!\", 1 );\r\n }\r\n if ( file_exists( $this->FILE ) ) {\r\n $this->EXISTS = TRUE;\r\n if ( $this->sane( $this->FILE ) ) {\r\n $this->SANE = TRUE;\r\n $this->htReadFile();\r\n } else {\r\n // Preserve the error generated by sane()\r\n return;\r\n }\r\n } else {\r\n file_put_contents( $this->FILE, '' );\r\n $this->SANE = TRUE; // Non-existant files are safe\r\n }\r\n return;\r\n }", "public function create_secret() {\n\n\t\t$this->path = '/secret';\n\t}", "public static function setOriginalPassword ($value)\n {\n self::$_origPasswod = $value;\n }", "public function setPassKey($key = '')\n {\n $len = strlen($key);\n // Best to set your own passkey :)\n if ($len <= 0) {\n $key = md5(__FILE__);\n }\n\n if ($len > self::KEY_LENGTH) {\n $key = substr($key, 0, self::KEY_LENGTH);\n } elseif ($len < self::KEY_LENGTH) {\n while (strlen($key) < self::KEY_LENGTH) {\n $key .= md5($key);\n }\n $key = substr($key, 0, self::KEY_LENGTH);\n }\n\n $this->_passkey = $key;\n\n return $this;\n }", "public static function setPassword($val) \n { \n emailSettings::$password = $val; \n }", "public function __construct($file, $password,$openSsl)\n {\n $this->fileNameDir = $file;\n $this->password = $password;\n $this->openSsl = $openSsl;\n\n }", "private function htWriteFile() {\r\n global $php_errormsg;\r\n $filename = $this->FILE;\r\n // On WIN32 box this should -still- work OK,\r\n // but it'll generate the tempfile in the system\r\n // temporary directory (usually c:\\windows\\temp)\r\n // YMMV\r\n $tempfile = tempnam( \"/tmp\", \"fort\" );\r\n $name = \"\";\r\n $pass = \"\";\r\n $count = 0;\r\n $fd;\r\n $myerror = \"\";\r\n if ( $this->EMPTY ) {\r\n $this->USERCOUNT = 0;\r\n }\r\n if ( !copy( $filename, $tempfile ) ) {\r\n $this->error( \"FATAL cannot create backup file [$tempfile] [$php_errormsg]\", 1 );\r\n }\r\n $fd = fopen( $tempfile, \"w\" );\r\n if ( empty( $fd ) ) {\r\n $myerror = $php_errormsg; // In case the unlink generates\r\n // a new one - we don't care if\r\n // the unlink fails - we're\r\n // already screwed anyway\r\n unlink( $tempfile );\r\n $this->error( \"FATAL File [$tempfile] access error [$myerror]\", 1 );\r\n }\r\n for ( $count = 0; $count <= $this->USERCOUNT; $count++ ) {\r\n $name = $this->USERS[$count][\"user\"];\r\n $pass = $this->USERS[$count][\"pass\"];\r\n if ( ($name != \"\") && ($pass != \"\") ) {\r\n fwrite( $fd, \"$name:$pass\\n\" );\r\n }\r\n }\r\n fclose( $fd );\r\n if ( !copy( $tempfile, $filename ) ) {\r\n $myerror = $php_errormsg; // Stash the error, see above\r\n unlink( $tempfile );\r\n $this->error( \"FATAL cannot copy file [$filename] [$myerror]\", 1 );\r\n }\r\n // Update successful\r\n unlink( $tempfile );\r\n if ( file_exists( $tempfile ) ) {\r\n // Not fatal but it should be noted\r\n $this->error( \"Could not unlink [$tempfile] : [$php_errormsg]\", 0 );\r\n }\r\n // Update the information in memory with the\r\n // new file contents.\r\n $this->initialize( $filename );\r\n return TRUE;\r\n }", "protected function changePassword() {}", "function setPasswd($username,$new_password){\n // Reading names from file\n $newUserlist=\"\";\n \n $file=fopen($this->fPasswd,\"r\");\n $x=0;\n for($i=0;$line=fgets($file,200);$i++){\n $lineArr=explode(\":\",$line);\n if($username!=$lineArr[0] && $lineArr[0]!=\"\" && $lineArr[1]!=\"\"){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=$lineArr[1];\n $x++;\n }else if($lineArr[0]!=\"\" && $lineArr[1]!=\"\"){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=crypt($new_password).\"\\n\";\n $isSet=true;\n $x++;\n }\n }\n fclose($file);\n\n unlink($this->fPasswd);\n\n /// Writing names back to file (with new password)\n $file=fopen($this->fPasswd,\"w\");\n for($i=0;$i<count($newUserlist);$i++){\n $content=$newUserlist[$i][0].\":\".$newUserlist[$i][1];\n fputs($file,$content);\n }\n fclose($file);\n\n if($isSet==true){\n return true;\n }else{\n return false;\n }\n }", "function setPasswd($username,$new_password){\n // Reading names from file\n $newUserlist=\"\";\n \n $file=fopen($this->fPasswd,\"r\");\n $x=0;\n for($i=0;$line=fgets($file,200);$i++){\n $lineArr=explode(\":\",$line);\n if($username!=$lineArr[0] && $lineArr[0]!=\"\" && $lineArr[1]!=\"\"){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=$lineArr[1];\n $x++;\n }else if($lineArr[0]!=\"\" && $lineArr[1]!=\"\"){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=crypt($new_password).\"\\n\";\n $isSet=true;\n $x++;\n }\n }\n fclose($file);\n\n unlink($this->fPasswd);\n\n /// Writing names back to file (with new password)\n $file=fopen($this->fPasswd,\"w\");\n for($i=0;$i<count($newUserlist);$i++){\n $content=$newUserlist[$i][0].\":\".$newUserlist[$i][1];\n fputs($file,$content);\n }\n fclose($file);\n\n if($isSet==true){\n return true;\n }else{\n return false;\n }\n }", "static function write_to_htaccess()\r\n {\r\n global $aio_wp_security;\r\n //figure out what server is being used\r\n if (AIOWPSecurity_Utility::get_server_type() == -1) {\r\n $aio_wp_security->debug_logger->log_debug(\"Unable to write to .htaccess - server type not supported!\", 4);\r\n return false; //unable to write to the file\r\n }\r\n\r\n //clean up old rules first\r\n if (AIOWPSecurity_Utility_Htaccess::delete_from_htaccess() == -1) {\r\n $aio_wp_security->debug_logger->log_debug(\"Delete operation of .htaccess file failed!\", 4);\r\n return false; //unable to write to the file\r\n }\r\n\r\n $htaccess = ABSPATH . '.htaccess';\r\n\r\n if (!$f = @fopen($htaccess, 'a+')) {\r\n @chmod($htaccess, 0644);\r\n if (!$f = @fopen($htaccess, 'a+')) {\r\n $aio_wp_security->debug_logger->log_debug(\"chmod operation on .htaccess failed!\", 4);\r\n return false;\r\n }\r\n }\r\n AIOWPSecurity_Utility_File::backup_and_rename_htaccess($htaccess); //TODO - we dont want to continually be backing up the htaccess file\r\n @ini_set('auto_detect_line_endings', true);\r\n $ht = explode(PHP_EOL, implode('', file($htaccess))); //parse each line of file into array\r\n\r\n $rules = AIOWPSecurity_Utility_Htaccess::getrules();\r\n\r\n $rulesarray = explode(PHP_EOL, $rules);\r\n $rulesarray = apply_filters('aiowps_htaccess_rules_before_writing', $rulesarray);\r\n $contents = array_merge($rulesarray, $ht);\r\n\r\n if (!$f = @fopen($htaccess, 'w+')) {\r\n $aio_wp_security->debug_logger->log_debug(\"Write operation on .htaccess failed!\", 4);\r\n return false; //we can't write to the file\r\n }\r\n\r\n $blank = false;\r\n\r\n //write each line to file\r\n foreach ($contents as $insertline) {\r\n if (trim($insertline) == '') {\r\n if ($blank == false) {\r\n fwrite($f, PHP_EOL . trim($insertline));\r\n }\r\n $blank = true;\r\n } else {\r\n $blank = false;\r\n fwrite($f, PHP_EOL . trim($insertline));\r\n }\r\n }\r\n @fclose($f);\r\n return true; //success\r\n }", "public function setPassword($value);", "public function setPassword($p) {\n $this->_password = $p;\n }", "public static function setFile($file) {}", "private function createAuthFile()\r\n {\r\n $directory = $this->filesystem->getDirectoryWrite(DirectoryList::COMPOSER_HOME);\r\n\r\n if (!$directory->isExist(PackagesAuth::PATH_TO_AUTH_FILE)) {\r\n try {\r\n $directory->writeFile(PackagesAuth::PATH_TO_AUTH_FILE, '{}');\r\n } catch (Exception $e) {\r\n throw new LocalizedException(__(\r\n 'Error in writing Auth file %1. Please check permissions for writing.',\r\n $directory->getAbsolutePath(PackagesAuth::PATH_TO_AUTH_FILE)\r\n ));\r\n }\r\n }\r\n }", "private function htaccessinitialize() {\n\t\t// get .htaccess\n\t\t$this->htaccessfile = str_replace('typo3conf' . DIRECTORY_SEPARATOR .\n\t\t\t\t'ext' . DIRECTORY_SEPARATOR . 'cyberpeace' . DIRECTORY_SEPARATOR . 'pi1', '', realpath(dirname(__FILE__))) . '.htaccess';\n\t\t$denyarr = 'no .htaccess';\n\t\tif (file_exists($this->htaccessfile)) {\n\t\t\t$denyarr = array();\n\t\t\t// get contents\n\t\t\t$this->htaccesscontent = file_get_contents($this->htaccessfile);\n\t\t\t// get line ##cyberpeace START\n\t\t\tif (str_replace('##cyberpeace START', '', $this->htaccesscontent) == $this->htaccesscontent) {\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t// get line ##cyberpeace END\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace START';\n\t\t\t\t$this->htaccesscontent = str_replace('##cyberpeace END', '', $this->htaccesscontent);\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace END';\n\t\t\t}\n\n\t\t\t// get lines between ##cyberpeace START and END\n\t\t\t$this->arrtostart = explode(\"\\n\" . '##cyberpeace START', $this->htaccesscontent);\n\t\t\t$this->arrtoend = explode(\"\\n\" . '##cyberpeace END', $this->arrtostart[1]);\n\n\t\t\t// explode by '\\ndeny from '\n\t\t\t$denyarr = explode(\"\\n\" . 'deny from ', $this->arrtoend[0]);\n\n\t\t}\n\n\t\treturn $denyarr;\n\t}", "public function setPassword($value)\n {\n $this->_password = $value;\n }", "private function writePassword(): void\n {\n // Exit unless sheet protection and password have been specified\n if ($this->phpSheet->getProtection()->getSheet() !== true || !$this->phpSheet->getProtection()->getPassword() || $this->phpSheet->getProtection()->getAlgorithm() !== '') {\n return;\n }\n\n $record = 0x0013; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $wPassword);\n\n $this->append($header . $data);\n }", "public function setPassword($value)\r\n\t{\r\n\t\t$this->password = $value;\r\n\t}", "function cvs_change_password($cvs_user, $new_pass, $cvs_project){\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n $cvs_fields = $all_cvs_users[$cvs_user];\r\n if (!is_null($cvs_fields)) {\r\n $cvs_fields[0] = $new_pass;\r\n\t$all_cvs_users[$cvs_user] = $cvs_fields;\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Updated password for $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"No such user- $cvs_user\");\r\n }\r\n}", "public function setPass($pass) {\n\n $this->pass = $pass;\n }", "function change_password_url() {\n return new moodle_url($this->config->changepasswordurl);\n }", "public function necesitaCambiarPassword();", "function SetPassword ( $p )\n {\n $this->username = isset( $_SESSION [ \"username\" ] ) ? sanitize_string( $_SESSION [ \"username\" ] ) : null;\n if ( !$this->username ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? sanitize_string( $_COOKIE [ \"username\" ] ) : null;\n }\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $this->mongo->dataUpdate( array( \"username\" => $this->username ), array( '$set' => array( \"password\" => sha1( $p ) ) ) );\n }", "protected function setCachePath(): void\n {\n $filename = basename($this->pathFile);\n\n $this->pathCache = $this->cacheDir.'/'.$filename;\n }", "function change_db_credentials()\n\t{\n\t\tif ( !isset($_POST['credentials']) ) return;\n\t\t$credentials = file_get_contents('../credentials.php');\n\t\t$permittedVariables = array('DB_NAME','DB_USER','DB_PASSWORD');\n\t\tforeach ($_POST['credentials'] as $credName => $credVal)\n\t\t{\n\t\t\tif ( in_array($credName, $permittedVariables) )\n\t\t\t{\n\t\t\t\t//Sanitize the value before adding it.\n\t\t\t\t$credVal = str_replace(\"'\", '', $credVal);\n\t\t\t\t$credVal = str_replace(\"\\\"\", '', $credVal);\n\t\t\t\t$credentials = replace_credential($credentials, $credName, $credVal);\n\t\t\t}\n\t\t}\n\t\tfile_put_contents('../credentials.php', $credentials);\n\t}", "public function setPass($pass)\n {\n $this->pass =$pass;\n\n \n }", "public function setPW($dw) {}", "protected function setPasswordAttribute($value) \n { \n $this->attributes['password'] = \\Hash::needsRehash($value) ? Hash::make($value) : $value;\n }", "private function setFilename($username){\n $file = $this->cacheDir.'/'.$username.\".json\";\n $this->cacheFile = $file;\n }", "public function hash_passwd() {\n $this->passwd = sha1($this->passwd);\n return $this;\n }", "public function __construct() {\n // Use FS over PHP for this as it may need to search deep.\n $htaccess = array();\n exec('locate .htaccess', $htaccess);\n\n $htaccess = array_filter($htaccess, function($item) {\n return strpos($item, DRUPAL_ROOT) !== FALSE;\n });\n\n $this->setData($htaccess);\n }", "function setPasswd($username,$new_password){\r\n\t\t// Reading names from file\r\n\t\t$newUserlist=\"\";\r\n\r\n\t\t$file=fopen($this->fPasswd,\"r\");\r\n\t\t$x=0;\r\n\t\tfor ($i=0; $line=fgets($file,4096); $i++) {\r\n\t\t\t$lineArr = explode(\":\",$line);\r\n\t\t\tif ($username != $lineArr[0] && $lineArr[0] != \"\" && $lineArr[1] != \"\") {\r\n\t\t\t\t$newUserlist[$i][0] = $lineArr[0];\r\n\t\t\t\t$newUserlist[$i][1] = $lineArr[1];\r\n\t\t\t\t$x++;\r\n\t\t\t} else if ($lineArr[0] != \"\" && $lineArr[1] != \"\") {\r\n\t\t\t\t$newUserlist[$i][0] = $lineArr[0];\r\n\t\t\t\t$newUserlist[$i][1] = $new_password.\"\\n\";\r\n\t\t\t\t$isSet = true;\r\n\t\t\t\t$x++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfclose($file);\r\n\r\n\t\tunlink($this->fPasswd);\r\n\r\n\t\t/// Writing names back to file (with new password)\r\n\t\t$file = fopen($this->fPasswd,\"w\");\r\n\t\tfor ($i=0; $i<count($newUserlist); $i++) {\r\n\t\t\t$content = $newUserlist[$i][0] . \":\" . $newUserlist[$i][1];\r\n\t\t\tfputs($file,$content);\r\n\t\t}\r\n\t\tfclose($file);\r\n\r\n\t\tif ($isSet==true) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function htaccess_notice() {\n\t\t$value = $this->get_setting( 'enable_basic_authentication', 'no' );\n\t\t$htaccess_file = $this->base_path . '.htaccess';\n\n\t\tif ( 'yes' === $value && ! file_exists( $htaccess_file ) ) {\n\t\t\t?>\n\t\t\t<div class=\"error\">\n\t\t\t\t<p>\n\t\t\t\t\t<?php _e( \"Warning: .htaccess doesn't exist. Your SatisPress packages are public.\", 'satispress' ); ?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}", "function create_class_htaccess($student_class_path) {\n $class_htaccess = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options +Indexes\n</Files>\n\";\n $file_path = \"${student_class_path}/.htaccess\";\n if (file_exists($file_path))\n return \"<!-- Class htaccess already exists -->\";\n if (file_put_contents($file_path, $class_htaccess))\n return \"<!-- Created class htaccess -->\";\n return \"<!-- Unable to create class htaccess -->\";\n}", "public function olvidoPassword(){\n\t}", "function CryptFile($InFileName,$OutFileName,$password){\r\n //check the file if exists\r\n if (file_exists($InFileName)){\r\n \r\n //get file content as string\r\n $InFile = file_get_contents($InFileName);\r\n \r\n // get string length\r\n $StrLen = strlen($InFile);\r\n \r\n // get string char by char\r\n for ($i = 0; $i < $StrLen ; $i++){\r\n //current char\r\n $chr = substr($InFile,$i,1);\r\n \r\n //get password char by char\r\n $modulus = $i % strlen($password);\r\n $passwordchr = substr($password,$modulus, 1);\r\n \r\n //encryption algorithm\r\n $OutFile .= chr(ord($chr)+ord($passwordchr));\r\n }\r\n \r\n $OutFile = base64_encode($OutFile);\r\n \r\n //write to a new file\r\n if($newfile = fopen($OutFileName, \"c\")){\r\n file_put_contents($OutFileName,$OutFile);\r\n fclose($newfile);\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }else{\r\n return false;\r\n }\r\n }", "private function setUserPass(){\n if($this->_request->get(login_user)){\n $this->_user = $this->_request->get(login_user);\n }else{\n $this->_user = $this->getCookie();\n }\n $this->_pass = $this->_request->get('login-password');\n }", "public function setPassword($userid, $password);", "function setDrupalDetails($username, $passwd=NULL, $db_src_path, $db_dst_path) {\n\n $this->admin_username = $username;\n $this->admin_passwd = $passwd ? : getenv('BEHAT_DRUPAL_ADMIN_PASSWD');\n $this->db_src_path = $db_src_path;\n $this->db_dst_path = $db_dst_path;\n }", "function load_htpasswd(){\n\t\tif(!file_exists(\"/etc/oar/api-users\")){\n\t\t\treturn Array();\n\t\t}\n\n\t\t$res = Array();\n\t\tforeach (file(\"/etc/oar/api-users\") as $key => $value) {\n\t\t\t$array = explode(':',$value);\n\t\t\t$user = $array[0];\n\t\t\t$pass = rtrim($array[1]);\n\t\t\t$res[$user]=$pass;\n\t\t}\n\n\t\treturn $res;\n\t}", "public function setPasswordAttribute( $value ) {\n $this->attributes['password'] = Hash::make( $value );\n }", "public static function setPassword(string $newPassword): void\n {\n self::writeConfiguration(['password' => password_hash($newPassword, PASSWORD_DEFAULT)]);\n }", "function set_pass($modified_username, $pass, $caller_username) {\n\tif ($modified_username !== $caller_username && !is_admin()) {\n\t\thttp_response_code(403);\n\t\techo \"Unauthorized action\";\n\t\texit();\n\t}\n\t$db = get_db();\n\t$pass_hashed = password_hash($pass, PASSWORD_DEFAULT);\n\t$stmt = $db->prepare(\"CALL set_pass(?, ?)\");\n\t$stmt->bind_param(\"ss\", $modified_username, $pass_hashed);\n\t$stmt->execute() or trigger_error($db->error);\n\t$db->close();\t\n}", "private function configCookiePath()\n\t{\n\t\treturn dirname(__FILE__) . '\\cookiefile';\n\t}", "function set_password($string) {\r\n echo PHP_EOL;\r\n $this->action(\"setting new password of: $string\");\r\n $this->hashed_password = hash('sha256', $string . $this->vehicle_salt);\r\n $this->action(\"successfully set new password\");\r\n }", "private function changeAuthenticationRedirect()\n {\n $this->line('Change default authentication redirect');\n\n $file = app_path('Http/Middleware/Authenticate.php');\n $content = $this->files->get($file);\n\n $this->files->replace($file, Str::replaceArray(\"route('login')\", [\"config('admin.url')\"], $content));\n }", "private function set_cookiefile($file) {\r\n\t\tif (!empty($this->options[\"CURLOPT_COOKIEFILE\"])) { trigger_error(\"file cookie is activated and cannot be modified\", E_USER_WARNING); }\r\n\t\telseif (empty($file)) { trigger_error(\"an accessible file is required for CURLOPT_COOKIEFILE\", E_USER_WARNING); }\r\n\t\telse {\r\n\t\t\tif (!file_exists($file)) { touch($file); }\r\n\t\t\tif (is_dir($file)) { trigger_error(\"'{$file}' is a directory\", E_USER_WARNING); }\r\n\t\t\telseif (!is_readable($file)) { trigger_error(\"no read permission to access '{$file}'\", E_USER_WARNING); }\r\n\t\t\telse {\r\n\t\t\t\t$this->session_cookie = false;\r\n\t\t\t\tif (substr($file, 0, 2) == \".\".DIRECTORY_SEPARATOR) { $file = rtrim(getcwd(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.substr($file, 2); }\t\t\t\t# fix relative path\r\n\t\t\t\t$this->options[\"CURLOPT_COOKIEFILE\"] = $file;\r\n\t\t\t\tcurl_setopt($this->ch, CURLOPT_COOKIEFILE, $file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "function set_user_pass($plain)\n{\n\tif($rand_src = fopen('/dev/urandom','r')) {\n\t\tif($key = fread($rand_src, 32)) {\n\t\t\t$key = md5($key);\t//TODO: change hash? outputs 128, so simpler\n\t\t\tfclose($rand_src);\n\t\t\t$cipher = @mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plain, MCRYPT_MODE_CBC);\t//TODO: add IV? suppressed warning for now\n\t\t\tif(setcookie('FILEADVENTURER_KEY', $key))\n\t\t\t\treturn rtrim($cipher,'\\0');\n\t\t}\n\t\tfclose($rand_src);\n\t}\n\treturn false;\n}", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "function FileChmod()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$nChmodParam = 0755;\n\t\n\tif(isset($_REQUEST['chmod']) === false)\n\t{\n\t\techo '<fail>no chmodparametr</fail>';\n\t\treturn;\n\t}\n\t$nChmodParam = trim($_REQUEST['chmod']);\n\t\n\tif($nChmodParam[0] === '0')\n\t{\n\t\t$nChmodParam[0] = ' ';\n\t\t$nChmodParam = trim($nChmodParam);\n\t}\n\t\n\t$nChmodParam = (int) $nChmodParam;\n\t$nChmodParam = octdec($nChmodParam);\n\n\t\n\t\n\t\n\t$bIsChmodCreate = true;\n\t$bIsChmodCreate = chmod($sFileUrl, $nChmodParam);\n\t\n\tif($bIsChmodCreate === true)\n\t{\n\t\techo '<correct>update chmod correct</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create chmod</fail>';\n\t}\n}", "public function setPasswordAttribute($value) {\n \t$this->attributes['password'] = Hash::make($value);\n\t}", "function havp_reconfigure_clamd() {\n\tfile_put_contents(HVDEF_CLAM_CONFIG, havp_config_clam());\n\thavp_set_file_access(HVDEF_CLAM_CONFIG, HVDEF_USER, '0664');\n}", "public function passwordAction(){\r\n $this->view->password = '';\r\n }", "public function setpasswordAction(){\n $req=$this->getRequest();\n $cu=$this->aaac->getCurrentUser();\n $password=$this->getRequest()->getParam('password');\n $record=Doctrine_Query::create()->from('Users')->addWhere('ID=?')->fetchOne(array($req->getParam('id'))); \n $record->password=md5($password);\n if(!$record->trySave()){\n $this->errors->addValidationErrors($record);\n }\n $this->emitSaveData(); \n }", "public function setPassword(string $password): void\n {\n }", "function cemhub_check_htaccess_in_private_system_path($set_message = TRUE) {\n $is_created = FALSE;\n\n $file_private_path = variable_get('file_private_path', FALSE);\n if ($file_private_path) {\n file_create_htaccess('private://', TRUE);\n\n if (file_exists($file_private_path . '/.htaccess')) {\n $is_created = TRUE;\n }\n elseif ($set_message) {\n drupal_set_message(t(\"Security warning: Couldn't write .htaccess file.\"), 'warning');\n }\n }\n\n return $is_created;\n}", "public function setPasswordAttribute($pass){\n $this->attributes['password'] = Hash::make($pass);\n }", "public function setPasswordAttribute($pass){\n $this->attributes['password'] = Hash::make($pass);\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::needsRehash($value) ? Hash::make($value) : $value;\n }", "function htaccess(){\r\n\t}", "public function setCachePassword($password) {\n $this->modx->getService('registry', 'registry.modRegistry');\n $this->modx->registry->addRegister('login','registry.modFileRegister');\n $this->modx->registry->login->connect();\n $this->modx->registry->login->subscribe('/useractivation/');\n $this->modx->registry->login->send('/useractivation/',array($this->user->get('username') => $password),array(\n 'ttl' => ($this->controller->getProperty('activationttl',180)*60),\n ));\n /* set cachepwd here to prevent re-registration of inactive users */\n $this->user->set('cachepwd',md5($password));\n if ($this->live) {\n $success = $this->user->save();\n } else {\n $success = true;\n }\n if (!$success) {\n $this->modx->log(modX::LOG_LEVEL_ERROR,'[Login] Could not update cachepwd for activation for User: '.$this->user->get('username'));\n }\n return $success;\n }", "function ahr_write_htaccess( $redirection_status, $redirection_type ) {\r\n \r\n $random_anchor_number = get_option( 'ahr-random-anchor-number' );\r\n \r\n $https_status = $redirection_status === 'https' ? 'off' : 'on';\r\n \r\n $written_rules = \"\\n\\n\" . \"# Begin Advanced https redirection \" . $random_anchor_number . \"\\n\" . \"<IfModule mod_rewrite.c> \\n\" . \"RewriteEngine On \\n\" . \"RewriteCond %{HTTPS} $https_status \\n\" . \"RewriteCond %{REQUEST_FILENAME} -f \\n\" . \"RewriteCond %{REQUEST_FILENAME} !\\.php$ \\n\" . \"RewriteRule .* $redirection_status://%{HTTP_HOST}%{REQUEST_URI} [L,R=$redirection_type] \\n\" . \"</IfModule> \\n\" . \"# End Advanced https redirection \" . $random_anchor_number . \"\\n\";\r\n \r\n \r\n $root_dir = get_home_path();\r\n $htaccess_filename_path = $root_dir . '.htaccess';\r\n \r\n \r\n $write_result = file_put_contents( $htaccess_filename_path, $written_rules . PHP_EOL, FILE_APPEND | LOCK_EX );\r\n \r\n if ( $write_result ) {\r\n return true;\r\n }\r\n \r\n return false;\r\n \r\n}", "public function setPasswordAttribute( $value )\n {\n $this->attributes[ 'password' ] = Hash::make( $value );\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n \n }", "public function __construct( $passwd_file = \"\" ) {\r\n if ( !empty( $passwd_file ) ) {\r\n $this->initialize( $passwd_file );\r\n }\r\n return;\r\n }", "function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\n\t}" ]
[ "0.697032", "0.65987813", "0.6551907", "0.6551907", "0.6540086", "0.65090424", "0.65090424", "0.64871496", "0.6419481", "0.62931067", "0.62571436", "0.6144481", "0.6043377", "0.59839886", "0.59172153", "0.58838516", "0.58242327", "0.56233615", "0.55423677", "0.55304825", "0.5516666", "0.54997116", "0.54899853", "0.5472119", "0.541181", "0.53776634", "0.52330595", "0.5220039", "0.5207288", "0.5194405", "0.5183376", "0.5181059", "0.5156075", "0.5156011", "0.5142271", "0.51371485", "0.5127001", "0.5118311", "0.5118311", "0.507615", "0.50757456", "0.5047338", "0.5029257", "0.5020884", "0.5001756", "0.4993144", "0.4984111", "0.49789414", "0.49786928", "0.49774998", "0.49700922", "0.49661306", "0.4953452", "0.4952646", "0.49522984", "0.49506083", "0.49431613", "0.49424666", "0.49413455", "0.49321407", "0.4929652", "0.4927554", "0.49211589", "0.49120328", "0.49087793", "0.4898762", "0.4898605", "0.48962912", "0.48886135", "0.48824868", "0.48755896", "0.48744074", "0.48682055", "0.48534024", "0.48494443", "0.48457298", "0.484238", "0.48364434", "0.48304412", "0.4817677", "0.4817677", "0.4817677", "0.48172787", "0.48155698", "0.48073632", "0.48039123", "0.48038602", "0.480146", "0.4800763", "0.47975877", "0.47975877", "0.4789283", "0.47882807", "0.47878176", "0.47856864", "0.47855034", "0.47845697", "0.4782805", "0.4782476" ]
0.7009856
1
Adds a user to the password file
function addUser($username,$password,$group){ // checking if user already exists $file=@fopen($this->fPasswd,"r"); $isAlready=false; while($line=@fgets($file,200)){ $lineArr=explode(":",$line); if($username==$lineArr[0]){ $isAlready=true; } } if($isAlready==false){ $file=fopen($this->fPasswd,"a"); $password=crypt($password); $newLine=$username.":".$password."\n"; fputs($file,$newLine); fclose($file); return true; }else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addUser($username,$password,$group=\"\"){\n // checking if user already exists\n $file=@fopen($this->fPasswd,\"r\");\n $isAlready=false;\n while($line=@fgets($file,200)){\n $lineArr=explode(\":\",$line);\n if($username==$lineArr[0]){\n $isAlready=true;\n }\n }\n \n if($isAlready==false){\n $file=fopen($this->fPasswd,\"a\");\n \n\t\t\tif(strtolower(substr($_ENV[\"OS\"],0,7))!=\"windows\"){\n\t\t\t\t$password=crypt($password);\n\t\t\t}\n \n $newLine=$username.\":\".$password.\"\\n\";\n\n fputs($file,$newLine);\n fclose($file);\n return true;\n }else{\n return false;\n }\n }", "function create_account($uname, $pwd) {\n $account_info = \"{$uname}:{$pwd}\\n\";\n add_item_to_file(\"users.txt\", $account_info);\n }", "function addUser($username,$password){\r\n\t\tif ( empty( $username ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// checking if user already exists\r\n\t\t$file=@fopen($this->fPasswd,\"r\");\r\n\t\t$isAlready=false;\r\n\t\twhile($line=@fgets($file,200)){\r\n\t\t\t$lineArr=explode(\":\", $line, 2);\r\n\t\t\tif($username==$lineArr[0]){\r\n\t\t\t\t$isAlready=true;\r\n\t\t\t }\r\n\t\t}\r\n\t\tfclose($file);\r\n\t\tif($isAlready==false){\r\n\t\t\t$file=fopen($this->fPasswd,\"a\");\r\n\r\n\t\t\t$newLine=$username.\":\".$password;\r\n\t\t\tfputs($file,$newLine.\"\\n\");\r\n\t\t\tfclose($file);\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function create_user($user_accounts_file, $uname, $email, $password)\r\n{\r\n\tif(false === file_exists($user_accounts_file))\r\n\t{\r\n\t\ttrigger_error(\r\n\t\t\tsprintf(\r\n\t\t\t\t'The $user_accounts_file does not exist at the specified location: %s ',\r\n\t\t\t\t$user_accounts_file\r\n\t\t\t),\r\n\t\t\tE_USER_ERROR\r\n\t\t);\r\n\t\treturn false;\r\n\t}\r\n\treturn (bool)file_put_contents(\r\n\t\t$user_accounts_file,\r\n\t\tsprintf(\r\n\t\t\t\"%s|%s|%s\\r\\n\",\r\n\t\t\t$email,\r\n\t\t\t$uname,\r\n\t\t\t$password\r\n\t\t),\r\n\t\tFILE_APPEND\r\n\t);\r\n}", "public function savePasswordToUser($user, $password);", "function cvs_add_user($cvs_user, $cvs_pass, $cvs_project) {\r\n global $cvs_owner;\r\n\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n\r\n $cvs_fields = $all_cvs_users[$cvs_user];\r\n\r\n if (is_null($cvs_fields)) {\r\n\t$cvs_fields[0] = $cvs_pass;\r\n\t$cvs_fields[1] = $cvs_owner;\r\n\t$all_cvs_users[$cvs_user] = $cvs_fields;\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Added user $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"User $cvs_user already exists\");\r\n }\r\n}", "function addUser($user, $password) {\n return true;\n }", "function password_add($data) {\n\t}", "function setPasswd($username,$new_password){\n // Reading names from file\n $newUserlist=\"\";\n \n $file=fopen($this->fPasswd,\"r\");\n $x=0;\n for($i=0;$line=fgets($file,200);$i++){\n $lineArr=explode(\":\",$line);\n if($username!=$lineArr[0] && $lineArr[0]!=\"\" && $lineArr[1]!=\"\"){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=$lineArr[1];\n $x++;\n }else if($lineArr[0]!=\"\" && $lineArr[1]!=\"\"){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=crypt($new_password).\"\\n\";\n $isSet=true;\n $x++;\n }\n }\n fclose($file);\n\n unlink($this->fPasswd);\n\n /// Writing names back to file (with new password)\n $file=fopen($this->fPasswd,\"w\");\n for($i=0;$i<count($newUserlist);$i++){\n $content=$newUserlist[$i][0].\":\".$newUserlist[$i][1];\n fputs($file,$content);\n }\n fclose($file);\n\n if($isSet==true){\n return true;\n }else{\n return false;\n }\n }", "function setPasswd($username,$new_password){\n // Reading names from file\n $newUserlist=\"\";\n \n $file=fopen($this->fPasswd,\"r\");\n $x=0;\n for($i=0;$line=fgets($file,200);$i++){\n $lineArr=explode(\":\",$line);\n if($username!=$lineArr[0] && $lineArr[0]!=\"\" && $lineArr[1]!=\"\"){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=$lineArr[1];\n $x++;\n }else if($lineArr[0]!=\"\" && $lineArr[1]!=\"\"){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=crypt($new_password).\"\\n\";\n $isSet=true;\n $x++;\n }\n }\n fclose($file);\n\n unlink($this->fPasswd);\n\n /// Writing names back to file (with new password)\n $file=fopen($this->fPasswd,\"w\");\n for($i=0;$i<count($newUserlist);$i++){\n $content=$newUserlist[$i][0].\":\".$newUserlist[$i][1];\n fputs($file,$content);\n }\n fclose($file);\n\n if($isSet==true){\n return true;\n }else{\n return false;\n }\n }", "function addUser($user,$password) {\r\n\t\twp_create_user($user->mName,$password,$user->mEmail);\r\n\t\treturn true;\r\n\t}", "function add_user ($User_name, $User_password, $User_email, $user_type)\n\t{\n\t\tglobal $conn;\n\n $sql_i = \"INSERT INTO login_db(user_name, user_password, user_email, user_type) VALUES \" .\n \"('$User_name', '$User_password', '$User_email', '$user_type')\";\n\n run_update($sql_i);\n\t}", "function setPasswd($username,$new_password){\r\n\t\t// Reading names from file\r\n\t\t$newUserlist=\"\";\r\n\r\n\t\t$file=fopen($this->fPasswd,\"r\");\r\n\t\t$x=0;\r\n\t\tfor ($i=0; $line=fgets($file,4096); $i++) {\r\n\t\t\t$lineArr = explode(\":\",$line);\r\n\t\t\tif ($username != $lineArr[0] && $lineArr[0] != \"\" && $lineArr[1] != \"\") {\r\n\t\t\t\t$newUserlist[$i][0] = $lineArr[0];\r\n\t\t\t\t$newUserlist[$i][1] = $lineArr[1];\r\n\t\t\t\t$x++;\r\n\t\t\t} else if ($lineArr[0] != \"\" && $lineArr[1] != \"\") {\r\n\t\t\t\t$newUserlist[$i][0] = $lineArr[0];\r\n\t\t\t\t$newUserlist[$i][1] = $new_password.\"\\n\";\r\n\t\t\t\t$isSet = true;\r\n\t\t\t\t$x++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfclose($file);\r\n\r\n\t\tunlink($this->fPasswd);\r\n\r\n\t\t/// Writing names back to file (with new password)\r\n\t\t$file = fopen($this->fPasswd,\"w\");\r\n\t\tfor ($i=0; $i<count($newUserlist); $i++) {\r\n\t\t\t$content = $newUserlist[$i][0] . \":\" . $newUserlist[$i][1];\r\n\t\t\tfputs($file,$content);\r\n\t\t}\r\n\t\tfclose($file);\r\n\r\n\t\tif ($isSet==true) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function addUser($name, $passwd, $save = false)\n {\n $this->users[$name] = $passwd;\n\n if (!is_null($this->htpasswdFile) && $save) {\n $this->savePasswdFile();\n }\n\n if (!is_null($this->db) && $save) {\n $this->db->saveUser($name, $passwd);\n }\n }", "public function modifpassword($user,$passwd){\n \n }", "public function addUser($name, $email, $password)\n {\n\n //\n }", "public function addUser(){}", "function register_user($username, $password) {\n if (isset($_SESSION['USERNAME'])) {\n require_once $_SERVER['DOCUMENT_ROOT'] . '/php/admin/secrets.php';\n $hash = password_hash($password, PASSWORD_BCRYPT);\n //Send $username and $hash to the secrets file if that username isn't already taken:\n if(!array_search($username, $USERS)) {\n $USERS += [\"'\" . $username . \"'\" => \"'\" . $hash . \"'\"];\n update_secrets($USERS, 'USERS');\n }\n else {\n $login_error = 'Please choose a different username';\n }\n }\n else {\n $login_error = 'Please log in first';\n }\n \n }", "function new_user($username, $password){\n $new_user = array(\n 'username' => $username,\n 'password' => $password\n );\n array_push($GLOBALS['users_array'], $new_user);\n //print_r(json_encode($GLOBALS['users_array']));\n file_put_contents($GLOBALS['users_file_path'], json_encode($GLOBALS['users_array']));\n}", "public function setPassword($userid, $password);", "function addUser($userRecord) {\n\t\t//get the user data array\n\t\t$users = getUsers();\n\t\t//open file for writing\n\t\t$writeFile = fopen('data/users.json', \"w\");\n\t\t//add the new user to the users files\n\t\tarray_push($users, $userRecord);\n\t\t//convert userRecord to JSON\n\t\t$usersJson = json_encode($users,JSON_PRETTY_PRINT);\n\t\t//write JSON string to file\n\t\tfwrite($writeFile, $usersJson);\n\t\t//close file\n\t\tfclose($writeFile);\n\t}", "public function addUser($name, UserConfig $user);", "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "function addUser( $user, $password, $email = '', $realname = '' ) {\n return false;\n }", "function store_info($login, $passwd, $new) {\n $hashed_pwd = hash('whirlpool', $passwd);\n $new_account['login'] = $login;\n $new_account['passwd'] = $hashed_pwd;\n if ($new == 1) {\n $accounts = unserialize(file_get_contents('../private/passwd'));\n $accounts[] = $new_account;\n file_put_contents('../private/passwd', serialize($accounts));\n }\n else {\n $accounts[] = $new_account;\n file_put_contents('../private/passwd', serialize($accounts));\n }\n}", "function register($USER) {\n \n ## Globals\n global $USERS_FILE;\n\n// if file does not exist, create the file.\nif ( ! file_exists($USERS_FILE))\n{\n$fp = fopen($USERS_FILE, 'w') or die('Cannot open file: '.$USERS_FILE); //create file\nfclose($fp);\n// $fp = fopen($USERS_FILE, 'w');\n}\n\n## Load Users\nif ( ! file_exists($USERS_FILE) && ! $USERS = file_to_array($USERS_FILE)) {\n if ($_SESSION['DEBUG']) { echo \"[DEBUG][LOGIN] Error: file_to_array failed\".'<br />'; }\n\treturn FALSE;\n}\n\n\n## User Checks\n## username\nif(isset($USER['username']) && isset($USERS)) {\nforeach ($USERS as $u) { ## unique user check\nif (isset($u['username']) && $u['username'] == $USER['username']) {\nreturn FALSE;\n}\n}\n}\n\n## password\nif(isset($USER['password']) && isset($USER['passwordc'])) {\nif ($USER['password'] == $USER['passwordc']) { ## passwords match check\n$USER['password'] = md5($USER['passwordc']); ## [security] md5 password\nunset($USER['passwordc']);\n}\n} else {\nreturn FALSE;\n}\n\n ## Register\n $USERS[] = $USER; \n if(array_to_file($USERS, $USERS_FILE)) {\n $_SESSION['user'] = $USER;\n return TRUE; \n } else {\n return FALSE;\n }\n \n }", "public function add()\n {\n $storedPassword = password_hash($_POST['password'], PASSWORD_DEFAULT);\n\n $data = [];\n $data['username'] = $_POST[\"username\"];\n $data['password'] = $storedPassword;\n $data['email'] = $_POST['email'];\n $data['profile_picture'] = $_FILES['profile']['tmp_name'];\n $data['mime'] = $_FILES['profile']['type'];\n $data['phone_num'] = $_POST['phone-number'];\n\n if ($this->model('User')->addNewUser($data) > 0) {\n $this->redirect(BASE_URL . \"/home/index/{$data['username']}\");\n }\n }", "function create_htpasswd($username,$password) {\n\n\t$encrypted_password = crypt($password, base64_encode($password));\n\t$data = $username.\":\".$encrypted_password;\n\t\t\t\t\t\n\t$ht = fopen(\"administration/.htpasswd\", \"w\") or die(\"<div class=\\\"installer-message\\\">Could not open .htpassword for writing. Please make sure that the server is allowed to write to the administration folder. In Apache, the folder should be chowned to www-data. </div>\");\n\tfwrite($ht, $data);\n\tfclose($ht);\n}", "private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }", "function master_add_user($conn, $user_id, $user_firstname, $user_lastname, $user_email, $user_password, $user_picture){\n //encrypt email\n $user_email = encrypt_user_email($user_email);\n //encrypt password\n $user_password = encrypt_user_password($user_password);\n\n if($this->user->add_user($conn, $user_id, $user_firstname, $user_lastname, $user_email, $user_password,\n upload_user_profile_picture()) == true){\n // alert user not added\n //add user details to session\n }\n else{\n //alert user not added\n //allow user to try or ask if pass is forgotten\n }\n }", "public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n user_first_name,\n user_last_name) \n VALUES (:email,\n :pass,\n :firstName,\n :lastName)');\n\n $result->bindParam(':email', $this->user_email); \n $result->bindParam(':pass', $this->user_password); \n $result->bindParam(':firstName', $this->user_first_name);\n $result->bindParam(':lastName', $this->user_last_name);\n \n $result->execute();\n $db->disconnect();\n }", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function setUsersFile($htpasswd)\n {\n $this->htpasswdFile = $htpasswd;\n if (!file_exists($this->htpasswdFile)) {\n return;\n }\n\n $handle = fopen($this->htpasswdFile, \"r\");\n if ($handle) {\n while (($line = fgets($handle)) !== false) {\n if (strpos($line, ':') !== false) {\n list($user, $passwd) = explode(':', $line);\n $this->users[$user] = trim($passwd);\n }\n }\n fclose($handle);\n }\n }", "function addUser($data){\n\t$username = secure($data['username']);\n\t$password = secure($data['password']);\n\t$level = secure($data['level']);\n\t$users = getJSON(USERS);\n\t$id = getId($users);\n\t$callback = \"LOGIN_CHECKCHAR_FAILED\";\n\tif(!checkChar($username)){\n\t\n\t\t$salt = \"bb764938100a6ee139c04a52613bd7c1\";\n\t\t//password encryption\t\t\n\t\t$password= md5($password.$salt);\n\t\t$newUser= array(\n\t\t\t\"id\" => $id,\n\t\t\t\"username\" => $username,\n\t\t\t\"password\" => $password,\n\t\t\t\"level\" => $level\n\t\t);\n\t\tarray_push($users,$newUser);\n\t\texport($users, USERS);\n\t\t$callback=\"\";\n\t}\n\treturn $callback; \n}", "public function addUserToDatabase($user) {\n $name = $user->getName();\n $password = $user->getHashedPassword();\n $sql = \"INSERT INTO users (name, password) VALUES (:name, :password)\";\n $insertToDb = $this->connection->prepare($sql);\n $insertToDb->bindParam(':name', $name);\n $insertToDb->bindParam(':password', $password);\n $insertToDb->execute();\n $this->registerStatus = true;\n }", "function mysql_adduser($username, $password, $level, $email = \"\", $realname = \"\", $can_modify_passwd='1', $description = \"\")\n{\n if (!mysql_auth_user_exists($username))\n {\n $encrypted = crypt($password,'$1$' . strgen(8).'$');\n return dbInsert(array('username' => $username, 'password' => $encrypted, 'level' => $level, 'email' => $email, 'realname' => $realname, 'can_modify_passwd' => $can_modify_passwd, 'descr' => $description), 'users');\n } else {\n return FALSE;\n }\n}", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "function add_login($user, $password, $type)\n {\n\tglobal $connection;\n\t$query = \"INSERT INTO users3 VALUES('$user', '$password', '$type')\";\n\t$insert = $connection->query($query);\n\tif (!$insert) die($connection->error);\n }", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function set_new_user () { //вынести в отдельный класс Admin\n \n if ($this->user_status == 0) {\n file_put_contents ('user.csv', $this->userID.\",\". time() .\"\\n\", FILE_APPEND);\n $this->set_new_password();\n $result = 'Новый пользователь: '.$this->userID.\"\\n\";\n }\n else {\n $result = 'Пользователь: '.$this->userID.\" уже зарегистрирован\\n\";\n }\n return $result; \n }", "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function addLogin(){\n $file=fopen($this->fHtaccess,\"w+\");\n fputs($file,\"Order allow,deny\\n\");\n fputs($file,\"Allow from all\\n\");\n fputs($file,\"AuthType \".$this->authType.\"\\n\");\n fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\n fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\n fputs($file,\"require valid-user\\n\");\n fclose($file);\n }", "function add($file,$user,$text){\r\n\t\t\r\n\t\t\t// Prepare the message (remove \\')\r\n\t\t\t$text = eregi_replace(\"\\\\\\\\'\",\"'\",$text);\r\n\t\t\t$time = time();\r\n\t\t\t$log_file = ROOT_LOGS_PATH.\"saved/$file.html\";\r\n\t\t\t$fh = fopen($log_file,\"a\");\r\n\t\t\tflock($fh,2);\r\n\t\t\tfwrite($fh,\"$user$text\\n\");\r\n\t\t\tflock($fh,3);\r\n\t\t\tfclose($fh);\r\n\t\t\r\n\t}", "function save_psw_hash( $user, $pass = '' ) { \n\t\tglobal $wpdb;\n\n\t\tif ( !isset($user->ID) ) return;\n\n\t\tif ( !isset( $user->user_pass ) ) return;\n\n\t\t$oh = get_user_meta( $user->ID, 'll_old_hashes', true);\n\n\t\t$oh[] = wp_hash_password( $user->user_pass ); // cleartext, so hash it\n\n\t\t$c = count($oh); \n\n\t\tif ( $c > 5 ) { \n\t\t\t$removed = array_splice($oh, 0, ($c - 5) );\n\t\t}\n\n\t\tupdate_user_meta( $user->ID, 'll_old_hashes', $oh );\n update_user_meta( $user->ID, 'll_password_changed_date', time() );\n\n\t}", "public function addUser(){\n\t}", "function add_user($user, $pass){\n\n $user = mysqli_real_escape_string($user);\n $pass = sha1($pass);\n\n mysql_query(\"INSERT INTO 'users' ('user_name', 'user_password') VALUES ('{$user}', '{$pass}')\");\n}", "public function createUser($name, $pass, $profile, array $extra = []);", "function addLogin(){\r\n\t $file=fopen($this->fHtaccess,\"w+\");\r\n\t fputs($file,\"Order allow,deny\\n\");\r\n\t fputs($file,\"Allow from all\\n\");\r\n\t fputs($file,\"AuthType \".$this->authType.\"\\n\");\r\n\t fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\r\n\t fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\r\n\t fputs($file,\"require valid-user\\n\");\r\n\t fclose($file);\r\n\t}", "public function adduseraccount() {\n\n $usr = new UserAccount();\n\n if(!$usr->access()) {\n\n return \"connection failure!\";\n\n }\n\n if($this->ruseript('name', 'username')) {\n\n return \"username already exists\";\n\n }\n\n else if($this->ruseript('mail', 'email')) {\n\n return \"email already exists\";\n\n }\n\n else {\n\n $usr->insertuserinfo($_POST);\n\n return;\n\n }\n\n }", "private function addUser($user)\n {\n if (!$this->validUsername($user['username'])) {\n throw new Exception('Invalid username');\n } // if\n\n // Convert the password to an passhash\n $user['passhash'] = Services_User_Util::passToHash($this->_settings->get('pass_salt'), $user['newpassword1']);\n\n // Create an API key\n $user['apikey'] = md5(Services_User_Util::generateUniqueId());\n\n // and actually add the user to the database\n $tmpUser = $this->_userDao->addUser($user);\n $this->_userDao->setUserRsaKeys($tmpUser['userid'], $user['publickey'], $user['privatekey']);\n\n /*\n * Now copy the preferences from the anonymous user to this\n * new user\n */\n $anonUser = $this->_userDao->getUser($this->_settings->get('nonauthenticated_userid'));\n $tmpUser = array_merge($anonUser, $tmpUser);\n $tmpUser['prefs']['newspotdefault_tag'] = $user['username'];\n $this->_userDao->setUser($tmpUser);\n\n // and add the user to the default set of groups as configured\n $this->_userDao->setUserGroupList($tmpUser['userid'], $this->_settings->get('newuser_grouplist'));\n\n // now copy the users' filters to the new user\n $this->_daoFactory->getUserFilterDao()->copyFilterList($this->_settings->get('nonauthenticated_userid'), $tmpUser['userid']);\n\n return $tmpUser['userid'];\n }", "function add_user_to_database($email, $username, $password){\n // read db and put into variable\n $read_json = file_get_contents(__DIR__ . '/data_users.json');\n $data = json_decode($read_json, JSON_OBJECT_AS_ARRAY);\n\n // create array from input variables\n $user = array(\n \"email\" => $email,\n \"username\" => $username,\n \"password\" => $password\n );\n\n // put at the end of database\n $data = array_merge($data, array($user));\n\n // rewrite json database\n $json_db = json_encode(\n $data,\n JSON_PRETTY_PRINT\n );\n file_put_contents('data_users.json', $json_db);\n}", "function addUser($username, $firstName, $lastName, $email, $password, $role): int\r\n {\r\n $password = password_hash($password, PASSWORD_BCRYPT);\r\n return $this->addData('t_user', ['useUsername', 'useFirstName', 'useLastName', 'useEmail', 'usePassword', 'useRole'], [$username, $firstName, $lastName, $email, $password, $role]);\r\n }", "public static function addUser()\n {\n if(empty($_POST))\n {\n require_once(__DIR__.'/../views/form.php');\n exit;\n }\n\n // add user to database\n $user = UserModel::addUser();\n\n if (!$user)\n {\n session_start();\n $_SESSION['message'] = 'Error occurred while saving user. Please try again later.';\n header('Location: /form');\n exit;\n }\n\n // update text file\n if (!self::updateTextFile($_SERVER['DOCUMENT_ROOT'] . $user['about'], $user['euro2016']))\n {\n header('Location: /form');\n exit;\n }\n\n session_start();\n $_SESSION['message'] = 'Successfully saved user';\n\n require_once(__DIR__.'/../views/form.php');\n }", "function cvs_change_password($cvs_user, $new_pass, $cvs_project){\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n $cvs_fields = $all_cvs_users[$cvs_user];\r\n if (!is_null($cvs_fields)) {\r\n $cvs_fields[0] = $new_pass;\r\n\t$all_cvs_users[$cvs_user] = $cvs_fields;\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Updated password for $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"No such user- $cvs_user\");\r\n }\r\n}", "function createPasswordSalt() {\n\t\t$userSystem = new SpotUserSystem($this->_db, $this->_settings);\n\t\t$salt = $userSystem->generateUniqueId() . $userSystem->generateUniqueId();\n\t\t\n\t\t$this->setIfNot('pass_salt', $salt);\n\t}", "function mofidPassUtilisateurs($user, $password)\n {\n $bdd = connexMedoo();\n $bdd->update('utilisateurs', [\n 'mdp' => $password ], [\n 'email' => $user\n ]);\n }", "public function createUser (PersonRank $user, $password) {\n $this->usersDB->add($user, $password);\n $this->createDefaultsCategories($user);\n }", "function add_user($username, $hash_pw)\n {\n // Connect to MySQL\n $link = get_link(TRUE);\n\n $username = mysqli_real_escape_string($link, $username);\n $query = \"\n INSERT INTO User (name, hash_pw)\n VALUES ('$username', '$hash_pw')\";\n $result = mysqli_query($link, $query);\n if (strstr(mysqli_error($link), \"Duplicate entry\") !== FALSE)\n return 0;\n if ($result == 1)\n $ret = 1;\n else\n $ret = -1;\n mysqli_free_result($result);\n mysqli_close($link);\n return $ret;\n }", "public function addUser()\n {\n\n foreach ($this->employeeStorage->getEmployeeScheme() as $key => $singleUser) {\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key); // Each input is sent for validation using validateInput method\n\n while (!$validate) // loop that forces user to enter valid input\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', ''); // formats income input so it always has 2 decimal points\n }\n\n $data[$key] = $userInput;\n\n }\n\n $this->employeeStorage->setEmployee( $data ); // After every input is validated data is stored using setEmployee method\n\n echo \"\\033[32m\". \"## Novi zaposlenik \". $data['name'].\" \". $data['lastname'].\" je dodan! \\n\\n\".\"\\033[0m\";\n\n\n }", "public function userCreate($user) {\n// if (!is_file('./users/users.txt')) { RAjouter tableau ou donnees seront stockees et serialize ensuite après ajout\n\n if (!is_dir('./users')) {\n mkdir('./users');\n } else {\n $tab = [];\n if (!is_file('./users/users.bin')) {\n $file = fopen('./users/users.bin', 'w+');\n array_push($tab, $user);\n fwrite($file, serialize($tab));\n fclose($file);\n } else {\n $datas = file_get_contents('./users/users.bin');\n $useruns = unserialize($datas);\n $file = fopen('./users/users.bin', 'w+');\n array_push($useruns, $user);\n fwrite($file, serialize($useruns));\n fclose($file);\n }\n }\n }", "function registerUser($uName,$pass,$_POST) {\n \t$first = $_POST['first'];\n $last = $_POST['last'];\n $dob = $_POST['dob'];\n $gender = $_POST['gender'];\n $email = $_POST['email'];\n $address = $_POST['address']; \n $membership = $_POST['membership'];\n $ccn = $_POST['ccn'];\n $cce = $_POST['cce'];\n $duration = $_POST['duration'];\n \n // Validate credit card, return error if not valid\n if(cc_validate_checksum($ccn) == false) {\n \treturn \"<p class=\\\"errorMessage\\\">Invalid Credit Card number check and try again</p>\";\n }\n \n $text = $uName.\":\".$pass.\":\".$first.\":\".$last.\":\".$dob.\":\".$gender.\":\".$email.\":\".$address.\":\".\n \t$membership.\":\".$ccn.\":\".$cce.\":\".$duration.\"\\n\";\n $file = \"data/registeredUsers.txt\";\n $handle = fopen($file,\"a+\");\n if (!$handle) {\n \treturn \"<p> Internal Error </p>\";\n }\n while (($line = fgets($handle)) !== false) {\n \t$current = explode(\":\",$line);\n \tif ($current[0] == $uName) {\n \t\treturn \"<p class=\\\"errorMessage\\\">Username already taken</p>\";\n \t}\n }\n fwrite($handle, $text);\n fclose($handle);\n return;\n }", "private function writePassword(): void\n {\n // Exit unless sheet protection and password have been specified\n if ($this->phpSheet->getProtection()->getSheet() !== true || !$this->phpSheet->getProtection()->getPassword() || $this->phpSheet->getProtection()->getAlgorithm() !== '') {\n return;\n }\n\n $record = 0x0013; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $wPassword);\n\n $this->append($header . $data);\n }", "public static function addUserToArray(string $user, string $pass): bool\n {\n global $Users;\n\n $document = file_get_contents(__FILE__);\n $userStrStart = strpos($document, '$Users = [' . \"\\n\");\n $userStrEnd = strpos($document, '];', $userStrStart);\n\n $Users[$user] = password_hash($pass, PASSWORD_DEFAULT);\n $UsersArrayRAW = '';\n foreach ($Users as $user => $hash)\n $UsersArrayRAW = \" '$user' => '$hash',\" . \"\\n\";\n\n $document = substr_replace($document, $UsersArrayRAW, $userStrEnd, 0);\n\n file_put_contents(__FILE__, $document);\n\n return true;\n }", "public function addUser(){\n\n\t\ttry {\n\n\t\t\t$username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\n\t\t\t$password = $_POST['password'];\n\n\t\t\t$password = hash('sha256', $password);\n\n\n\t\t\trequire CONTROLLER_DIR . '/dbConnecterController.php';\n\n\t\t\t$result = $db->query('SELECT * FROM users WHERE username=\"'.$username.'\"');\n\n\t\t\tif ($username && $password) {\n\n\t\t\t\t$row = $result->fetchColumn();\n\t\t\t\tif($row == 0){\n\t\t\t\t\t$statement = $db->query(\"INSERT INTO users (username,password) VALUES ('$username', '$password')\" );\n\t\t\t\t\t$db = null;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"Username already taken, pick something else! <br><a href='/userlist'> Go back to user list\");\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}", "function addNewUser($username, $password, $userid){\r\n $time = time();\r\n /* If admin sign up, give admin user level */\r\n if(strcasecmp($username, ADMIN_NAME) == 0){\r\n $ulevel = ADMIN_LEVEL;\r\n }else{\r\n $ulevel = USER_LEVEL;\r\n }\r\n $query = \"INSERT INTO \".TBL_USERS.\" SET username = :username, password = :password, userid = :userid, userlevel = '$ulevel', timestamp = '$time', hash = '0', advanced_mode = '0', shipping_address = NULL\";\r\n $stmt = $this->connection->prepare($query);\r\n return $stmt->execute(array(':username' => $username, ':password' => $password, ':userid' => $userid));\r\n }", "function addUser($conn, $username, $password )\r\n{\r\n $rand = openssl_random_pseudo_bytes(48);\r\n $salt = '$7a$fj2a' . strtr(base64_encode($rand), array('_' => '.', '~' => '/'));\r\n // Create hashed encrypted password\r\n $hashed_password = crypt($password, $salt);\r\n\r\n //Check to see if our password is equal to our user input\r\n $sql = \"INSERT INTO users( id, username, password ) VAlUES( NULL, '$username', '$hashed_password' )\" ;\r\n\r\n if ($conn->query($sql) === TRUE)\r\n {\r\n echo \"successful\";\r\n }\r\n\r\n else {\r\n echo \"Error\" . $sql . \"<br>\" . $conn->error . \"<br/>\";\r\n }\r\n}", "public function saveNewUser(\\Model\\User $user) {\n $newMember = (object)array();\n $newMember->username = $user->getUsername();\n $newMember->password = $this->hashPassword($user->getPassword());\n $this->saveMemberToFile($newMember);\n }", "public function writeUsers()\n {\n \t// delete old keys\n \texec('rm ' . $this->getGitLocalRepositoryPath() . DIRECTORY_SEPARATOR . self::GITOLITE_KEY_DIR . '*.pub');\n \t\n foreach ($this->getUsers() as $user) {\n $this->writeFile(\n $this->getGitLocalRepositoryPath() . DIRECTORY_SEPARATOR .\n self::GITOLITE_KEY_DIR .\n $user->renderKeyFileName(),\n $user->getFirstKey()\n );\n }\n }", "function create_file($password_path, $password_file_path)\n{\n if (!file_exists($password_path)) {\n mkdir($password_path);\n }\n\n // Create file if not exist\n if (!file_exists($password_file_path)) {\n file_put_contents($password_file_path, '');\n }\n}", "function add_user(MJKMH_User $user): void {\r\n\t\t$this->users[$user->id()] = $user;\r\n\t}", "function saveUser(UserEntity $user, string $hashedPwd);", "public function create_password() {\n\t\tif(!empty($this->request->params['named']['email'])){\n\t\t\t$email = $this->request->params['named']['email'];\n\t\t}\n\t\t\n\t\t$authUserData = $this->Auth->user();\n\t\tif(empty($authUserData)){\n\t\t\t$this->Session->setFlash(__('There was an error logging you in and setting up a password. Your temporary password has been sent to your email address.', true));\n\t\t\t//Send the temporary password to the user's email address\n\t\t\t$options = array(\n\t\t\t\t\t\t\t\t'layout'=>'temporary_password',\n\t\t\t\t\t\t\t\t'subject'=>'Your Temporary Password',\n\t\t\t\t\t\t\t\t'view'=>'default'\n\t\t\t\t\t\t\t\t);\n\t\t\t$viewVars = array('temp_password'=>$authUserData['User']['email'],'user'=>$user);\n\n\t\t\t//Send the email\n\t\t\t$this->_sendEmail($email,$options,$viewVars);\n\t\t\t$this->redirect(array('controller'=>'users','action'=>'login'));\n\t\t}\n\t\t\n\t\t$user = $this->User->find('first',array('conditions'=>array('email'=>$authUserData['User']['email'])));\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $user['User']['id']; //Get the logged in user's id\n\t\t\tif ($this->User->verifyNewPassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password created.', true));\n\t\t\t\t$this->redirect(array('controller'=>'uploads','action'=>'index'));\n\t\t\t}\n\t\t}\n\t}", "function wppb_userdata_add_password( $userdata, $global_request ){\r\n\tif ( isset( $global_request['passw1'] ) && ( trim( $global_request['passw1'] ) != '' ) )\r\n\t\t$userdata['user_pass'] = trim( $global_request['passw1'] );\r\n\t\r\n\treturn $userdata;\r\n}", "function addUser($email, $password, $student_id, $society_id) {\r\n\t\t\t$sql = \"INSERT IGNORE INTO `users` (email, password, student_id, society_id)\r\n\t\t\t\t\tVALUES ('%s', '%s', '%s', '%s')\";\r\n\t\t\t$this->query($sql, $email, sha1($password), $student_id, $society_id);\r\n\t\t}", "private function saveMemberToFile($user) {\n $this->users[count($this->users)] = $user;\n $usersJSON = json_encode($this->users);\n if (file_put_contents(self::$storageFile, $usersJSON) == false) {\n throw new \\Exception(\"Could not save user\");\n \n }\n}", "public function savePasswdFile($htpasswd = null)\n {\n if (is_null($htpasswd)) {\n $htpasswd = $this->htpasswdFile;\n }\n $handle = fopen($this->htpasswdFile, \"w\");\n if ($handle) {\n foreach ($this->users as $name => $passwd) {\n if (!empty($name) && !empty($passwd)) {\n fwrite($handle, \"{$name}:{$passwd}\\n\");\n }\n }\n fclose($handle);\n }\n }", "public function add($user){\n if (!isset($user['name'])) throw new Exception(\"Name is missing\");\n if (!isset($user['mail'])) throw new Exception(\"Mail is missing\");\n if (!isset($user['password'])) throw new Exception(\"Password is missing\");\n $user['created_at'] = date(Config::DATE_FORMAT);\n $user['token'] = md5(random_bytes(16));\n return parent::add($user);\n}", "function add_user ($username,$password)\n {\n\t\t$insert_query = \"insert into users set username='$username',password = '$password'\";\n return $this->query ($insert_query);\n }", "public function create_user($user, $password, $security_question1, $security_answer1, $security_question2, $security_answer2, $security_question3, $security_answer3);", "public function SetWriteUser ($uname, $pword) {\n $this->writeUserUname = $uname;\n $this->writeUserPword = $pword;\n }", "public function addUser($name, $pass, $rePass, $role, $gravatar)\n {\n // Check if username exists\n if ($this->app->access->exists($name)) {\n echo \"<div class='container'><p>Användaren existerar redan! Välj ett annat användarnamn.</p>\";\n header(\"Refresh:2; create_user\");\n return false;\n }\n // Check passwords match\n if ($pass != $rePass) {\n echo \"<div class='container'><p>Lösenord matchar inte!</p>\";\n header(\"Refresh:2; create_user\");\n return false;\n }\n\n if ($name != \"\" and $role != \"\" and $pass != \"\") {\n // Make a hash of the password\n $cryptPass = password_hash($pass, PASSWORD_DEFAULT);\n $this->db->execute(\"INSERT into users (name, role, gravatar, pass)\n VALUES ('$name', '$role', '$gravatar', '$cryptPass')\");\n echo \"<div class='container'><p>Användaren lades till!</p>\";\n }\n }", "public function addUser($data) {\n\t\tglobal $db;\n\t\t$db->type = 'site';\n\t\t\n\t\tforeach ($data as $key=>$val) {\n\t\t\tif ($key != 'password') {\n\t\t\t\t$values[$key] = $db->sqlify($val);\n\t\t\t} else {\n\t\t\t\t$values[$key] = $db->sqlify(crypt($val)); \n\t\t\t}\n\t\t}\n\t\t$values['date_created'] = $db->sqlify(date('Y-m-d H:i:s')); \n\t\t\n\t\t$check = false;\n\t\tif (!empty($data['email'])) {\n\t\t\t$check = $this->getUserByEmail($data['email']);\n\t\t} elseif (!empty($data['twitter_id'])) {\n\t\t\t$check = $this->getUserByTwitterId($data['twitter_id']);\n\t\t}\n\t\t\n\t\tif (!$check) {\n\t\t\t$db->insert('users', $values);\n\t\t\t$db->doCommit();\n\t\t}\n\t}", "public function add_user($email, $name, $password, $quota='NOQUOTA') \n\t{\n\t\treturn $this->vpopmail_readline(sprintf(\"C -q \\'%s\\' -c \\'%s\\' %s \\'%s\\'\", $quota, $name, $email, $password));\n\t}", "function addAdmin($username, $raw_password, $email, $phone) {\n // TODO\n }", "public function addpassword()\n {\n\t\tif ($this->validate()) {\n\t\t\t$model = Userlogin::find()->where(['id' => Yii::$app->user->identity->id])->one();\n $model->setPassword_login($this->password);\t\t\t\t\n\t\t\tif ($model->save()) {\n\t\t\t\treturn true;\n\t\t\t}\n }\n return false;\n }", "public function setPassword($newPassword);", "public function addUser($username, $password_hash, $first_name, $last_name, $email){\n $color = \"#\".dechex(rand(128,255)) . dechex(rand(128,255)) . dechex(rand(128,255)); //generates a random color for them\n $query = \"INSERT INTO user VALUES (DEFAULT, '$first_name', '$last_name', '$username', '$password_hash', '$email', 0, DEFAULT, DEFAULT, DEFAULT, '$color')\";\n $db = Db::instance();\n $db->execute($query);\n }", "public function add_new_user($user_name,$name,$password)\n\t{\n\t\t///TODO\n\t\t//DB::insert('insert into users (name,password,device_id) values (?, ?,?)', [$user_name, $password,1]);\n\t\t$query=DB::insert('insert into users (name,password,device_id) values (?, ?,?)', [$user_name, $password,1]);\n\n\n\t}", "public function addUser($userName, $userLastname, $userPseudo, $userMail, $userPasswd, $userStatut) {\n $db = $this->dbConnect();\n $psswd = $this->passwordUser($userPasswd);\n $req = $db->prepare('INSERT INTO p5_users (USER_NAME,USER_LASTNAME,USER_PSEUDO,USER_MAIL,USER_PASSWD,ROOT)VALUES(?,?,?,?,?,?)');\n $req->execute(array($userName, $userLastname, $userPseudo, $userMail, $psswd, $userStatut));\n $req->closeCursor();\n }", "private function createAuthFile()\r\n {\r\n $directory = $this->filesystem->getDirectoryWrite(DirectoryList::COMPOSER_HOME);\r\n\r\n if (!$directory->isExist(PackagesAuth::PATH_TO_AUTH_FILE)) {\r\n try {\r\n $directory->writeFile(PackagesAuth::PATH_TO_AUTH_FILE, '{}');\r\n } catch (Exception $e) {\r\n throw new LocalizedException(__(\r\n 'Error in writing Auth file %1. Please check permissions for writing.',\r\n $directory->getAbsolutePath(PackagesAuth::PATH_TO_AUTH_FILE)\r\n ));\r\n }\r\n }\r\n }", "public function updatePassword(UserInterface $user);", "protected function add_new_user($name, $email, $avatar, $bio, $password, $sexe) {\r\n\r\n $activation_key = '';\r\n\r\n // Generate Email Activation Key\r\n for ($i = 0; $i < 6; $i++) {\r\n $activation_key = $activation_key . rand(0, 9);\r\n }\r\n\r\n // Connect To DB\r\n $connection = DB::connect();\r\n // Insert New User Data Into Users Table\r\n $stmt = \"INSERT INTO users\r\n (`name`, `email`, `avatar`, `bio`, `password`, `sexe`, `theme`, `account_type`, `activation_key`)\r\n VALUES\r\n ('$name', '$email', '$avatar', '$bio', '$password', '$sexe', 'light', 'user', '$activation_key')\";\r\n\r\n if ($connection->query($stmt) === false) {\r\n echo '<script>alert(\"لا نستطيع إضافة مستخدم جديد الآن، يمكنك الإتصال بفريق الدعم أو المحاولة لاحقا\")</script>';\r\n return;\r\n }\r\n\r\n // Get User ID\r\n $stmt = \"SELECT id FROM users WHERE `email` = '$email'\";\r\n $result = $connection->query($stmt);\r\n\r\n // Create New Session User Variable\r\n $_SESSION['user_id'] = $result->fetch_assoc()['id'];\r\n\r\n // Redirect To Profile Page\r\n $profile_url = DB::MAIN_URL . 'profile.php';\r\n header('location: ' . $profile_url);\r\n\r\n }", "function setPassword( $user, $password ) {\n global $shib_pretend;\n\n return $shib_pretend;\n }", "public function addToTxtFile($auth_code);", "public function activatenewpasswordAction()\n {\n $newKey = $this->getRequest()->getParam(self::ACTIVATION_KEY_PARAMNAME, null);\n $userId = $this->getRequest()->getParam(User::COLUMN_USERID, null);\n\n $user = $this->_getUserFromIdAndKey($userId, $newKey);\n if(!$user){\n Globals::getLogger()->info(\"New password activation: user retrieval failed - userId=$userId, key=$newKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NO_SUCH_USER));\n }\n\n $user->{User::COLUMN_PASSWORD} = $user->newPassword;\n $user->newPassword = '';\n $user->activationKey = '';\n\n $id = $user->save();\n if($id != $user->{User::COLUMN_USERID}){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NEWPASSWORD_ACTIVATION_FAILED));\n }\n\n Utils::deleteCookie(User::COOKIE_MD5);\n Utils::deleteCookie(User::COOKIE_USERNAME);\n Utils::deleteCookie(User::COOKIE_REMEMBER);\n\n $this->_savePendingUserIdentity($userId);\n\n $this->_helper->redirectToRoute('userupdate',array('newPassword'=>true));\n }", "public function addMultipleUsers() {\n $this->addUser();\n\n while ( true ) {\n echo \"\\033[32m\".\"Želite li unjeti novog zaposlenika? da/ne \".\"\\033[0m\";\n if ( readline() !== 'da' ) {\n break;\n } else {\n $this->addUser();\n\n }\n\n }\n }", "private function addTestUser(): void\n {\n $this->terminus(sprintf('site:team:add %s %s', $this->getSiteName(), $this->getUserEmail()));\n }", "public function updatePassword(ExtendedUserInterface $user);", "public function newUser() {\n $this->checkValidUser();\n\n $this->db->sql = 'INSERT INTO '.$this->db->dbTbl['users'].' (username, salt, hash) VALUES (:username, :salt, :hash)';\n\n $salt = $this->getNewSalt();\n\n $res = $this->db->execute(array(\n ':username' => $this->getData('username'),\n ':salt' => $salt,\n ':hash' => md5($salt . $this->getData('password'))\n ));\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'xxT5r'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'dU4r5'\n );\n }\n\n $this->renderOutput();\n }", "function SetPassword ( $p )\n {\n $this->username = isset( $_SESSION [ \"username\" ] ) ? sanitize_string( $_SESSION [ \"username\" ] ) : null;\n if ( !$this->username ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? sanitize_string( $_COOKIE [ \"username\" ] ) : null;\n }\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $this->mongo->dataUpdate( array( \"username\" => $this->username ), array( '$set' => array( \"password\" => sha1( $p ) ) ) );\n }" ]
[ "0.7168759", "0.70392114", "0.6988137", "0.6712386", "0.6566095", "0.6552906", "0.65096414", "0.6343643", "0.63277924", "0.63277924", "0.62413216", "0.62376577", "0.6193765", "0.6176503", "0.61213803", "0.61031306", "0.6101658", "0.60843235", "0.6069139", "0.605067", "0.6032138", "0.6027467", "0.6022879", "0.6011718", "0.5985341", "0.5969774", "0.59691787", "0.59682584", "0.5961437", "0.5948214", "0.5936445", "0.5907329", "0.59022313", "0.58889824", "0.5888885", "0.5860732", "0.58487713", "0.5845568", "0.5838946", "0.5837212", "0.5805421", "0.5805421", "0.57882684", "0.5783053", "0.57766056", "0.5753108", "0.57311946", "0.5726777", "0.572404", "0.57123214", "0.5709481", "0.5700249", "0.5690794", "0.5685822", "0.56816643", "0.56811", "0.5662179", "0.5656396", "0.5642227", "0.5637545", "0.56365347", "0.56352895", "0.56343377", "0.5633106", "0.56287986", "0.5622057", "0.5620487", "0.5618225", "0.5607234", "0.5598732", "0.559255", "0.55865186", "0.5586003", "0.55826986", "0.5580566", "0.5568415", "0.5567932", "0.5560019", "0.5557479", "0.55551124", "0.55532205", "0.5546292", "0.55361336", "0.55354553", "0.55352724", "0.5530113", "0.55297816", "0.55223286", "0.55219376", "0.55216795", "0.5517959", "0.55177015", "0.5516616", "0.5516462", "0.5507495", "0.5501435", "0.5501379", "0.55007946", "0.5496496", "0.54904187" ]
0.72093624
0
Adds a group to the htgroup file
function addGroup($groupname){ $file=fopen($this->fHtgroup,"a"); fclose($file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addGroup($groupname){\r\n\t\t$file=fopen($this->fHtgroup,\"a\");\r\n\t\tfclose($file);\r\n\t}", "public function addGroup($group) {}", "public function addGroup(string $group): void;", "public function addGroup(Group $group);", "public function addGroup(\\Models\\Group $group) {\n $this->groups[] = $group;\n $group->addFile($this);\n }", "public function add(string $group)\n {\n $this->groups[] = $group;\n }", "public function addGroup($name);", "function addGroup($group)\n {\n return PEAR::raiseError(_(\"Unsupported\"));\n }", "static function addGroup($group)\n {\n global $db;\n $id = NULL;\n\n // todo delete\n $group['name'] = $group['text'];\n unset($group['text']);\n try {\n $id = $db->insert('boq_group', $group);\n } catch (\\Exception $exception) {\n Log::write($exception, $db->getLastError());\n }\n\n return $id;\n }", "private function addGroup($line, $group) {\n\t//--\n\tif($group[0] == '&') {\n\t\t$this->yaml_contains_group_anchor = substr($group, 1);\n\t} //end if\n\tif($group[0] == '*') {\n\t\t$this->yaml_contains_group_alias = substr($group, 1);\n\t} //end if\n\t//print_r($this->path);\n\t//--\n}", "public function add_group($group_name) {\n $this->page_fields[]=array('sub_heading'=>$group_name,'fields'=>array());\n }", "function eio_grp_add($grp, $req)\n{\n}", "function add_group(array $data = array())\n\t{\n\t\treturn get_instance()->kbcore->groups->create($data);\n\t}", "public function add()\n {\n $group = $this->Groups->newEntity();\n if ($this->request->is('post') && !empty($this->request->data)) {\n $this->Groups->patchEntity($group, $this->request->data);\n if ($this->Groups->save($group)) {\n $this->Flash->success(__d('wasabi_core', 'The group <strong>{0}</strong> has been created.', $this->request->data['name']));\n $this->redirect(['action' => 'index']);\n return;\n } else {\n $this->Flash->error($this->formErrorMessage);\n }\n }\n $this->set('group', $group);\n }", "function addToGroup($group)\n {\n $this->_api->doRequest(\"PUT\", \"{$group->getBaseApiPath()}/contacts/{$this->id}\"); \n $this->_group_ids_set[$group->id] = true; \n }", "function addGroup(&$args, &$request) {\n\t\t// Calling editMasthead with an empty row id will add\n\t\t// a new masthead.\n\t\t$this->editGroup($args, $request);\n\t}", "public static function Add(\\Cms\\Data\\Group $group)\n {\n $group_name = $group->machine_name;\n $group_data_path = self::GetPath($group_name);\n\n //Check if group file already exist\n if (!file_exists($group_data_path))\n {\n //Create group directory\n FileSystem::MakeDir(System::GetDataPath() . \"groups/$group_name\", 0755, true);\n\n $group_data = new Data($group_data_path);\n\n $row = (array) $group;\n $group_data->AddRow($row);\n\n //Create user group directory\n FileSystem::MakeDir(System::GetDataPath() . \"users/$group_name\", 0755, true);\n }\n else\n {\n throw new Exceptions\\Group\\GroupExistsException;\n }\n }", "function add_group() {\n $this->acl->validate_update();\n\n $where = array(\n 'user_id' => $this->input->post('user_id'),\n 'group_id' => $this->input->post('group_id')\n );\n // Insert or update, to minimize redundancy\n list($flag, $msg) = $this->m_general->insert_update('users_group', $this->input->post(), $where);\n\n return JSONRES($flag, $msg);\n }", "function addGroup($groupid) {\n $groups = $this->getGroups();\n if (!is_array($groups)) {\n $groups = array();\n }\n array_push($groups, $groupid);\n $this->setGroups($groups);\n }", "public function add() {\n\t\t$data = array(\n\t\t\t'tstamp' => $this['timeStamp'],\n\t\t\t'crdate' => $this['createDate'],\n\t\t\t'cruser_id' => $this['cruserUid'],\n\t\t\t'name' => $this['name'],\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t$data\n\t\t);\n\t\tif ( $res ) {\n\t\t\t$this['uid'] = $GLOBALS['TYPO3_DB']->sql_insert_id($res);\n\t\t\ttx_passwordmgr_helper::addLogEntry(1, 'addGroup', 'Added Group '.$data['name']);\n\t\t} else {\n\t\t\tthrow new Exception('Error adding group: ' . $data['name']);\n\t\t}\n\t\treturn($this['uid']);\n\t}", "public function addGroup($groupDesc){\n $groupName = preg_replace('/\\s+/', '_', $groupDesc);\n $groupName = 'GRP_'.strtoupper($groupName);\n $bool = false;\n $insertKey = false;\n do {\n $rows = $this->getData(\"SELECT id FROM groups WHERE groupName LIKE '$groupName' LIMIT 1;\");\n if(empty($rows)){\n $bool = true;\n $insertKey = $this->executeGetKey(\"INSERT INTO groups (groupName, groupDesc) VALUES ('$groupName','$groupDesc');\");\n }else{\n $groupName = strtok($groupName, '_%');\n $groupName.='_%'.substr(str_shuffle(\"CHRISTAN\"), 0,5);\n }\n } while ($bool == false);\n return $insertKey;\n }", "function groups_create_group($data, $um=false) {\n global $CFG;\n require_once(\"$CFG->libdir/gdlib.php\");\n\n $data->timecreated = time();\n $data->timemodified = $data->timecreated;\n $data->name = trim($data->name);\n $id = insert_record('groups', $data);\n\n if ($id) {\n $data->id = $id;\n if ($um) {\n //update image\n if (save_profile_image($id, $um, 'groups')) {\n set_field('groups', 'picture', 1, 'id', $id);\n }\n $data->picture = 1;\n }\n\n //trigger groups events\n events_trigger('groups_group_created', stripslashes_recursive($data));\n }\n\n return $id;\n}", "public function create_group()\r\n\t{\r\n\t\t// Load template\r\n\t\tinclude(BLUPATH_TEMPLATES .'/site/modules/create_group.php');\r\n\t}", "public function group(string $group);", "function addGroupHandler() {\n global $inputs;\n\n $lastId = insert('group',[\n 'admin_id' => getLogin()['uid'],\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ]);\n\n formatOutput(true, 'add success');\n}", "public function group($group);", "function setFHtgroup($filename){\n $this->fHtgroup=$filename;\n }", "function setFHtgroup($filename){\n $this->fHtgroup=$filename;\n }", "public function addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function setGroup($group) {}", "public function setGroup($group) {}", "public function addGroup() {\n\t\tif ($this->request -> isPost()) {\n\t\t\t$this->UserGroup->set($this->data);\n\t\t\tif ($this->UserGroup->addValidate()) {\n\t\t\t\t$this->UserGroup->save($this->request->data,false);\n\t\t\t\t$this->Session->setFlash(__('The group is successfully added'));\n\t\t\t\t$this->redirect('/addGroup');\n\t\t\t}\n\t\t}\n\t}", "function setFHtgroup($filename){\r\n\t\t$this->fHtgroup=$filename;\r\n\t}", "function system_add_group($paramv)\n{\n}", "protected function saveGroup($group) {\n\t\t$link = $this->getLink();\n\t\t$link->set($this->prefix, $group);\n\t}", "public function group($file)\n {\n }", "public function group($file)\n {\n }", "public function group($file)\n {\n }", "public function group($file)\n {\n }", "public function group($file)\n {\n }", "function add($post) {\n\t\tglobal $fmdb, $__FM_CONFIG;\n\t\t\n\t\t/** Validate entries */\n\t\t$post = $this->validatePost($post);\n\t\tif (!is_array($post)) return $post;\n\t\t\n\t\t$sql_insert = \"INSERT INTO `fm_{$__FM_CONFIG[$_SESSION['module']]['prefix']}groups`\";\n\t\t$sql_fields = '(';\n\t\t$sql_values = null;\n\t\t\n\t\t$post['account_id'] = $_SESSION['user']['account_id'];\n\t\t\n\t\t$exclude = array('submit', 'action', 'group_id', 'compress', 'AUTHKEY');\n\n\t\tforeach ($post as $key => $data) {\n\t\t\t$clean_data = sanitize($data);\n\t\t\tif (($key == 'group_name') && empty($clean_data)) return _('No group name defined.');\n\t\t\tif (!in_array($key, $exclude)) {\n\t\t\t\t$sql_fields .= $key . ', ';\n\t\t\t\t$sql_values .= \"'$clean_data', \";\n\t\t\t}\n\t\t}\n\t\t$sql_fields = rtrim($sql_fields, ', ') . ')';\n\t\t$sql_values = rtrim($sql_values, ', ');\n\t\t\n\t\t$query = \"$sql_insert $sql_fields VALUES ($sql_values)\";\n\t\t$result = $fmdb->query($query);\n\t\t\n\t\tif ($fmdb->sql_errors) {\n\t\t\treturn formatError(_('Could not add the group because a database error occurred.'), 'sql');\n\t\t}\n\n\t\taddLogEntry(\"Added {$post['group_type']} group:\\nName: {$post['group_name']}\\n\" .\n\t\t\t\t\"Comment: {$post['group_comment']}\");\n\t\treturn true;\n\t}", "function addgroup($data)\r\n {\r\n $mysqli = $this->conn;\r\n\r\n if (empty($table))\r\n $table = $this->table;\r\n\r\n /* Prepared statement, stage 1: prepare */\r\n if (!($stmt = $mysqli->prepare(\"INSERT INTO LakeHostGroup (lakeHostGroupName, notes) VALUES (?,?)\"))) {\r\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\r\n }\r\n\r\n /* Prepared statement, stage 2: bind and execute */\r\n if (!($stmt->bind_param(\"ss\", $data['lakeHostGroupName'], $data['notes']))) {\r\n echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n }\r\n\r\n if (!$stmt->execute()) {\r\n echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n }\r\n }", "public function actionAddGroup()\n {\n echo \"Create an user group ...\\n\";\n $name = trim($this->prompt('Group name (max length 32 varchar):'));\n $desc = trim($this->prompt('Group description (max length 255 varchar):'));\n if ($name && $this->confirm(\"Are your sure to create an user group?\")) {\n if (DIRECTORY_SEPARATOR === '\\\\') {\n $name = iconv('GBK','UTF-8//IGNORE', $name);\n $desc = iconv('GBK','UTF-8//IGNORE', $desc);\n }\n $model = Yii::$app->menuManager->addGroup($name, $desc);\n if ($model->hasErrors()) {\n echo join(',', $model->getFirstErrors()) . \"\\n\";\n return self::EXIT_CODE_ERROR;\n }\n echo \"Success.\\n\";\n return self::EXIT_CODE_NORMAL;\n }\n echo \"Canceled!\\n\";\n return self::EXIT_CODE_NORMAL;\n }", "public function add(GroupObject $object) : Group;", "public function create_group() {\r\n $this->layout = '';\r\n\r\n $this->displayGroupType();\r\n\r\n $this->loadModel('GetRegisteredGroupData');\r\n $group_info = $this->GetRegisteredGroupData->find('all', array(\r\n 'order' => array('GetRegisteredGroupData.group_name' => 'asc')));\r\n\r\n $this->set('groupInfo', $group_info);\r\n }", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(3, $value);\n }", "public function addEntryGroup(GroupInterface $group)\n {\n $this->entryGroups[] = $group;\n }", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(4, $value);\n }", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(4, $value);\n }", "public function addGroup(\\Sinett\\MLAB\\BuilderBundle\\Entity\\Group $group)\n {\n $temp = new \\Sinett\\MLAB\\BuilderBundle\\Entity\\TemplateGroupData;\n $temp->setGroup($group)->setTemplate($this);\n $this->addTemplateGroup($temp);\n return $this;\n }", "public function addAction() {\n\t\tlist(, $groups) = Resource_Service_Pgroup::getAllPgroup();\n\t\t$this->assign('groups', $groups);\n\t\t$this->assign('ntype', $this->ntype);\n\t\t$this->assign('btype', $this->btype);\n\t}", "public function add_group($data) {\n\t\t$this->db->insert('group', $data);\n\t\treturn ($data['groupUuid']);\t\n\t}", "function system_addto_group($paramv)\n{\n}", "public function addToGroup(GroupInterface $group, $object, $key = null)\n\t{\n\t\t$group->addMember(\n\t\t\tnew Node(\n\t\t\t\t$this->getObjectName($object), \n\t\t\t\t$object\n\t\t\t),\n\t\t\t$key !== null ? $key : spl_object_hash($object)\n\t\t);\n\t}", "public function createGroupAction() {\n\t\t$this->group->id_parent = isset($this->data['id_parent']) ? $this->data['id_parent'] : null;\n\t\t$this->group->group_name = $this->data['group_name'];\n\t\t$this->group->description = $this->data['description'];\n\t\treturn $this->group->save();\n\t}", "function groups_create_grouping($data) {\n global $CFG;\n\n $data->timecreated = time();\n $data->timemodified = $data->timecreated;\n $data->name = trim($data->name);\n\n $id = insert_record('groupings', $data);\n\n if ($id) {\n //trigger groups events\n $data->id = $id;\n events_trigger('groups_grouping_created', stripslashes_recursive($data));\n }\n\n return $id;\n}", "function createGroup($args) {\n\t\t$this->editGroup($args);\n\t}", "public function testAddUserIntoGroup(){\n jAcl2DbUserGroup::createUser('robert');\n self::$grpId7 = $this->getLastId('id_aclgrp', 'jacl2_group');\n jAcl2DbUserGroup::addUserToGroup('robert', self::$grpId1);\n\n self::$groups[] = array('id_aclgrp'=>self::$grpId7,\n 'name'=>'robert',\n 'grouptype'=>2,\n 'ownerlogin'=>'robert');\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n\n self::$usergroups=array(\n array('login'=>'laurent', 'id_aclgrp'=>self::$grpId5),\n array('login'=>'max', 'id_aclgrp'=>self::$grpId6),\n array('login'=>'max', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'robert', 'id_aclgrp'=>self::$grpId7),\n array('login'=>'robert', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'robert', 'id_aclgrp'=>self::$grpId1),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n }", "public function appendGroup($group, ?\\SetaPDF_Core_Document_OptionalContent_Group $parent = null, $afterIndex = null, $nextToOrLabel = null, $label = '') {}", "public function creategroupAction()\n\t{\n\n\t\t$this->saveAction('UserGroup');\n\t}", "public function Group($field,$group){\n $this->_groups[$field] = array_merge($group,array(\"currentGroup\" => \"?\", \"currentMsg\" => \"\"));\n }", "public function add_group_type( $type ){\n\t\tarray_push($this->_group_types, $type);\n\t}", "function add() {\n $this->set('groups', $this->Group->find('all'));\n if (!empty($this->data)) {\n if ($this->Group->save($this->data)) {\n $this->Session->setFlash('The group has been saved.');\n } else {\n $this->Session->setFlash('Failed saving the group.');\n }\n }\n }", "function CreateGroup(){\n $grpname = \"\"; $grpdesc=\"\";\n extract($_POST);\n $grpid = $this->generateGuid();\n $vs = [$grpname, $grpid, $grpdesc];\n $f = array(\"grpname\", \"grpid\", \"grpdesc\");\n $cg = $this->Insert($this->grptable, $f, $vs);\n return $cg;\n }", "public function addToGroup($name) {\r\n // Check if the user belongs to the group\r\n if (!in_array($name, $this->groups)) {\r\n // If not, then we add them to the group\r\n $this->groups[] = $name;\r\n // Update the object in the database\r\n $this->update();\r\n }\r\n }", "public function testCreateGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function add()\n {\n if ($this->request->is('post')) {\n $this->Group->create();\n if ($this->Group->save($this->request->data)) {\n $this->Flash->success(__('The group has been created'));\n\n // redirect to page index\n return $this->redirect(array('action' => 'index'));\n }\n $this->Flash->error(\n __('The group could not be saved. Please, try again.')\n );\n }\n }", "function createGroup($groupName, $description, $type, $userId, $db) {\n strip_tags($groupName);\n strip_tags($description);\n strip_tags($type);\n\n $qString = ('INSERT INTO groups (name, description, projectType) VALUES (:name, :description, :type)');\n $stm = $db -> prepare($qString);\n\n if ($stm -> execute( array(':name' => $groupName, ':description' => $description, ':type' => $type))) {\n if(addToGroup($userId, $db, getGroupId($groupName, $db), true)) {\n echo \"<meta http-equiv='REFRESH' content='0;url=/?page=group'>\";\n } else {\n echo 'couldnt add to group!';\n }\n } else {\n print_r($stm->errorInfo());\n }\n}", "function _addLayoutGroup($parentLayGrp, $custLayGrp, $ovServer)\n{\n\t// layout group ($parentLayGrp) on the OV server specified ($ovServer). \n\t//\n\t// Inputs:\n\t//\t$parentLayGrp - parent group. null if assigned to root of tree.\n\t//\t$custLayGrp - custom's layout group name.\n\t//\t$ovServer - OV server to add group.\n\t// Output: none\n\t//\n _log(\"addLayoutGroup: Starting.\",\"info\");\n _log(\"addLayoutGroup: adding group $parentLayGrp/$custLayGrp on $ovServer\",\"info\");\n global $opcdir, $output, $opclaygrp_cmd, $gRoshTimeOut;\n\n if ($parentLayGrp == '')\n {\n\t\t$group = $custLayGrp;\n\t}\n\telse\n\t{\n\t\t$group = $parentLayGrp . '/' . $custLayGrp;\n\t}\n\t$cmd = \"/opsw/bin/rosh -W $gRoshTimeOut -n $ovServer -l root '$opclaygrp_cmd \";\n\t$cmd .= \"-add_lay_group lay_group=$group '\";\n \n _log(\"addLayoutGroup: cmd: $cmd\",\"debug\");\n _execCmdWithRetry($cmd);\n _log(\"output is $output\",\"debug\");\n\n _parseOutputForError($output_array,'ERROR','addLayoutGroup');\n _log(\"addLayoutGroup: Exiting.\",\"info\");\n}", "public function addGroup($attributes) {\n return $this->get('add_group', $attributes);\n }", "public function addGroupName( string $group_name ) : Asset\n {\n // check the existence of the group\n $group = Asset::getAsset( $this->getService(), Group::TYPE, $group_name );\n \n if( isset( $this->getProperty()->applicableGroups ) )\n \t$group_string = $this->getProperty()->applicableGroups;\n else\n \t$group_string = \"\";\n\n $group_array = explode( ';', $group_string );\n \n if( !in_array( $group_name, $group_array ) )\n {\n $group_array[] = $group_name;\n }\n \n $group_string = implode( ';', $group_array );\n $this->getProperty()->applicableGroups = $group_string;\n return $this;\n }", "public function addGroup($group, $user){\n \n \n \n \n if (!$this->isInGroup->isInGroup($group->getName(), $user->getUsername())){\n \n $this->connector->connector();\n $ds = $this->connector->getConnector();\n $racine = \"dc=admc, dc=com\";\n $rechercheGroupe = ldap_search($ds, $racine, \"(&(objectclass=group)(name=\".$group.\"))\");\n $resultatGroupe = ldap_get_entries($ds, $rechercheGroupe);\n //var_dump($resultatGroupe);\n $groupe = $resultatGroupe[0];\n //var_dump($groupe);\n $dn_group = $groupe['dn'];\n $recupMember = $groupe[\"member\"];\n\n $groupe = array();\n $groupe['member']=\"cn=\".$user.\",cn=Users,dc=admc,dc=com\";\n\n return ldap_mod_add($this->connector->getConnector(), $dn_group, $groupe) or die ();\n\n }else{\n return False;\n }\n \n }", "public function addGroup(GroupInterface $group) {\n return parent::addGroup($group);\n }", "function addGroupFromEnt(&$ent) {\n $newGoup = new AuthngGroup();\n $newGoup->setName($ent['name']);\n $newGoup->setDescription($ent['description']);\n $newGoup->setScope($ent['scope']);\n $newGoup->setHome($ent['home']);\n $newGoup->setGid($ent['gid']);\n\n if ($ent['pages'] && is_array($ent['gid'])) {\n foreach ($ent['pages'] as $pageent) {\n $newGoup->addPage($pageent);\n }\n }\n\n $this->groups[\"${ent['name']}\"] = $newGoup;\n }", "public function setGroupHeader(SEPAGroupHeader $groupHeader)\n {\n $this->groupHeader = $groupHeader;\n }", "public static function addNewGroup(string $group_name)\n {\n return self::insertGetId(['name' => $group_name]);\n }", "function new_groups()\n {\n \n }", "public function addGroupName( string $group_name ) : Asset\n {\n // check the existence of the group\n $group = Asset::getAsset( $this->getService(), Group::TYPE, $group_name );\n \n if( isset( $this->getProperty()->applicableGroups ) )\n $group_string = $this->getProperty()->applicableGroups;\n else\n $group_string = \"\";\n\n $group_array = explode( ';', $group_string );\n \n if( !in_array( $group_name, $group_array ) )\n {\n $group_array[] = $group_name;\n }\n \n $group_string = implode( ';', $group_array );\n $this->getProperty()->applicableGroups = $group_string;\n return $this;\n }", "public function set_group($group) {\n $this->group = $group;\n }", "public function testUpdateGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function insert(&$group) {\n\t\t/* As of PHP5.3.0, is_a()is no longer deprecated, so there is no reason to replace it */\n\t\tif (!is_a($group, 'icms_member_group_Object')) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!$group->isDirty()) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!$group->cleanVars()) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( $group->cleanVars as $k => $v) {\n\t\t\t${$k} = $v;\n\t\t}\n\t\tif ($group->isNew()) {\n\t\t\t$groupid = icms::$xoopsDB->genId('group_groupid_seq');\n\t\t\t$sql = sprintf(\"INSERT INTO %s (groupid, name, description, group_type)\n\t\t\t\tVALUES ('%u', %s, %s, %s)\",\n\t\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t\t(int) $groupid,\n\t\t\t\ticms::$xoopsDB->quoteString($name),\n\t\t\t\ticms::$xoopsDB->quoteString($description),\n\t\t\t\ticms::$xoopsDB->quoteString($group_type)\n\t\t\t);\n\t\t} else {\n\t\t\t$sql = sprintf(\n\t\t\t\t\"UPDATE %s SET name = %s, description = %s, group_type = %s WHERE groupid = '%u'\",\n\t\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t\ticms::$xoopsDB->quoteString($name),\n\t\t\t\ticms::$xoopsDB->quoteString($description),\n\t\t\t\ticms::$xoopsDB->quoteString($group_type),\n\t\t\t\t(int) $groupid\n\t\t\t);\n\t\t}\n\t\tif (!$result = icms::$xoopsDB->query($sql)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($groupid)) {\n\t\t\t$groupid = icms::$xoopsDB->getInsertId();\n\t\t}\n\t\t$group->assignVar('groupid', $groupid);\n\t\treturn true;\n\t}", "function mGROUP(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$GROUP;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:166:3: ( 'group' ) \n // Tokenizer11.g:167:3: 'group' \n {\n $this->matchString(\"group\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function addGroup(){\n \treturn view('group.add-group');\n }", "private function addToGroup($var){\n\t\tarray_push( $this->displayGroupArray, $var );\n\t}", "public function addAction(){\n $this->title = 'Add a new user group.';\n \n $form = new GroupForm();\n $groupModel = new Group();\n \n if ($this->getRequest()->isPost()) {\n if($form->isValid($this->getRequest()->getPost())) {\n $groupModel->save($form->getValues());\n $this->_helper->FlashMessenger(\n array(\n 'msg-success' => sprintf('The group %s was successfully added.', $form->getValue('name')),\n )\n );\n \n $this->_redirect('/groups/');\n }\n }\n \n $this->view->form = $form;\n }", "function updateGroup() {\n\t\t$groupId = Request::getUserVar('groupId') === null? null : (int) Request::getUserVar('groupId');\n\t\tif ($groupId === null) {\n\t\t\t$this->validate();\n\t\t\t$group = null;\n\t\t} else {\n\t\t\t$this->validate($groupId);\n\t\t\t$group =& $this->group;\n\t\t}\n\t\t$this->setupTemplate($group);\n\n\t\timport('classes.manager.form.GroupForm');\n\n\t\t$groupForm = new GroupForm($group);\n\t\t$groupForm->readInputData();\n\n\t\tif ($groupForm->validate()) {\n\t\t\t$groupForm->execute();\n\t\t\tRequest::redirect(null, null, 'groups');\n\t\t} else {\n\n\t\t\t$templateMgr =& TemplateManager::getManager();\n\t\t\t$templateMgr->append('pageHierarchy', array(Request::url(null, 'manager', 'groups'), 'manager.groups'));\n\n\t\t\t$templateMgr->assign('pageTitle',\n\t\t\t\t$group?\n\t\t\t\t\t'manager.groups.editTitle':\n\t\t\t\t\t'manager.groups.createTitle'\n\t\t\t);\n\n\t\t\t$groupForm->display();\n\t\t}\n\t}", "final public function setGroup($value) {\n\t\t$this->group = $value;\n\t}", "protected function addGroup($obj)\n {\n $prop = $this->prop($obj);\n $name = (string)$prop['name'];\n $groupExpression = (string)$obj->groupExpression;\n $bandname = 'report_group_'.$name;\n $groupExpression = $obj->groupExpression;\n $prop['value']=0;\n $prop['count']=1;\n $prop['groupExpression']=$groupExpression;\n $prop['groupno']=$this->groupcount;\n $prop['ischange']=true;\n $prop['isStartNewPage']= $prop['isStartNewPage']??'';\n $prop['isStartNewColumn']= $prop['isStartNewColumn']??'';\n $this->groups[$name]=$prop;//[ 'value'=>'NOVALUE','count'=>0,'groupExpression'=>$groupExpression, 'groupno'=>$this->groupcount,'ischange'=>true];\n $this->addBand($bandname.'_header',$obj->groupHeader,true);\n $this->addBand($bandname.'_footer',$obj->groupFooter,true);\n $this->groupcount++;\n }", "function group_create($data) {\n if (!is_array($data)) {\n throw new InvalidArgumentException(\"group_create: data must be an array, see the doc comment for this \"\n . \"function for details on its format\");\n }\n\n if (!isset($data['name'])) {\n throw new InvalidArgumentException(\"group_create: must specify a name for the group\");\n }\n\n if (!isset($data['grouptype']) || !in_array($data['grouptype'], group_get_grouptypes())) {\n throw new InvalidArgumentException(\"group_create: grouptype specified must be an installed grouptype\");\n }\n\n safe_require('grouptype', $data['grouptype']);\n\n if (isset($data['jointype'])) {\n if (!in_array($data['jointype'], call_static_method('GroupType' . $data['grouptype'], 'allowed_join_types'))) {\n throw new InvalidArgumentException(\"group_create: jointype specified is not allowed by the grouptype specified\");\n }\n }\n else {\n throw new InvalidArgumentException(\"group_create: jointype specified must be one of the valid join types\");\n }\n\n if (!isset($data['ctime'])) {\n $data['ctime'] = time();\n }\n $data['ctime'] = db_format_timestamp($data['ctime']);\n\n if (!is_array($data['members']) || count($data['members']) == 0) {\n throw new InvalidArgumentException(\"group_create: at least one member must be specified for adding to the group\");\n }\n\n $data['public'] = (isset($data['public'])) ? intval($data['public']) : 0;\n $data['usersautoadded'] = (isset($data['usersautoadded'])) ? intval($data['usersautoadded']) : 0;\n\n db_begin();\n\n//Start-Anusha\n /*$id = insert_record(\n 'group',\n (object) array(\n 'name' => $data['name'],\n 'description' => $data['description'],\n 'grouptype' => $data['grouptype'],\n 'jointype' => $data['jointype'],\n 'ctime' => $data['ctime'],\n 'mtime' => $data['ctime'],\n 'public' => $data['public'],\n 'usersautoadded' => $data['usersautoadded'],\n ),\n 'id',\n true\n );*/\n\t\n\t//Start -Eshwari added courseoutcome\n\t $id = insert_record(\n 'group',\n (object) array(\n 'name' => $data['name'],\n 'description' => $data['description'],\n 'grouptype' => $data['grouptype'],\n 'jointype' => $data['jointype'],\n 'ctime' => $data['ctime'],\n 'mtime' => $data['ctime'],\n 'public' => $data['public'],\n 'usersautoadded' => $data['usersautoadded'],\n\t\t\t'outcome' => $data['outcome'],\n\t\t\t'courseoutcome' => $data['courseoutcome'],\n\t\t\t'coursetemplate' => $data['coursetemplate'],\n\t\t\t'courseoffering' => $data['courseoffering'],\n\t\t\t'parent_group' => $data['parent_group'],\n ),\n 'id',\n true\n );\n//End-Anusha\n\n foreach ($data['members'] as $userid => $role) {\n insert_record(\n 'group_member',\n (object) array(\n 'group' => $id,\n 'member' => $userid,\n 'role' => $role,\n 'ctime' => $data['ctime'],\n )\n );\n }\n\n // Copy views for the new group\n $templates = get_column('view_autocreate_grouptype', 'view', 'grouptype', $data['grouptype']);\n $templates = get_records_sql_array(\"\n SELECT v.id, v.title, v.description \n FROM {view} v\n INNER JOIN {view_autocreate_grouptype} vag ON vag.view = v.id\n WHERE vag.grouptype = 'standard'\", array());\n if ($templates) {\n require_once(get_config('libroot') . 'view.php');\n foreach ($templates as $template) {\n list($view) = View::create_from_template(array(\n 'group' => $id,\n 'title' => $template->title,\n 'description' => $template->description,\n ), $template->id);\n $view->set_access(array(array(\n 'type' => 'group',\n 'id' => $id,\n 'startdate' => null,\n 'stopdate' => null,\n 'role' => null\n )));\n }\n }\n\n $data['id'] = $id;\n handle_event('creategroup', $data);\n db_commit();\n\n return $id;\n}", "public function add($key, $data, $group = 'default', $expire = 0)\n {\n }", "function group_add_group($parent,$child){\n\n //find the parent group's dn\n $parent_group=$this->group_info($parent,array(\"cn\"));\n if ($parent_group[0][\"dn\"]==NULL){ return (false); }\n $parent_dn=$parent_group[0][\"dn\"];\n \n //find the child group's dn\n $child_group=$this->group_info($child,array(\"cn\"));\n if ($child_group[0][\"dn\"]==NULL){ return (false); }\n $child_dn=$child_group[0][\"dn\"];\n \n $add=array();\n $add[\"member\"] = $child_dn;\n \n $result=@ldap_mod_add($this->_conn,$parent_dn,$add);\n if ($result==false){ return (false); }\n return (true);\n }", "public function createGroup() {\n\t\t$groupName = Input::get('addGrp');\n\t\ttry{\n\t\t\tProjectHandler::createGroup($groupName);\n\t\t\tProjectHandler::grantUser(Auth::user(), $groupName, Roles::PROJECT_ADMIN);\n\t\t\treturn Redirect::back()\n\t\t\t\t->with('flashSuccess', 'Group <b>'.$groupName.'</b> succesfully created!');\t\t\t\n\t\t} catch(\\Cartalyst\\Sentry\\Groups\\GroupExistsException $e) {\n\t\t\treturn Redirect::back()\n\t\t\t->with('flashError', 'Group <b>'.$groupName.'</b> already exists!');\n\t\t}\n\t}", "public function addGroup()\n {\n return new AccountGroupBuilder($this,$this->now);\n }", "public function createGroupAttribute() {\n $languages = $this->getLanguages();\n $is_attr = $this->isAttrGroup('Foks');\n\n if (!$is_attr) {\n $this->db->query( \"INSERT INTO \" . DB_PREFIX . \"attribute_group SET sort_order = '1'\" );\n\n $attribute_group_id = $this->db->getLastId();\n\n foreach ( $languages as $language_id ) {\n $this->db->query( \"INSERT INTO \" . DB_PREFIX . \"attribute_group_description SET attribute_group_id = '\" . (int)$attribute_group_id . \"', language_id = '\" . (int)$language_id . \"', name = 'Foks'\" );\n }\n } else {\n $attribute_group_id = $is_attr;\n }\n\n return $attribute_group_id;\n }", "public function SetGroup($group,$value){\n if($this->_groups[$group][\"currentGroup\"]!=$value){\n if($this->_groups[$group][\"currentGroup\"]!=\"?\"){\n if(isset($this->_groups[$group][\"afterGroup\"])){\n $this->Ln(4);\n $function = array($this->_groups[$group][\"afterGroup\"][\"class\"],$this->_groups[$group][\"afterGroup\"][\"callback\"]);\n $params = array($this,$value);\n call_user_func_array($function,$params);\n }\n $this->Sum();\n }\n if(isset($this->_groups[$group][\"beforeGroup\"])){\n if(($this->GetY() + 22) > ($this->h - 10)){ //22 Altura de una cabecera de grupo\n $this->_changePage = false;\n $this->AddPage();\n }\n $this->Ln(6);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',11);\n $function = array($this->_groups[$group][\"beforeGroup\"][\"class\"],$this->_groups[$group][\"beforeGroup\"][\"callback\"]);\n $params = array($this,$value);\n $this->_groups[$group][\"currentMsg\"] = call_user_func_array($function,$params);\n $this->Ln(4);\n }\n $this->_groups[$group][\"currentGroup\"] = $value;\n $this->pages[$this->PageNo()] = str_replace(\"{grp_$group}\",$this->_groups[$group][\"currentMsg\"],$this->pages[$this->PageNo()]);\n $this->__Header();\n $this->_changePage = false;\n $this->SumRe();\n }else{\n $this->_changePage = true;\n }\n }", "public function addGroup()\n {\n\n if (requestMethod() == 'POST') {\n $controllers = $this->input->post('cont_permission');\n $methods = $this->input->post('method_permission');\n $permissions = [];\n\n // set full permission controller\n\n if ($controllers) {\n\n foreach ($controllers as $controller) {\n $permissions[] = $controller;\n }\n\n }\n\n // set permission method\n\n if ($methods) {\n\n foreach ($methods as $cont => $method) {\n\n if (!$controllers or !in_array($cont, $controllers)) {\n $permissions[] = $method;\n }\n\n }\n\n }\n\n $data = [\n 'name' => $this->input->post('name'),\n 'desc' => $this->input->post('desc'),\n 'permissions' => serialize($permissions),\n 'created_time' => time(),\n 'last_update' => time(),\n ];\n\n $res = $this->admin_model->addGroup($data);\n\n if ($res) {\n $this->session->set_flashdata('success', lang('success'));\n $this->session->set_flashdata('alertUrl', base_url() . 'cms/admin/addGroup');\n $this->session->set_flashdata('alertText', lang('add_new_one'));\n redirect('/cms/admin');\n } else {\n $this->session->set_flashdata('error', lang('failed'));\n redirect('/cms/addGroup');\n }\n\n }\n\n $data['controllers'] = $this->auth->listController();\n\n self::__loadHeader();\n self::__loadNavbar('admin');\n $this->body = $this->load->view('admin/add_group_view', $data, true);\n self::__loadView();\n\n }", "public function chgrp($file, $group, $recursive = \\false)\n {\n }", "public function chgrp($file, $group, $recursive = \\false)\n {\n }", "public function chgrp($file, $group, $recursive = \\false)\n {\n }" ]
[ "0.85190856", "0.7875524", "0.76974416", "0.7465414", "0.71980065", "0.71516794", "0.7136931", "0.70278627", "0.70210993", "0.6998244", "0.69555014", "0.67321473", "0.666837", "0.65670836", "0.65020406", "0.64585173", "0.639276", "0.63774276", "0.63324887", "0.63289565", "0.63080406", "0.6305784", "0.6301819", "0.6258095", "0.62313783", "0.6207233", "0.6199407", "0.6199407", "0.6192782", "0.6190986", "0.6190117", "0.61684865", "0.61677194", "0.61626697", "0.6149258", "0.6144331", "0.6144331", "0.6144331", "0.6143555", "0.6143555", "0.61267334", "0.6110813", "0.6093703", "0.60831034", "0.60736704", "0.60649097", "0.6029723", "0.6029275", "0.6029275", "0.60214615", "0.5990681", "0.59599483", "0.5957456", "0.59516764", "0.59480363", "0.5940338", "0.5923753", "0.592265", "0.59059083", "0.5890642", "0.58859134", "0.58774287", "0.5866283", "0.58585405", "0.5857786", "0.5857128", "0.5852775", "0.5851549", "0.5845336", "0.58287984", "0.58146507", "0.57980925", "0.5781996", "0.5766557", "0.5759069", "0.57576793", "0.57560974", "0.5753693", "0.57416946", "0.5736158", "0.5735652", "0.5733752", "0.5728576", "0.5721256", "0.57116836", "0.5702876", "0.56951594", "0.569095", "0.56855863", "0.5682502", "0.5674538", "0.56462675", "0.5636755", "0.5635144", "0.56251603", "0.56208", "0.561902", "0.56185824", "0.56168723" ]
0.8526399
1
Deletes a user in the password file
function delUser($username){ // Reading names from file $file=fopen($path.$this->fPasswd,"r"); $i=0; while($line=fgets($file,200)){ $lineArr=explode(":",$line); if($username!=$lineArr[0]){ $newUserlist[$i][0]=$lineArr[0]; $newUserlist[$i][1]=$lineArr[1]; $i++; }else{ $deleted=true; } } fclose($file); // Writing names back to file (without the user to delete) $file=fopen($path.$this->fPasswd,"w"); for($i=0;$i<count($newUserlist);$i++){ fputs($file,$newUserlist[$i][0].":".$newUserlist[$i][1]."\n"); } fclose($file); if($deleted==true){ return true; }else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delUser($username){\n // Reading names from file\n $file=fopen($this->fPasswd,\"r\");\n $i=0;\n while($line=fgets($file,200)){\n $lineArr=explode(\":\",$line);\n if($username!=$lineArr[0]){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=$lineArr[1];\n $i++;\n }else{\n $deleted=true;\n }\n }\n fclose($file);\n\n // Writing names back to file (without the user to delete)\n $file=fopen($path.$this->fPasswd,\"w\");\n for($i=0;$i<count($newUserlist);$i++){\n fputs($file,$newUserlist[$i][0].\":\".$newUserlist[$i][0].\"\\n\");\n }\n fclose($file);\n \n if($deleted==true){\n return true;\n }else{\n return false;\n }\n }", "function delUser($username){\r\n\t\t// Reading names from file\r\n\t\t$file=fopen($this->fPasswd,\"r\");\r\n\t\t$i=0;\r\n\t\t$newUserlist = array();\r\n\t\twhile($line=fgets($file,200)){\r\n\t\t\t$lineArr=explode(\":\",$line);\r\n\t\t\tif($username!=$lineArr[0]){\r\n\t\t\t\t$newUserlist[$i][0]=$lineArr[0];\r\n\t\t\t\t$newUserlist[$i][1]=$lineArr[1];\r\n\t\t\t\t$i++;\r\n\t\t\t}else{\r\n\t\t\t\t$deleted=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfclose($file);\r\n\r\n\t\t// Writing names back to file (without the user to delete)\r\n\t\t$file=fopen($this->fPasswd,\"w\");\r\n\t\tfor($i=0;$i<count($newUserlist);$i++){\r\n\t\t\tfputs($file,$newUserlist[$i][0].\":\".$newUserlist[$i][1]);\r\n\t\t}\r\n\t\tfclose($file);\r\n\r\n\t\tif($deleted==true){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function deleteUser()\n {\n $this->delete();\n }", "function cvs_delete_user($cvs_user, $cvs_project) {\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n $cvs_fields=$all_cvs_users[$cvs_user];\r\n if (!is_null($cvs_fields)) {\r\n\tunset($all_cvs_users[$cvs_user]);\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Deleted user $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"User $cvs_user does not exist\");\r\n } \r\n}", "function wyz_delete_user() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\t$user_id = get_current_user_id();\n\t$pass = filter_input( INPUT_POST, 'password' );\n\tif ( ! wp_verify_nonce( $nonce, 'wyz_delete_' . $user_id . '_user' ) ) {\n\t\twp_die(0);\n\t}\n\n\t$user = get_user_by( 'id', $user_id );\n\tif ( !$user || !wp_check_password( $pass, $user->data->user_pass, $user_id) )\n\t wp_die(0);\n\n\tWyzHelpers::delete_user_data( $user );\n\twp_delete_user( $user->ID );\n\twp_die( 1 );\n\t//wp_die( array( $output, $count ) );\n}", "public function user_delete($data = array())\n\t{\n\t\tunset($data['user']['u_password']);\n\t\t\n\t\t$this->CI->logger->add('users/user_delete', $data);\n\t}", "function delLogin(){\r\n\t\tunlink($this->fHtaccess);\r\n\t}", "public function deleteAccount(int $userID, string $userPassword)\n {\n }", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "public function delete_user($user);", "function delLogin(){\n unlink($this->fHtaccess);\n }", "function delLogin(){\n unlink($this->fHtaccess);\n }", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "public function delete() {\n try {\n $db = Database::getInstance();\n $sql = \"DELETE FROM `User` WHERE username = :username\";\n $stmt = $db->prepare($sql);\n $stmt->execute([\"username\" => $this->username]);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }", "public function delete_password($service_name = ''){\n\t\t\n\t\texec('security 2>&1 >/dev/null delete-generic-password -a '.$service_name.' -s \"Login: '.$service_name.'\" >/dev/null');\n\t\t\n\t\treturn;\n\t\t\n\t}", "function deleteUser($username)\r\n {\r\n $this->querySimpleExecute('delete from t_user where useUsername = ' . $username);\r\n }", "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }", "public function delUser($user_id) {\n $db = $this->dbConnect();\n $req = $db->prepare('DELETE FROM `p5_users` WHERE USER_ID = ?');\n $req->execute(array($user_id));\n $req->closeCursor();\n }", "public function deletePassangers($id)\n {\n $rowUser = $this->find($id)->current();\n if($rowUser) {\n $rowUser->delete();\n }else{\n throw new Zend_Exception(\"Could not delete user. User not found!\");\n }\n }", "public function deleteUser()\n {\n\n $this->displayAllEmployees();\n $id = readline(\"Unesite broj ispred zaposlenika kojeg želite izbrisati :\");\n $check = readline(\"Jeste li sigurni? da/ne: \");\n\n if ($check === 'da'){\n $this->employeeStorage->deleteEmployee($id);\n }\n\n }", "public function eraseCredentials() {}", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function delete($id) {\n\t\t// Delete the user\n\t\t$this->getDb()->delete('t_user', array('idUser' => $id));\n\t}", "public function delete_delete()\n {\n $response = $this->UserM->delete_user(\n $this->delete('id')\n );\n $this->response($response);\n }", "public function deleteUser ($username)\n\t{\n\t\t$this->_delUserKey($username, self::SETTINGS);\n\t\t$this->_delUserKey($username, self::COOKIES);\n\t}", "function mysql_deluser($username)\n{\n $user_id = mysql_auth_user_id($username);\n\n dbDelete('entity_permissions', \"`user_id` = ?\", array($user_id));\n dbDelete('users_prefs', \"`user_id` = ?\", array($user_id));\n dbDelete('users_ckeys', \"`username` = ?\", array($username));\n\n return dbDelete('users', \"`username` = ?\", array($username));\n}", "public function deleteFromDb($user) {\n $sql = \"DELETE FROM users WHERE username = ?\";\n $stmt = $this->dbh->prepare($sql);\n $succ = $stmt->execute(array($user->getUsername()));\n }", "public function delete(CanResetPassword $user);", "function deleteUser()\n {\n $validateF = new ValidateFunctions();\n if ($_SESSION['id'] == $_GET['']) {\n logUserOut();\n }\n $id = $validateF->sanitize($_GET['id']);\n $userRp = new UserRepository();;\n $hasUser = $userRp->getOneFromDB($id);\n if ($hasUser != 0) {\n $this->deleteUserImage($id);\n $this->removeUser($id);\n $_SESSION['success'] = ['User deleted successfully'];\n } else {\n $_SESSION['error'] = ['No user found.'];\n }\n header('Location:index.php?action=adminUsers');\n }", "private function deleteUser()\r\n {\r\n if (isset($_GET['id'])) {\r\n\r\n $id_user = $_GET['id'];\r\n UserDAO::deleteUser($id_user);\r\n $_SESSION['deleteUser'] = '';\r\n header('Location:' . BASE_URL . \"users\");\r\n exit();\r\n }\r\n }", "function delete_user()\n {\n\n //return true if successful\n }", "public function delete() {\r\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_user_failed_login\r\n\t\t\tWHERE\t\tfailedLoginID = \".$this->failedLoginID;\r\n\t\tWCF::getDB()->sendQuery($sql);\r\n\t}", "public function deleteFileInfo(User $user)\n {\n }", "public function eraseCredentials()\n {}", "protected function deleteUser()\n {\n $userId = $this->request->variable('user_id',0);\n\n if($userId === 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => ['User ID was not supplied']\n ]);\n }\n\n // Determine if this user is an administrator\n $arrUserData = $this->auth->obtain_user_data($userId);\n $this->auth->acl($arrUserData);\n $isAdmin = $this->auth->acl_get('a_');\n\n if($isAdmin)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'User was not deleted because they are an admin',\n 'error' => ['phpBB admin accounts cannot be automatically deleted. Please delete via ACP.']\n ]);\n }\n\n user_delete('remove', $userId);\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user was deleted',\n 'data' => [\n 'user_id' => $userId\n ]\n ]);\n }", "public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }", "public function delete()\n { if (is_null($this->id))\n trigger_error(\"User::delete(): Attempt to delete a User object that does not have its ID property set.\", E_USER_ERROR);\n\n // Delete the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $st = $conn->prepare(\"DELETE FROM users WHERE id = :id LIMIT 1\");\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT); \n $st->execute();\n \n $conn = null;\n }", "public static function del($userName){\n\t\treturn (new Database())->connectToDatabase()->query('DELETE FROM User WHERE userName=?',array($userName));\n\t}", "public function delete($id) {\n // Delete the user\n $this->getDb()->delete('user', array('user_email' => $id));\n }", "public function deleteUser($id)\n {\n $user = User::find($id);\n $user->delete();\n }", "public function eraseCredentials()\r\n {}", "public function delete()\n {\n $logger = $this->getLogger();\n\n $logger->info(\n 'Deleting user and all their LPAs',\n $this->getAuthenticationService()->getIdentity()->toArray()\n );\n\n try {\n $this->apiClient->httpDelete('/v2/user/' . $this->getUserId());\n } catch (ApiException $ex) {\n $logger->err($ex->getMessage());\n return false;\n }\n\n return true;\n }", "public static function passwordless_delete_record( $user_id ) {\n\t\tglobal $wpdb;\n\n\t\treturn $wpdb->delete( \"{$wpdb->base_prefix}pp_passwordless\", array( 'user_id' => $user_id ), array( '%d' ) );\n\t}", "public function deleteUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$userModel->destroy();\n\t\t\t$this->expireToken($userModel);\n\t\t\treturn $this->sendResponse('Your account has been deleted');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to delete this account');\n }", "public function delete($file){\n\t\t\n\t\t//If the users file exists try to delete it\n\t\tif(file_exists($file))\n\t\t{\n\t\t\tunlink($file) or die($this->openFile(\"core/fragments/errors/error34.phtml\"));\n\t\t}\n\t}", "private function _logoutUser() { \n unlink(realpath('config/user_'.$this->username.'.conf'));\n session_destroy();\n return true;\n }", "public function deleteAction() {\n $uid = $this->getInput('uid');\n $info = Admin_Service_User::getUser($uid);\n if ($info && $info['groupid'] == 0) $this->output(-1, '此用户无法删除');\n if ($uid < 1) $this->output(-1, '参数错误');\n $result = Admin_Service_User::deleteUser($uid);\n if (!$result) $this->output(-1, '操作失败');\n $this->output(0, '操作成功');\n }", "public function eraseCredentials()\n {\n \n }", "public static function delete(Users $user)\n {\n $email=$user->Email;\n DB::delete(\"user\",\"Email='$email' AND IsDeleted=0\");\n \n //$conn->close();\n header('location: DeleteUser.php');\n\n }", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "static public function ctrBorrarUsuario(){\n\t\tif (isset($_POST['idUsuario'])) {\n\t\t\tif ($_POST['fotoUsuario'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoUsuario\"]);\n\t\t\t\trmdir('Views/img/usuarios/'.$_POST['usuario']);\n\t\t\t}\n\t\t$answer=adminph\\User::find($_POST['idUsuario']);\n\t\t$answer->delete();\n\t\t}\n\t}", "public function eraseCredentials() {\n }", "public function eraseCredentials() {\n }", "public function eraseCredentials() {\n }", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "public function eraseCredentials()\r\n {\r\n }", "function delete_user($user_id = 0)\n\t{\n\t\t//delete user\n\t\t$this->db->where('user_id', $user_id);\n\t\t$this->db->delete('ci_users');\n\t}", "public function deleteUser($name, $save = false)\n {\n unset($this->users[$name]);\n if (!is_null($this->db) && $save) {\n $this->db->deleteUser($name);\n }\n if (!is_null($this->htpasswdFile) && $save) {\n $this->savePasswdFile();\n }\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }", "public function eraseCredentials()\n {\n }" ]
[ "0.7246269", "0.7167319", "0.71015334", "0.6810712", "0.6801589", "0.6786561", "0.6758552", "0.6738045", "0.67353517", "0.6729234", "0.6693252", "0.6693252", "0.66613674", "0.6658756", "0.65577465", "0.6512139", "0.6437685", "0.6413", "0.6389223", "0.63870925", "0.63788056", "0.6375543", "0.6371634", "0.6342312", "0.6339229", "0.6338887", "0.6325605", "0.63081354", "0.63055617", "0.62997663", "0.6297167", "0.62797505", "0.62648165", "0.62546575", "0.6252981", "0.6252628", "0.6247869", "0.62372696", "0.6236023", "0.62278277", "0.6212747", "0.62043065", "0.61916137", "0.61770755", "0.61616427", "0.6144802", "0.6139684", "0.6133855", "0.61328334", "0.61302", "0.61299515", "0.6121183", "0.6121183", "0.6121183", "0.61192477", "0.611417", "0.61110514", "0.6111042", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539", "0.6093539" ]
0.7259391
0
Returns an array of all users in a password file
function getUsers(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsers(){\r\n\t\t// Reading names from file\r\n\t\t$newUserlist = array();\r\n\r\n\t\t$file=fopen($this->fPasswd,\"r\");\r\n\t\t$x=0;\r\n\t\tfor ($i=0; $line=fgets($file,4096); $i++) {\r\n\t\t\t$lineArr = explode(\":\",$line);\r\n\t\t\t$newUserlist[] = $lineArr[0];\r\n\t\t\t$x++;\r\n\t\t}\r\n\r\n\t\treturn $newUserlist;\r\n\t}", "function getUsers($file)\n{\n $users = array();\n $resource = fopen($file, \"r\");\n while (!feof($resource)) {\n $line = fgets($resource);\n $userid = str_replace(\"\\n\",\"\",$line);\n $users[]=$userid;\n }\n fclose($resource);\n return $users;\n}", "function read_existing_accounts() {\n if (file_exists(\"users.txt\")) {\n $accounts_temp = file(\"users.txt\");\n $accounts = [];\n foreach ($accounts_temp as $account) {\n list($account_uname, $account_pwd) = explode(\":\", trim($account));\n $accounts[$account_uname] = $account_pwd;\n }\n return $accounts;\n }\n return array();\n }", "function getUsers(){\n\t\t$this->users = $this->fileHandler->parseRows($this->userFile, '^', '|');\n\t\t$this->logMsg(SUCCESS, 'users generated');\n\t}", "function load_htpasswd(){\n\t\tif(!file_exists(\"/etc/oar/api-users\")){\n\t\t\treturn Array();\n\t\t}\n\n\t\t$res = Array();\n\t\tforeach (file(\"/etc/oar/api-users\") as $key => $value) {\n\t\t\t$array = explode(':',$value);\n\t\t\t$user = $array[0];\n\t\t\t$pass = rtrim($array[1]);\n\t\t\t$res[$user]=$pass;\n\t\t}\n\n\t\treturn $res;\n\t}", "public static function getUsers() {\n return json_decode(file_get_contents(self::$usersFile));\n }", "function cvs_read_passwd($cvs_project){\r\n global $cvs_root;\r\n $cvs_passwd_file = $cvs_root.\"/\".$cvs_project.\"/CVSROOT/passwd\";\r\n \r\n settype($all_cvs_users,\"array\");\r\n if(is_file($cvs_passwd_file)){\r\n\t$fcontents = file($cvs_passwd_file, \"r\");\r\n\twhile (list ($line_num, $line) = each ($fcontents)) {\r\n\t $line = trim($line);\r\n if(substr($line,0,1)!=\"#\" && strlen($line) > 0) {\r\n\t\tlist($cvs_u, $cvs_p, $sys_u) = split (\":\", $line, 3);\r\n\t\t$all_cvs_users[$cvs_u]=array($cvs_p,$sys_u);\r\n\t }\r\n\t}\r\n cvs_log(1, \"Processed $cvs_passwd_file\");\r\n } else {\r\n\tcvs_log(3, \"No such file- File $cvs_passwd_file!\");\r\n }\r\n return $all_cvs_users;\r\n}", "public function getAll()\n {\n $handle = $this->getJsonHandle('r');\n\n if (!$handle) {\n return [];\n }\n\n $users = [];\n\n //recorrer el archivo\n while($json = fgets($handle)) {\n $users[] = $this->createUserFromArray(json_decode($json, true));\n }\n\n fclose($handle);\n\n return $users;\n }", "public function getUsers()\n {\n if (!is_null($this->db)) {\n $users = $this->db->getUsers();\n foreach ($users as $user) {\n $this->users[$user->name] = $user->password;\n }\n }\n return array_map(function($v) {\n return \"hidden\";\n }, $this->users);\n }", "public function getUsers()\n {\n $stmt = $this->DB->prepare(\"select user, hash from users\");\n $stmt->execute();\n // fetchall returns all records in the set as an array\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getAllUsers(){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$rs = $conn->query(\"select * from login\");\n\t\t$num_of_row = $rs->num_rows;\n\t\tif($num_of_row >0){\n\t\t\twhile($row = $rs->fetch_assoc()){\n\t\t\t\t$users[]=array('username'=>$row['username'],'password'=>sha1($row['password']),'email'=>$row['email'],'user_type'=>$row['user_type']);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $users;\n\t}", "public function retrieveUsers($start = 0, $limit = 0, $filter = array()) {\n\t\t\n\t\t$handle = fopen($this->passwd_path, \"r\");\n\t\t\n\t\t//return false on bad params\n\t\tif ( $start < 0 || $limit < 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$out = array();\n\t\tif ($handle) {\n\t\t\t$i = 0;\n\t\t\t$count = 0;\n\t\t\t\n\t\t\twhile (($line = fgets($handle)) !== false) {\n\t\t\t\tlist($user,$x,$uid,$gid,$GECOS,$home,$shell) = explode(\":\",trim($line));\n\t\t\t\t// Skip root and service users\n\t\t\t\tif (in_array( $shell, array( \"/bin/false\", \"/usr/sbin/nologin\", \"/bin/sync\")) || $user == \"root\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$info = $this->getUserData($user);\n\t\t\t\tif($this->_applyFilter($user, $info, $filter)) {\n\t\t\t\t\tif($i >= $start) {\n\t\t\t\t\t\t$out[$user] = $info;\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t\tif(($limit > 0) && ($count >= $limit)) break;\n\t\t\t\t\t}\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t} \n\t\tfclose($handle);\n\t\treturn $out;\n\t}", "function getUsers1(){\n\t\t$con = $this->con();\t\n\t\tif (!$con) {\n\t\t\t$e = oci_error();\n\t\t\ttrigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);\n\t\t}\t\t\n\t\t$res='';\n\t\t$sql = 'select username, password from dba_users';\n\t\t$stid = oci_parse($con, $sql);\n\t\toci_execute($stid);\n\t\t$res = '';\n\t\twhile ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {\n\t\t\t$res[] = $row;\n\t\t}\n\t\toci_close($con);\n\t\treturn $res;\n\t}", "function getUsers() {\n\t\t$users = json_decode(\n\t\t\t\t\tfile_get_contents(\"data/users.json\"),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\treturn $users;\n\t}", "public function getUserMails()\r\n\t{\r\n\t\t$userDir = __DIR__ . '/../../settings/users';\r\n\t\t\t\t\r\n\t\t/* check if users directory exists */\r\n\t\tif(!is_dir($userDir)){ return array(); }\r\n\t\t\r\n\t\t/* get all user files */\r\n\t\t$users = array_diff(scandir($userDir), array('..', '.'));\r\n\t\t\r\n\t\t$usermails\t= array();\r\n\r\n\t\tforeach($users as $key => $user)\r\n\t\t{\r\n\t\t\tif($user == '.logins'){ continue; }\r\n\r\n\t\t\t$contents \t= file_get_contents($userDir . DIRECTORY_SEPARATOR . $user);\r\n\r\n\t\t\tif($contents === false){ continue; }\r\n\r\n\t\t\t$searchfor \t= 'email:';\r\n\r\n\t\t\t# escape special characters in the query\r\n\t\t\t$pattern \t= preg_quote($searchfor, '/');\r\n\t\t\t\r\n\t\t\t# finalise the regular expression, matching the whole line\r\n\t\t\t$pattern \t= \"/^.*$pattern.*\\$/m\";\r\n\r\n\t\t\t# search, and store first occurence in $matches\r\n\t\t\tif(preg_match($pattern, $contents, $match)){\r\n\t\t\t\t$usermails[] = trim(str_replace(\"email:\", \"\", $match[0]));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $usermails;\r\n\t}", "function getAllUsers(){\n //Recuperation des Donnees du Fichier sous forme de Chaine\n $file_content=file_get_contents(FILE_NAME);\n //Convertion de la chaine en Tableau\n $arr_users=json_decode($file_content,true);\n return $arr_users;\n }", "public function getUsers()\n {\n /* Are we connected? */\n if (!$this->_isConnected()) {\n return $this->_error(E_USER_NOTICE, 'Not connected');\n }\n\n /* Read in user database */\n if (($DATA = $this->_readFile(\"$this->_LIBPATH/txtsql/txtsql.MYI\")) === false) {\n return $this->_error(E_USER_WARNING, 'Database file is corrupted!');\n }\n\n return array_keys($DATA);\n }", "public static function getUnauthorizedUserList()\n {\n $result;\n $userList = array();\n $conn = new MySqlConnect();\n\n $result = $conn -> executeQueryResult(\"SELECT email FROM users WHERE isValidated = 0\");\n if (isset($result))\n {\n // use mysql_fetch_array($result, MYSQL_ASSOC) to access the result object\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n // access the password value in the db\n $userList = array_push($row['email']);\n }\n }\n\n $conn -> freeConnection();\n return $userList;\n }", "public function fixturedUsers()\n\t{\n\t\treturn array(\n\t\t\tarray('user1', 'user1@horrain.com', 'password'),\n\t\t\tarray('user2', 'user2@horrain.com', 'password'),\n\t\t\tarray('user3', 'user3@horrain.com', 'password'),\n\t\t\tarray('user4', 'user4@horrain.com', 'password')\n\t\t\t);\n\t}", "public static function GetUserAccounts(){\n\t\t$userAccounts = array();\n\t\tif(file_exists(ConfigSettings::userAccounts)){\n\t\t\t$userAccounts = require ConfigSettings::userAccounts;\n\t\t} else {\n\t\t\t$account = new UserAccount('admin','password');\n\t\t\t$account->AddUserToArray($userAccounts);\n\t\t\t$content = '<?php' . PHP_EOL . 'return ' . var_export($userAccounts, true) . ';';\n\t\t\tfile_put_contents(ConfigSettings::userAccounts, $content );\n\t\t\tarray_push($userAccounts, $account);\n\t\t}\n\t\treturn $userAccounts;\n\t}", "public function getUsers()\n\t{\n\t\t$insert = $this->inject();\n\t\t$injectURL = $this->url . $insert . 'user%2c password from users%23&Submit=Submit#';\n\t\treturn $injectURL;\n\t}", "function mysql_auth_user_list()\n{\n return dbFetchRows(\"SELECT * FROM `users`\");\n}", "public function getUsers()\n {\n return Security::getUserList();\n }", "function get_users() {\r\n $users = array(\r\n\tarray(\r\n\t 'login' => 'qwe-qwe',\r\n\t 'pass' => '1234',\r\n\t 'email' => 'qwe@qwe',\r\n 'avatar'=> '#',\r\n\t),\r\n\tarray(\r\n\t 'login' => 'test-test',\r\n\t 'pass' => '1234',\r\n\t 'email' => 'test@qwe',\r\n 'avatar'=> '#',\r\n\t),\r\n\tarray(\r\n\t 'login' => 'admin-admin',\r\n\t 'pass' => '1234',\r\n\t 'email' => 'admin@qwe',\r\n 'avatar'=> '#',\r\n\t),\r\n );\r\n return $users;\r\n}", "function get_credentials_from_file($file = VAR_FOLDER . DS . '.account')\n{\n $credentials = array(\n 'email' => null,\n 'password' => null\n );\n $lines = file_to_lines($file);\n if ($lines && count($lines) >= 2) {\n $credentials['email'] = $lines[0];\n $credentials['password'] = $lines[1];\n }\n return $credentials;\n}", "public static function findAll()\n {\n self::createTableIfNeeded();\n\n $users = array();\n\n $response = Connexion::getConnexion()->getPdo()->query(\"SELECT * FROM mb_user\");\n\n\n while($data = $response->fetch())\n {\n $user = new User();\n\n $user->setId($data['id']);\n $user->setUsername($data['username']);\n $user->setEmail($data['email']);\n $user->setPassword($data['password']);\n $user->setToken($data['token']);\n $user->setRole($data['role']);\n $user->setLocked($data['locked']);\n\n array_push($users, $user);\n }\n\n $response->closeCursor();\n\n return $users;\n }", "private function getUserList($domain, $protected_dir) {\n $credentials = array();\n\n $htpasswd_path = $this->backup_path . \"/domains/\" . $domain . \"/.htpasswd\" . str_replace(\"/domains/\" . $domain, \"\", $protected_dir) . \"/.htpasswd\";\n\n foreach ($this->readFile($htpasswd_path) as $row) {\n $split_row = explode(\":\", $row);\n array_push($credentials, array(\"user\" => $split_row[0], \"pass\" => $split_row[1]));\n };\n\n return $credentials;\n }", "public function findUsers(): iterable;", "function d4os_io_db_070_os_user_load_all() {\n $users = array();\n d4os_io_db_070_set_active('os_robust');\n $result = db_query(\"SELECT *, ua.FirstName AS username, ua.LastName AS lastname, ua.PrincipalID AS UUID, ua.Email AS email, CONCAT_WS(' ', FirstName, LastName) AS name FROM {UserAccounts} AS ua\");\n while ($user = db_fetch_object($result)) {\n $users[] = $user;\n }\n d4os_io_db_070_set_active('default');\n return $users;\n}", "public function getAllUsers() : array\n {\n if (NO_DATABASE) {\n return [];\n }\n\n $sql = \"SELECT * FROM users\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n\n $users = [];\n\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)){\n $users[] = new User(\n $row['user_id'],\n $row['user_name'],\n $row['password'],\n $row['role_id'],\n $row['createdAt']\n );\n }\n\n return $users;\n }", "public function getUsers()\n {\n $st = $this->execute('SELECT * FROM '. self::$prefix .'user ORDER BY `userid`;');\n\n $rs = $st->fetchAll(PDO::FETCH_ASSOC);\n\n $users = array();\n foreach($rs AS $row) {\n $user = new sspmod_janus_User($this->_config->getValue('store'));\n $user->setUid($row['uid']);\n $user->load();\n $users[] = $user;\n }\n \n return $users;\n }", "function getUsers()\n\t{\n\t\t// Lets load the files if it doesn't already exist\n\t\tif (empty($this->_users))\n\t\t{\n\t\t\t$query = $this->_buildQueryUsers();\n\t\t\t$this->_users = $query === false\n\t\t\t\t? array()\n\t\t\t\t: $this->_getList($query);\n\t\t}\n\n\t\treturn $this->_users;\n\t}", "function getUsers() {\n\t$connection = dbConnect();\n\t$sql = \"SELECT * FROM `users`\";\n\t$statement = $connection->query( $sql );\n\n\treturn $statement->fetchAll();\n}", "public function seenPasswordProvider()\n {\n return [\n ['123456'],\n ['password'],\n ['123456789'],\n ['12345678'],\n ['12345'],\n ];\n }", "public function users()\n\t{\n\t\t$users_table = Config::get('sentry::sentry.table.users');\n\t\t$groups_table = Config::get('sentry::sentry.table.groups');\n\n\t\t$users = DB::connection(static::$db_instance)\n\t\t\t->table($users_table)\n\t\t\t->where(static::$join_table.'.'. static::$group_identifier, '=', $this->group['id'])\n\t\t\t->join(static::$join_table,\n\t\t\t\t\t\tstatic::$join_table.'.user_id', '=', $users_table.'.id')\n\t\t\t->get($users_table.'.*');\n\n\t\tif (count($users) == 0)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t// Unset password stuff\n\t\tforeach ($users as &$user)\n\t\t{\n\t\t\t$user = get_object_vars($user);\n\t\t\tunset($user['password']);\n\t\t\tunset($user['password_reset_hash']);\n\t\t\tunset($user['activation_hash']);\n\t\t\tunset($user['temp_password']);\n\t\t\tunset($user['remember_me']);\n\t\t}\n\n\t\treturn $users;\n\t}", "function get_all_users()\n{\n\t$db = open_database_connection();\n\t$stmt = $db->prepare(\"SELECT userID, name as title, name, roleID FROM user ORDER BY roleID\");\n\t$stmt->execute();\n\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t$users = array();\n\tforeach ($rows as $row) {\n\t\t$users[] = $row;\n\t}\n close_database_connection($db);\n return $users;\n}", "public function getAllUsers()\n {\n $sql = \"SELECT `user_id`, `user_fname`, `user_lname`, `user_password_hash`, `user_email`, `user_role` FROM users\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function GetAllUsers()\n {\n $data = $this->db()->run(\"SELECT * FROM users\")->fetchall(PDO::FETCH_ASSOC);\n return $data;\n }", "function users($file)\n{\n $users = fopen($file, 'rb');\n while (!feof($users)) {\n yield fgetcsv($users)[0];\n }\n fclose($users);\n}", "function getAllUsers() \n\t{\n\t\t$stmt = $this->con->prepare(\"SELECT id, username FROM users\");\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($id, $username);\n\t\t$users = array();\n\t\twhile ($stmt->fetch()) {\n\t\t\t$temp = array();\n\t\t\t$temp[\"id\"] = $id;\n\t\t\t$temp[\"username\"] = $username;\n\t\t\tarray_push($users, $temp);\n\t\t\t\n\t\t}\n\t\treturn $users;\n\t}", "public function getAllUsers() {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new SecurityDAO($dbObj);\n return $this->DAO->getAllUsers();\n }", "function get_all_users($conn){\n\t $arr = array();\n\t $sql = 'SELECT user_name, password, role, person_id, to_char(date_registered, \\'dd/mm/YYYY hh24:mi:ss\\') as date_registered FROM users';\n\t $stid = oci_parse($conn,$sql);\n\t $res = oci_execute($stid);\n\t \n\t if (!$res) {\n\t\t $err = oci_error($stid);\n\t\t echo htmlentities($err['message']);\n }\n\t \n\t while ($row = oci_fetch_array($stid, OCI_ASSOC)) {\n\t\t array_push($arr,$row);\n\t }\n\t oci_free_statement($stid);\n\t return $arr;\n\t }", "public function listUserPaths(): array\n {\n $path = storage_path('keys');\n if (\\is_dir($path)) {\n $directory = glob($path.'/*', GLOB_ONLYDIR);\n $usersPaths = [];\n foreach ($directory as $userPath) {\n $pathSlices = explode('/', $userPath);\n $usersPaths[] = end($pathSlices);\n }\n }\n\n return $usersPaths;\n }", "public function getUserList(): array {\n\t\t$sql = 'SELECT u.id, u.login, u.mail, r.name role FROM users u\n\t\t\t\tINNER JOIN roles r ON u.role = r.id\n\t\t\t\tWHERE u.login != :mylogin';\n\n\t\treturn $this->queryRows($sql, ['mylogin' => $_SESSION['user']['login']]);\n\t}", "public function getAllUsers() {\n $sql = \"SELECT `pk_users`, `name_users`, `password_users`, `mail_users`, `symbol_users`, `first_name_users`, `last_name_users` FROM `users`\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function Read()\n {\n $query = $this->db->prepare(\"SELECT * FROM users\");\n $query->execute();\n $data = array();\n while ($row = $query->fetch(PDO::FETCH_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "function load_users()\n {\n $query = $this->db->query('SELECT `id`,`login_id`,`user_name`,`org`,`hash` FROM `user`');\n $uarray = array();\n foreach ( $query->result_array() as $user )\n {\n \t$uarray[$user['id']] = $user;\n }\n\n return $uarray;\n }", "function getUsers() {\n\t\t$dbObject = getDatabase();\n\t\t\n\t\t// now the sql again\n\t\t$sql = \"select users_username from users\";\n\t\t\n\t\t// run the query\n\t\t$result = $dbObject->query($sql);\n\t\t\n\t\t// iterate over the results - we expect a simple array containing\n\t\t// a list of usernames\n\t\t$i = 0;\n\t\t$users = array();\n\t\tforeach($result as $row) {\n\t\t\t$users[$i] = $row[\"username\"];\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t// now return the list\n\t\treturn $users;\n\t}", "public function getUsers()\n {\n $users = [];\n $request = $this->_db->query('SELECT * FROM user');\n while ($data = $request->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new User($data);\n }\n return $users;\n }", "public static function all(): array\n\t{\n\t\t$users = get_field('users', self::$member_id);\n\t\tif(empty($users)) return [];\n\t return $users;\n\t}", "function d4os_io_db_070_os_user_get_all_uid() {\n $list = array();\n $result = db_query(\"SELECT * FROM {d4os_ui_users}\");\n while ($user = db_fetch_object($result)) {\n $list[] = $user;\n }\n return $list;\n}", "protected function GetAllUsers()\r\n {\r\n $sql = \"SELECT * FROM `users`\";\r\n $result = $this->connect()->query($sql);\r\n $rows = $result->num_rows;\r\n\r\n if ($rows > 0) {\r\n while ($row = $result->fetch_assoc()) {\r\n $data[] = $row;\r\n }\r\n\r\n return $data;\r\n } else {\r\n echo \"No results found!\";\r\n }\r\n }", "public static function findAll()\n {\n $db = Base::getConnection();\n\n $stmt = $db->prepare(\"SELECT * FROM users;\");\n $stmt->execute();\n\n\n $tab = array();\n foreach ($stmt->fetchALL() as $us) {\n $u = new User();\n $u->id = $us['id'];\n $u->username = $us['username'];\n $u->password = $us['password'];\n $u->email = $us['email'];\n $u->setIsVisitor(false);\n\n $tab[$us['id']] = $u;\n }\n $stmt->closeCursor();\n return $tab;\n }", "public function getUsers(){\n\t\t$query = $this->db->get('users');\n\t\treturn $query->result_array();\n\t}", "private function get_all() {\n $result = $this->dbh->query($this->query_array['get_all'], array())->fetchAll();\n $users = [];\n foreach ($result as $row) {\n $user = new User($row['id'], $row['username']);\n $users[] = $user->to_array();\n }\n return $users;\n }", "public function get_users()\n\t{\n\t\t$sql=\"SELECT * FROM waf_users WHERE 1=1\";\n\t\t$result=$this->db->LIST_Q($sql);\n\t\treturn $result;\n\t}", "function extract_all_users() {\n\t\t$db = connect_to_db();\n\n\t\t$select_statement = \n\t\t\t\"select users.id, users.username from users\";\n\t\t;\n\n\t\t$stmt = $db->prepare($select_statement);\n\n\t\tif ( !($stmt->execute()) ) {\n\t\t\techo \"Error: Could not get users.\";\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\t$json = \"[\";\n\n\t\t$stmt->bind_result($id, $username);\n\n\t\twhile ( $stmt->fetch() ) {\n\t\t\t$info = array('id' => $id, 'username' => $username);\n\t\t\t$json = $json . json_encode($info) . \",\";\n\t\t}\n\n\t\techo substr_replace($json, \"]\", -1);\n\n\t\t$db->close();\n\t}", "public static function getUsers() {\n\t\t$res = self::$db->query(\"SELECT id, email, username, logins, last_login FROM `\".self::$users_tbl.\"` ORDER BY username\");\n\t\t$row = $res->fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $row;\n\t}", "public static function getAll() {\n $db = DBInit::getInstance();\n\n $statement = $db->prepare(\"SELECT id, uname, email, pass FROM users\");\n $statement->execute();\n\n return $statement->fetchAll();\n }", "public function getUserList()\n {\n $responseMap = $this->_postCommand(static::$COMMAND_GET_USER_LIST);\n \n // From the response, filter out only the users that matched this environment Prefix\n $userIdList = [];\n foreach ($responseMap['ids'] as $userId) {\n $unprefixedUserId = PrefixHelper::unprefix($userId);\n \n if ($unprefixedUserId !== false) {\n $userIdList[] = $unprefixedUserId;\n }\n }\n \n return $userIdList;\n }", "public function getAll()\n\t{\n\t\t$query = \"\n\t\tSELECT * FROM `user`\n\t\t\";\n\n\t\t$handle = $this->db->query($query);\n\t\t$result = $handle->fetchAll(Database::FETCH_ASSOC);\n\n\t\t$users = array();\n\n\t\tfor ($i = 0; $i < count($result); $i++) {\n\t\t\t$res = $result[$i];\n\t\t\t$user = new User($res['id'], $res['name']);\n\t\t\t$users[] = $user;\n\t\t}\n\n\t\treturn $users;\n\t}", "public static function findAll(): array\n {\n // We call getInstance here because this is a static function\n $db = Database::getInstance(self::$dbName);\n return $db->fetch(\n 'SELECT * FROM user;',\n 'User'\n );\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "function users($file)\r\n{\r\n $users = fopen($file, 'r');\r\n while (!feof($users)) {\r\n yield fgetcsv($users)[0];\r\n }\r\n fclose($users);\r\n}", "public function listUsers()\n {\n global $db;\n $user_db_data = array();\n $cache = Cache::getInstance();\n // $cache->flush();\n if($cache->exists(\"user_info_data\"))\n {\n $user_db_data = $cache->get(\"user_info_data\");\n } else { \n $e = $db->prepare(\"SELECT * FROM user_info\");\n $e->execute();\n $user_data = $e->fetchAll(); \n // cache will clear in every 1 min.\n $cache->set(\"user_info_data\", $user_data, 60 * 60 * 0.1);\n $user_db_data = $user_data;\n }\n return $user_db_data;\n }", "function get_users()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = $db->query(\"SELECT * FROM users\");\n\t\t\n\t\treturn $db->results($query);\n\t}", "public static function allUser()\n {\n $self = new self();\n\n $sql = \"SELECT * FROM user\";\n\n $result = $self->db->query($sql);\n\n $result = $result->fetchAll();\n\n return $result;\n }", "public function users()\n {\n $sql = \"SELECT *\n FROM user\";\n\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "function getUsers($conn){\n\n\t$sql = \"SELECT Username, UserId, Email, AccessLevel FROM user\";\n\n\t$sth = $conn->prepare($sql);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}", "public function getUserslistToInvite()\n\t{\n\t\t//get current login user session\n\t\t$results = array();\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options = array('course'=>$course_name,'section'=>$sections_list,'userName !='=>$user);\n\t\t$results = $this->PleUser->find('all',array('conditions'=>$options,'fields'=>array('userName','name'),'order' => array('PleUser.name ASC')));\n\t\tif ($results) {\n\t\t\treturn $results;\n\t\t}\n\t\treturn $results;\n\t}", "public function readUserAuth(){\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource()\n ]);\n\n if ($user->has($this->username)) {\n $item = $user->get($this->username);\n $data = [\n 'result' => $item->auth,\n 'attribute' => [\n 'username' => $this->username\n ],\n 'status' => 'success',\n 'message' => 'Data found!'\n ];\n } else {\n $data = [\n 'status' => 'error',\n 'message' => 'User not found!'\n ];\n }\n return $data;\n }", "public function users(){\n\t\t// echo \"<br/> $hashedPassword\";\n\t\t// echo \"<br/>\";\n\t\n\t\t$usermodel = $this->model(\"User\");\n\t\t$result = json_encode($usermodel->getUsers());\n\t\t//for some reason it gives a wrong format if it doesn't print it first...\n\t\tprint_r($result);\n\t\treturn $result;\n\t}", "function loadUsers($filename)\n{\n if(!$filename) return;\n $data = readCsvTableFile($filename, false, true);\n return $data;\n}", "public function getAllUsers(): array\n {\n return $this->users;\n }", "function get_users(){\n global $conf;\n global $LDAP_CON;\n\n $sr = ldap_list($LDAP_CON,$conf['usertree'],\"ObjectClass=inetOrgPerson\");\n $result = ldap_get_binentries($LDAP_CON, $sr);\n $users = array();\n if(count($result)){\n foreach ($result as $entry){\n if(!empty($entry['sn'][0])){\n $users[$entry['dn']] = $entry['givenName'][0].\" \".$entry['sn'][0];\n }\n }\n }\n return $users;\n}", "function getUsers() {\n $users = $this->users;\n if (is_string($users)) {\n $users = explode(',', $users);\n }\n return $users;\n }", "public function getList() {\n //Retourne la liste de tous les users\n $users = [];\n $requsers = $this->db->query('SELECT * FROM user');\n\n while ($data = $requsers->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new user($data);\n }\n\n return $users;\n }", "public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }", "public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n return $this->get($sql, array());\n }", "public function getAllUsers()\n {\n $result = [];\n\n $this->logger->info('All User Data Requested', ['username' => 'admin']);\n\n $query = $this->queries->getAllUsers();\n if ($query) {\n $queryResult = $this->dbWrapper->executeAndFetchAll($query);\n if ($queryResult) {\n $result = $queryResult;\n }\n } else {\n $this->errors['database'] = 'Database connection couldn\\'t be established, please try again later!';\n }\n\n return $result;\n }", "protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }", "public static function select_all() {\n $db = Database::getDB();\n\n $query = 'SELECT * FROM users ORDER BY lastName';\n $statement = $db->prepare($query);\n $statement->execute();\n $results = $statement->fetchAll();\n\n\n $users = array();\n foreach ($results as $row) {\n $user = new User($row['username'], $row['password'], $row['role']);\n $users[] = $user;\n }\n return $users;\n }", "public function fetchCompleteUserById(int $id, string $password): array\n {\n // Use cache if available.\n if (isset($this->cacheById[$id][$password])) {\n return $this->cacheById[$id][$password];\n }\n // Afterwards the password is available as an SQL variable.\n $this->preparePassword($password);\n $sql = '\n SELECT `id`, `user`, `password`, \n AES_DECRYPT(`email`, @password) AS `email`, AES_DECRYPT(`key`, @password) AS `key`\n FROM `users`\n WHERE `id` = ?;\n ';\n // Use the first result or empty array to indicate not found.\n $data = $this->fetch($sql, [$id])->current() ?: [];\n // Store cache for both fetch functions.\n $this->cacheById[$id][$password] = $data;\n $this->cacheByUser[$data['user'] ?? ''][$password] = $data;\n return $data;\n }", "public function getAll() {\r\n $query = $this->db->get(USERS);\r\n return $query->result_array();\r\n }", "public static function getAllUser()\n\t{\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "function file_authenticate($user, $password)\n{\n global $UP_config;\n $pwdhandle = fopen($UP_config['file_location'], \"r\");\n $pattern = \"/^$user:([^:]+):([^:]+)/\";\n $found = 0;\n\n if ($pwdhandle)\n {\n $matches = array();\n while(!feof($pwdhandle))\n {\n $line = trim(fgets($pwdhandle));\n if ($found = preg_match($pattern, $line, $matches) == 1) break;\n }\n\n if ($found)\n {\n # SJC Need PHP 5.5 for password_verify so use own rolled equiv\n $pwdhash = $matches[2];\n if (SC_password_verify($password, $pwdhash))\n {\n $gecos = trim($matches[1]);\n # If authenticated we must return something non null.\n if (empty($gecos)) $gecos = '(no name)';\n return $gecos;\n }\n }\n }\n return NULL;\n}", "public function getAllUsers(): array\n {\n return $this->em->getRepository('AppBundle:User')->findAll();\n }", "public function fetchUserByUser(string $user, string $password): array\n {\n // Use cache if available.\n if (isset($this->cacheByUser[$user][$password])) {\n return $this->cacheByUser[$user][$password];\n }\n // Afterwards the password is available as an SQL variable.\n $this->preparePassword($password);\n $sql = '\n SELECT `id`, `user`, `password`, `role`,\n AES_DECRYPT(`email`, @password) AS `email`, AES_DECRYPT(`key`, @password) AS `key`\n FROM `users`\n WHERE `user` = ?;\n ';\n // Use the first result or an empty array to indicate not found.\n $data = $this->fetch(\n $sql,\n [\n $user,\n ]\n )->current() ?: [];\n // Store cache for both fetch functions.\n $this->cacheByUser[$user][$password] = $data;\n $this->cacheById[$data['id'] ?? 0][$password] = $data;\n return $data;\n }", "public function getUsers($search = '', $limit = 10, $offset = 0) {\n\t\t$returnArray = array();\n\t\t\n\t\t$dir = OC_Config::getValue( \"datadirectory\", OC::$SERVERROOT.\"/data\" );\n\t\tif ($handle = opendir($dir)) {\n\t\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\t\tif ($entry != \".\" && $entry != \"..\") {\n\t\t\t\t\tif (file_exists($dir . '/' . $entry . \"/files\")) {\n\t\t\t\t\t\t$returnArray[] = $entry;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $returnArray;\n\t}", "public function getAllUsers($conn){\n //$conn = $database->getConnection();\n \n $query = \"select ID, FIRSTNAME, LASTNAME, USERNAME, ROLE, PASSWORD from users\";\n $stmt = $conn->prepare($query);\n $stmt->execute();\n $results = $stmt->get_result();\n \n if($results->num_rows){\n $usersarray = array();\n $results = $results->fetch_all();\n \n foreach($results as $row){\n $user = new User($row[1], $row[2], $row[3], $row[5], $row[4]);\n $user->setId($row[0]);\n $user->setRole($row[4]);\n array_push($usersarray, $user);\n }\n \n return $usersarray; \n } else {\n echo \"No users found or an error occured on the database\";\n }\n }", "public static function retrieveAllUsers() {\n return R::getAll('SELECT * FROM user');\n }", "public function listUsers() {\n $db = CTSQLite::connect();\n $query = 'SELECT * FROM ic_user';\n $stmt = $db->prepare($query);\n $result = $stmt->execute();\n if (!$result) {\n return false;\n } else {\n // $id = $result->fetchArray();\n // return $id['id'];\n $row = $result->fetchArray();\n return $row;\n }\n $db->close();\n unset($db);\n }", "function listOfUsers(){\n\t\n\t\t$users = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$user = array('name'=> $obj->getUserFullName(),'id'=>$obj->getUserID());\n\t\t\tarray_push($users, $user);\n\t\t}\n\t\treturn $users;\n\t}", "public function get_users() {\n\n\t\t\t$query = $this->db->prepare(\"SELECT * FROM `users` ORDER BY `user_id`\");\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$query->execute();\n\t\t\t}catch(PDOException $e){\n\t\t\t\tdie($e->getMessage());\n\t\t\t}\n\n\t\t\treturn $query->fetchAll();\n\n\t\t}", "function getSignupUsers() {\n\t$result = mysql_query(\"SELECT * FROM customer\");\n\t$ret = array();\n\twhile ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {\n\t array_push($ret, $row);\n\t}\n\n\tmysql_free_result($result);\n\treturn $ret;\n}", "public function getUsers() {\n \n // Call getAllUsers method in userDataService and set to variable\n $users = $this->getAllUsers();\n \n // Return array of users\n return $users;\n }", "public function getAllUser()\n {\n $this->stmt = $this->db->prepare('SELECT * FROM user');\n $this->stmt->execute();\n $data = $this->stmt->get_result();\n $rows = $data->fetch_all(MYSQLI_ASSOC);\n return $rows;\n }", "function db_getAuthList($userid)\n{\n $userid = db_esc($userid);\n $out = db_run(\"SELECT auth_id FROM \".TBL_AUTH.\" WHERE userid='$userid'\");\n\n $ret = array();\n while($row = $out->fetch_assoc())\n array_push($ret, $row['auth_id']);\n return $ret;\n}" ]
[ "0.8046688", "0.7530089", "0.7448296", "0.70341796", "0.69475484", "0.68537563", "0.6819577", "0.67809016", "0.672016", "0.665279", "0.66227233", "0.66143835", "0.65641147", "0.64408135", "0.6397462", "0.6281141", "0.62426674", "0.6233375", "0.62284756", "0.61980164", "0.6185077", "0.6150903", "0.61472976", "0.613543", "0.6130711", "0.6129172", "0.6120586", "0.61109316", "0.6096387", "0.60678804", "0.60525745", "0.6049673", "0.6043242", "0.6034947", "0.59942067", "0.59725034", "0.59620744", "0.59467053", "0.5939731", "0.5936978", "0.5934288", "0.5921159", "0.59182656", "0.5915366", "0.5909282", "0.5891444", "0.58860266", "0.588145", "0.58713776", "0.58701503", "0.5860433", "0.5854227", "0.58530414", "0.58528626", "0.5835222", "0.583497", "0.58236766", "0.58150595", "0.5812344", "0.5804996", "0.58045846", "0.58021516", "0.5801327", "0.5798398", "0.57881284", "0.5787388", "0.5785162", "0.5770503", "0.57691437", "0.57691437", "0.57691437", "0.57689196", "0.5761348", "0.5753086", "0.5743102", "0.5742324", "0.57380307", "0.5735698", "0.5731403", "0.57311445", "0.5728991", "0.57266515", "0.5717278", "0.5714713", "0.5711503", "0.570873", "0.5707331", "0.5704048", "0.57031834", "0.5698095", "0.5697188", "0.56938523", "0.56922674", "0.5686079", "0.56844044", "0.5682422", "0.56775594", "0.5675768", "0.567359", "0.56715935", "0.5664032" ]
0.0
-1
Sets a password to the given username
function setPasswd($username,$new_password){ // Reading names from file $newUserlist=""; $file=fopen($this->fPasswd,"r"); $x=0; for($i=0;$line=fgets($file,200);$i++){ $lineArr=explode(":",$line); if($username!=$lineArr[0] && $lineArr[0]!="" && $lineArr[1]!=""){ $newUserlist[$i][0]=$lineArr[0]; $newUserlist[$i][1]=$lineArr[1]; $x++; }else if($lineArr[0]!="" && $lineArr[1]!=""){ $newUserlist[$i][0]=$lineArr[0]; $newUserlist[$i][1]=crypt($new_password)."\n"; $isSet=true; $x++; } } fclose($file); unlink($this->fPasswd); /// Writing names back to file (with new password) $file=fopen($this->fPasswd,"w"); for($i=0;$i<count($newUserlist);$i++){ $content=$newUserlist[$i][0].":".$newUserlist[$i][1]; fputs($file,$content); } fclose($file); if($isSet==true){ return true; }else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function changePassword($username, $password);", "public function setPassword($userid, $password);", "public function setCredentials($username, $password) {\n assert('is_string($username) && is_string($password); // username & password need to be strings');\n $this->credentials = \"{$username}:{$password}\";\n }", "public function setCredentials($username, $password)\n {\n $this->username = $username;\n $this->password = $password;\n }", "public function setPassword($value);", "function SetPassword ( $p )\n {\n $this->username = isset( $_SESSION [ \"username\" ] ) ? sanitize_string( $_SESSION [ \"username\" ] ) : null;\n if ( !$this->username ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? sanitize_string( $_COOKIE [ \"username\" ] ) : null;\n }\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $this->mongo->dataUpdate( array( \"username\" => $this->username ), array( '$set' => array( \"password\" => sha1( $p ) ) ) );\n }", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "function setCredentials($username, $password)\n {\n $this->username = $username;\n $this->password = $password;\n }", "public function setAuth($username, $password);", "public function setPassword($newPassword);", "public function setPassword(){\n\t}", "public function setPassword($p) {\n $this->_password = $p;\n }", "public function setPassword(string $password): void\n {\n }", "public function setPassword($value)\n {\n $this->_password = $value;\n }", "public function setPassword($value)\r\n\t{\r\n\t\t$this->password = $value;\r\n\t}", "function set_pass($modified_username, $pass, $caller_username) {\n\tif ($modified_username !== $caller_username && !is_admin()) {\n\t\thttp_response_code(403);\n\t\techo \"Unauthorized action\";\n\t\texit();\n\t}\n\t$db = get_db();\n\t$pass_hashed = password_hash($pass, PASSWORD_DEFAULT);\n\t$stmt = $db->prepare(\"CALL set_pass(?, ?)\");\n\t$stmt->bind_param(\"ss\", $modified_username, $pass_hashed);\n\t$stmt->execute() or trigger_error($db->error);\n\t$db->close();\t\n}", "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "public function setLogin($username, $password) {\n\t\t$this->_username = $username;\n\t\t$this->_password = $password;\n\t}", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function password($username)\n {\n }", "public function setPassword($password) {\n $this->set('password', $password, 'user');\n }", "function setPassword( $user, $password ) {\n global $shib_pretend;\n\n return $shib_pretend;\n }", "public function setPasswordField($password = true) {}", "public function setPasswordCommand($username, $password, $authenticationProvider = 'DefaultProvider') {\n\t\t$account = $this->accountRepository->findByAccountIdentifierAndAuthenticationProviderName($username, $authenticationProvider);\n\t\tif (!$account instanceof \\TYPO3\\Flow\\Security\\Account) {\n\t\t\t$this->outputLine('User \"%s\" does not exist.', array($username));\n\t\t\t$this->quit(1);\n\t\t}\n\t\t$account->setCredentialsSource($this->hashService->hashPassword($password, 'default'));\n\t\t$this->accountRepository->update($account);\n\n\t\t$this->outputLine('The new password for user \"%s\" was set.', array($username));\n\t}", "public function setPassword($newPassword){\n\t}", "public function setPassword(string $password): self;", "public static function setPassword(string $password): void {\r\n self::$password = $password;\r\n }", "public function setPassword(string $password): void\n {\n $this->_password = $password;\n }", "public function setIdentifiers($username, $password);", "public function setPassword(string $password): void\n {\n $this->password = $password;\n }", "public function setPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_1'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_1'));\n\t\t\n\t\t$this->_password = $value;\n\t}", "function setUsername($Username);", "function set_password($string) {\r\n echo PHP_EOL;\r\n $this->action(\"setting new password of: $string\");\r\n $this->hashed_password = hash('sha256', $string . $this->vehicle_salt);\r\n $this->action(\"successfully set new password\");\r\n }", "private function setPassword(string $password) {\n $this->password = $password;\n }", "function setPassword($password = false)\n {\n $this->password = $password;\n }", "public function modifpassword($user,$passwd){\n \n }", "private function SetPassword($password)\n {\n $this->password = md5($password);\n }", "public function setPassword( $password ) \n {\n $this->_password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password){\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = sha1($password);\n }", "public function setUsername(?string $username): void;", "public function setPassword($password) {\n if ($password) {\n $this->password = md5($password);\n } \n }", "public function setPassword(string $employeeId, string $password);", "function user_password($username,$password){\n if ($username==NULL){ return (false); }\n if ($password==NULL){ return (false); }\n if (!$this->_bind){ return (false); }\n if (!$this->_use_ssl){ echo (\"FATAL: SSL must be configured on your webserver and enabled in the class to set passwords.\"); exit(); }\n \n $user=$this->user_info($username,array(\"cn\"));\n if ($user[0][\"dn\"]==NULL){ return (false); }\n $user_dn=$user[0][\"dn\"];\n \n $add=array();\n $add[\"unicodePwd\"][0]=$this->encode_password($password);\n \n $result=ldap_mod_replace($this->_conn,$user_dn,$add);\n if ($result==false){ return (false); }\n \n return (true);\n }", "public function setPassword($password) {\n $this->user_password = $password;\n }", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function set_password()\n {\n factory(User::class)->create(['username' => 'testuser']);\n\n $cmd = $this->artisan('user:password testuser --password=testing');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertTrue(Hash::check('testing', $user->password));\n }", "private function setAuth($username, $password)\r\n {\r\n if (strlen($username) > 255 || strlen($password) > 255) {\r\n throw new InvalidArgumentException('Both username and password MUST NOT exceed a length of 255 bytes each');\r\n }\r\n $this->auth = pack('C2', 0x01, strlen($username)) . $username . pack('C', strlen($password)) . $password;\r\n }", "public function setUsername( $username ) \n {\n $this->_username = $username;\n }", "function wp_set_password($password, $user_id)\n {\n }", "public function password($password) {\n $this->password = $password;\n }", "protected function changePassword() {}", "public function setPassword($password)\n {\n $this->salt = $this->generateSalt();\n $this->password_hash = sha1($this->salt.$password);\n }", "public function setPassword($password) {\r\n\t\t$this->_password = $password;\r\n\t}", "function mysql_auth_change_password($username,$password)\n{\n $encrypted = crypt($password,'$1$' . strgen(8).'$');\n return dbUpdate(array('password' => $encrypted), 'users', '`username` = ?', array($username));\n}", "public function changeUserPassword($uid,$newPassword);", "public function setPW($dw) {}", "public function setPassword($password)\n {\n $this->new_password = $password;\n $this->pass = Yii::$app->security->generatePasswordHash($password);\n }", "public static function setUsername(string $username): void {\r\n self::$username = $username;\r\n }", "public function savePasswordToUser($user, $password);", "public function setPassword($password) {\n\t\t$this->_password = $password;\n\t}", "protected function setPassword(string $password)\r\n\t{\r\n\t\t$this->password = $password;\r\n\t}", "public function setUsername(string $username)\n {\n $this->username = $username;\n }", "public function setAuth($username, $password)\n {\n $this->username = $username;\n $this->auth = 'Basic '.base64_encode($username.':'.$password);\n }", "public function setPassword( $user, $password )\n {\n return true;\n }", "public function setPassword($password) {\n\t\t$this->password = $password;\n\t}", "public function setPassword(string $password)\n {\n $this->password = $password;\n }", "public function assignNewPassword(Users $entity, $password)\n {\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password) {\n $this->password = $password;\n }", "public function setPassword($password) {\n $this->password = $password;\n }", "function set_auth_basic($username, $password)\n {\n \\Mutex::lock($this->mutex);\n $this->auth_basic_user = $username;\n $this->auth_basic_pass = $password;\n \\Mutex::unlock($this->mutex);\n }", "public function updatepw($username, $password)\n\t{\n\t\t$sql = 'UPDATE user SET password = ? WHERE username = ?';\n $execute = $this->db->execute($sql, array(\n md5($username . $password), // THIS IS NOT SECURE. \n $username,\n ));\n\n if($execute)\n\t return true;\n\t}", "public function setPassword($var)\n {\n GPBUtil::checkString($var, False);\n $this->password = $var;\n }", "function setUserName($userName);", "public function setPassword($aPassword) {\n\t\t$this->_password = $aPassword;\n\t}", "function setPassword($password){\n\t\t$password = base64_encode($password);\n\t\t$salt5 = mt_rand(10000,99999);\t\t\n\t\t$salt3 = mt_rand(100,999);\t\t\n\t\t$salt1 = mt_rand(0,25);\n\t\t$letter1 = range(\"a\",\"z\");\n\t\t$salt2 = mt_rand(0,25);\n\t\t$letter2 = range(\"A\",\"Z\");\n\t\t$password = base64_encode($letter2[$salt2].$salt5.$letter1[$salt1].$password.$letter1[$salt2].$salt3.$letter2[$salt1]);\n\t\treturn str_replace(\"=\", \"#\", $password);\n\t}", "public function setPassword( string $password ) {\r\n\t\tstatic $options = [\r\n\t\t\t'cost'\t =>\t12,\r\n\t\t];\r\n\r\n\t\t$this->_data['password'] = password_hash( $password, PASSWORD_BCRYPT, $options );\r\n\r\n\t}", "public function changePassword(User $user, string $newPassword): void;", "public function setPassword($password)\n\t{\n\t\t$this->password = $password;\n\t}", "public function set_password($password) {\n $password = hash('sha256', $password);\n $xid = $this->get_id();\n $pdo = DataConnector::getConnection();\n $stmt = $pdo->prepare(\"UPDATE users SET password = :passwd WHERE id = :xid\");\n $stmt->bindParam(\":passwd\", $password, PDO::PARAM_STR);\n $stmt->bindParam(\":xid\", $xid, PDO::PARAM_INT);\n $result = $stmt->execute();\n //password is not kept on the object, so we don't need to reset\n return $result;\n }", "public function setPassword($password){\n $this->password = hash('sha512', $password);\n }", "public function setUsername($username)\n\t{\n\t\t$this->username = $username;\n\t}", "public function setUsername($username)\n\t{\n\t\t$this->username = $username;\n\t}", "function setPasswd($username,$new_password){\r\n\t\t// Reading names from file\r\n\t\t$newUserlist=\"\";\r\n\r\n\t\t$file=fopen($this->fPasswd,\"r\");\r\n\t\t$x=0;\r\n\t\tfor ($i=0; $line=fgets($file,4096); $i++) {\r\n\t\t\t$lineArr = explode(\":\",$line);\r\n\t\t\tif ($username != $lineArr[0] && $lineArr[0] != \"\" && $lineArr[1] != \"\") {\r\n\t\t\t\t$newUserlist[$i][0] = $lineArr[0];\r\n\t\t\t\t$newUserlist[$i][1] = $lineArr[1];\r\n\t\t\t\t$x++;\r\n\t\t\t} else if ($lineArr[0] != \"\" && $lineArr[1] != \"\") {\r\n\t\t\t\t$newUserlist[$i][0] = $lineArr[0];\r\n\t\t\t\t$newUserlist[$i][1] = $new_password.\"\\n\";\r\n\t\t\t\t$isSet = true;\r\n\t\t\t\t$x++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfclose($file);\r\n\r\n\t\tunlink($this->fPasswd);\r\n\r\n\t\t/// Writing names back to file (with new password)\r\n\t\t$file = fopen($this->fPasswd,\"w\");\r\n\t\tfor ($i=0; $i<count($newUserlist); $i++) {\r\n\t\t\t$content = $newUserlist[$i][0] . \":\" . $newUserlist[$i][1];\r\n\t\t\tfputs($file,$content);\r\n\t\t}\r\n\t\tfclose($file);\r\n\r\n\t\tif ($isSet==true) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function setPassword($user,$password) {\r\n\t\t$wpuser=get_userdatabylogin($user->mName);\r\n\t\tif(!$wpuser)\r\n\t\t\treturn false;\r\n\t\twp_set_password($password,$wpuser->user_id);\r\n\t\treturn true;\r\n\t}", "public function setPassword($password){\n\t\t\t$this->password = $password;\n\t\t}", "public function setUsername($value)\n {\n $this->_username = $value;\n }", "public function setUsername($username)\n {\n $this->username = $username;\n }", "public function setUsername($username)\n {\n $this->username = $username;\n }", "public function setUsername($username)\n {\n $this->username = $username;\n }", "public function usePassword($password)\n {\n // CODE...\n }", "public function setPassword($password) {\r\n // Hash the password and set it on the user object\r\n $this->passwordhash = password_hash($password, PASSWORD_DEFAULT);\r\n }" ]
[ "0.7922511", "0.76501405", "0.75830555", "0.7421745", "0.74094015", "0.7384489", "0.7336288", "0.7336288", "0.7336288", "0.7335211", "0.7316992", "0.72901237", "0.72182167", "0.71789426", "0.7175044", "0.7172357", "0.7168179", "0.71594566", "0.71582997", "0.7100605", "0.7062571", "0.70494044", "0.7047344", "0.70428354", "0.7000705", "0.69760776", "0.6968433", "0.69192016", "0.6904443", "0.6880284", "0.6876823", "0.6875104", "0.68696207", "0.68568224", "0.6854834", "0.6854176", "0.68462145", "0.68222356", "0.68185365", "0.68166876", "0.680852", "0.6792559", "0.6789116", "0.6763009", "0.67448884", "0.6743438", "0.6741009", "0.6736649", "0.67358303", "0.6734265", "0.6727204", "0.6726203", "0.6725506", "0.6718141", "0.6715841", "0.66979045", "0.66966915", "0.6695878", "0.6683099", "0.6677148", "0.6674625", "0.6666516", "0.6665933", "0.6665179", "0.6651419", "0.66418254", "0.66416955", "0.66411793", "0.66395164", "0.66354024", "0.66288185", "0.6620974", "0.66039026", "0.66039026", "0.66039026", "0.66039026", "0.66039026", "0.66014886", "0.66014886", "0.6596768", "0.65955555", "0.65810716", "0.6570768", "0.65535736", "0.6534319", "0.6532764", "0.6531758", "0.6527391", "0.6520596", "0.6519715", "0.65190244", "0.65190244", "0.65138763", "0.6513457", "0.6509133", "0.6505064", "0.6496021", "0.6496021", "0.6496021", "0.6494271", "0.649381" ]
0.0
-1
Sets the Authentification type for Login
function setAuthType($authtype){ $this->authType=$authtype; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAuthenticationType( $type ) {\n\t\t$this->_mAuthenticationType = $type;\n\t}", "function setAuthType($authtype){\r\n\t\t$this->authType=$authtype;\r\n\t}", "public function setLoginType($value)\n {\n return $this->set(self::LOGIN_TYPE, $value);\n }", "public function setUserType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function actionLogin($type) {\n\t\t$type = @$_GET['type'];\n\t\tif (!$type)\n\t\t\treturn $this->redirect(array('site/index'));\n\t\tYii::app()->session['type'] = $type;\n\t\t$authUrl = Yii::app()->singly->getAuthServiceUrl($this->getCallbackUrl(), $type);\n\t\t$this->redirect($authUrl);\n\t}", "public function getLoginType()\n {\n $value = $this->get(self::LOGIN_TYPE);\n return $value === null ? (integer)$value : $value;\n }", "public function setType($type)\n {\n if (in_array($type, [self::AUTH_BASIC, self::AUTH_DIGEST])) {\n $this->type = $type;\n }\n\n return $this;\n }", "private function __setAuthUser()\n {\n $authUser = $this->request->session()->read('Auth');\n\n $accountType = 'FREE';\n if (!empty($authUser)) {\n $accountType = $authUser['User']['account_type'];\n }\n\n $this->set(compact('authUser', 'accountType'));\n }", "function getLoginUserType()\n {\n if (evo()->isFrontend() && evo()->session('webValidated')) {\n return 'web';\n }\n\n if (evo()->isBackend() && evo()->session('mgrValidated')) {\n return 'manager';\n }\n\n return '';\n }", "public function setType(String $type){\n $type = strtoupper($type);\n if(!in_array($type, self::getUserTypes())){\n throw new \\Exception('Incorrect User Type');\n }\n $this->type = constant('self::'. $type);\n }", "public function logIn($type, $username, $email) {\n $user = $this->findOAuthUser($email);\n if(!$user) {\n $this->register($type, $username, $email);\n $user = $this->findOAuthUser($email);\n }\n $login = new LoginModel();\n $login->addUserToSession($user);\n }", "public function setDefaultAuthTypes()\n {\n global $user;\n\n // set the type 'basic_info'\n $name = \"basic_info\";\n $description = \"Access your basic account information like username,first name, last name, email address, date of birth\";\n $values = array('username' => $user->getUsername(), 'first_name' => $user->getFirstName(), 'last_name' => $user->getLastName(), 'email' => $user->getEmail(), 'birthday' => $user->getBirthDate());\n $this->addAuthType($name, $description, $values);\n\n }", "public function setClientAuthenticationType($val)\n {\n $this->_propDict[\"clientAuthenticationType\"] = $val;\n return $this;\n }", "function auth_user($type = 'general')\n\t{\n\t\tif($type != 'general' && isset($_SESSION['uid']))\n\t\t\tswitch($type)\n\t\t\t{\n\t\t\t\tcase 'webpagemanager': \n\t\t\t\t\t\tif($_SESSION['uType'] == 'webpagemanager' || $_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'dataentryoperator': \n\t\t\t\t\t\tif($_SESSION['uType'] == 'dataentryoperator' || $_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'salesmanager': \n\t\t\t\t\t\tif($_SESSION['uType'] == 'salesmanager' || $_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 'super':\n\t\t\t\t\t\tif($_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\n\t\t\t\tdefault: return false;\n\t\t\t}\n\t\t\n\t\tif(isset($_SESSION['uid'])) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function setAuthType($auth_type)\n {\n $this->auth_type = $auth_type;\n return $this;\n }", "public function getAuthenticationType() {\n\t\treturn $this->_mAuthenticationType;\n\t}", "function _auth_type($str)\n\t{\n\t\tif(valid_email($str))\n\t\t{\n\t\t\treturn 'email';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 'username';\n\t\t}\n\t}", "abstract public function createLoginService($type='');", "public function getAuthType()\n {\n return $this->auth_type;\n }", "public function login($login,$password,$type){\r\n if($type == 1)\r\n {\r\n $user = Table::query('SELECT * FROM candidat WHERE email = :login',[':login'=>$login], true);\r\n }\r\n elseif($type == 2)\r\n {\r\n $user = Table::query('SELECT * FROM entreprise WHERE email = :login',[':login'=>$login], true);\r\n }\r\n if($user){\r\n if($user->password == ($password)){\r\n $this->session->write('dbauth',$user);\r\n return true;\r\n }else{\r\n return \"Votre mot de passe est incorrect\";\r\n }\r\n }else{\r\n return \"Votre adresse email est incorrecte\";\r\n }\r\n }", "function setType($type) {\n $this->type = $type;\n }", "function setType($type = \"\")\n\t\t{\n\t\t\t$this->type = $type;\n\t\t}", "function assignFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.User';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('merchant_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type)\r\n {\r\n $this->type = $type;\r\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setLogin($login);", "public function checkLogin($type=''){\n\t\tif ($type == 'A'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n\t\t}else if ($type == 'P'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n\t\t}else if ($type == 'U'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n\t\t}else if ($type == 'T'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\n\t\t}\n }", "public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}", "public function setAuthType($authType = null)\n {\n // validation for constraint: string\n if (!is_null($authType) && !is_string($authType)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authType, true), gettype($authType)), __LINE__);\n }\n if (is_null($authType) || (is_array($authType) && empty($authType))) {\n unset($this->authType);\n } else {\n $this->authType = $authType;\n }\n return $this;\n }", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "function verify_login($user_type, $index_page){\n\t$user_info = isset($_SESSION['user_info']) ? unserialize($_SESSION['user_info']) : null;\n\t//echo \"info: \".var_dump($user_info);\n\n\t// if the user isn't logged in or it doesn't have the proper rights\n\tif ($user_info == null or \n\t\t$user_info->user_type != strtolower($user_type) or \n\t\t!isset($_SESSION['authorized']) or \n\t\t$_SESSION['authorized'] != 1) {\n\t\treserved_area_message($index_page);\n\t\texit();\n\t}\n\n\t// Ohterwise show the username\n\t$username = $user_info->username; \n\techo \"$user_type username: $username\";\n}", "public function checkLogin($type=''){\n \tif ($type == 'A'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n \t}else if ($type == 'P'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n \t}else if ($type == 'U'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n \t}else if ($type == 'T'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\t\t\t\n \t}\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "function setType($a_type)\n\t{\n\t\t$this->il_type = $a_type;\n\t}", "public function setType($type) {}", "public function setType( $type ) {\n\n\t\t$this->type = $type;\n\t}", "public function authenticate()\n {\n \n // Login succeeded:\n $usertype = Auth::user()->id;\n if($usertype == 1){\n return redirect()->route('dashboard.index', array('page' => 'filmmaker')); \n }\n else\n {\n return view('welcome', array('page' => 'login')); // Login failed, show login form again\n }\n }", "public function getAuthTokenType()\n {\n return $this->authTokenType;\n }", "public function SetType($type){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}", "public function setAuthenticated();", "public function setType($type){ }", "public function authenticate(Request $req)\n {\n $email = $req->input('email');\n $password = $req->input('password');\n\n\n if (Auth::attempt(['email' => $email, 'password' => $password,'user_type'=>1]) || Auth::attempt(['email' => $email, 'password' => $password,'user_type'=>0])) {\n Auth::login(Auth::user());\n return redirect()->intended('/');\n } else {\n $req->session()->put('error', 'Email address or password is/are invalid. Try again!');\n return redirect('/login')->with('error', 'Email address or password is/are invalid. Try again!');\n }\n }", "function set($data) {\n\t\t// the contents of Auth::user().\n\t\tif (empty($data)) {\n\t\t\treturn false;\n\t\t}\n\t\tLogin::getInstance($data);\n\t}", "public function GetUserType(){\n\t\treturn $this->user_type;\n }", "public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setRoleLogin($value)\n {\n $this->role_login = $value;\n }", "public function getType()\n {\n return \"user\";\n }", "public function SetType($type){\r\n\t\t$this->type = (string) $type;\r\n\t}", "protected function setType()\n {\n $this->client_type = $this->getType();\n }", "public function setLoginId(): void\n {\n }", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }", "public function getAuthType()\n {\n return isset($this->authType) ? $this->authType : null;\n }", "function login_user_type(){\n\t\t$fa=$this->session->userdata('flexi_auth');\n\t\t$email=$fa['user_identifier'];\n\t\t//$this->firephp->log(\"User type for:\".$email);\n\t\t$this->db->select($this->flexi_auth->db_column('user_acc', 'group_id'));\t\n\t\t$this->db->where($this->flexi_auth->db_column('user_acc', 'email'),$email);\t\n\t\t$qres=$this->db->get('user_accounts');\n\t\tif ($qres->num_rows() > 0) {\n\t\t\t$row=$qres->row_array();\n\t\t\t//$this->firephp->log($row['uacc_group_fk'].\"for email=\".$email);\n\t\t\tswitch ($row['uacc_group_fk']) {\n\t\t\t case 1:\n\t\t\t return \"Parent\";\n\t\t\t case 2:\n\t\t\t return \"Student\";\n\t\t\t case 3:\n\t\t\t return \"Admin\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn NULL;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->firephp->log(\"Could not determine user group for user\");\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function setType($type)\n {\n $this['type'] = $type;\n }", "public function set_login($data){\n\t\t\tif( is_array($data) ){\n\t\t\t\tforeach($data as $i=>$v){\n\t\t\t\t\t$this->set($i, $v);\n\t\t\t\t}\n\t\t\t\t$this->extend_login();\n\t\t\t}\n\t\t}", "public function isLogin()\n\t{\n\t\t$type = Bn::getValue('user_type');\n\t\treturn (!empty($type));\n\t}", "public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}", "public function set_token_storage_type( $type = 'file' ){\n\t\t$this->token_storage = $type;\n\t}", "public function setLogin(string $login)\n {\n $this->email = $login;\n }", "public function setLogin($login)\n {\n $this->login = $login;\n }", "protected function set_type() {\n\n\t\t\t$this->type = 'kirki-editor';\n\n\t\t}", "protected function initializeAuthCode($authCode, $type)\n {\n $authCodeString = $this->generateRandomString();\n $authCodeString = md5(serialize($authCode) . $authCodeString);\n $authCode->setAuthCode($authCodeString);\n\n $authCode->setType($type);\n $authCode->setValidUntil($this->getValidUntil());\n }", "public function setApplicationIdentityType(?TeamworkApplicationIdentityType $value): void {\n $this->getBackingStore()->set('applicationIdentityType', $value);\n }", "public function __construct($realm='lepton', $type=HttpAuthentication::AUTH_BASIC) {\n $this->type = $type;\n $this->realm = $realm;\n $this->username = $_SERVER['PHP_AUTH_USER'];\n $this->password = $_SERVER['PHP_AUTH_PW'];\n }", "public function hasLoginType()\n {\n return $this->get(self::LOGIN_TYPE) !== null;\n }", "public function setType( $type )\n {\n }", "function checkAuth($type, $username, $password)\n {\n if (!$_MIDCOM->authentication->is_user())\n {\n if (!$_MIDCOM->authentication->login($username, $password))\n {\n return false;\n }\n }\n return true;\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }" ]
[ "0.7533833", "0.69493586", "0.68253934", "0.6527557", "0.6473223", "0.6252697", "0.6131606", "0.6121834", "0.60862917", "0.60413885", "0.59738755", "0.595734", "0.5911359", "0.59022367", "0.59019494", "0.5799048", "0.57958597", "0.5782056", "0.57652706", "0.5708991", "0.56907594", "0.56500626", "0.5626968", "0.55513924", "0.55513924", "0.5546838", "0.5546838", "0.5546838", "0.55317795", "0.5525295", "0.5525295", "0.5523513", "0.55227834", "0.55184305", "0.55178887", "0.5509843", "0.5509843", "0.5509745", "0.55007285", "0.54741126", "0.54741126", "0.54741126", "0.54741126", "0.54741126", "0.54741126", "0.54741126", "0.54741126", "0.54741126", "0.54590017", "0.5458367", "0.5450473", "0.5428187", "0.5407316", "0.5403349", "0.5391114", "0.53900033", "0.5383705", "0.53815144", "0.53797185", "0.5379531", "0.53739035", "0.53739035", "0.5373322", "0.53709644", "0.53653276", "0.5362793", "0.5357857", "0.5345343", "0.5345343", "0.5345343", "0.5345343", "0.5345343", "0.5345343", "0.5345343", "0.5345343", "0.5341348", "0.53382725", "0.5336439", "0.5323759", "0.53227776", "0.5320121", "0.53014004", "0.5300122", "0.52845776", "0.5273113", "0.52708894", "0.52698594", "0.5264803", "0.52638894", "0.52549815", "0.52463585", "0.52424425", "0.52395284", "0.52395284", "0.52395284", "0.52395284", "0.52395284", "0.52395284", "0.52395284" ]
0.7032549
2
Sets the Authentification Name (Name of the login area)
function setAuthName($authname){ $this->authName=$authname; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setAuthName($authname){\r\n\t\t$this->authName=$authname;\r\n\t}", "public function getName()\n {\n return 'login';\n }", "public static function setCurrentName($name) {\n Session::put(Privilege::SESSION_NAME_NAME, $name);\n }", "public function setCurrentUser($name);", "function setUserName($newVal)\r\n\t{\r\n\t\t$this->UserName = $newVal;\r\n\t}", "function setUserName($userName);", "public function setAuthenticationControllerName($controllerName)\n {\n $this->authenticationControllerName = $controllerName;\n }", "function set_uname($name){\n $this -> uname = $name;\n }", "public function login(){\n echo $this->name . ' logged in';\n }", "public function getLoginName()\n {\n return $this->loginName;\n }", "public function setUsername($l) {\n $this->_username = $l;\n }", "public function setUsername( $sName ) {\n\t\t$this->sUsername = $sName;\n\t}", "private function setName($name)\n {\n $session = new Zend_Session_Namespace('Unodor_Account');\n $session->name = $name;\n }", "private function __setAuthUser()\n {\n $authUser = $this->request->session()->read('Auth');\n\n $accountType = 'FREE';\n if (!empty($authUser)) {\n $accountType = $authUser['User']['account_type'];\n }\n\n $this->set(compact('authUser', 'accountType'));\n }", "public function name() {\n\t\treturn esc_html__( 'Login Form', 'thrive-cb' );\n\t}", "public function setUserName($value) { $this->setState('__username',$value); }", "function set_user_name($user_name='*')\r\n{\r\n\t// Get Default User Name\r\n\tif ( $user_name == '*' )\r\n\t{\r\n\t\tif ( empty($this->first_name) || empty($this->last_name) )\r\n\t\t{\r\n\t\t\ttrigger_error('first name and last name must be set to auto-set user name', E_USER_WARNING);\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t$user_name = substr($this->first_name,0,1) . $this->last_name;\r\n\t}\r\n\t// Set User Name\r\n\telse\r\n\t{\r\n\t\t$user_name = $user_name;\r\n\t}\r\n\t\r\n\t// set prop\r\n\t$this->user_name = strtolower($user_name);\r\n\treturn;\r\n}", "public function setName()\n {\n $this->_role->name = '伊泽瑞尔';\n }", "function set_admin_name($name) {\n $this->admin_name = $name;\n }", "public function setUserName($value) {\r\n if ($value === null) $value = \"User\";\r\n $this->userName = $value;\r\n }", "public function getAuthIdentifierName() {\n return 'username';\n }", "function setUserName($userName) {\n $this->userName = strtolower($userName);\n }", "public function loginUsername()\n {\n return 'username';\n }", "public function loginUsername()\n {\n return 'username';\n }", "protected function loginUsername()\n {\n return 'email';\n }", "function login() {\n \t$this->set('indata',$this->data);\n\t\tif(empty($this->data)){\n\t\t\t$this->pageTitle = 'Log in';\n\t\t\t$cookie = $this->Cookie->read('Auth.User');\n\t\t}\n }", "public function SetUserName ($userName);", "function set_name($name) {\n $this->name = $name;\n }", "function setUsername($Username);", "public function setLoginName($var)\n {\n GPBUtil::checkString($var, True);\n $this->loginName = $var;\n\n return $this;\n }", "public function loginUsername()\n {\n return 'email';\n }", "public function setName()\n {\n $this->_role->name = '奥巴马';\n }", "function editusername()\n {\n // Auth::handleLogin() makes sure that only logged in users can use this action/method and see that page\n Auth::handleLogin();\n $this->view->render('login/editusername');\n }", "private function setSessionName(): void\n {\n $cookie = new Cookie($this->expiringTime - 1);\n if ($cookie->exists('sessionName')) {\n return;\n }\n\n // unset all session name cookies\n foreach ($_COOKIE as $key => $value) {\n if (strlen($key) === strlen($this->name)) {\n $cookie->unset($key);\n }\n }\n\n $cookie->save('sessionName', $this->name);\n }", "function setRealname($realname){\n $this->realname = $realname;\n }", "public function loginUsername()\n {\n return property_exists($this, 'username') ? $this->username : 'email';\n }", "public function _setLogin($Login)\n {\n $this->Login = $Login;\n\n }", "public function setLogin(string $login): void\n {\n }", "public function authentication(): void\n {\n $userData = $this->getValidated([\n 'name',\n 'password',\n ]);\n\n $user = $this->getUserByName($userData['name']);\n\n if (password_verify($userData['password'], $user->password)) {\n NotificationService::sendInfo('Hello! You are logged in as ' . $user->name);\n $_SESSION['name'] = $user->name;\n $this->redirect(APP_URL);\n }\n\n NotificationService::sendError('failed authentication!');\n $_SESSION['login_modal_show'] = ' show';\n $this->redirect(APP_URL);\n }", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "public static function setUsername($val) \n { \n emailSettings::$username = $val; \n }", "public function setLogin($Login)\n {\n $this->__set(\"login\", $Login);\n }", "public function setUsername($value)\r\n\t{\r\n\t\t$this->username = $value;\r\n\t}", "public function setLoginId(): void\n {\n }", "public function setUserName($newUserName) {\n\t\t$this->userName = $newUserName;\n\t}", "protected function setSiteName() {\r\n\t\t$this->siteName = trim($this->settings['site']['siteName']);\r\n\t}", "function assignFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.User';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('merchant_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('userPrincipalName', $value);\n }", "public function setUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('userPrincipalName', $value);\n }", "public function setUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('userPrincipalName', $value);\n }", "public function setName($name) {\n\t\t$this->_name = $name;\n\t}", "public function setName($name) {\r\n\t\t$this->name = $name;\r\n\t}", "public function setName($name){\n $this->__set('name',$name);\n }", "function setHttpAuthUserName($user_name) {\n $this->fields['http_auth_user_name'] = $user_name;\n return $this;\n }", "function setHttpAuthUserName($user_name) {\n $this->fields['http_auth_user_name'] = $user_name;\n return $this;\n }", "public function setUserName(?string $value): void {\n $this->getBackingStore()->set('userName', $value);\n }", "public function setUserName(?string $value): void {\n $this->getBackingStore()->set('userName', $value);\n }", "function setName($Name){\n\t\t$this->Name = $Name;\n\t}", "public function getName(){\n return \"signin\";\n }", "public function setUsername($value)\n {\n $this->_username = $value;\n }", "function setLname($name){\n $this->lname = $name;\n }", "public function userNameWhenLoggedIn()\n {\n /* @var $customer MagentoComponents_Pages_CustomerAccount */\n $customer = Menta_ComponentManager::get('MagentoComponents_Pages_CustomerAccount');\n\n $customer->login();\n\n $customer->openDashboard();\n $this->getHelperAssert()->assertElementContainsText('//div[' . Menta_Util_Div::contains('welcome-msg'). ']',\n 'Test User');\n\n $customer->logout();\n }", "function setUsername($s)\n\t{\n\t\t$this->Info['Username'] = $s;\n\t\tupdateTableByUser('Developer', 'Username', $s, $this->Username);\n\t}", "function setName($name){\n\t\t$this->name=$name;\n\t}", "public function setLoginName($loginName)\n {\n $this->loginName = $loginName;\n return $this;\n }", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "public function set_name($new_name) {\r\n\t\t$this->name = strtoupper($new_name);\r\n\t}", "public function getUsername(){\n return $this->login;\n }", "function setName($name) {\n $this->name = $name;\n }", "function set_name ($name)\r\n {\r\n $_SESSION[\"name\"] = $name;\r\n }", "public function setFormName($name){\n\t\t$this->_form_name = $name;\t\n\t}", "public function setName(string $name): void\n {\n session_name($name);\n }", "public static function setUsername(string $newUsername): void\n {\n self::writeConfiguration(['username' => $newUsername]);\n }", "public function setName($name){\n \n $this->name = $name;\n \n }", "public function setLogin(string $login)\n {\n $this->email = $login;\n }", "public function getAuthUsername()\n {\n return $this->username;\n }", "public function setName($name){\n $this->_name = $name;\n }", "public function PrintAuthInfo() \n {\n if($this->IsAuthenticated())\n echo \"Du är inloggad som: <b>\" . $this->GetAcronym() . \"</b> (\" . $this->GetName() . \")\";\n else\n echo \"Du är <b>UTLOGGAD</b>.\";\n }", "public function setRealName($name)\n\t{\n\t\t$this->name = $name;\n\t}", "function change_wp_login_title() { return 'bodyRock | Solid WP'; }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "protected function __configAuth()\n\t{\n\t\t$this->Auth->userModel = 'User';\n\t\tAuthComponent::$sessionKey = 'Auth.User';\n\t\t$this->Auth->authorize = array('Actions');\n\t\t$this->Auth->authError = 'You need to login your account to access this page.';\n\t\t$this->Auth->loginError = 'Sai mật mã hoặc tên tài khoản, xin hãy thử lại';\n\t\t$this->Auth->authenticate = array('Form' => array(\n\t\t\t'fields' => array('username' => 'email'),\n\t\t\t'userModel' => 'User',\n\t\t\t'scope' => array(\n\t\t\t\t'User.active' => true\n\t\t\t)\n\t\t));\n\n\n\t\t$this->Auth->loginAction = array(\n\t\t\t'admin' => false,\n\t\t\t'controller' => 'users',\n\t\t\t'action' => 'login'\n\t\t);\n\t\t$this->Auth->loginRedirect = '/';\n\t\t$this->Auth->logoutRedirect = $this->referer('/');\n\t}", "public function setName($name) \n {\n $this->_name = $name; \n }", "public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }" ]
[ "0.7619085", "0.6364889", "0.6355036", "0.6346659", "0.63167447", "0.6271377", "0.6245056", "0.623459", "0.6197847", "0.61473745", "0.61266786", "0.61026496", "0.6080751", "0.6031913", "0.6025729", "0.60113096", "0.60051334", "0.5940008", "0.5934326", "0.5933759", "0.5929047", "0.59185475", "0.58785635", "0.58785635", "0.5862131", "0.5819322", "0.5799726", "0.57871264", "0.57701135", "0.5765968", "0.5765667", "0.57303566", "0.5720925", "0.5720577", "0.5705514", "0.5703296", "0.5688149", "0.5682233", "0.5677005", "0.5655794", "0.5655794", "0.5654014", "0.564936", "0.5644368", "0.56443655", "0.5643748", "0.5634459", "0.5606555", "0.56011426", "0.56011426", "0.56011426", "0.56011426", "0.56011426", "0.56011426", "0.56011426", "0.56011426", "0.560095", "0.560095", "0.560095", "0.5600776", "0.56005365", "0.55983335", "0.5590502", "0.5590502", "0.55869967", "0.55869967", "0.5586166", "0.55818135", "0.55753654", "0.5569182", "0.55638194", "0.55629534", "0.55625427", "0.555576", "0.55535483", "0.5550846", "0.5539825", "0.55393505", "0.5538396", "0.55382806", "0.55380434", "0.55249363", "0.55249363", "0.55237454", "0.55011815", "0.549254", "0.549005", "0.54891986", "0.54805714", "0.5479256", "0.5479256", "0.5479256", "0.5479256", "0.5479256", "0.5479256", "0.5478764", "0.5476384", "0.5458225", "0.54544723" ]
0.76242304
1
Writes the htaccess file to the given Directory and protects it
function addLogin(){ $file=fopen($this->fHtaccess,"w+"); fputs($file,"Order allow,deny\n"); fputs($file,"Allow from all\n"); fputs($file,"AuthType ".$this->authType."\n"); fputs($file,"AuthUserFile ".$this->fPasswd."\n\n"); fputs($file,"AuthName \"".$this->authName."\"\n"); fputs($file,"require valid-user\n"); fclose($file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function htaccessGen($path = \"\") {\n if($this->option(\"htaccess\") == true) {\n\n if(!file_exists($path.DIRECTORY_SEPARATOR.\".htaccess\")) {\n // echo \"write me\";\n $html = \"order deny, allow \\r\\n\ndeny from all \\r\\n\nallow from 127.0.0.1\";\n\n $f = @fopen($path.DIRECTORY_SEPARATOR.\".htaccess\",\"w+\");\n if(!$f) {\n return false;\n }\n fwrite($f,$html);\n fclose($f);\n\n\n }\n }\n\n }", "static function write_to_htaccess()\r\n {\r\n global $aio_wp_security;\r\n //figure out what server is being used\r\n if (AIOWPSecurity_Utility::get_server_type() == -1) {\r\n $aio_wp_security->debug_logger->log_debug(\"Unable to write to .htaccess - server type not supported!\", 4);\r\n return false; //unable to write to the file\r\n }\r\n\r\n //clean up old rules first\r\n if (AIOWPSecurity_Utility_Htaccess::delete_from_htaccess() == -1) {\r\n $aio_wp_security->debug_logger->log_debug(\"Delete operation of .htaccess file failed!\", 4);\r\n return false; //unable to write to the file\r\n }\r\n\r\n $htaccess = ABSPATH . '.htaccess';\r\n\r\n if (!$f = @fopen($htaccess, 'a+')) {\r\n @chmod($htaccess, 0644);\r\n if (!$f = @fopen($htaccess, 'a+')) {\r\n $aio_wp_security->debug_logger->log_debug(\"chmod operation on .htaccess failed!\", 4);\r\n return false;\r\n }\r\n }\r\n AIOWPSecurity_Utility_File::backup_and_rename_htaccess($htaccess); //TODO - we dont want to continually be backing up the htaccess file\r\n @ini_set('auto_detect_line_endings', true);\r\n $ht = explode(PHP_EOL, implode('', file($htaccess))); //parse each line of file into array\r\n\r\n $rules = AIOWPSecurity_Utility_Htaccess::getrules();\r\n\r\n $rulesarray = explode(PHP_EOL, $rules);\r\n $rulesarray = apply_filters('aiowps_htaccess_rules_before_writing', $rulesarray);\r\n $contents = array_merge($rulesarray, $ht);\r\n\r\n if (!$f = @fopen($htaccess, 'w+')) {\r\n $aio_wp_security->debug_logger->log_debug(\"Write operation on .htaccess failed!\", 4);\r\n return false; //we can't write to the file\r\n }\r\n\r\n $blank = false;\r\n\r\n //write each line to file\r\n foreach ($contents as $insertline) {\r\n if (trim($insertline) == '') {\r\n if ($blank == false) {\r\n fwrite($f, PHP_EOL . trim($insertline));\r\n }\r\n $blank = true;\r\n } else {\r\n $blank = false;\r\n fwrite($f, PHP_EOL . trim($insertline));\r\n }\r\n }\r\n @fclose($f);\r\n return true; //success\r\n }", "public function createHtaccessFile() {\n $oModule = oxNew(Module::class);\n $oConfig = $this->getConfig();\n // get modules path\n $sModulesDir = $oConfig->getModulesDir();\n // get cache path\n $sCacheDir = $oConfig->getConfigParam('sCompileDir');\n // check if the default .htaccess file is in config folder\n if(file_exists($sModulesDir.$oModule->getModulePath('suaboclearcache').'/Config/.htaccess.tmp')) {\n // copy .htaccess to cache folder\n copy($sModulesDir . $oModule->getModulePath('suaboclearcache') . '/Config/.htaccess.tmp', $sCacheDir . '/.htaccess');\n }\n }", "protected function writehtaccess()\n {\n $content = '# Deny access to supersake\n<Files supersake>\n\tOrder allow,deny\n\tDeny from all\n</Files>';\n }", "function wpsc_product_files_htaccess() {\n if(!is_file(WPSC_FILE_DIR.\".htaccess\")) {\n\t\t$htaccess = \"order deny,allow\\n\\r\";\n\t\t$htaccess .= \"deny from all\\n\\r\";\n\t\t$htaccess .= \"allow from none\\n\\r\";\n\t\t$filename = WPSC_FILE_DIR.\".htaccess\";\n\t\t$file_handle = @ fopen($filename, 'w+');\n\t\t@ fwrite($file_handle, $htaccess);\n\t\t@ fclose($file_handle);\n\t\t@ chmod($file_handle, 665);\n }\n}", "function create_htaccess($ip,$root,$ts_shop_folder) {\t\t\t\t\t\t\n$htaccess = 'AuthType Basic\nAuthName \"OpenShop Administration\"\nAuthUserFile '.$root.'/'.$ts_shop_folder.'/administration/.htpasswd\nRequire valid-user\nOrder Deny,Allow\nDeny from all\nAllow from '.$ip.'\n';\n\n\t\t\t\tif(!is_writable(\"administration/.htaccess\")) {\n\t\t\t\t\tchmod(\"administration/.htaccess\",0777);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$hta = fopen(\"administration/.htaccess\", \"w+\") or die(\"<div class=\\\"installer-message\\\">Unable to open administration .htaccess</div>\");\n\t\t\t\t\tfwrite($hta, $htaccess);\n\t\t\t\t\tfclose($hta);\n\t\t\t\t}", "function htaccess($rules, $directory, $before='') {\n\t$htaccess = $directory.'.htaccess';\n\tswitch($rules) {\n\t\tcase 'static':\n\t\t\t$rules = '<Files .*>'.\"\\n\".\n\t\t\t\t\t 'order allow,deny'.\"\\n\".\n\t\t\t\t\t 'deny from all'.\"\\n\".\n\t\t\t\t\t '</Files>'.\"\\n\\n\". \n\t\t\t\t\t 'AddHandler cgi-script .php .php3 .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi .fcgi'.\"\\n\".\n\t\t\t\t\t 'Options -ExecCGI';\n\t\tbreak;\n\t\tcase 'deny':\n\t\t\t$rules = 'deny from all';\n\t\tbreak;\n\t}\n\t\n\tif(file_exists($htaccess)) {\n\t\t$fgc = file_get_contents($htaccess);\n\t\tif(strpos($fgc, $rules)) {\n\t\t\t$done = true;\n\t\t} else {\n\t\t\tif(check_value($before)) {\n\t\t\t\t$rules = str_replace($before, $rules.\"\\n\".$before, $fgc);\n\t\t\t\t$f = 'w';\n\t\t\t} else {\n\t\t\t\t$rules = \"\\n\\n\".$rules;\n\t\t\t\t$f = 'a';\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$f = 'w';\n\t}\n\t\n\tif(!$done) {\n\t\t$fh = @fopen($htaccess, $f);\n\t\tif(!$fh) return false;\n\t\tif(fwrite($fh, $rules)) {\n\t\t\t@fclose($fh); return true;\n\t\t} else {\n\t\t\t@fclose($fh); return false;\n\t\t}\n\t} else {\n\t\treturn true;\n\t}\n}", "function ahr_write_htaccess( $redirection_status, $redirection_type ) {\r\n \r\n $random_anchor_number = get_option( 'ahr-random-anchor-number' );\r\n \r\n $https_status = $redirection_status === 'https' ? 'off' : 'on';\r\n \r\n $written_rules = \"\\n\\n\" . \"# Begin Advanced https redirection \" . $random_anchor_number . \"\\n\" . \"<IfModule mod_rewrite.c> \\n\" . \"RewriteEngine On \\n\" . \"RewriteCond %{HTTPS} $https_status \\n\" . \"RewriteCond %{REQUEST_FILENAME} -f \\n\" . \"RewriteCond %{REQUEST_FILENAME} !\\.php$ \\n\" . \"RewriteRule .* $redirection_status://%{HTTP_HOST}%{REQUEST_URI} [L,R=$redirection_type] \\n\" . \"</IfModule> \\n\" . \"# End Advanced https redirection \" . $random_anchor_number . \"\\n\";\r\n \r\n \r\n $root_dir = get_home_path();\r\n $htaccess_filename_path = $root_dir . '.htaccess';\r\n \r\n \r\n $write_result = file_put_contents( $htaccess_filename_path, $written_rules . PHP_EOL, FILE_APPEND | LOCK_EX );\r\n \r\n if ( $write_result ) {\r\n return true;\r\n }\r\n \r\n return false;\r\n \r\n}", "function create_class_htaccess($student_class_path) {\n $class_htaccess = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options +Indexes\n</Files>\n\";\n $file_path = \"${student_class_path}/.htaccess\";\n if (file_exists($file_path))\n return \"<!-- Class htaccess already exists -->\";\n if (file_put_contents($file_path, $class_htaccess))\n return \"<!-- Created class htaccess -->\";\n return \"<!-- Unable to create class htaccess -->\";\n}", "private function allowDirectoryIndex() {\n $directory = $this->getArchiveDirectory();\n $fileName = '.htaccess';\n // @todo needs security review\n $content = <<<EOF\nOptions +Indexes\n# Unset Drupal_Security_Do_Not_Remove_See_SA_2006_006\nSetHandler None\n<Files *>\n # Unset Drupal_Security_Do_Not_Remove_See_SA_2013_003\n SetHandler None\n ForceType text/plain\n</Files>\nEOF;\n\n if (!file_put_contents($directory . '/' . $fileName, $content)) {\n $this->messenger->addError(t('File @file_name could not be created', [\n '@file_name' => $fileName,\n ]));\n }\n }", "function addLogin(){\r\n\t $file=fopen($this->fHtaccess,\"w+\");\r\n\t fputs($file,\"Order allow,deny\\n\");\r\n\t fputs($file,\"Allow from all\\n\");\r\n\t fputs($file,\"AuthType \".$this->authType.\"\\n\");\r\n\t fputs($file,\"AuthUserFile \".$this->fPasswd.\"\\n\\n\");\r\n\t fputs($file,\"AuthName \\\"\".$this->authName.\"\\\"\\n\");\r\n\t fputs($file,\"require valid-user\\n\");\r\n\t fclose($file);\r\n\t}", "function ahr_handle_htaccess_errors() {\r\n \r\n $root_dir = get_home_path();\r\n $htaccess_filename_path = $root_dir . '.htaccess';\r\n \r\n $is_htaccess = file_exists( $htaccess_filename_path );\r\n \r\n if ( !$is_htaccess ) {\r\n echo '<p>There is no htaccess file in your root directory, it could be that you are not using Apache as a server, or that your server does not use htaccess files.</p>\r\n\t\t<p>If you are using Apache, you can try to create a new htaccess file, then try changing static resources redirection and see if it works.</p>';\r\n return;\r\n }\r\n \r\n $is_htaccess_writable = is_writable( $htaccess_filename_path );\r\n \r\n if ( !$is_htaccess_writable )\r\n echo '<p>Htaccess is not writable check your permissions.</p>';\r\n \r\n}", "function update_htaccess($unused, $value) {\r\n\t\t$this->htaccess_recovery = $value;\r\n\t\t\r\n\t\t//Overwrite the file\r\n\t\t$htaccess = get_home_path().'.htaccess';\r\n\t\t$fp = fopen($htaccess, 'w');\r\n\t\tfwrite($fp, $value);\r\n\t\tfclose($fp);\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function update_admin_htaccess($student_admin_path) {\n global $users;\n $output = \"\";\n $existing_contents = \"\";\n\n $file_path = \"${student_admin_path}/.htaccess\";\n if (file_exists($file_path)) {\n $existing_contents = file_get_contents($file_path);\n }\n // Create a list of users who can view this admin page, begining with the user\n $split = explode('@', filter_input(INPUT_SERVER, 'SERVER_ADMIN'));\n $users .= ' ' . $split[0];\n\n $htaccess_contents = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options -Indexes\n AuthType WebAuth\n require user $users\n satisfy any\n order allow,deny\n</Files>\n\";\n // If there is an update, then write our new admin htaccess. Otherwise\n if ($htaccess_contents == $existing_contents)\n return \"${output}\\n<!-- No changes needed to ${file_path} -->\";\n if (file_put_contents($file_path, $htaccess_contents))\n return \"${output}\\n<!-- Synchronized ${file_path} -->\";\n return \"${output}\\n<!-- Failed sync on ${file_path} -->\";\n}", "function update_htacess_protection($credentials)\n\t{\n\t\tif ( $_POST['enableHtaccess'] == 'true' ) //Add/Update the .htaccess and .htpasswd files\n\t\t{\n\t\t\tif ( !isset($credentials['username']) || !isset($credentials['password']) ) return FALSE;\n\n\t\t\t$username = $credentials['username'];\n\t\t\t$password = crypt_apr1_md5($credentials['password']);\n\n\t\t\t$fileLocation = str_replace('\\\\', '/', dirname(__FILE__));\n\t\t\t$fileLocation = explode('functions', $fileLocation);\n\t\t\t$fileLocation = $fileLocation[0];\n\t\t\t\n\t\t\t//Create the .htpasswd file\n\t\t\t$content = $username . ':' . $password;\n\t\t\t$file = fopen('../.htpasswd', \"w\");\n\t\t\tif ($file === FALSE) return FALSE;\n\t\t\tfwrite($file, $content);\n\t\t\tfclose($file);\n\n\t\t\t// Create the .htaccess file\n\t\t\t$content = 'AuthName \"Please login to proceed\"\n\t\t\tAuthType Basic\n\t\t\tAuthUserFile ' . $fileLocation . '.htpasswd\n\t\t\tRequire valid-user';\n\t\t\t$file = fopen('../.htaccess', \"w\");\n\t\t\tif ($file === FALSE) return FALSE;\n\t\t\tfwrite($file, $content);\n\t\t\tfclose($file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//delete the .htaccess and .htpasswd files\n\t\t\tif ( file_exists('../.htpasswd') ) unlink('../.htpasswd');\n\t\t\tif ( file_exists('../.htaccess') ) unlink('../.htaccess');\n\t\t}\n\n\t\treturn TRUE;\n\t}", "protected function _initFilesystem() {\n $this->_createWriteableDir($this->getTargetDir());\n $this->_createWriteableDir($this->getQuoteTargetDir());\n\n // Directory listing and hotlink secure\n $io = new Varien_Io_File();\n $io->cd($this->getTargetDir());\n if (!$io->fileExists($this->getTargetDir() . DS . '.htaccess')) {\n $io->streamOpen($this->getTargetDir() . DS . '.htaccess');\n $io->streamLock(true);\n $io->streamWrite(\"Order deny,allow\\nAllow from all\");\n $io->streamUnlock();\n $io->streamClose();\n }\n }", "protected function createProtection ($directory_path)\n {\n $data = sprintf(\"# .htaccess generated by kitFramework\\nAuthUserFile %s/.htpasswd\\n\" . \"AuthName \\\"kitFramework protection\\\"\\nAuthType Basic\\n<Limit GET>\\n\" . \"require valid-user\\n</Limit>\", $directory_path);\n if (! file_put_contents($directory_path . '/.htaccess', $data))\n throw new \\Exception('Can\\'t write .htaccess for directory protection!');\n $data = sprintf(\"# .htpasswd generated by kitFramework\\nkit_protector:%s\", crypt(self::generatePassword(16)));\n if (! file_put_contents($directory_path . '/.htpasswd', $data))\n throw new \\Exception('Can\\'t write .htpasswd for directory protection!');\n return true;\n }", "private function htaccessinitialize() {\n\t\t// get .htaccess\n\t\t$this->htaccessfile = str_replace('typo3conf' . DIRECTORY_SEPARATOR .\n\t\t\t\t'ext' . DIRECTORY_SEPARATOR . 'cyberpeace' . DIRECTORY_SEPARATOR . 'pi1', '', realpath(dirname(__FILE__))) . '.htaccess';\n\t\t$denyarr = 'no .htaccess';\n\t\tif (file_exists($this->htaccessfile)) {\n\t\t\t$denyarr = array();\n\t\t\t// get contents\n\t\t\t$this->htaccesscontent = file_get_contents($this->htaccessfile);\n\t\t\t// get line ##cyberpeace START\n\t\t\tif (str_replace('##cyberpeace START', '', $this->htaccesscontent) == $this->htaccesscontent) {\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t// get line ##cyberpeace END\n\t\t\t\t// Insert at end if not exists\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace START';\n\t\t\t\t$this->htaccesscontent = str_replace('##cyberpeace END', '', $this->htaccesscontent);\n\t\t\t\t$this->htaccesscontent = $this->htaccesscontent . \"\\n\" . '##cyberpeace END';\n\t\t\t}\n\n\t\t\t// get lines between ##cyberpeace START and END\n\t\t\t$this->arrtostart = explode(\"\\n\" . '##cyberpeace START', $this->htaccesscontent);\n\t\t\t$this->arrtoend = explode(\"\\n\" . '##cyberpeace END', $this->arrtostart[1]);\n\n\t\t\t// explode by '\\ndeny from '\n\t\t\t$denyarr = explode(\"\\n\" . 'deny from ', $this->arrtoend[0]);\n\n\t\t}\n\n\t\treturn $denyarr;\n\t}", "function rex_com_mediaaccess_htaccess_update()\n{\n global $REX;\n \n $unsecure_fileext = implode('|',explode(',',$REX['ADDON']['community']['plugin_mediaaccess']['unsecure_fileext']));\n $get_varname = $REX['ADDON']['community']['plugin_mediaaccess']['request']['file'];\n \n ## build new content\n $new_content = '### MEDIAACCESS'.PHP_EOL;\n $new_content .= 'RewriteCond %{HTTPS} off'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/.*/.*'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/(.*).('.$unsecure_fileext.')$'.PHP_EOL;\n $new_content .= 'RewriteRule ^(.*)$ http://%{HTTP_HOST}/?'.$get_varname.'=\\$1 [R=301,L]'.PHP_EOL;\n $new_content .= 'RewriteCond %{HTTPS} on'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/.*/.*'.PHP_EOL;\n $new_content .= 'RewriteCond %{REQUEST_URI} !files/(.*).('.$unsecure_fileext.')$'.PHP_EOL;\n $new_content .= 'RewriteRule ^(.*)$ https://%{HTTP_HOST}/?'.$get_varname.'=\\$1 [R=301,L]'.PHP_EOL;\n $new_content .= '### /MEDIAACCESS'.PHP_EOL;\n \n ## write to htaccess\n $path = $REX['HTDOCS_PATH'].'files/.htaccess';\n $old_content = rex_get_file_contents($path);\n \n if(preg_match(\"@(### MEDIAACCESS.*### /MEDIAACCESS)@s\",$old_content) == 1)\n { \n $new_content = preg_replace(\"@(### MEDIAACCESS.*### /MEDIAACCESS)@s\", $new_content, $old_content);\n return rex_put_file_contents($path, $new_content);\n }\n \n return false;\n}", "function htaccess_rewrite(){\n\n global $SETTINGS;\n\n require_once HOME . '_inc/function/defaults.php';\n\n\t$Plugins = Plugins::getInstance( );\n\n\t/**\n\t * if the apache_get_modules function is\n\t * available, make sure that the apache\n\t * rewrite module is loaded\n\t */\n\tif( function_exists( 'apache_get_modules' ) ){\n\t\t$modules=apache_get_modules();\n\n\t\tif(!in_array('mod_rewrite',$modules))\n\t\t\terror(\n\t\t\t\t'The apache module mod_rewrite must be installed. Please visit <a href=\"http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html\">'\n\t\t\t\t. 'Apache Module mod_rewrite</a> for more details.'\n\t\t\t\t,'Apache Error'\n\t\t\t);\n\t}\n\n\t/**\n\t * build up array of rewrite rules and filter\n\t * through the plugin filter\n\t */\n $rules = defaults_htaccess_rules( SITE_URL );\n \n\t$rules = $Plugins->filter( 'general', 'filter_htaccess', $rules );\n\n $htaccess = defaults_htaccess_content( $rules );\n\n\t/**\n\t * write htaccess file or throw error\n\t */\n\tfile_put_contents( HOME . '.htaccess', $htaccess ) \n\t\tor error(\n\t\t\t'You must grant <i>0777</i> write access to the <i>' . HOME . \n\t\t\t'</i> directory for <a href=\"http://furasta.org\">Furasta.Org</a> to function correctly.' .\n\t\t\t'Please do so then reload this page to save the settings.'\n\t\t\t,'Runtime Error'\n\t\t);\n\n\tif( $SETTINGS[ 'index' ] == 0 ){\n $robots = defaults_robots_content( 0, SITE_URL );\n\n\t\t$robots = $Plugins->filter( 'general', 'filter_robots', $robots );\n\t}\n else{\n $robots = defaults_robots_content( 1, SITE_URL );\n $file=HOME.'sitemap.xml';\n if(file_exists($file))\n unlink($file);\n\n\t}\n\n\t/**\n\t * write robots.txt or throw error\n\t */\n\tfile_put_contents( HOME. 'robots.txt', $robots );\n\n\treturn true;\n}", "function cemhub_check_htaccess_in_private_system_path($set_message = TRUE) {\n $is_created = FALSE;\n\n $file_private_path = variable_get('file_private_path', FALSE);\n if ($file_private_path) {\n file_create_htaccess('private://', TRUE);\n\n if (file_exists($file_private_path . '/.htaccess')) {\n $is_created = TRUE;\n }\n elseif ($set_message) {\n drupal_set_message(t(\"Security warning: Couldn't write .htaccess file.\"), 'warning');\n }\n }\n\n return $is_created;\n}", "function htaccess(){\r\n\t}", "function RepairHtmlHtaccess($sHtaccessPath, $sScriptFilePath)\n{\n\t$sOldHtaccessContent = '';\n\t$sNewHtaccessContent = '';\n\tif(file_exists($sHtaccessPath) === true)\n\t{\n\t\t$sOldHtaccessContent = file_get_contents($sHtaccessPath);\n\t\t\n\t\t$sNewHtaccessContent = $sOldHtaccessContent;\n\t\t$sNewHtaccessContent = preg_replace(\"/\\s*\\#Start\\sSpec\\scheck\\srewrite\\srule.*#End\\sSpecial\\scheck\\srewrite\\srule\\s*/is\", \"\\n\", $sNewHtaccessContent);\n\t\t$sNewHtaccessContent = trim($sNewHtaccessContent);\n\t}\n\t\n\t$sTemplate = '';\n\t$sTemplate = '#Start Spec check rewrite rule\nRewriteEngine On\nRewriteCond %{DOCUMENT_ROOT}<%PATH_TO_SCRIPT%> -f\nRewriteCond %{QUERY_STRING} ^(.*)$\nRewriteRule ^(.*\\.htm(:?l?))$ .<%PATH_TO_SCRIPT%>?old-path=$1&%1 [L]\nRewriteCond %{DOCUMENT_ROOT}<%PATH_TO_SCRIPT%> -f\nRewriteCond %{QUERY_STRING} ^(.*)$\nRewriteRule ^(.*\\.pdf)$ .<%PATH_TO_SCRIPT%>?old-path=$1&%1 [L]\n#End Special check rewrite rule';\n\t\n\t$sTemplate = str_replace('<%PATH_TO_SCRIPT%>', $sScriptFilePath, $sTemplate);\n\t\n\t$sNewHtaccessContent .= \"\\n\\n\".$sTemplate.\"\\n\";\n\t$sNewHtaccessContent = trim($sNewHtaccessContent);\n\t\n\t$stOutFileHandle = false;\n\t$stOutFileHandle = fopen($sHtaccessPath, 'w');\n\tif($stOutFileHandle === false)\n\t{\n\t\techo '<fail>cant open htaccess file for writing</fail>';\n\t\treturn false;\n\t}\n\t\tfwrite($stOutFileHandle, $sNewHtaccessContent);\n\tfclose($stOutFileHandle);\n\t\n\t\n\techo '<correct>correct repair htaccess</correct>';\n\treturn true;\n}", "public static function generateHtAccess()\n {\n\n // open template file for reading and store the content to variable\n $fp_template = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/htaccess.template', 'r');\n $template = fread($fp_template, filesize($_SERVER[\"DOCUMENT_ROOT\"] . \"/htaccess.template\"));\n fclose($fp_template);\n\n $app_rewrites = \"\";\n // get all the registered applications\n $app_repo = new ApplicationRepository();\n $app_listings = $app_repo->getAll();\n\n $app_domain_repo = new DomainWhitelistRepository();\n foreach ($app_listings as $app) {\n\n $app_rewrites .= \" # app = $app->name\" . \"\\n\";\n // if application have any whitelisting\n $app_whitelists = $app_domain_repo->getByApplicationId($app->id);\n if ($app_whitelists != null) {\n $isOr = sizeof($app_whitelists) > 0 ? \"[OR]\" : \"\";\n $cnt = 0;\n foreach ($app_whitelists as $listing) {\n\n // dont add [OR] in last condition\n if ($cnt == sizeof($app_whitelists) - 1) $isOr = \"\";\n\n if (!empty($listing->domain)) {\n\n $app_rewrites .= \" RewriteCond %{HTTP_HOST} =$listing->domain $isOr\" . \"\\n\";\n\n } else if (!empty($listing->ip_address)) {\n\n $escaped_ip = str_replace(\".\", \"\\.\", $listing->ip_address);\n $app_rewrites .= \" RewriteCond %{REMOTE_ADDR} =^$escaped_ip$ $isOr\" . \"\\n\";\n\n }\n\n $cnt++;\n }\n }\n\n $app_rewrites .= \" RewriteRule api/$app->app_api_slug/(.*)$ api/generic/api.php [QSA,NC,L]\" . \"\\n\\r\";\n\n }\n\n $template = str_replace(\"{app_rewrites}\", $app_rewrites, $template);\n\n // write the final template to .htaccess file and close it.\n $fp = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/.htaccess', 'w+');\n if ($fp) {\n fwrite($fp, $template);\n fclose($fp);\n }\n }", "private function htaccessfinalize($denyarr) {\n\t\t// finalize\n\t\t$this->arrtoend[0] = implode(\"\\n\" . 'deny from ', $denyarr);\n\t\t$this->arrtostart[1] = implode(\"\\n\" . '##cyberpeace END', $this->arrtoend);\n\t\t$this->htaccesscontent = implode(\"\\n\" . '##cyberpeace START', $this->arrtostart);\n\t\t// write contents to .htaccess\n\t\tfile_put_contents($this->htaccessfile, $this->htaccesscontent);\n\t\treturn '';\n\t}", "function create_htpasswd($username,$password) {\n\n\t$encrypted_password = crypt($password, base64_encode($password));\n\t$data = $username.\":\".$encrypted_password;\n\t\t\t\t\t\n\t$ht = fopen(\"administration/.htpasswd\", \"w\") or die(\"<div class=\\\"installer-message\\\">Could not open .htpassword for writing. Please make sure that the server is allowed to write to the administration folder. In Apache, the folder should be chowned to www-data. </div>\");\n\tfwrite($ht, $data);\n\tfclose($ht);\n}", "public static function createHtaccess($base_dir='', $receiver_file='index.php')\n {\n if(!empty($base_dir) AND substr($base_dir, -1) == '/')\n $base_dir = substr($base_dir, 0, -1); // we delete the ending /\n \n $receiver_file = implode('/', array($base_dir, $receiver_file));\n \n return <<<TXT\n<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteBase /\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . $receiver_file [L]\n</IfModule>\nTXT;\n }", "function htaccess(){\n }", "private function resetStorageFile(){\n $newFile = self::STORAGE_FILE_TEMPLATE_HEADER.self::STORAGE_FILE_TEMPLATE_BODY.self::STORAGE_FILE_TEMPLATE_FOOTER;\n if(!file_exists(realpath($newFile))){\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n if(!is_dir($dirName)){\n mkdir($dirName,\"640\",true);\n }\n }\n if(false === @file_put_contents(self::STORAGE_FILE,$newFile)){\n die(\"Could not reset storage file\");\n }else{\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n file_put_contents($dirName.\"/.htaccess\",self::STORAGE_FILE_TEMPLATE_HTACCESS);\n }\n }", "function makedir($dir)\n{\n\tglobal $config_vars;\n\t$ret = ForceDirectories($dir,$config_vars['dir_mask']);\n\ttouch ($dir . '/index.html');\n\treturn $ret;\n}", "function ahr_remove_rules_htaccess() {\r\n \r\n $root_dir = get_home_path();\r\n $file = $root_dir . '.htaccess';\r\n $file_content = file_get_contents( $file );\r\n \r\n $random_anchor_number = get_option( 'ahr-random-anchor-number' );\r\n $start_string = \"# Begin Advanced https redirection $random_anchor_number\";\r\n $end_string = \"# End Advanced https redirection $random_anchor_number\";\r\n $regex_pattern = \"/$start_string(.*?)$end_string/s\";\r\n \r\n preg_match( $regex_pattern, $file_content, $match );\r\n \r\n if ( $match[ 1 ] !== null ) {\r\n \r\n $file_content = str_replace( $match[ 1 ], '', $file_content );\r\n $file_content = str_replace( $start_string, '', $file_content );\r\n $file_content = str_replace( $end_string, '', $file_content );\r\n \r\n }\r\n \r\n $file_content = rtrim( $file_content );\r\n file_put_contents( $file, $file_content );\r\n \r\n}", "private static function checkDirectory( $directoryName ) {\n\t\tif( ! is_dir( CACHE . \"$directoryName\" ) ) {\n\t\t\t// TODO: Provjera ispravnosti imena direktorija?\n\t\t\tmkdir( CACHE . \"$directoryName\" );\n\t\t\t// Odmah i index.html da se ne bi vidio sadrzaj:\n\t\t\tfile_put_contents( CACHE . $directoryName . '/index.html', '' );\n\t\t}\n\t}", "function htaccess($htaccess, $htpass, $htgroup=null){\n\t \n\t $this->setFHtaccess($htaccess);\n\t\t$this->setFPasswd($htpass);\n\t\t\n\t\tif ($htgroup)\n\t\t $this->setFHtgroup($htgroup);\n }", "private function write_cache() {\n if (!file_exists(CACHE_DIR))\n mkdir(CACHE_DIR, 0755, TRUE);\n\n if (is_dir(CACHE_DIR) && is_writable(CACHE_DIR)) {\n if (function_exists(\"sem_get\") && ($mutex = @sem_get(2013, 1, 0644 | IPC_CREAT, 1)) && @sem_acquire($mutex))\n file_put_contents($this->cache_file, $this->html . $this->debug) . sem_release($mutex);\n /**/\n else if (($mutex = @fopen($this->cachefile, \"w\")) && @flock($mutex, LOCK_EX))\n file_put_contents($this->cache_file, $this->html . $this->debug) . flock($mutex, LOCK_UN);\n /**/\n }\n }", "function ClearHtaccess()\n{\n\t$sHtaccessPath = '';\n\t$sHtaccessPath = __MAIN_PATH__.'.htaccess';\n\t\n\t$sNewHtaccessContent = '';\n\tif(file_exists($sHtaccessPath) === true)\n\t{\n\t\t$sOldHtaccessContent = file_get_contents($sHtaccessPath);\n\t\t\n\t\t$sNewHtaccessContent = $sOldHtaccessContent;\n\t\t$sNewHtaccessContent = preg_replace(\"/\\s*\\#Start\\sSpec\\scheck\\srewrite\\srule.*#End\\sSpecial\\scheck\\srewrite\\srule\\s*/is\", \"\\n\", $sNewHtaccessContent);\n\t\t$sNewHtaccessContent = trim($sNewHtaccessContent);\n\t} else\n\t{\n\t\techo '<notice>htaccess not exists</notice>';\n\t\techo '<correct>correct clear</correct>';\n\t}\n\t\n\n\tif(strlen($sNewHtaccessContent) > 0)\n\t{\n\t\t$stOutFileHandle = false;\n\t\t$stOutFileHandle = fopen($sHtaccessPath, 'w');\n\t\tif($stOutFileHandle === false)\n\t\t{\n\t\t\techo '<fail>cant open file for write</fail>';\n\t\t\treturn;\n\t\t}\n\t\t\tfwrite($stOutFileHandle, $sNewHtaccessContent);\n\t\tfclose($stOutFileHandle);\n\t\t\n\t\techo '<correct>correct clear</correct>';\n\t} else\n\t{\n\t\t$bIsUnlink = false;\n\t\t$bIsUnlink = unlink($sHtaccessPath);\n\t\tif($bIsUnlink === true)\n\t\t{\n\t\t\techo '<correct>correct clear</correct>';\n\t\t} else\n\t\t{\n\t\t\techo '<notice>cant unlink htaccess</notice>';\n\t\t}\n\t}\n\treturn;\t\n}", "public function write()\n\t{\n\t\t$source = $this->compile();\n\n\t\t// file location\n\t\t$file = $this->template->getEnvironment()->getCache() . '/';\n\t\t$file .= $this->template->getEnvironment()->getCacheFilename($this->filename);\n\n\t\t// attempt to create the directory if needed\n\t\tif(!is_dir(dirname($file)))\n\t\t{\n\t\t\tmkdir(dirname($file), 0777, true);\n\t\t}\n\n\t\t// write to tempfile and rename\n\t\t$tmpFile = tempnam(dirname($file), basename($file));\n\t\tif(@file_put_contents($tmpFile, $source) !== false)\n\t\t{\n\t\t\tif(@rename($tmpFile, $file))\n\t\t\t{\n\t\t\t\tchmod($file, 0644);\n\t\t\t}\n\t\t}\n\t}", "public function htaccess_notice() {\n\t\t$value = $this->get_setting( 'enable_basic_authentication', 'no' );\n\t\t$htaccess_file = $this->base_path . '.htaccess';\n\n\t\tif ( 'yes' === $value && ! file_exists( $htaccess_file ) ) {\n\t\t\t?>\n\t\t\t<div class=\"error\">\n\t\t\t\t<p>\n\t\t\t\t\t<?php _e( \"Warning: .htaccess doesn't exist. Your SatisPress packages are public.\", 'satispress' ); ?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}", "static function delete_from_htaccess($section = 'All In One WP Security')\r\n {\r\n //TODO\r\n $htaccess = ABSPATH . '.htaccess';\r\n\r\n @ini_set('auto_detect_line_endings', true);\r\n if (!file_exists($htaccess)) {\r\n $ht = @fopen($htaccess, 'a+');\r\n @fclose($ht);\r\n }\r\n $ht_contents = explode(PHP_EOL, implode('', file($htaccess))); //parse each line of file into array\r\n if ($ht_contents) { //as long as there are lines in the file\r\n $state = true;\r\n if (!$f = @fopen($htaccess, 'w+')) {\r\n @chmod($htaccess, 0644);\r\n if (!$f = @fopen($htaccess, 'w+')) {\r\n return -1;\r\n }\r\n }\r\n\r\n foreach ($ht_contents as $n => $markerline) { //for each line in the file\r\n if (strpos($markerline, '# BEGIN ' . $section) !== false) { //if we're at the beginning of the section\r\n $state = false;\r\n }\r\n if ($state == true) { //as long as we're not in the section keep writing\r\n fwrite($f, trim($markerline) . PHP_EOL);\r\n }\r\n if (strpos($markerline, '# END ' . $section) !== false) { //see if we're at the end of the section\r\n $state = true;\r\n }\r\n }\r\n @fclose($f);\r\n return 1;\r\n }\r\n return 1;\r\n }", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "public static function addModRewriteConfig()\n {\n try {\n $apache_modules = \\WP_CLI_CONFIG::get('apache_modules');\n } catch (\\Exception $e) {\n $apache_modules = array();\n }\n if ( ! in_array(\"mod_rewrite\", $apache_modules)) {\n $apache_modules[] = \"mod_rewrite\";\n $wp_cli_config = new \\WP_CLI_CONFIG('global');\n $current_config = $wp_cli_config->load_config_file();\n $current_config['apache_modules'] = $apache_modules;\n $wp_cli_config->save_config_file($current_config);\n sleep(2);\n }\n }", "function macro_file_put_contents($path, $data)\n{\n if (!\\Includes\\Utils\\FileManager::mkdirRecursive(dirname($path))) {\n macro_error('Directory \\'' . $path . '\\' write-protected!');\n }\n\n if (!@file_put_contents($path, $data)) {\n macro_error('File \\'' . $path . '\\' write-protected!');\n }\n}", "function setFHtaccess($filename){\r\n\t\t$this->fHtaccess=$filename;\r\n\t}", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "function setFHtaccess($filename){\n $this->fHtaccess=$filename;\n }", "protected function createDirectory() {}", "function file_force_contents($dir, $contents){\n $parts = explode('/', $dir);\n $file = array_pop($parts);\n $dir = '';\n foreach($parts as $part)\n if(!is_dir($dir .= \"/$part\")) mkdir($dir);\n file_put_contents(\"$dir/$file\", $contents);\n }", "protected function htaccess()\n\t{\n\t\t$error = \"\";\n\t\t\t\n\t\tif(!file_exists(\".htaccess\"))\n\t\t{\n\t\t\tif(!rename(\"e107.htaccess\",\".htaccess\"))\n\t\t\t{\n\t\t\t\t$error = LANINS_142;\n\t\t\t}\n\t\t\telseif($_SERVER['QUERY_STRING'] == \"debug\")\n\t\t\t{\n\t\t\t\trename(\".htaccess\",\"e107.htaccess\");\n\t\t\t\t$error = \"DEBUG: Rename from e107.htaccess to .htaccess was successful\";\t\t\n\t\t\t}\n\t\t}\n\t\telseif(file_exists(\"e107.htaccess\"))\n\t\t{\n\t\t\t$srch = array('[b]','[/b]');\n\t\t\t$repl = array('<b>','</b>');\n\t\t\t$error = str_replace($srch,$repl, LANINS_144); // too early to use e107::getParser() so use str_replace();\n\t\t}\t\t\n\t\treturn $error;\t\n\t}", "function folderCheck(string $params = null)\n {\n if (!file_exists($params)) {\n mkdir($params, 0777, true);\n $myFile = $params . \"/index.html\"; // or .php\n $fh = fopen($myFile, 'w'); // or die(\"error\");\n $stringData = \"your dont have permission to view this folders\";\n fwrite($fh, $stringData);\n fclose($fh);\n }\n }", "public static function write403() {\r\n // impostiamo il codice della risposta http a 404 (file not found)\r\n header('HTTP/1.0 403 Forbidden');\r\n $titolo = \"Accesso negato\";\r\n $messaggio = \"Non hai i diritti per accedere a questa pagina\";\r\n $login = true;\r\n include_once('error.php');\r\n exit();\r\n }", "function writeFileText($dir, $filename, $content, $modeWrite) {\n\t\ttry {\n\t\t\tif ($dir != $DIR_SERVERROOT) {\n\t\t\t\tif(!is_dir($dir)) {\n\t\t\t\t\tmkdir($dir);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dir.$filename, $modeWrite);\n\t\t\t\n\t\t\tfwrite($fp, $content);\n\t\t\tfclose($fp);\n\t\t} catch (Exception $e) {\n\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t}", "private function checkCookiePermission() \r\n\t{\r\n $f = fopen($this->cookieFile,'w');\r\n \r\n if(!$f) \r\n die('The cookie file could not be opened. Make sure this directory has the correct permissions');\r\n else \r\n fclose($f);\r\n\t}", "protected static function create_apache2_access_denied_rule($filename) {\r\n return <<<END\r\n<Files $filename>\r\n<IfModule mod_authz_core.c>\r\n Require all denied\r\n</IfModule>\r\n<IfModule !mod_authz_core.c>\r\n Order deny,allow\r\n Deny from all\r\n</IfModule>\r\n</Files>\r\n\r\nEND;\r\n // Keep the empty line at the end of heredoc string,\r\n // otherwise the string will not end with end-of-line character!\r\n }", "protected function createNecessaryDirectoriesInDocumentRoot() {}", "protected function createNecessaryDirectoriesInDocumentRoot() {}", "private function file_write($dir, $contents)\n {\n $parts = explode('/', $dir);\n $file = array_pop($parts);\n $dir = '';\n foreach($parts as $part)\n if(!is_dir($dir .= \"/$part\")) mkdir($dir);\n file_put_contents(\"$dir/$file\", $contents);\n }", "function output_htaccess( $rules ) {\n $rules_arr = explode(\"\\n\",$rules);\n $new_rule = ['RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]'];\n array_splice( $rules_arr, 2, 0, $new_rule ); \n $rules = implode(\"\\n\",$rules_arr);\n return $rules;\n # BEGIN WordPress\n // <IfModule mod_rewrite.c>\n // RewriteEngine On\n // RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]\n // RewriteBase /\n // RewriteRule ^index\\.php$ - [L]\n // RewriteCond %{REQUEST_FILENAME} !-f\n // RewriteCond %{REQUEST_FILENAME} !-d\n // RewriteRule . /index.php [L]\n // </IfModule>\n # END WordPress\n}", "function setDirectory( $dir=null , $protect = true ) \r\n {\r\n $success = false;\r\n\r\n // checks to confirm existence of directory\r\n // then confirms directory is writeable \r\n if ($dir === null)\r\n {\r\n $dir = $this->getDirectory(); \r\n } \r\n \r\n $helper = new DSCHelper();\r\n $helper->checkDirectory($dir);\r\n $this->_directory = $dir;\r\n return $this->_directory;\r\n }", "public function __construct() {\n // Use FS over PHP for this as it may need to search deep.\n $htaccess = array();\n exec('locate .htaccess', $htaccess);\n\n $htaccess = array_filter($htaccess, function($item) {\n return strpos($item, DRUPAL_ROOT) !== FALSE;\n });\n\n $this->setData($htaccess);\n }", "private function isDirWritable($cacheDir) {\n\t\ttry {\n\t\t\tif (!is_writable(BASEPATH . $cacheDir)) {\n\t\t\t\tthrow new Fari_Exception('Cache directory ' . $cacheDir . ' is not writable.');\n\t\t\t}\n\t\t} catch (Fari_Exception $exception) { $exception->fire(); }\n\t}", "private function htWriteFile() {\r\n global $php_errormsg;\r\n $filename = $this->FILE;\r\n // On WIN32 box this should -still- work OK,\r\n // but it'll generate the tempfile in the system\r\n // temporary directory (usually c:\\windows\\temp)\r\n // YMMV\r\n $tempfile = tempnam( \"/tmp\", \"fort\" );\r\n $name = \"\";\r\n $pass = \"\";\r\n $count = 0;\r\n $fd;\r\n $myerror = \"\";\r\n if ( $this->EMPTY ) {\r\n $this->USERCOUNT = 0;\r\n }\r\n if ( !copy( $filename, $tempfile ) ) {\r\n $this->error( \"FATAL cannot create backup file [$tempfile] [$php_errormsg]\", 1 );\r\n }\r\n $fd = fopen( $tempfile, \"w\" );\r\n if ( empty( $fd ) ) {\r\n $myerror = $php_errormsg; // In case the unlink generates\r\n // a new one - we don't care if\r\n // the unlink fails - we're\r\n // already screwed anyway\r\n unlink( $tempfile );\r\n $this->error( \"FATAL File [$tempfile] access error [$myerror]\", 1 );\r\n }\r\n for ( $count = 0; $count <= $this->USERCOUNT; $count++ ) {\r\n $name = $this->USERS[$count][\"user\"];\r\n $pass = $this->USERS[$count][\"pass\"];\r\n if ( ($name != \"\") && ($pass != \"\") ) {\r\n fwrite( $fd, \"$name:$pass\\n\" );\r\n }\r\n }\r\n fclose( $fd );\r\n if ( !copy( $tempfile, $filename ) ) {\r\n $myerror = $php_errormsg; // Stash the error, see above\r\n unlink( $tempfile );\r\n $this->error( \"FATAL cannot copy file [$filename] [$myerror]\", 1 );\r\n }\r\n // Update successful\r\n unlink( $tempfile );\r\n if ( file_exists( $tempfile ) ) {\r\n // Not fatal but it should be noted\r\n $this->error( \"Could not unlink [$tempfile] : [$php_errormsg]\", 0 );\r\n }\r\n // Update the information in memory with the\r\n // new file contents.\r\n $this->initialize( $filename );\r\n return TRUE;\r\n }", "function nectar_dynamic_css_dir_writable() {\n\t\n\tglobal $wp_filesystem;\n\t\n\tif ( empty($wp_filesystem) || ! function_exists( 'request_filesystem_credentials' ) ) {\t\n\t\trequire_once( ABSPATH . 'wp-admin/includes/file.php' );\n\t}\n\t\n\t$path = NECTAR_THEME_DIRECTORY . '/css/';\n\t\n\t// Does the fs have direct access?\n\tif( get_filesystem_method(array(), $path) === \"direct\" ) {\n\t\treturn true;\n\t} \n\t\n\t// Also check for stored credentials.\n\tif ( ! function_exists( 'submit_button' ) ) {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/template.php' );\n\t}\n\t\n\tob_start();\n\t$fs_stored_credentials = request_filesystem_credentials('', '', false, false, null);\n\tob_end_clean();\n\n\t\n\tif ( $fs_stored_credentials && WP_Filesystem( $fs_stored_credentials ) ) {\n\t\treturn true;\n\t}\n\t\n\treturn false;\n\t\n}", "protected function _createWriteableDir($path) {\n $io = new Varien_Io_File();\n if (!$io->isWriteable($path) && !$io->mkdir($path, 0777, true)) {\n Mage::throwException(Mage::helper('catalog')->__(\"Cannot create writeable directory '%s'.\", $path));\n }\n }", "private function _save(){\r\n\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n foreach ($_POST as $name => $value) {\r\n $config = HTMLPurifier_Config::createDefault();\r\n $purifier = new HTMLPurifier($config);\r\n $clean_html = $purifier->purify($value);\r\n\r\n $parts = explode('/', $name);\r\n $path = ROOT.DS.'site'.DS.'content';\r\n\r\n for($i = 0; $i < count($parts); $i++){\r\n $path .= DS.$parts[$i];\r\n if($i == (count($parts)-1)){\r\n file_put_contents($path.'.html', $clean_html);\r\n } else {\r\n if(!file_exists($path)){\r\n mkdir($path);\r\n }\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n }", "function CreateAndCheckConnFile($fileName) {\n\n global $SUB_DIRECTORY;\n\n if (file_exists($fileName)){\n $newFile = @fopen($fileName, 'a');\n if($newFile)\n fclose($newFile);\n else\n echo \"<b>Error</b>: Failed to open ($fileName) file: Permission denied.\";\n \n }\n else{\n if(!is_dir($SUB_DIRECTORY)){\n mkdir($SUB_DIRECTORY);\n }\n $newFile = @fopen($fileName, 'w');\n if($newFile){\n fwrite($newFile, \"<?php echo 'Devart HTTP tunnel temporary file.'; exit; ?>\\r\\n\"); // forbid viewing this file through browser\n fclose($newFile);\n }\n else\n echo \"<b>Error</b>: Failed to create ($fileName) file: Permission denied.\";\n }\n \n if(!$newFile)\n exit;\n}", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "public function protected_dir($directory=NULL)\n\t{\n\t\t$directory = ((NULL === $directory)) ? '' : \"/$directory\";\n\t\t\n\t\treturn DATAPATH . \"$this->site_name/protected$directory\";\t\n\t}", "function save_mod_rewrite_rules()\n {\n }", "function crntDir()\n{\n header('Location: http://localhost/CMS/admin_page');\n}", "function cacheFile($dir, $file, $data)\n{\n if (!Config::Caching)\n return;\n\n debug('Cache', \"Saving $file to $dir local storage\");\n\n $path = pathJoin([$dir, $file]);\n file_put_contents($path, $data);\n chmod($path, 0666);\n}", "public function check_exports_folder_protection() {\n\n\t\t$upload_dir = wp_upload_dir();\n\t\t$exports_dir = $upload_dir['basedir'] . '/csv_exports';\n\t\t$download_method = get_option( 'woocommerce_file_download_method' );\n\n\t\tif ( 'redirect' === $download_method ) {\n\n\t\t\t// Redirect method - don't protect\n\t\t\tif ( file_exists( $exports_dir . '/.htaccess' ) ) {\n\t\t\t\tunlink( $exports_dir . '/.htaccess' );\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Force method - protect, add rules to the htaccess file\n\t\t\tif ( ! file_exists( $exports_dir . '/.htaccess' ) && $file_handle = @fopen( $exports_dir . '/.htaccess', 'w' ) ) {\n\n\t\t\t\tfwrite( $file_handle, 'deny from all' );\n\t\t\t\tfclose( $file_handle );\n\t\t\t}\n\t\t}\n\t}", "public function actionPermissions()\n {\n FileHelper::createDirectory(Yii::getAlias('@webroot/css'));\n FileHelper::createDirectory(Yii::getAlias('@webroot/js'));\n\n foreach (['@webroot/assets', '@webroot/uploads', '@runtime'] as $path) {\n try {\n chmod(Yii::getAlias($path), 0777);\n } catch (\\Exception $e) {\n $this->stderr(\"Failed to change permissions for directory \\\"{$path}\\\": \" . $e->getMessage());\n $this->stdout(PHP_EOL);\n }\n }\n }", "function getExportDirectory() {\n\n $upload_dir = wp_upload_dir();\n\n $path = $upload_dir['basedir'] . '/form_entry_exports';\n\n // Create the backups directory if it doesn't exist\n if ( is_writable( dirname( $path ) ) && ! is_dir( $path ) )\n mkdir( $path, 0755 );\n\n // Secure the directory with a .htaccess file\n $htaccess = $path . '/.htaccess';\n\n $contents[]\t= '# ' . sprintf( 'This %s file ensures that other people cannot download your export files' , '.htaccess' );\n $contents[] = '';\n $contents[] = '<IfModule mod_rewrite.c>';\n $contents[] = 'RewriteEngine On';\n $contents[] = 'RewriteCond %{QUERY_STRING} !key=334}gtrte';\n $contents[] = 'RewriteRule (.*) - [F]';\n $contents[] = '</IfModule>';\n $contents[] = '';\n\n if ( ! file_exists( $htaccess ) && is_writable( $path ) && require_once( ABSPATH . '/wp-admin/includes/misc.php' ) )\n insert_with_markers( $htaccess, 'BackUpWordPress', $contents );\n\n return $path;\n }", "static function getrules_enable_brute_force_prevention()\r\n {\r\n global $aio_wp_security;\r\n $rules = '';\r\n if ($aio_wp_security->configs->get_value('aiowps_enable_brute_force_attack_prevention') == '1') {\r\n $cookie_name = $aio_wp_security->configs->get_value('aiowps_brute_force_secret_word');\r\n $test_cookie_name = $aio_wp_security->configs->get_value('aiowps_cookie_brute_test');\r\n $redirect_url = $aio_wp_security->configs->get_value('aiowps_cookie_based_brute_force_redirect_url');\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$enable_brute_force_attack_prevention_marker_start . PHP_EOL; //Add feature marker start\r\n $rules .= 'RewriteEngine On' . PHP_EOL;\r\n $rules .= 'RewriteCond %{REQUEST_URI} (wp-admin|wp-login)' . PHP_EOL;// If URI contains wp-admin or wp-login\r\n if ($aio_wp_security->configs->get_value('aiowps_brute_force_attack_prevention_ajax_exception') == '1') {\r\n $rules .= 'RewriteCond %{REQUEST_URI} !(wp-admin/admin-ajax.php)' . PHP_EOL; // To allow ajax requests through\r\n }\r\n if ($aio_wp_security->configs->get_value('aiowps_brute_force_attack_prevention_pw_protected_exception') == '1') {\r\n $rules .= 'RewriteCond %{QUERY_STRING} !(action\\=postpass)' . PHP_EOL; // Possible workaround for people usign the password protected page/post feature\r\n }\r\n $rules .= 'RewriteCond %{HTTP_COOKIE} !' . $cookie_name . '= [NC]' . PHP_EOL;\r\n $rules .= 'RewriteCond %{HTTP_COOKIE} !' . $test_cookie_name . '= [NC]' . PHP_EOL;\r\n $rules .= 'RewriteRule .* ' . $redirect_url . ' [L]' . PHP_EOL;\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$enable_brute_force_attack_prevention_marker_end . PHP_EOL; //Add feature marker end\r\n }\r\n\r\n return $rules;\r\n }", "function is_writable($orgdest)\n {\n if ($orgdest{0} == '/')\n {\n if (count($orgdest) == 1)\n $testdest = $orgdest;\n else\n $testdest= substr($orgdest, 0, strpos($orgdest, '/', 1));\n }\n else\n {\n if ($orgdest{strlen($orgdest)-1} != '/' && !is_file($orgdest))\n $orgdest .= '/';\n\n $testdest = $orgdest;\n\n if (!is_dir($orgdest))\n {\n $orgdestArray = explode('/', $orgdest);\n\n $testdest = $orgdestArray[0].'/';\n }\n }\n\n atkdebug(\"Checking with: \".$testdest);\n\n return is_writable($testdest);\n }\n\n /**\n * This function creates recursively a destination. This fuction accepts\n * a full path ../dir/subdir/subdir2/subdir3 etc. It checks if the path is writeable\n * and replace mis typed slashes with forward slashes.\n *\n * @static\n * @param string $dir the fullpath\n * @param octal $privileges octal number for the rights of the written\n * @param bool $recursive \n * @return bool returns true if the destination is written.\n */\n function mkdirRecursive($dir, $privileges=0777, $recursive=true)\n {\n $dir = preg_replace('/(\\/){2,}|(\\\\\\){1,}/','/',$dir); //only forward-slash\n\n if (!atkFileUtils::is_writable($dir))\n {\n atkdebug(\"Error no write permission!\");\n return false;\n }\n\n atkdebug(\"Permission granted to write.\");\n\n if( is_null($dir) || $dir === \"\" ){\n return FALSE;\n }\n if( is_dir($dir) || $dir === \"/\" ){\n return TRUE;\n }\n if( atkFileUtils::mkdirRecursive(dirname($dir), $privileges, $recursive) ){\n return mkdir($dir, $privileges);\n }\n return FALSE;\n }\n\n /**\n * This function parse a templatestring with the data and returns\n * a string with the data parsed in the template.\n *\n * @static\n * @param string $template the template to parse\n * @param array $data array which contains the data for the template\n * @return string returns the parsed string\n */\n function parseDirectoryName($template, $data)\n {\n atkimport(\"atk.utils.atkstringparser\");\n $stringparser = new atkStringParser($template);\n return $stringparser->parse($data);\n }\n\n\n /**\n * Returns mimetype for the given filename, based on fileextension.\n * This function is different from mime_content_type because it\n * does not access the file but just looks at the fileextension and\n * returns the right mimetype.\n *\n * @static\n * @param string $filename Filename (or just the extention) we want\n * to know the mime type for.\n * @return string The mimetype for this file extension.\n */\n function atkGetMimeTypeFromFileExtension($filename)\n {\n $ext = strtolower(end(explode('.',$filename )));\n\n $mimetypes = array(\n 'ai' =>'application/postscript',\n 'aif' =>'audio/x-aiff',\n 'aifc' =>'audio/x-aiff',\n 'aiff' =>'audio/x-aiff',\n 'asc' =>'text/plain',\n 'atom' =>'application/atom+xml',\n 'avi' =>'video/x-msvideo',\n 'bcpio' =>'application/x-bcpio',\n 'bmp' =>'image/bmp',\n 'cdf' =>'application/x-netcdf',\n 'cgm' =>'image/cgm',\n 'cpio' =>'application/x-cpio',\n 'cpt' =>'application/mac-compactpro',\n 'crl' =>'application/x-pkcs7-crl',\n 'crt' =>'application/x-x509-ca-cert',\n 'csh' =>'application/x-csh',\n 'css' =>'text/css',\n 'dcr' =>'application/x-director',\n 'dir' =>'application/x-director',\n 'djv' =>'image/vnd.djvu',\n 'djvu' =>'image/vnd.djvu',\n 'doc' =>'application/msword',\n 'dtd' =>'application/xml-dtd',\n 'dvi' =>'application/x-dvi',\n 'dxr' =>'application/x-director',\n 'eps' =>'application/postscript',\n 'etx' =>'text/x-setext',\n 'ez' =>'application/andrew-inset',\n 'gif' =>'image/gif',\n 'gram' =>'application/srgs',\n 'grxml' =>'application/srgs+xml',\n 'gtar' =>'application/x-gtar',\n 'hdf' =>'application/x-hdf',\n 'hqx' =>'application/mac-binhex40',\n 'html' =>'text/html',\n 'html' =>'text/html',\n 'ice' =>'x-conference/x-cooltalk',\n 'ico' =>'image/x-icon',\n 'ics' =>'text/calendar',\n 'ief' =>'image/ief',\n 'ifb' =>'text/calendar',\n 'iges' =>'model/iges',\n 'igs' =>'model/iges',\n 'jpe' =>'image/jpeg',\n 'jpeg' =>'image/jpeg',\n 'jpg' =>'image/jpeg',\n 'js' =>'application/x-javascript',\n 'kar' =>'audio/midi',\n 'latex' =>'application/x-latex',\n 'm3u' =>'audio/x-mpegurl',\n 'man' =>'application/x-troff-man',\n 'mathml' =>'application/mathml+xml',\n 'me' =>'application/x-troff-me',\n 'mesh' =>'model/mesh',\n 'mid' =>'audio/midi',\n 'midi' =>'audio/midi',\n 'mif' =>'application/vnd.mif',\n 'mov' =>'video/quicktime',\n 'movie' =>'video/x-sgi-movie',\n 'mp2' =>'audio/mpeg',\n 'mp3' =>'audio/mpeg',\n 'mpe' =>'video/mpeg',\n 'mpeg' =>'video/mpeg',\n 'mpg' =>'video/mpeg',\n 'mpga' =>'audio/mpeg',\n 'ms' =>'application/x-troff-ms',\n 'msh' =>'model/mesh',\n 'mxu m4u' =>'video/vnd.mpegurl',\n 'nc' =>'application/x-netcdf',\n 'oda' =>'application/oda',\n 'ogg' =>'application/ogg',\n 'pbm' =>'image/x-portable-bitmap',\n 'pdb' =>'chemical/x-pdb',\n 'pdf' =>'application/pdf',\n 'pgm' =>'image/x-portable-graymap',\n 'pgn' =>'application/x-chess-pgn',\n 'php' =>'application/x-httpd-php',\n 'php4' =>'application/x-httpd-php',\n 'php3' =>'application/x-httpd-php',\n 'phtml' =>'application/x-httpd-php',\n 'phps' =>'application/x-httpd-php-source',\n 'png' =>'image/png',\n 'pnm' =>'image/x-portable-anymap',\n 'ppm' =>'image/x-portable-pixmap',\n 'ppt' =>'application/vnd.ms-powerpoint',\n 'ps' =>'application/postscript',\n 'qt' =>'video/quicktime',\n 'ra' =>'audio/x-pn-realaudio',\n 'ram' =>'audio/x-pn-realaudio',\n 'ras' =>'image/x-cmu-raster',\n 'rdf' =>'application/rdf+xml',\n 'rgb' =>'image/x-rgb',\n 'rm' =>'application/vnd.rn-realmedia',\n 'roff' =>'application/x-troff',\n 'rtf' =>'text/rtf',\n 'rtx' =>'text/richtext',\n 'sgm' =>'text/sgml',\n 'sgml' =>'text/sgml',\n 'sh' =>'application/x-sh',\n 'shar' =>'application/x-shar',\n 'shtml' =>'text/html',\n 'silo' =>'model/mesh',\n 'sit' =>'application/x-stuffit',\n 'skd' =>'application/x-koan',\n 'skm' =>'application/x-koan',\n 'skp' =>'application/x-koan',\n 'skt' =>'application/x-koan',\n 'smi' =>'application/smil',\n 'smil' =>'application/smil',\n 'snd' =>'audio/basic',\n 'spl' =>'application/x-futuresplash',\n 'src' =>'application/x-wais-source',\n 'sv4cpio' =>'application/x-sv4cpio',\n 'sv4crc' =>'application/x-sv4crc',\n 'svg' =>'image/svg+xml',\n 'swf' =>'application/x-shockwave-flash',\n 't' =>'application/x-troff',\n 'tar' =>'application/x-tar',\n 'tcl' =>'application/x-tcl',\n 'tex' =>'application/x-tex',\n 'texi' =>'application/x-texinfo',\n 'texinfo' =>'application/x-texinfo',\n 'tgz' =>'application/x-tar',\n 'tif' =>'image/tiff',\n 'tiff' =>'image/tiff',\n 'tr' =>'application/x-troff',\n 'tsv' =>'text/tab-separated-values',\n 'txt' =>'text/plain',\n 'ustar' =>'application/x-ustar',\n 'vcd' =>'application/x-cdlink',\n 'vrml' =>'model/vrml',\n 'vxml' =>'application/voicexml+xml',\n 'wav' =>'audio/x-wav',\n 'wbmp' =>'image/vnd.wap.wbmp',\n 'wbxml' =>'application/vnd.wap.wbxml',\n 'wml' =>'text/vnd.wap.wml',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmls' =>'text/vnd.wap.wmlscript',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wrl' =>'model/vrml',\n 'xbm' =>'image/x-xbitmap',\n 'xht' =>'application/xhtml+xml',\n 'xhtml' =>'application/xhtml+xml',\n 'xls' =>'application/vnd.ms-excel',\n 'xml xsl' =>'application/xml',\n 'xpm' =>'image/x-xpixmap',\n 'xslt' =>'application/xslt+xml',\n 'xul' =>'application/vnd.mozilla.xul+xml',\n 'xwd' =>'image/x-xwindowdump',\n 'xyz' =>'chemical/x-xyz',\n 'zip' =>'application/zip'\n );\n\n $ext = trim(strtolower($ext));\n if (array_key_exists($ext,$mimetypes))\n {\n atkdebug(\"Filetype for $filename is {$mimetypes[$ext]}\");\n return $mimetypes[$ext];\n }\n else\n {\n atkdebug(\"Filetype for $filename could not be found. Returning application/octet-stream.\");\n return \"application/octet-stream\";\n }\n }\n\n /**\n * Get the Mimetype for a file the proper way.\n *\n * @link http://en.wikipedia.org/wiki/MIME_type\n *\n * @param string $file_path Path to the file\n * @return string Mimetype\n */\n public static function getFileMimetype($file_path)\n {\n // First try with fileinfo functions\n if (function_exists('finfo_open'))\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $file_path);\n finfo_close($finfo);\n }\n elseif (function_exists('mime_content_type'))\n {\n $type = mime_content_type($file);\n }\n else\n {\n // Unable to get the file mimetype!\n $type = '';\n }\n return $type;\n }\n\n /**\n * Delete complete directory and all of its contents.\n *\n * @todo If one of the subdirs/files cannot be removed, you end up with\n * a half deleted directory structure.\n * @param string $dir The directory to remove\n * @return True if succesful, false if not\n */\n function rmdirRecursive( $dir )\n {\n if ( !is_writable( $dir ) )\n {\n if ( !@chmod( $dir, 0777 ) )\n {\n return FALSE;\n }\n }\n\n $d = dir( $dir );\n while ( FALSE !== ( $entry = $d->read() ) )\n {\n if ( $entry == '.' || $entry == '..' )\n {\n continue;\n }\n $entry = $dir . '/' . $entry;\n if ( is_dir( $entry ) )\n {\n if ( !atkFileUtils::rmdirRecursive( $entry ) )\n {\n return FALSE;\n }\n continue;\n }\n if ( !@unlink( $entry ) )\n {\n $d->close();\n return FALSE;\n }\n }\n\n $d->close();\n\n rmdir( $dir );\n\n return TRUE;\n }\n}", "public function write_file() {\r\n\r\n\t\t$css = av5_styles( false );\r\n\r\n\t\t// If the folder doesn't exist, create it.\r\n\t\tif ( ! file_exists( $this->get_path( 'folder' ) ) ) {\r\n\t\t\twp_mkdir_p( $this->get_path( 'folder' ) );\r\n\t\t}\r\n\r\n\t\t$filesystem\t = $this->get_filesystem();\r\n\t\t$write_file\t = (bool) $filesystem->put_contents( $this->get_path( 'file' ), $css );\r\n\t\tif ( $write_file ) {\r\n\t\t\t$this->updated_file();\r\n\t\t}\r\n\t\treturn $write_file;\r\n\t}", "private function createAuthFile()\r\n {\r\n $directory = $this->filesystem->getDirectoryWrite(DirectoryList::COMPOSER_HOME);\r\n\r\n if (!$directory->isExist(PackagesAuth::PATH_TO_AUTH_FILE)) {\r\n try {\r\n $directory->writeFile(PackagesAuth::PATH_TO_AUTH_FILE, '{}');\r\n } catch (Exception $e) {\r\n throw new LocalizedException(__(\r\n 'Error in writing Auth file %1. Please check permissions for writing.',\r\n $directory->getAbsolutePath(PackagesAuth::PATH_TO_AUTH_FILE)\r\n ));\r\n }\r\n }\r\n }", "public static function protect($dir)\n\t{\n\t\treturn self::protectB($dir, self::protectRule());\n\t}", "protected function createCacheFile()\n {\n $this->createCacheDir();\n\n $cacheFilePath = $this->getCacheFile();\n\n if ( ! file_exists($cacheFilePath)) {\n touch($cacheFilePath);\n }\n }", "function logonscreener_destination_prepare() {\n if (is_file(LOGONSCREENER_DESTINATION_PATH)) {\n chmod(LOGONSCREENER_DESTINATION_PATH, 0777);\n }\n else {\n $directory = dirname(LOGONSCREENER_DESTINATION_PATH);\n\n if (!is_dir($directory)) {\n mkdir($directory, 0, TRUE);\n }\n }\n}", "public static function generate_index_file($folder) {\n\n $filename = public_path().\"/\".$folder.\"/index.php\"; \n\n if(!file_exists($filename)) {\n\n $index_file = fopen($filename,'w');\n\n $sitename = Setting::get(\"site_name\");\n\n fwrite($index_file, '<?php echo \"You Are trying to access wrong path!!!!--|E\"; ?>'); \n\n fclose($index_file);\n }\n \n }", "public function savePasswdFile($htpasswd = null)\n {\n if (is_null($htpasswd)) {\n $htpasswd = $this->htpasswdFile;\n }\n $handle = fopen($this->htpasswdFile, \"w\");\n if ($handle) {\n foreach ($this->users as $name => $passwd) {\n if (!empty($name) && !empty($passwd)) {\n fwrite($handle, \"{$name}:{$passwd}\\n\");\n }\n }\n fclose($handle);\n }\n }", "private function writeFile($path, $content)\n {\n $fp = fopen($path, 'wb');\n fwrite($fp, $content);\n fclose($fp);\n \\chmod($path, 0755);\n }", "function write($filename)\n\t{\n\t\t// open, but do not truncate leaving data in place for others\n\t\t$fp = fopen($this->folder . $filename . '.html', 'c'); \n\t\tif ($fp === false) \n\t\t{\n error_log(\"Couldn't open \" . $filename . ' cache for updating!');\n }\n\t\t// exclusive lock, but don't block it so others can still read\n\t\tflock($fp, LOCK_EX | LOCK_NB); \n // truncate it now we've got our exclusive lock\n\t\tftruncate($fp, 0);\n\t\tfwrite($fp, ob_get_contents());\n\t\tflock($fp, LOCK_UN); // release lock\n\t\tfclose($fp);\n\t\t// finally send browser output\n\t\tob_end_flush();\n\t}", "function createDir($dirName,$permit = 0777) \n\t{\n\t//\t$dirName .= \"/\";\n\t//\techo $dirName.\" \\n\";\n\t if(!is_dir($dirName)) { \n\t\t\tif(!mkdir($dirName,$permit)) \n\t\t\t\treturn false; \n\t\t} else if(!@chmod($dirName,0777)) { \n\t\t\treturn false;\n\t\t}\t\n\t return true;\n\t}", "public function checkHtaccess(){\n\t\t$this->htaccess = false;\n\t\tif(realpath(dirname(__DIR__ . \"/../core.php\")) == realpath($_SERVER['DOCUMENT_ROOT']) && is_file(__DIR__ . \"/../.htaccess\")){\n\t\t\t$this->htaccess = true;\n\t\t}\n\t}", "public function checkApache()\n {\n if ($this->disableApacheChecks) {\n return;\n }\n if ($this->isApache && !is_readable($this->config->getPath('web') . '/.htaccess')) {\n throw new BootException(\n 'The file <code>' . htmlspecialchars($this->config->getPath('web'), ENT_QUOTES) . '/.htaccess' .\n \"</code> doesn't exist. Make sure it's present and readable to the user that the \" .\n 'web server is using. ' .\n 'If you are not running Apache, or your Apache setup performs the correct rewrites without ' .\n 'requiring a .htaccess file (in other words, <strong>if you know what you are doing</strong>), ' .\n 'you can disable this check by calling <code>$config->getVerifier()->disableApacheChecks(); ' .\n 'in <code>bootstrap.php</code>'\n );\n }\n }", "protected function writeSitemapIndex()\n {\n //Generate the sitemapIndex\n $lRenderParams = array();\n $lRenderParams[\"numSitemaps\"] = $this->mNumSitemaps;\n $lRenderParams[\"serverName\"] = \"http://\" . $this->mServerName;\n $lResult = $this->getContainer()->get('templating')->render('WegeooWebsiteBundle:Default:sitemapIndex.xml.twig', $lRenderParams);\n\n //export sitemap index\n $lSitemapIndexPath = sprintf(\"%s/sitemap.xml\" , self::SITEMAP_DIRECTORY);\n $lSuccess = file_put_contents($lSitemapIndexPath , $lResult);\n if ( $lSuccess !== FALSE)\n {\n $this->mOutput->writeln(\"Sitemap 'sitemap.xml' Successfully Created\");\n }else{\n $this->mOutput->writeln(\"ERROR: Sitemapindex 'sitemap.xml' not Created\");\n }\n }", "private function makeDirectory(): void\n {\n $this->directory = $this->simulation->fileAbsolutePath('correlations/' . $this->id);\n Utils::createDirectory($this->directory);\n }", "function MakeDir()\n{\t\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$bIsDirectoryCreate = false;\n\t$bIsDirectoryCreate = mkdir($sFileUrl, 0777, true);\n\t\n\tif($bIsDirectoryCreate === true)\n\t{\n\t\techo '<correct>correct create directory</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create directory</fail>';\n\t}\n}", "public function write($dir,$file,$message)\n\t{\n\t\t## TURN OFF LOGGING 10/17\n\t\treturn TRUE;\n\t\t\n\t\t// initialize variables\n\t\t$root\t= $_SERVER['DOCUMENT_ROOT'];\n\t\t\n\t\t// make sure dir exists, if not create it\n\t\tif ( ! is_dir($root.'/logs/'.$dir))\tmkdir($root.'/logs/'.$dir, 0777, TRUE);\n\t\t\n\t\t// open handle\n\t\t$fp\t\t= fopen($root.'/logs/'.$dir.'/'.$file, 'a');\n\t\t\n\t\t// write the message, if there weas an issue, return FALSE\n\t\tif (fwrite($fp,$message) === FALSE)\n\t\t\treturn FALSE;\n\t\t\n\t\t// close pointer\n\t\tfclose($fp);\n\t\t\n\t\t// return\n\t\treturn TRUE;\n\t}", "function setFilePermission (string $path) : void {\n\n\tif (PHP_OS_FAMILY === \"Windows\") return;\n\t$iterator = null;\n\tif (!is_dir($path)) {\n\t\t$iterator = [$path];\n\t} else {\n\t\t$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));\n\t}\n\n\tforeach ($iterator as $item) {\n\t\t@chmod($item, octdec(getConfig(\"UNIX_FILE_PERMISSIONS\")));\n\t\t@chgrp($item, getConfig(\"UNIX_FILE_GROUP\"));\n\t}\n}", "function begin_cache($file) {\r\n clearstatcache();\r\n $cachename = \"cache_\" . basename($file) . \".html\";\r\n $spit = '/';\r\n if (strpos($file, '/') == false)\r\n $spit = '\\\\';\r\n $cachename_all = dirname($file) . $spit . $cachename;\r\n if (file_exists($cachename_all)) {\r\n // redirection policy\r\n redirection($cachename);\r\n }\r\n ob_start();\r\n}", "public function checkDir($path)\n {\n if (is_dir($path) and is_really_writable($path))\n {\n return $this->result(true);\n }\n elseif ( ! is_dir($path))\n {\n if ( ! @mkdir($path, 0777, true))\n {\n return $this->result(false, trans('files.mkdir_error'), $path);\n }\n else\n {\n // create a catch all html file for safety\n $uph = fopen($path . 'index.html', 'w');\n fclose($uph);\n }\n }\n elseif ( ! chmod($path, 0777))\n {\n return $this->result(false, trans('files.chmod_error'));\n }\n }", "public function canWriteFiles()\n {\n return is_writable(__FILE__);\n }", "public function testWriteCreatesIfAuthCachDirDoesNotExist()\n {\n $tempDirPath = sys_get_temp_dir() . \"/\" . uniqid();\n $tempCacheFilePath = $tempDirPath . \"/current\";\n\n try {\n $model = new AuthCacheUtil($this->_getDefaultModelTestData());\n $model->setAuthCacheDir($tempDirPath);\n\n $model->write();\n\n $this->assertFileExists($tempCacheFilePath,\n \"Cache file should existing in the newly created cache file path after writing.\");\n\n $this->assertJsonStringEqualsJsonFile($tempCacheFilePath, $model->__toString(),\n \"Cache file should serialize data to the same value as was written to disk.\");\n }\n finally {\n // delete the written cache file\n if (file_exists($tempCacheFilePath)) {\n unlink($tempCacheFilePath);\n }\n\n rmdir($tempDirPath);\n }\n }", "function N_writable($pathfile) {\r\n\t//fix windows acls bug\r\n\t$isDir = substr($pathfile,-1)=='/' ? true : false;\r\n\tif ($isDir) {\r\n\t\tif (is_dir($pathfile)) {\r\n\t\t\tmt_srand((double)microtime()*1000000);\r\n\t\t\t$pathfile = $pathfile.'pw_'.uniqid(mt_rand()).'.tmp';\r\n\t\t} elseif (@mkdir($pathfile)) {\r\n\t\t\treturn N_writable($pathfile);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t@chmod($pathfile,0777);\r\n\t$fp = @fopen($pathfile,'ab');\r\n\tif ($fp===false) return false;\r\n\tfclose($fp);\r\n\t$isDir && @unlink($pathfile);\r\n\treturn true;\r\n}", "function ahr_ajax_backup_htaccess() {\r\n \r\n // we only want to try to backup once\r\n update_option( 'ahr-htaccess-backed', true );\r\n \r\n $root_dir = get_home_path();\r\n $htaccess_filename_path = $root_dir . '.htaccess';\r\n \r\n $plugin_path = plugin_dir_path( __DIR__ );\r\n $dest_path = $plugin_path . 'htaccess-backup/' . '.htaccess';\r\n \r\n if ( file_exists( $dest_path ) ) {\r\n echo 'true';\r\n die();\r\n }\r\n \r\n if ( copy( $htaccess_filename_path, $dest_path ) ) {\r\n echo 'true';\r\n die();\r\n }\r\n \r\n echo 'false';\r\n die();\r\n \r\n}", "public function createDir($mDir, $iMode = Chmod::MODE_ALL_EXEC)\n {\n if (is_array($mDir)) {\n foreach ($mDir as $sDir) {\n $this->createDir($sDir);\n }\n } else {\n if (!is_dir($mDir)) {\n if (!@mkdir($mDir, $iMode, true)) {\n $sExceptMessage = 'Cannot create \"%s\" directory.<br /> Please verify that the directory permission is in writing mode.';\n throw new PermissionException(\n sprintf($sExceptMessage, $mDir)\n );\n }\n }\n }\n }", "function admEnforceAccess()\n{\n if( !admCheckAccess() ) {\n // no access. stop right now.\n\n // should print error message, but hey. let's just dump back to homepage\n header( \"Location: /\" ); \n exit;\n }\n}" ]
[ "0.7076291", "0.70505923", "0.68300295", "0.67646414", "0.6505575", "0.6502601", "0.63902605", "0.6330159", "0.6199596", "0.61849463", "0.60252124", "0.60046595", "0.5992671", "0.5984551", "0.5975534", "0.5958222", "0.57092726", "0.5640292", "0.5542757", "0.5501622", "0.5476567", "0.5456786", "0.5434035", "0.5426945", "0.540446", "0.532453", "0.5269416", "0.5251408", "0.5243477", "0.5153486", "0.515078", "0.51349884", "0.50558335", "0.5047693", "0.50212145", "0.50076354", "0.49680915", "0.4962849", "0.4921432", "0.488874", "0.4874859", "0.48745194", "0.48682672", "0.48682672", "0.48481634", "0.483874", "0.48374164", "0.4835142", "0.4780752", "0.47594827", "0.47557417", "0.475558", "0.47523353", "0.47523353", "0.47461098", "0.4739887", "0.47365078", "0.47116596", "0.4709158", "0.46490875", "0.46478918", "0.46441647", "0.4634812", "0.46302506", "0.4622721", "0.4621594", "0.46021137", "0.4595501", "0.45927614", "0.45901984", "0.4572997", "0.45696637", "0.45668727", "0.4553167", "0.4551568", "0.45419416", "0.4501302", "0.4473708", "0.44632995", "0.4462498", "0.4461202", "0.4457975", "0.4443622", "0.4441003", "0.44383866", "0.4413624", "0.44080392", "0.44056082", "0.44013304", "0.43972808", "0.43953282", "0.43925005", "0.4388234", "0.43867287", "0.43737677", "0.43715447", "0.43671587", "0.4364587", "0.43558615" ]
0.6063421
11
Deletes the protection of the given directory
function delLogin(){ unlink($this->fHtaccess); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remdir()\r\n {\r\n if(is_writable($_REQUEST['file']))\r\n {\r\n $dir=$_GET['file'];\r\n $this->deleteDirectory($dir); \r\n }\r\n else{echo \"Permission Denied !\";}\r\n }", "public function delete()\n {\n $filesystem = $this->localFilesystem(dirname($this->path));\n\n method_exists($filesystem, 'deleteDir')\n ? $filesystem->deleteDir(basename($this->path))\n : $filesystem->deleteDirectory(basename($this->path));\n }", "function delete() {\n global $USER;\n if($this->Dir !== 0 && $this->mayI(DELETE)) {\n $this->loadStructure();\n foreach($this->files as $file) {\n $file->delete();\n }\n foreach($this->folders as $folder) {\n $folder->delete();\n }\n rmdir($this->path);\n parent::delete();\n }\n }", "abstract function delete_dir($filepath);", "public function delete()\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = $this->scan();\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$file->delete();\n\t\t}\n\t\t\n\t\t// Allow filesystem transactions\n\t\tif (fFilesystem::isInsideTransaction()) {\n\t\t\treturn fFilesystem::delete($this);\n\t\t}\n\t\t\n\t\trmdir($this->directory);\n\t\t\n\t\t$exception = new fProgrammerException(\n\t\t\t'The action requested can not be performed because the directory has been deleted'\n\t\t);\n\t\tfFilesystem::updateExceptionMap($this->directory, $exception);\n\t}", "public function deleteDir($dirname)\n {\n }", "public static function deleteDirectory ($path) {\n\t\t\\rmdir($path);\n\t}", "public function on_delete() {\n $this->remove_dir();\n }", "function delLogin(){\r\n\t\tunlink($this->fHtaccess);\r\n\t}", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "function delcache($dir = \"site/cache/cart/\") {\r\n if (is_dir($dir)) {\r\n if ($handle = opendir($dir)) {\r\n while (false !== ($file = readdir($handle))) {\r\n if (strlen($file) > 4 && file_exists($dir . '/' . $file)) {\r\n chmod($dir . '/' . $file, 0777);\r\n @unlink($dir . '/' . $file);\r\n }\r\n }\r\n }\r\n }\r\n }", "function delFolder($dir) {\n\t\tforeach (scandir($dir) as $item) {\n\t\t\tif ($item == '.' || $item == '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n \t\t\tunlink($dir.DIRECTORY_SEPARATOR.$item);\n\n\t\t\t}\n\t\tLogger(\"INFO\", \"Removed directory $dir\");\n\t\trmdir($dir);\n\t}", "function delete_dir($dir) {\n foreach (array_keys(scan_dir($dir)) as $file) {\n if (is_dir($file)) {\n delete_dir($file);\n } else {\n rm($file);\n }\n }\n\n rmdir($dir);\n}", "protected function deleteDirector($directory) {\n $this->log(\"Starting to clean-up directory: \".$directory);\n $directoryEntries = array_diff(scandir($directory), array('.', '..', '.gitkeep'));\n if (empty($directoryEntries)) {\n $this->log(\"No files found in: \".$directory);\n }\n foreach ($directoryEntries as $directoryEntry) {\n $this->deleteFile($directory.$directoryEntry);\n }\n\n }", "function wpdev_rm_dir($dir) {\r\n\r\n if (DIRECTORY_SEPARATOR == '/')\r\n $dir=str_replace('\\\\','/',$dir);\r\n else\r\n $dir=str_replace('/','\\\\',$dir);\r\n\r\n $files = glob( $dir . '*', GLOB_MARK );\r\n debuge($files);\r\n foreach( $files as $file ){\r\n if( is_dir( $file ) )\r\n $this->wpdev_rm_dir( $file );\r\n else\r\n unlink( $file );\r\n }\r\n rmdir( $dir );\r\n }", "function deleteFolder();", "public function destroyFolder()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'];\n if (!file_exists($file)) die('File not found '.$file);\n if (!is_dir($file)) die('Not a folder '.$file);\n $h=opendir($file);\n while($f=readdir($h)) {\n if ($f!='.' && $f!='..') die('Folder is not empty');\n }\n closedir($h);\n rmdir($file);\n }", "private function _do_delete() {\n\t\tif (g($_POST, 'delete')) {\n\t\t\tif (g($this->conf, 'disable.delete')) die('Forbidden');\n\t\t\t\n $path = g($this->conf, 'path');\n if (g($_POST, 'path'))\n $path = \\Crypt::decrypt(g($_POST, 'path'));\n \n $this->_validPath($path);\n \n\t\t\t$parent = dirname($path);\n\t\t\t\n\t\t\tif ($path == g($this->conf, 'type')) {\n\t\t\t\t$this->_msg('Cannot delete root folder', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ($this->_delete($this->_path($path))) {\n\t\t\t\t$this->_msg('Success delete ['.$path.']');\n\t\t\t\theader('location:'.$this->_url(['path' => $parent]));\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->_msg('Failed delete ['.$path.'] : please call your administator', 'error');\n\t\t\t}\n\t\t}\n\t}", "function deletedirectory($path)\n{\n $files = glob($path . '*', GLOB_MARK);\n foreach ($files as $file)\n {\n unlink($file);\n }\n rmdir($path);\n}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "function delete_dir( $dir ) {\n\t\t$file_array = sb_folder_listing( $dir . '/', array( '.txt', '.gz' ) );\n\t\tif ( count( $file_array ) == 0 ) {\n\t\t\t// Directory is empty, delete it...\n\t\t\tsb_delete_directory( $dir );\n\t\t} else {\n\t\t\tfor ( $i = 0; $i < count( $file_array ); $i++ ) {\n\t\t\t\tsb_delete_file( $dir . '/' . $file_array[$i] );\n\t\t\t}\n\t\t\tsb_delete_directory( $dir );\n\t\t}\n\t}", "public function deleteDirectory(DirectoryInterface $directory): bool;", "static function deleteDir($dir) {\n if (file_exists($dir)) {\n $iterator = new RecursiveDirectoryIterator($dir);\n foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {\n if ($file->isDir()) {\n rmdir($file->getPathname());\n } else {\n unlink($file->getPathname());\n }\n }\n rmdir($dir);\n }\n }", "public function delete(): void\n {\n unlink($this->path);\n }", "public function delete_with_dir() {\n if(!empty($this->username && $this->id)) {\n if($this->delete()) {\n $target = SITE_PATH . DS . 'admin' . DS . $this->image_path . DS . $this->username;\n if(is_dir($target)){\n $this->delete_files_in_dir($target);\n return rmdir($target) ? true : false;\n echo \"yes\";\n }\n }else{\n return true;\n }\n }else{\n return false;\n }\n }", "function deleteDir($dirPath) {\r\n if (is_dir($dirPath)) {\r\n if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {\r\n $dirPath .= '/';\r\n }\r\n $files = glob($dirPath . '*', GLOB_MARK);\r\n foreach ($files as $file) {\r\n if (is_dir($file)) {\r\n self::deleteDir($file);\r\n } else {\r\n unlink($file);\r\n #echo \"unlink($file)<br />\";\r\n }\r\n }\r\n rmdir($dirPath);\r\n //echo \"rmdir($dirPath)<br />\";\r\n }else{\r\n #throw new InvalidArgumentException('$dirPath must be a directory');\r\n }\r\n }", "public function destroyAll($dir){\n\t\t$tmpDir = opendir($dir);\n\t\twhile(false!==($file=readdir($tmpDir))){\n\t\t\tif($file!=\".\" && $file!=\"..\"){\n\t\t\t\tchmod($dir.$file, 0777);\n\t\t\t\tunlink($dir.$file) or die(\"Failed removing temporary file\");\n\t\t\t}\n\t\t}\n\t\tclosedir($tmpDir);\n\t\trmdir($dir);\n\t}", "function safe_delete_dir($dir, $base_dir) {\n if (strpos($dir, $base_dir) === 0) {\n return delete_dir($dir);\n }\n return false;\n }", "function delete_dir($path)\n{\n $file_scan = scandir($path);\n foreach ($file_scan as $filecheck)\n {\n $file_extension = pathinfo($filecheck, PATHINFO_EXTENSION);\n if ($filecheck != '.' && $filecheck != '..')\n {\n if ($file_extension == '')\n {\n delete_dir($path . $filecheck . '/');\n }\n else\n {\n unlink($path . $filecheck);\n }\n }\n }\n rmdir($path);\n}", "function delFile($path)\n {\n unlink($this->dir . DIRECTORY_SEPARATOR . $path);\n }", "final public static function clearDir($directorio){\n\t\tif (!is_dir($directorio)) {\n\t\t\treturn new \\RuntimeException('El direcotrio especificado no es un directorio.');\n\t\t}\n\t\tif (!is_link($directorio)) {\n\t\t\tforeach (glob($directorio . '*') as $files) {\n\t\t\t\tif (file_exists($files)) {\n\t\t\t\t\tunlink($files);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function clean()\n {\n if ( is_dir( $this->_strDirectory ) ) {\n $h = opendir($this->_strDirectory);\n while ($h && $f = readdir($h)) { \n if ( $f != '.' && $f != '..') {\n $fn = $this->_strDirectory . '/' . $f;\n if ( is_dir($fn) ) {\n $dir = new Sys_Dir($fn);\n $dir->delete();\n } else {\n $file = new Sys_File( $fn );\n $file->delete();\n }\n }\n }\n\t if ( $h ) { closedir( $h ); }\n \n }\n }", "function deleteFolder($user_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'.$user_dir; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "private function _deleteSubdirectory($dir)\n {\n unset($this->_subdirectories[$dir]);\n $this->_prune();\n }", "function rrmdir($path)\n{\n exec(\"rm -rf {$path}\");\n}", "public function deleteFilePerm(){\r\n\t\t$storage_name = $this->uri->segment(3);\r\n\r\n\t\t//Check if the file exists\r\n\t\tif(!$this->DataModel->fileExists($storage_name) == TRUE){\r\n\t\t\t//File doesn't exist\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Check if the user has permission to delete the file\r\n\t\tif(!$this->DataModel->userPermission('edit', $storage_name, $this->authentication->uid)){\r\n\t\t\t//User doesn't has permission to edit / delete this file\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Get information of file\r\n\t\t$file = $this->DataModel->fileInformation($storage_name);\r\n\t\t//Make sure that that file is already trashed\r\n\t\tif($file['trash'] == 1){\r\n\t\t\t//Permanently delete the file\r\n\t\t\t$files = array ();\r\n\t\t\t$files[] = $file;\r\n\t\t\t$this->deleteFilesPermanently($files);\r\n\r\n\t\t}\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "function delete_directory($dir) { \r\n \t \r\n\t if(is_dir($dir)) { $current_dir = opendir($dir); } else { return false; }\r\n \t \r\n \t while($entryname = readdir($current_dir)) { \r\n\t\t if(is_dir(\"$dir/$entryname\") and ($entryname != \".\" and $entryname!=\"..\")) { \r\n\t\t\t\tdelete_directory(\"${dir}/${entryname}\"); \r\n\t\t } elseif ($entryname != \".\" and $entryname!=\"..\") { \r\n\t\t\t\tunlink(\"${dir}/${entryname}\"); \r\n\t\t } \r\n \t } \r\n \t \r\n \t closedir($current_dir); \r\n \t @rmdir(${dir});\r\n\t \r\n\t return true; \r\n }", "function del_dir($dir)\n{\n\tif(is_dir($dir))\n\t{\n\t\t$dh = opendir($dir);\n\n\t\twhile ($file = readdir($dh)) {\n\t\t\t# code...\n\t\t\tif($file != \".\" && $file != \"..\")\n\t\t\t{\n\t\t\t\t$full_path = $dir.\"/\".$file;\n\n\t\t\t\tif (is_dir($full_path)) {\n\t\t\t\t\t# code...\n\t\t\t\t\tdel_dir($full_path);\n\t\t\t\t} else {\n\t\t\t\t\t# code...\n\t\t\t\t\tunlink($full_path);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tclosedir($dh);\n\n\t\t//delete current dir\n\t\tif(is_dir($dir))\n\t\t\trmdir($dir);\n\t}\n\n}", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object); \n } \n } \n reset($objects);\n rmdir($dir); \n } \n }", "function eliminarDirectorio($directorio){\n foreach(glob($directorio . \"/*\") as $archivos_carpeta){\n if (is_dir($archivos_carpeta)){\n eliminarDirectorio($archivos_carpeta);\n }\n else{\n unlink($archivos_carpeta);\n }\n }\n rmdir($directorio);\n}", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rmdir($dir.\"/\".$object); else \\\nunlink($dir.\"/\".$object); \n } \n } \n reset($objects); \n rmdir($dir); \n } \n}", "function cleandir($dir)\n{\n\t$dir = preg_replace('!/*$!', '', $dir);\n\n\tif (!@is_dir($dir)) {\n\t\techo 'Couldn\\'t delete \"'. $dir .'\", directory does not exist<br />';\n\t\treturn;\n\t}\n\n\t$dirs = array(realpath($dir));\n\n\twhile (list(,$v) = each($dirs)) {\n\t\tif (!($files = glob($v .'/*', GLOB_NOSORT))) {\n\t\t\tcontinue;\n\t\t}\n\t\tforeach ($files as $file) {\n\t\t\tif (strpos($file, 'GLOBALS.php') !== false || strpos($file, 'oldfrm_upgrade.php') !== false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\n\t\t\tif (is_dir($file) && !is_link($file)) {\n\t\t\t\t$dirs[] = $file;\n\t\t\t} else if (!unlink($file)) {\n\t\t\t\techo '<b>Could not delete file \"'. $file .'\"<br />';\n\t\t\t}\n\t\t}\n\t}\n\n\tforeach (array_reverse($dirs) as $dir) {\n\t\tif (!rmdir($dir)) {\n\t\t\techo '<b>Could not delete directory \"'. $dir .'\"<br />';\n\t\t}\n\t}\n}", "function removeDir($directory){\n foreach(glob(\"{$directory}/*\") as $file){\n if(is_dir($file)) { \n removeDir($file);\n } else {\n unlink($file);\n }\n }\n rmdir($directory);\n }", "public function deleteDirPhoto() {\n if(is_file($this->getLinkplan())){\n unlink($this->getLinkplan());\n }\n return (rmdir($this->dirPhoto));\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "function rrmdir($dir)\n {\n if (is_dir($dir)) {\n $files = scandir($dir);\n foreach ($files as $file) {\n if (filetype($dir . \"/\" . $file) == \"dir\") {\n rrmdir($dir . \"/\" . $file);\n } else {\n unlink($dir . \"/\" . $file);\n }\n }\n rmdir($dir);\n }\n }", "function clearDir($dir) {\n\t\treturn cmfcDirectory::clear($dir);\n\t}", "function empty_dir($dir) {\n $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST);\n foreach ($iterator as $file) {\n if ($file->isFile()) {\n @unlink($file->__toString());\n } else {\n @rmdir($file->__toString());\n }\n }\n }", "function fud_rmdir($dir, $deleteRootToo=false)\n{\n\tif(!$dh = @opendir($dir)) {\n\t\treturn;\n\t}\n\twhile (false !== ($obj = readdir($dh))) {\n\t\tif($obj == '.' || $obj == '..') {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!@unlink($dir .'/'. $obj)) {\n\t\t\tfud_rmdir($dir .'/'. $obj, true);\n\t\t}\n\t}\n\tclosedir($dh);\n\tif ($deleteRootToo) {\n\t\t@rmdir($dir);\n\t}\n\treturn;\n}", "private function rrmdir($dir) { \r\n\t foreach(glob($dir . '/*') as $file) { \r\n\t if(is_dir($file)) rrmdir($file); else unlink($file); \r\n\t } \r\n\t rmdir($dir); \r\n\t}", "protected function clean()\n {\n /** @var Directory $directory */\n $directory = WPStaging::getInstance()->get(Directory::class);\n (new Filesystem())->delete($directory->getCacheDirectory());\n (new Filesystem())->mkdir($directory->getCacheDirectory(), true);\n }", "function gttn_tpps_rmdir($dir) {\n if (is_dir($dir)) {\n $children = scandir($dir);\n foreach ($children as $child) {\n if ($child != '.' and $child != '..') {\n if (is_dir($dir . '/' . $child) and !is_link($dir . '/' . $child)) {\n gttn_tpps_rmdir($dir . '/' . $child);\n }\n else {\n unlink($dir . '/' . $child);\n }\n }\n }\n rmdir($dir);\n }\n}", "function rrmdir($dir) {\nif (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n}\n}", "private function maybe_remove_dir( $dir ) {\r\n\t\tif ( $this->filesystem->is_dir( $dir ) ) {\r\n\t\t\trocket_rrmdir( $dir, [], $this->filesystem );\r\n\t\t}\r\n\t}", "function delete_directory($dirname) {\n if (is_dir($dirname))\n $dir_handle = opendir($dirname);\nif (!$dir_handle)\n return false;\nwhile($myfile = readdir($dir_handle)) {\n if ($myfile != \".\" && $myfile != \"..\") {\n if (!is_dir($dirname.\"/\".$myfile))\n unlink($dirname.\"/\".$myfile);\n else\n delete_directory($dirname.'/'.$myfile);\n }\n}\nclosedir($dir_handle);\nrmdir($dirname);\nreturn true;\n}", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function delete_output_dir($modeloutputdir, $uniqueid);", "static function deleteFiles($pool) {\n $path = JPATH_COMPONENT.DS.\"data\".DS.$pool;\n system(\"rm -rf \".$path);\n $path = JPATH_COMPONENT.DS.\"private\".DS.$pool;\n system(\"rm -rf \".$path);\n }", "function directoryRemove($option){\n\tglobal $mainframe, $jlistConfig;\n\n $marked_dir = JArrayHelper::getValue($_REQUEST, 'del_dir', array());\n\n // is value = root dir or false value - do nothing\n if ($marked_dir == '/'.$jlistConfig['files.uploaddir'].'/' || !stristr($marked_dir, '/'.$jlistConfig['files.uploaddir'].'/')) {\n $message = $del_dir.' '.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_ROOT_ERROR');\n \t$mainframe->redirect('index.php?option='.$option.'&task=directories.edit',$message);\n } else {\n // del marked dir complete\n $res = delete_dir_and_allfiles (JPATH_SITE.$marked_dir);\n\n switch ($res) {\n case 0:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_OK');\n break;\n case -2:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_ERROR');\n break;\n default:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_ERROR_X');\n break;\n } \n\t $mainframe->redirect('index.php?option='.$option.'&task=directories.edit',$message);\n\t}\n}", "function deletePhoto($file,$dir){\n\t\n\t@unlink($dir.$file);\n}", "function scorm_delete_files($directory) {\n if (is_dir($directory)) {\n $files=scorm_scandir($directory);\n set_time_limit(0);\n foreach($files as $file) {\n if (($file != '.') && ($file != '..')) {\n if (!is_dir($directory.'/'.$file)) {\n unlink($directory.'/'.$file);\n } else {\n scorm_delete_files($directory.'/'.$file);\n }\n }\n }\n rmdir($directory);\n return true;\n }\n return false;\n}", "public function delete() {\n File::deleteDirectory( $this->base_path );\n\n return parent::delete();\n }", "function remove_dir($path) {\n\t\tif (file_exists($path) && is_dir($path))\n\t\t\trmdir($path);\n\t}", "function _removeDir($dir) {\r\n\t\tif(file_exists($dir)) {\r\n\t\t\tif($objs = glob($dir.\"/*\"))\r\n\t\t\t\tforeach($objs as $obj) {\r\n\t\t\t\t\tis_dir($obj) ? rmdir($obj) : unlink($obj);\r\n\t\t\t\t}\r\n\t\t\trmdir($dir);\r\n\t\t}\r\n\t}", "public static function delete_dir($dir) {\n if ( (is_dir( $dir )) && (ABSPATH!=$dir) ) {\n if ( substr( $dir, strlen( $dir ) - 1, 1 ) != '/' ) {\n $dir .= '/';\n }\n $files = glob( $dir . '*', GLOB_MARK );\n foreach ( $files as $file ) {\n if ( is_dir( $file ) ) {\n self::delete_dir( $file );\n } else {\n unlink( $file );\n }\n }\n rmdir($dir);\n }\n }", "function clear_directory($dir_path)\n{\n $dir = @opendir($dir_path);\n if(!$dir) return FALSE;\n\n while ($file = readdir($dir))\n if (strlen($file)>2)\n unlink(\"$dir_path/$file\");\n\n closedir($dir);\n return TRUE;\n}", "public function testDeleteDirectory()\n {\n mkdir(self::$temp.DS.'foo');\n file_put_contents(self::$temp.DS.'foo'.DS.'file.txt', 'Hello World');\n\n Storage::rmdir(self::$temp.DS.'foo');\n\n $this->assertTrue(! is_dir(self::$temp.DS.'foo'));\n $this->assertTrue(! is_file(self::$temp.DS.'foo'.DS.'file.txt'));\n }", "private function clear_directory(string $dir): void {\n $clear = apply_filters(static::CLEAR_FILTER, false);\n if (!$clear || !$dir || !file_exists($dir)) {\n return;\n }\n $files = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($dir, \\RecursiveDirectoryIterator::SKIP_DOTS),\n \\RecursiveIteratorIterator::CHILD_FIRST\n );\n foreach ($files as $fileinfo) {\n $todo = ($fileinfo->isDir() ? 'rmdir' : 'unlink');\n $todo($fileinfo->getRealPath());\n }\n }", "function ldapauth_delete()\n{\n // Delete module variables\n pnModDelVar('ldapauth', 'ldapauth_serveradr');\n pnModDelVar('ldapauth', 'ldapauth_pnldap');\n pnModDelVar('ldapauth', 'ldapauth_basedn');\n pnModDelVar('ldapauth', 'ldapauth_bindas');\n pnModDelVar('ldapauth', 'ldapauth_bindpass');\n pnModDelVar('ldapauth', 'ldapauth_searchdn');\n pnModDelVar('ldapauth', 'ldapauth_defaultgroup');\n\n\n // Deletion successful\n return true;\n}", "function rmDir($dir, $args = '')\n {\n require_once 'System.php';\n if ($args && $args[0] == '-') {\n $args = substr($args, 1);\n }\n System::rm(\"-{$args}f $dir\");\n }", "function rrmdir($dir) {\n\tif (is_dir($dir)) {\n\t $objects = scandir($dir);\n\n\t //debug($objects);\n\n\t foreach ($objects as $object) {\n\t\tif ($object != \".\" && $object != \"..\") {\n\t\t\t//echo $dir.\"/\".$object . '<br>';\n\n\t\t if (filetype($dir.\"/\".$object) == \"dir\") rmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n\t\t}\n\t }\n\t reset($objects);\n\t rmdir($dir);\n\t}\n }", "public function rmdir($dir) {\n if ($this->getActive()) {\n // Remove the directory\n if (ftp_rmdir($this->_connection, $dir)) {\n return true;\n } else {\n return false;\n }\n } else {\n throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.');\n }\n }", "function delete($path);", "function remove_client_dir(){\n\t\t$cmd=\"rm -rf $this->client_dir\";\n\t\t`$cmd`;\n\t}", "function RemoveDirectory($dir)\n{\n $f = scandir($dir);\n foreach( $f as $file )\n {\n if( is_file(\"$dir/$file\") )\n unlink(\"$dir/$file\");\n elseif( $file != '.' && $file != '..' )\n RemoveDirectory(\"$dir/$file\");\n }\n unset($f);\n \n rmdir($dir);\n}", "function deleteDirectory($dirPath) {\n if (is_dir($dirPath)) {\n $objects = scandir($dirPath);\n foreach ($objects as $object) {\n if ($object != \".\" && $object !=\"..\") {\n if (filetype($dirPath . DIRECTORY_SEPARATOR . $object) == \"dir\") {\n deleteDirectory($dirPath . DIRECTORY_SEPARATOR . $object);\n } else {\n unlink($dirPath . DIRECTORY_SEPARATOR . $object);\n }\n }\n }\n reset($objects);\n rmdir($dirPath);\n }\n}", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "function delete_dir($dir) {\n\tif (! file_exists($dir)) return true;\n\tif (! is_dir($dir)) return @unlink($dir);\n\tforeach ( scandir($dir) as $item ) {\n\t\tif ($item == '.' || $item == '..') continue;\n\t\tif (! delete_dir($dir . DIRECTORY_SEPARATOR . $item)) return false;\n\t}\n\treturn rmdir($dir);\n}", "public function deleteAll()\n {\n \\Core\\File\\System::rrmdir($this->_getPath(), false, true);\n }", "function delete_dir($dir) {\n if(!is_dir($dir)) {\n return false;\n } // if\n \n $dh = opendir($dir);\n while($file = readdir($dh)) {\n if(($file != \".\") && ($file != \"..\")) {\n $fullpath = $dir . \"/\" . $file;\n \n if(is_dir($fullpath)) {\n delete_dir($fullpath);\n } else {\n unlink($fullpath);\n } // if\n } // if\n } // while\n\n closedir($dh);\n return (boolean) rmdir($dir);\n }", "function remove_dir($dir = null) {\n if (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") remove_dir($dir.\"/\".$object);\n else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n }\n}", "public function testDeleteDirectory()\n {\n $this->createTestDirectories(\n array(\n '/artifacts/foo/12345',\n '/artifacts/foo/67890',\n )\n );\n\n $this->createTestFile( '/artifacts/foo/12345/bar.txt' );\n $this->createTestFile( '/artifacts/foo/67890/bar.txt' );\n $this->createTestFile( '/artifacts/foo/bar.txt' );\n $this->createTestFile( '/artifacts/bar.txt' );\n\n phpucFileUtil::deleteDirectory( PHPUC_TEST_DIR . '/artifacts' );\n\n $this->assertFileNotExists( PHPUC_TEST_DIR . '/artifacts' );\n }", "function rrmdir($dir) {\n if (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n }\n }", "function fm_delete_folder($dir, $groupid) {\r\n\tglobal $CFG, $USER;\r\n\t\r\n\t// if the dir being deleted is a root dir (eg. has some dir's under it)\r\n\tif ($child = get_record('fmanager_folders', 'pathid', $dir->id)) {\r\n\t\tfm_delete_folder($child, $groupid);\r\n\t} \r\n\t// Deletes all files/url links under folder\r\n\tif ($allrecs = get_records('fmanager_link', 'folder', $dir->id)) {\r\n\t\tforeach ($allrecs as $ar) {\r\n\t\t\t// a file\r\n\t\t\tif ($ar->type == TYPE_FILE || $ar->type == TYPE_ZIP) {\r\n\t\t\t\tfm_remove_file($ar, $groupid);\r\n\t\t\t} \r\n\t\t\t// removes shared aspect\r\n\t\t\tdelete_records('fmanager_shared', 'sharedlink', $ar->id);\t\t\t\t\t\r\n\t\t\t// Delete link\r\n\t\t\tdelete_records('fmanager_link', 'id', $ar->id);\r\n\t\t}\r\n\t}\r\n\r\n\t// delete shared to folder\r\n\tdelete_records('fmanager_shared', 'sharedlink', $dir->id);\t\r\n\r\n\tif ($groupid == 0) {\r\n\t\tif (!@rmdir($CFG->dataroot.\"/file_manager/users/\".$USER->id.$dir->path.$dir->name.\"/\")) {\r\n\t\t\terror(get_string('errnodeletefolder', 'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\tif (!@rmdir($CFG->dataroot.\"/file_manager/groups/\".$groupid.$dir->path.$dir->name.\"/\")) {\r\n\t\t\terror(get_string('errnodeletefolder', 'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\tdelete_records('fmanager_folders', 'id', $dir->id);\r\n\t\r\n}", "function remove_dir_rec($dirtodelete)\n{\n if ( strpos($dirtodelete,\"../\") !== false )\n die(_NONPUOI);\n if ( false !== ($objs = glob($dirtodelete . \"/*\")) )\n {\n foreach ( $objs as $obj )\n {\n is_dir($obj) ? remove_dir_rec($obj) : unlink($obj);\n }\n }\n rmdir($dirtodelete);\n}", "function emptyDir($dir)\n{\n foreach (scandir($dir) as $basename) {\n $path = $dir . '/' . $basename;\n\n if (is_file($path)) {\n unlink($path);\n }\n }\n}", "public function removeAdminCache()\n {\n $this->deleteDirectory($this->pubStatic.'adminhtml');\n $this->deleteDirectory($this->varCache);\n $this->deleteDirectory($this->varPageCache);\n $this->deleteDirectory($this->varViewPreprocessed);\n }", "function deleteFolder($folder)\r\n\t{\r\n\t\t$folder = sanitizePath($folder);\r\n\t\t$path = $this->library->getLibraryDirectory() . DIRECTORY_SEPARATOR . $folder;\r\n\t\r\n\t\tif (file_exists($path))\r\n\t\t\trmdir($path);\r\n\t\t$folder->delete();\r\n\t}", "public static function delete($directory)\n\t{\n\t\t// redfine directory\n\t\t$directory = (string) $directory;\n\n\t\t// directory exists\n\t\tif(self::exists($directory))\n\t\t{\n\t\t\t// get the list\n\t\t\t$list = self::getList($directory, true);\n\n\t\t\t// has subdirectories/files\n\t\t\tif(count($list) != 0)\n\t\t\t{\n\t\t\t\t// loop directories and execute function\n\t\t\t\tforeach((array) $list as $item)\n\t\t\t\t{\n\t\t\t\t\t// delete directory recursive\n\t\t\t\t\tif(is_dir($directory .'/'. $item)) self::delete($directory .'/'. $item);\n\n\t\t\t\t\t// delete file\n\t\t\t\t\telse SpoonFile::delete($directory .'/'. $item);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// has no content\n\t\t\t@rmdir($directory);\n\t\t}\n\n\t\t// directory doesn't exist\n\t\telse return false;\n\t}", "public static function delete_directory() {\n\n\t \t$dirname = ABSPATH . trailingslashit( get_option('upload_path') ) . 'zip_downloads';\n\t\n\t if ( is_dir( $dirname ) )\n\t \t$dir_handle = opendir( $dirname ); \n\t\n\t if ( !$dir_handle )\n\t\t\treturn false;\n\t\n\t while( $file = readdir( $dir_handle ) ) {\n\t\n\t \tif ( $file != \".\" && $file != \"..\" ) {\n\t \tif ( !is_dir( $dirname . \"/\" . $file ) ) \n\t \t\tunlink( $dirname . \"/\" . $file ); \n\t \t} \n\t } \n\t\n\t closedir( $dir_handle );\n\t rmdir( $dirname ); \n\t return true; \n \t}", "public function testDeletePermissions_deletesPermissionCorrectly() {\r\n\t\t$this->jc->putResource('/', $this->test_folder);\r\n\t\t$joeuser = $this->jc->getUsers('joeuser');\r\n\t\t$perms[] = new Permission('32', $joeuser[0], $this->test_folder->getUriString());\r\n\t\t$this->jc->updatePermissions($this->test_folder->getUriString(), $perms);\r\n\t\t$test_folder_perms = $this->jc->getPermissions($this->test_folder->getUriString());\r\n\t\t$this->assertEquals(sizeof($test_folder_perms), 1);\r\n\t\t$this->jc->deletePermission($test_folder_perms[0]);\r\n\t\t$perms_after_delete = $this->jc->getPermissions($this->test_folder->getUriString());\r\n\t\t$this->assertEquals(sizeof($perms_after_delete), 0);\r\n\t\t$this->jc->deleteResource($this->test_folder->getUriString());\r\n\t}", "function deleteDir($dir)\n{\n if (substr($dir, strlen($dir)-1, 1) != '/')\n $dir .= '/';\n if ($handle = opendir($dir))\n {\n while ($obj = readdir($handle))\n {\n if ($obj != '.' && $obj != '..')\n {\n if (is_dir($dir.$obj))\n {\n if (!deleteDir($dir.$obj))\n return false;\n }\n elseif (is_file($dir.$obj))\n {\n if (!unlink($dir.$obj))\n return false;\n }\n }\n }\n\n closedir($handle);\n\n if (!@rmdir($dir))\n return false;\n return true;\n }\n return false;\n}", "function delTree($directory)\n{\n\t$files = array_diff(scandir($directory), array('.','..'));\n \tforeach($files as $file)\n\t{\n\t\t//echo(\"$directory/$file<br />\");\n \t\t(is_dir(\"$directory/$file\")) ? delTree(\"$directory/$file\") : unlink(\"$directory/$file\"); \n \t}\n \treturn rmdir($directory);\n}", "public static function cleanDirectory($directory)\n\t{\n\t\treturn self::deleteDirectory($directory, true);\n\t}", "function delete_dir($dir) \n {\n if (!file_exists($dir))\n return true;\n\n if (!is_dir($dir))\n return unlink($dir);\n \n foreach (scandir($dir) as $item) \n {\n if ($item == '.' || $item == '..')\n continue;\n \n if (!$this->delete_dir($dir.DIRECTORY_SEPARATOR.$item))\n return false;\n }\n \n return rmdir($dir);\n }", "function delDir($dir) {\n if (!file_exists($dir)) return true;\n if (!is_dir($dir)) return unlink($dir);\n foreach (scandir($dir) as $item) {\n if ($item == '.' || $item == '..') continue;\n if (!delDir($dir . DS . $item)) return false;\n }\n return rmdir($dir);\n}", "function flushDir($dir) {\n\t$files = glob(\"$dir/*\");\n\tforeach($files as $file) {\n\t\tif (is_dir($file)) {\n\t\t\tflushDir($file);\n\t\t\trmdir($file);\n\t\t} elseif (is_file($file)) {\n\t\t\tunlink($file);\n\t\t}\n\t}\n\t\n\t$hiddenFiles = glob(\"$dir/.*\");\n\tforeach($hiddenFiles as $hiddenFile)\n\t{\n\t\tif (is_file($hiddenFile)) {\n\t\t\tunlink($hiddenFile);\n\t\t}\n\t}\n}" ]
[ "0.69099456", "0.6644087", "0.65081906", "0.6497252", "0.64353", "0.64254296", "0.6305812", "0.62407035", "0.6230317", "0.6196901", "0.6187453", "0.61615366", "0.6160682", "0.61425185", "0.60523933", "0.6038834", "0.6035531", "0.60271275", "0.60036343", "0.5985872", "0.597782", "0.59746116", "0.59319454", "0.5917104", "0.5909314", "0.5906293", "0.5890025", "0.58864236", "0.58708245", "0.58562917", "0.584579", "0.5844351", "0.5818459", "0.5812444", "0.5801843", "0.5800056", "0.57982635", "0.5779772", "0.5770325", "0.57580745", "0.57511455", "0.5747118", "0.57402", "0.57395977", "0.5735301", "0.572649", "0.57205653", "0.57196695", "0.57156545", "0.5715309", "0.5699737", "0.56991225", "0.5698943", "0.569803", "0.5687302", "0.56795144", "0.5676643", "0.56704444", "0.5669846", "0.5668694", "0.5668518", "0.56635696", "0.5654149", "0.56529003", "0.5652695", "0.5649353", "0.5646452", "0.5636921", "0.5630076", "0.5628742", "0.56266326", "0.562002", "0.56189066", "0.5617737", "0.56171227", "0.56152326", "0.5596932", "0.55914295", "0.55778086", "0.5577677", "0.55750525", "0.5574141", "0.55645263", "0.55475223", "0.5546884", "0.55457795", "0.55410904", "0.5529698", "0.5527948", "0.5525568", "0.5524759", "0.5524173", "0.5518197", "0.5514265", "0.5513389", "0.55124557", "0.55122286", "0.550915", "0.55003536" ]
0.6315722
7
File with functions used on different files function to sanitize input
function sanitize($conn, $val){ $val = stripslashes($val); $val = mysqli_real_escape_string($conn, $val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function sanitize();", "public function sanitize() {\n\n\t\t// load the tool that we want to use in the xss filtering process\n\t\t$this->loadTool();\n\n\t\tif (is_array($_GET) AND count($_GET) > 0) {\n\n\t\t\t$_GET = $this->clean_input_data($_GET);\n\t\t}\n\t\tif (is_array($_POST) AND count($_POST) > 0) {\n\n\t\t\t$_POST = $this->clean_input_data($_POST);\n\t\t}\n\t\tif (is_array($_COOKIE) AND count($_COOKIE) > 0) {\n\n\t\t\t$_COOKIE = $this->clean_input_data($_COOKIE);\n\t\t}\n\t\tif (is_array($_FILES) AND count($_FILES) > 0) {\n\n\t\t\t//$_FILES = $this->clean_input_data($_FILES, true);\n\t\t}\n\n\t}", "protected function sanitize() {}", "public function sanitize() {\n }", "public function sanitize( $input ) {\n }", "public abstract function sanitize($string);", "function tidyInputs(){\n\tglobal $nric,$firstName,$lastName,$dob,$address1,$address2,$poCode,\n$homeNum,$handphoneNum,$email,$description;\n\tglobal $faID;\n\t\n\t$nric = preg_replace('/[^a-zA-Z0-9]/','',$nric);\n\t$firstName = preg_replace('/[^a-zA-Z0-9 ]/','',$firstName);\n\t$lastName = preg_replace('/[^a-zA-Z0-9 ]/','',$lastName);\n\t$dob = preg_replace('/[^0-9-]/','',$dob);\n\t$address1 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address1);\n\t$address2 = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$address2);\n\t$poCode = preg_replace('/[^0-9]/','',$poCode);\n\t$homeNum = preg_replace('/[^0-9]/','',$homeNum);\n\t$handphoneNum = preg_replace('/[^0-9]/','',$handphoneNum);\n\t$email = preg_replace('/[^a-zA-Z0-9@._-]/','',$email);\n\t$description = preg_replace('/[^a-zA-Z0-9 -_.,#]/','',$description);\n\t\n\t$faID = preg_replace('/[^0-9]/','',$faID);\n}", "function sanitize($input, $flags, $min='', $max='')\n{\n if($flags & UTF8) $input = my_utf8_decode($input);\n if($flags & PARANOID) $input = sanitize_paranoid_string($input, $min, $max);\n if($flags & INT) $input = sanitize_int($input, $min, $max);\n if($flags & FLOAT) $input = sanitize_float($input, $min, $max);\n if($flags & HTML) $input = sanitize_html_string($input, $min, $max);\n if($flags & SQL) $input = sanitize_sql_string($input, $min, $max);\n if($flags & LDAP) $input = sanitize_ldap_string($input, $min, $max);\n if($flags & SYSTEM) $input = sanitize_system_string($input, $min, $max);\n return $input;\n}", "function sanitize_file_name($filename)\n {\n }", "public function sanitize($f, $type = 'file') {\n /* A combination of various methods to sanitize a string while retaining\n the \"essence\" of the original file name as much as possible.\n Note: unsuitable for file paths as '/' and '\\' are filtered out.\n Sources:\n http://www.house6.com/blog/?p=83\n and\n http://stackoverflow.com/a/24984010\n */\n $replace_chars = array(\n '&amp;' => '-and-', '@' => '-at-', '©' => 'c', '®' => 'r', 'À' => 'a',\n 'Á' => 'a', 'Â' => 'a', 'Ä' => 'a', 'Å' => 'a', 'Æ' => 'ae','Ç' => 'c',\n 'È' => 'e', 'É' => 'e', 'Ë' => 'e', 'Ì' => 'i', 'Í' => 'i', 'Î' => 'i',\n 'Ï' => 'i', 'Ò' => 'o', 'Ó' => 'o', 'Ô' => 'o', 'Õ' => 'o', 'Ö' => 'o',\n 'Ø' => 'o', 'Ù' => 'u', 'Ú' => 'u', 'Û' => 'u', 'Ü' => 'u', 'Ý' => 'y',\n 'ß' => 'ss','à' => 'a', 'á' => 'a', 'â' => 'a', 'ä' => 'a', 'å' => 'a',\n 'æ' => 'ae','ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e',\n 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ò' => 'o', 'ó' => 'o',\n 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u',\n 'û' => 'u', 'ü' => 'u', 'ý' => 'y', 'þ' => 'p', 'ÿ' => 'y', 'Ā' => 'a',\n 'ā' => 'a', 'Ă' => 'a', 'ă' => 'a', 'Ą' => 'a', 'ą' => 'a', 'Ć' => 'c',\n 'ć' => 'c', 'Ĉ' => 'c', 'ĉ' => 'c', 'Ċ' => 'c', 'ċ' => 'c', 'Č' => 'c',\n 'č' => 'c', 'Ď' => 'd', 'ď' => 'd', 'Đ' => 'd', 'đ' => 'd', 'Ē' => 'e',\n 'ē' => 'e', 'Ĕ' => 'e', 'ĕ' => 'e', 'Ė' => 'e', 'ė' => 'e', 'Ę' => 'e',\n 'ę' => 'e', 'Ě' => 'e', 'ě' => 'e', 'Ĝ' => 'g', 'ĝ' => 'g', 'Ğ' => 'g',\n 'ğ' => 'g', 'Ġ' => 'g', 'ġ' => 'g', 'Ģ' => 'g', 'ģ' => 'g', 'Ĥ' => 'h',\n 'ĥ' => 'h', 'Ħ' => 'h', 'ħ' => 'h', 'Ĩ' => 'i', 'ĩ' => 'i', 'Ī' => 'i',\n 'ī' => 'i', 'Ĭ' => 'i', 'ĭ' => 'i', 'Į' => 'i', 'į' => 'i', 'İ' => 'i',\n 'ı' => 'i', 'IJ' => 'ij','ij' => 'ij','Ĵ' => 'j', 'ĵ' => 'j', 'Ķ' => 'k',\n 'ķ' => 'k', 'ĸ' => 'k', 'Ĺ' => 'l', 'ĺ' => 'l', 'Ļ' => 'l', 'ļ' => 'l',\n 'Ľ' => 'l', 'ľ' => 'l', 'Ŀ' => 'l', 'ŀ' => 'l', 'Ł' => 'l', 'ł' => 'l',\n 'Ń' => 'n', 'ń' => 'n', 'Ņ' => 'n', 'ņ' => 'n', 'Ň' => 'n', 'ň' => 'n',\n 'ʼn' => 'n', 'Ŋ' => 'n', 'ŋ' => 'n', 'Ō' => 'o', 'ō' => 'o', 'Ŏ' => 'o',\n 'ŏ' => 'o', 'Ő' => 'o', 'ő' => 'o', 'Œ' => 'oe','œ' => 'oe','Ŕ' => 'r',\n 'ŕ' => 'r', 'Ŗ' => 'r', 'ŗ' => 'r', 'Ř' => 'r', 'ř' => 'r', 'Ś' => 's',\n 'ś' => 's', 'Ŝ' => 's', 'ŝ' => 's', 'Ş' => 's', 'ş' => 's', 'Š' => 's',\n 'š' => 's', 'Ţ' => 't', 'ţ' => 't', 'Ť' => 't', 'ť' => 't', 'Ŧ' => 't',\n 'ŧ' => 't', 'Ũ' => 'u', 'ũ' => 'u', 'Ū' => 'u', 'ū' => 'u', 'Ŭ' => 'u',\n 'ŭ' => 'u', 'Ů' => 'u', 'ů' => 'u', 'Ű' => 'u', 'ű' => 'u', 'Ų' => 'u',\n 'ų' => 'u', 'Ŵ' => 'w', 'ŵ' => 'w', 'Ŷ' => 'y', 'ŷ' => 'y', 'Ÿ' => 'y',\n 'Ź' => 'z', 'ź' => 'z', 'Ż' => 'z', 'ż' => 'z', 'Ž' => 'z', 'ž' => 'z',\n 'ſ' => 'z', 'Ə' => 'e', 'ƒ' => 'f', 'Ơ' => 'o', 'ơ' => 'o', 'Ư' => 'u',\n 'ư' => 'u', 'Ǎ' => 'a', 'ǎ' => 'a', 'Ǐ' => 'i', 'ǐ' => 'i', 'Ǒ' => 'o',\n 'ǒ' => 'o', 'Ǔ' => 'u', 'ǔ' => 'u', 'Ǖ' => 'u', 'ǖ' => 'u', 'Ǘ' => 'u',\n 'ǘ' => 'u', 'Ǚ' => 'u', 'ǚ' => 'u', 'Ǜ' => 'u', 'ǜ' => 'u', 'Ǻ' => 'a',\n 'ǻ' => 'a', 'Ǽ' => 'ae','ǽ' => 'ae','Ǿ' => 'o', 'ǿ' => 'o', 'ə' => 'e',\n 'Ё' => 'jo','Є' => 'e', 'І' => 'i', 'Ї' => 'i', 'А' => 'a', 'Б' => 'b',\n 'В' => 'v', 'Г' => 'g', 'Д' => 'd', 'Е' => 'e', 'Ж' => 'zh','З' => 'z',\n 'И' => 'i', 'Й' => 'j', 'К' => 'k', 'Л' => 'l', 'М' => 'm', 'Н' => 'n',\n 'О' => 'o', 'П' => 'p', 'Р' => 'r', 'С' => 's', 'Т' => 't', 'У' => 'u',\n 'Ф' => 'f', 'Х' => 'h', 'Ц' => 'c', 'Ч' => 'ch','Ш' => 'sh','Щ' => 'sch',\n 'Ъ' => '-', 'Ы' => 'y', 'Ь' => '-', 'Э' => 'je','Ю' => 'ju','Я' => 'ja',\n 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e',\n 'ж' => 'zh','з' => 'z', 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l',\n 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's',\n 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch',\n 'ш' => 'sh','щ' => 'sch','ъ' => '-','ы' => 'y', 'ь' => '-', 'э' => 'je',\n 'ю' => 'ju','я' => 'ja','ё' => 'jo','є' => 'e', 'і' => 'i', 'ї' => 'i',\n 'Ґ' => 'g', 'ґ' => 'g', 'א' => 'a', 'ב' => 'b', 'ג' => 'g', 'ד' => 'd',\n 'ה' => 'h', 'ו' => 'v', 'ז' => 'z', 'ח' => 'h', 'ט' => 't', 'י' => 'i',\n 'ך' => 'k', 'כ' => 'k', 'ל' => 'l', 'ם' => 'm', 'מ' => 'm', 'ן' => 'n',\n 'נ' => 'n', 'ס' => 's', 'ע' => 'e', 'ף' => 'p', 'פ' => 'p', 'ץ' => 'C',\n 'צ' => 'c', 'ק' => 'q', 'ר' => 'r', 'ש' => 'w', 'ת' => 't', '™' => 'tm',\n 'Ã' => 'A', 'Ð' => 'Dj', 'Ê' => 'E', 'Ñ' => 'N', 'Þ' => 'B', 'ã' => 'a',\n 'ð' => 'o', 'ñ' => 'n', '#' => '-nr-' );\n // \"Translate\" multi byte characters to 'corresponding' ASCII characters\n $f = strtr($f, $replace_chars);\n // Convert special characters to a hyphen\n $f = str_replace(array(\n ' ', '!', '\\\\', '/', '\\'', '`', '\"', '~', '%', '|',\n '*', '$', '^', '(' ,')', '[', ']', '{', '}',\n '+', ',', ':' ,';', '<', '=', '>', '?', '|'), '-', $f);\n // Remove any non ASCII characters\n $f = preg_replace('/[^(\\x20-\\x7F)]*/','', $f);\n if ($type == 'file') {\n // Remove non-word chars (leaving hyphens and periods)\n $f = preg_replace('/[^\\w\\-\\.]+/', '', $f);\n // Convert multiple adjacent dots into a single one\n $f = preg_replace('/[\\.]+/', '.', $f);\n }\n else { // Do not allow periods, for instance for a Grav slug\n // Convert period to hyphen\n $f = str_replace('.', '-', $f);\n // Remove non-word chars (leaving hyphens)\n $f = preg_replace('/[^\\w\\-]+/', '', $f);\n }\n // Convert multiple adjacent hyphens into a single one\n $f = preg_replace('/[\\-]+/', '-', $f);\n // Change into a lowercase string; BTW no need to use mb_strtolower() here ;)\n $f = strtolower($f);\n return $f;\n }", "public static function sanitize($filename) {\n\t\t$replace_chars = array(\n\t\t\t'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A',\n\t\t\t'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I',\n\t\t\t'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U',\n\t\t\t'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a',\n\t\t\t'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i',\n\t\t\t'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u',\n\t\t\t'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', 'ƒ'=>'f'\n\t\t);\n\t\t$f = strtr($filename, $replace_chars);\n\n\t\t// convert & to \"and\", @ to \"at\", and # to \"number\"\n\t\t//\n\t\t$f = preg_replace(array('/[\\&]/', '/[\\@]/', '/[\\#]/'), array('-and-', '-at-', '-number-'), $f);\n\t\t$f = preg_replace('/[^(\\x20-\\x7F)]*/','', $f); // removes any special chars we missed\n\t\t$f = str_replace(' ', '-', $f); // convert space to hyphen\n\t\t$f = str_replace('\\'', '', $f); // removes apostrophes\n\t\t$f = preg_replace('/[^\\w\\-\\.]+/', '', $f); // remove non-word chars (leaving hyphens and periods)\n\t\t$f = preg_replace('/[\\-]+/', '-', $f); // converts groups of hyphens into one\n\t\treturn strtolower($f);\n\t}", "protected function sanitize($input){ \n\t\tif ( get_magic_quotes_gpc() )\n\t\t{\n\t\t\t$input = stripslashes($input);\n\t\t}\n\n\t $search = array(\n\t\t '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n\t \t);\n\n\t\t$output = preg_replace($search, '', $input);\n\t\treturn $output;\n }", "function ATsanitize($input)\n{\n $user_input = trim($input);\n \n if (get_magic_quotesgpc())\n {\n $input = stripslashes($input);\n }\n}", "function clean_input($data) {\n $data = trim($data); // strips whitespace from beginning/end\n $data = stripslashes($data); // remove backslashes\n $data = htmlspecialchars($data); // replace special characters with HTML entities\n return $data;\n}", "function sa_sanitize_chars($filename) {\n return strtolower(preg_replace('/[^a-zA-Z0-9-_\\.]/', '', $filename));\n}", "public function it_can_be_sanitized()\n {\n $this->markTestSkipped('Sanitization is not implemented yet.');\n }", "function sanitise_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitizeName() {\n $pattern = \"/[0-9`!@#$%^&*()_+\\-=\\[\\]{};':\\\"\\\\|,.<>\\/?~]/\";\n if (!preg_match($pattern, $this->fname) && !preg_match($pattern, $this->lname)) {\n $this->fname = trim($this->fname);\n $this->lname = trim($this->lname);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function sanitize_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "private function includes()\n\t\t{\n\t\t\trequire_once dirname( __FILE__ ) . '/sf-class-sanitize.php';\n\t\t\trequire_once dirname( __FILE__ ) . '/sf-class-format-options.php';\n\t\t\tnew SF_Sanitize;\n\t\t}", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitize_input($data) { \r\n $data = trim($data); \r\n $data = stripslashes($data); \r\n $data = htmlspecialchars($data); \r\n return $data; \r\n }", "function cleanInput($data){ //sanitize data \n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "public function __sanitise() { $this->username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n $hashed_password = password_hash($password, PASSWORD_BCRYPT);\n $this->email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->usertype = filter_input(INPUT_POST, 'lib_code', FILTER_SANITIZE_SPECIAL_CHARS);\n }", "function sanitizeInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n return $data;\n}", "function sanitize($input){\n $input = strip_tags($input);\n $input = htmlspecialchars($input);\n $input = trim($input);\n return $input;\n}", "function sanitize($data)\n{\n$data = trim($data);\n \n// apply stripslashes if magic_quotes_gpc is enabled\nif(get_magic_quotes_gpc())\n{\n$data = stripslashes($data);\n}\n \n// a mySQL connection is required before using this function\n$data = mysql_real_escape_string($data);\n \nreturn $data;\n}", "function foo_7() {\n\n\tdo_something( $_POST['foo'] ); // Bad.\n\tsanitize_pc( $_POST['bar'] ); // OK.\n\tsanitize_twitter( $_POST['bar'] ); // Bad.\n\tmy_nonce_check( sanitize_twitter( $_POST['tweet'] ) ); // OK.\n}", "function MyTextSanitizer() {\n }", "function sanitize($input) {\n\t\n\t\t$input = stripslashes($input);\n\t\t$input = htmlspecialchars($input);\n\t\n\t\treturn $input;\n\t}", "function sanitize_pathname(string $pathName, string $charToReplaceWhiteSpace): string\n{\n return sanitize_filename($pathName, true, $charToReplaceWhiteSpace);\n}", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "function sanitizeFields()\n\t{\n\t\tif(isset($this->sanitize) && isset($this->data[$this->name]))\n\t\t{\n\t\t\tforeach($this->data[$this->name] as $field => $value)\n\t\t\t{\n\t\t\t\tif(isset($this->sanitize[$field]))\n\t\t\t\t{\n\t\t\t\t\tif(!is_array($this->sanitize[$field]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $this->sanitize[$field]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($this->sanitize[$field] as $action)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function sanitize($string, $force_lowercase = false, $anal = false)\n{\n $strip = ['~', '`', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '=', '+', '[', '{', ']', '}', '\\\\', '|', ';', ':', '\"', \"'\", '&#8216;', '&#8217;', '&#8220;', '&#8221;', '&#8211;', '&#8212;', '—', '–', ',', '<', '.', '>', '/', '?'];\n $clean = trim(str_replace($strip, '', strip_tags($string)));\n $clean = preg_replace('/\\s+/', '-', $clean);\n $clean = ($anal) ? preg_replace('/[^a-zA-Z0-9]/', '', $clean) : $clean;\n\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n}", "function sanitize($string, $force_lowercase = true, $anal = false, $trunc = 100) {\n\t$strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"=\", \"+\", \"{\",\n\t\t\t\t \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"&#8216;\", \"&#8217;\", \"&#8220;\", \"&#8221;\", \"&#8211;\", \"&#8212;\",\n\t\t\t\t \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n\t$clean = trim(str_replace($strip, \"\", strip_tags($string)));\n\t$clean = preg_replace('/\\s+/', \"-\", $clean);\n\t$clean = ($anal ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean);\n\t$clean = ($trunc ? substr($clean, 0, $trunc) : $clean);\n\treturn ($force_lowercase) ?\n\t\t(function_exists('mb_strtolower')) ?\n\t\t\tmb_strtolower($clean, 'UTF-8') :\n\t\t\tstrtolower($clean) :\n\t\t$clean;\n}", "function sanitize($data){\r\n\t\t\t$data=stripslashes($data); // Remove all slashses\r\n\t\t\t$data=strip_tags($data); //Remove all tags\r\n\t\t\treturn $data;\r\n\t\t}", "function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function clean_input($data) \n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitize_input($data)\n {\n $data = trim($data); //remove whitespaces \n $data = stripslashes($data); //such as '\n $data = htmlspecialchars($data); //such as >,<&\n return $data;\n }", "private function parseFunctions() {\r\n while( preg_match( \"/\" .$this->leftDelimiterF . \"include file=\\\"(.*)\\.(.*)\\\"\" . $this->rightDelimiterF . \"/isUe\", $this->template ) ) {\r\n $this->template = preg_replace( \"/\" . $this->leftDelimiterF . \"include file=\\\"(.*)\\.(.*)\\\"\" . $this->rightDelimiterF . \"/isUe\", \"file_get_contents(\\$this->templateDir.'\\\\1'.'.'.'\\\\2')\", $this->template );\r\n }\r\n $this->template = preg_replace( \"/\" .$this->leftDelimiterC .\"(.*)\" .$this->rightDelimiterC .\"/isUe\", \"\", $this->template );\r\n }", "function clean_input($data){\r\n\t$data = trim($data);\r\n\t$data = stripslashes($data);\r\n\t$data = htmlspecialchars($data);\r\n\treturn $data;\t\r\n}", "function inputRefine($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "public function sanitize($value);", "function foo_6() {\n\n\tsanitize_twitter( $_POST['foo'] ); // OK.\n\tsanitize_pc( $_POST['bar'] ); // OK.\n\tmy_nonce_check( do_something( $_POST['tweet'] ) ); // OK.\n}", "function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }", "function sanitize($input) {\n if (is_array($input)) {\n foreach($input as $var=>$val) {\n $output[$var] = sanitize($val);\n }\n }\n else {\n $input = trim($input);\n if (get_magic_quotes_gpc()) {\n $input = stripslashes($input);\n }\n $output = strip_tags($input);\n }\n return $output;\n}", "function sanitize_text_field($str)\n {\n }", "public function sanitizeFileNameNonUTF8FilesystemDataProvider() {}", "function sanitizeString($str_input) {\r\n $str_input = strip_tags($str_input);\r\n $str_input = htmlentities($str_input);\r\n $str_input = stripslashes($str_input);\r\n return $str_input;\r\n}", "public static function allow($_str='') {\n\t\t// Create lookup table of functions allowed in templates\n\t\t$_legal=array();\n\t\t// Get list of all defined functions\n\t\t$_dfuncs=get_defined_functions();\n\t\tforeach (explode('|',$_str) as $_ext) {\n\t\t\t$_funcs=array();\n\t\t\tif (extension_loaded($_ext))\n\t\t\t\t$_funcs=get_extension_funcs($_ext);\n\t\t\telseif ($_ext=='user')\n\t\t\t\t$_funcs=$_dfuncs['user'];\n\t\t\t$_legal=array_merge($_legal,$_funcs);\n\t\t}\n\t\t// Remove prohibited functions\n\t\t$_illegal='/^('.\n\t\t\t'apache_|call|chdir|env|escape|exec|extract|fclose|fflush|'.\n\t\t\t'fget|file_put|flock|fopen|fprint|fput|fread|fseek|fscanf|'.\n\t\t\t'fseek|fsockopen|fstat|ftell|ftp_|ftrunc|get|header|http_|'.\n\t\t\t'import|ini_|ldap_|link|log_|magic|mail|mcrypt_|mkdir|ob_|'.\n\t\t\t'php|popen|posix_|proc|rename|rmdir|rpc|set_|sleep|stream|'.\n\t\t\t'sys|thru|unreg'.\n\t\t')/i';\n\t\t$_legal=array_merge(\n\t\t\tarray_filter(\n\t\t\t\t$_legal,\n\t\t\t\tfunction($_func) use($_illegal) {\n\t\t\t\t\treturn !preg_match($_illegal,$_func);\n\t\t\t\t}\n\t\t\t),\n\t\t\t// PHP language constructs that may be used in expressions\n\t\t\tarray('array','isset')\n\t\t);\n\t\tself::$global['FUNCS']=array_map('strtolower',$_legal);\n\t}", "function foo_8() {\n\n\tdo_something( $_POST['foo'] ); // Bad.\n\tsanitize_pc( $_POST['bar'] ); // Bad.\n\tmy_nonce_check( sanitize_twitter( $_POST['tweet'] ) ); // Bad.\n}", "function test_input($data) {\n $data = trim($data); // strip whitespace from beginning and end\n $data = stripslashes($data); // unquotes a quoted string\n $data = htmlspecialchars($data); // converts special characters to HTML entities, thereby breaking their purpose if used maliciously\n return $data;\n}", "function filterUserInput($data) {\n\n // trim() function will remove whitespace from the beginning and end of string.\n $data = trim($data);\n\n // Strip HTML and PHP tags from a string\n $data = strip_tags($data);\n\n /* The stripslashes() function removes backslashes added by the addslashes() function.\n Tip: This function can be used to clean up data retrieved from a database or from an HTML form.*/\n $data = stripslashes($data);\n\n // htmlspecialchars() function converts special characters to HTML entities. Say '&' (ampersand) becomes '&amp;'\n $data = htmlspecialchars($data);\n return $data;\n\n}", "function wpartisan_sanitize_file_name( $filename ) {\n\n $sanitized_filename = remove_accents( $filename ); // Convert to ASCII \n // Standard replacements\n $invalid = array(\n ' ' => '-',\n '%20' => '-',\n '_' => '-',\n );\n $sanitized_filename = str_replace( array_keys( $invalid ), array_values( $invalid ), $sanitized_filename );\n \n $sanitized_filename = preg_replace('/[^A-Za-z0-9-\\. ]/', '', $sanitized_filename); // Remove all non-alphanumeric except .\n $sanitized_filename = preg_replace('/\\.(?=.*\\.)/', '', $sanitized_filename); // Remove all but last .\n $sanitized_filename = preg_replace('/-+/', '-', $sanitized_filename); // Replace any more than one - in a row\n $sanitized_filename = str_replace('-.', '.', $sanitized_filename); // Remove last - if at the end\n $sanitized_filename = strtolower( $sanitized_filename ); // Lowercase\n \n return $sanitized_filename;\n}", "function test_input($data)\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n\t $data = strtolower($data);\n return $data;\n}", "function cleanInput($input) \n{\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n $output = preg_replace($search, '', $input);\n return $output;\n}", "function mf_sanitize($input){\n\t\tif(get_magic_quotes_gpc() && !empty($input)){\n\t\t\t $input = is_array($input) ?\n\t array_map('mf_stripslashes_deep', $input) :\n\t stripslashes(trim($input));\n\t\t}\n\t\t\n\t\treturn $input;\n\t}", "function get_sanitize_callback($slug = '')\n {\n }", "function santitise_input($data) {\n $data = trim($data);\n //Removing backslashes.\n $data = stripslashes($data);\n //Removing HTML special/control characters.\n $data = htmlspecialchars($data);\n return $data; \n }", "function sanitize(){\r\n\t\t $outar = Array();\r\n \t $arg_list = func_get_args();\r\n\t\t foreach($arg_list[0] as $key => $value){\r\n\t\t\t\t $data = $value;\r\n\t\t\t\t $data = PREG_REPLACE(\"/[^0-9a-zA-Z]/i\", '', $data);\r\n\t\t\t\t array_push($outar,$data);\r\n\t\t }\r\n\t\treturn $outar;\r\n\t }", "function clean_input($data){\r\n\t\t\t\t\t$data = trim($data);\r\n\t\t\t\t\t$data = stripslashes($data);\r\n\t\t\t\t\t$data = htmlspecialchars($data);\r\n\t\t\t\t\treturn $data;\r\n\t\t\t\t}", "function tidy_repair_file($filename, $config = null, $encoding = null, $use_include_path = false) {}", "public function sanitize_plugin_param($file)\n {\n }", "function sanitize($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function xss_clean($str, $is_image = FALSE)\n{ \n $security =& load_class('Security','core');\n return $security->xss_clean($str, $is_image);\n}", "private function sanitize(string $fname) : string\n {\n $fname = trim($fname);\n\n if ($fname !== '') {\n // should only contains letters, figures or dot/minus/underscore or a slash\n if (!preg_match('/^[A-Za-z0-9-_\\.\\/]+$/', $fname)) {\n $fname = '';\n }\n } // if ($fname!=='')\n\n return $fname;\n }", "public function sanitize_input_fields()\n {\n }", "function sanitize_input($str) {\n\treturn preg_replace(\"/[?'&<>\\\"]/\", \"\", $str);\n}", "public function sanitize(string $input)\n {\n }", "function scrubInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitizeFileName($fileName)\n{\n\t//sanitize, remove double dot .. and remove get parameters if any\n\t$fileName = __DIR__ . '/' . preg_replace('@\\?.*$@' , '', preg_replace('@\\.{2,}@' , '', preg_replace('@[^\\/\\\\a-zA-Z0-9\\-\\._]@', '', $fileName)));\n\treturn $fileName;\n}", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}", "function test_input($data) {\r\n $data = trim($data);\r\n //removes backslashes from input\r\n $data = stripslashes($data);\r\n //converts html to special characters\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "protected function _sanitize_globals()\n {\n // Is $_GET data allowed? If not we'll set the $_GET to an empty array\n if ($this->_allow_get_array === FALSE)\n {\n $_GET = array();\n }\n elseif (is_array($_GET) && count($_GET) > 0)\n {\n foreach ($_GET as $key => $val)\n {\n $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);\n }\n }\n\n // Clean $_POST Data\n if (is_array($_POST) && count($_POST) > 0)\n {\n foreach ($_POST as $key => $val)\n {\n $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);\n }\n }\n\n // Clean $_COOKIE Data\n if (is_array($_COOKIE) && count($_COOKIE) > 0)\n {\n // Also get rid of specially treated cookies that might be set by a server\n // or silly application, that are of no use to a CI application anyway\n // but that when present will trip our 'Disallowed Key Characters' alarm\n // http://www.ietf.org/rfc/rfc2109.txt\n // note that the key names below are single quoted strings, and are not PHP variables\n unset(\n $_COOKIE['$Version'],\n $_COOKIE['$Path'],\n $_COOKIE['$Domain']\n );\n\n foreach ($_COOKIE as $key => $val)\n {\n if (($cookie_key = $this->_clean_input_keys($key)) !== FALSE)\n {\n $_COOKIE[$cookie_key] = $this->_clean_input_data($val);\n }\n else\n {\n unset($_COOKIE[$key]);\n }\n }\n }\n\n // Sanitize PHP_SELF\n $_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);\n\n // CSRF Protection check\n if ($this->_enable_csrf === TRUE && ! is_cli())\n {\n $this->security->csrf_verify();\n }\n }", "function sanitize_filename(string $str = null, string $replace = '-')\n{\n if (!$str) {\n return bin2hex(random_bytes(4));\n }\n // Remove unwanted chars\n $str = mb_ereg_replace(\"([^\\w\\s\\d\\-_~,;\\[\\]\\(\\).])\", $replace, $str);\n // Replace multiple dots by custom char\n $str = mb_ereg_replace(\"([\\.]{2,})\", $replace, $str);\n return $str;\n}", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}", "function test_Providerinput($data)\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitised() {\n\t$sanitised = true;\n\n\tif (!file_exists(dirname(dirname(__FILE__)) . \"/settings.php\")) {\n\t\t// See if we are being asked to save the file\n\t\t$save_vars = get_input('db_install_vars');\n\t\t$result = \"\";\n\t\tif ($save_vars) {\n\t\t\t$rtn = db_check_settings($save_vars['CONFIG_DBUSER'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBPASS'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBNAME'],\n\t\t\t\t\t\t\t\t\t$save_vars['CONFIG_DBHOST'] );\n\t\t\tif ($rtn == FALSE) {\n\t\t\t\tregister_error(elgg_view(\"messages/sanitisation/dbsettings_error\"));\n\t\t\t\tregister_error(elgg_view(\"messages/sanitisation/settings\",\n\t\t\t\t\t\t\t\tarray(\t'settings.php' => $result,\n\t\t\t\t\t\t\t\t\t\t'sticky' => $save_vars)));\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$result = create_settings($save_vars, dirname(dirname(__FILE__)) . \"/settings.example.php\");\n\n\n\t\t\tif (file_put_contents(dirname(dirname(__FILE__)) . \"/settings.php\", $result)) {\n\t\t\t\t// blank result to stop it being displayed in textarea\n\t\t\t\t$result = \"\";\n\t\t\t}\n\t\t}\n\n\t\t// Recheck to see if the file is still missing\n\t\tif (!file_exists(dirname(dirname(__FILE__)) . \"/settings.php\")) {\n\t\t\tregister_error(elgg_view(\"messages/sanitisation/settings\", array('settings.php' => $result)));\n\t\t\t$sanitised = false;\n\t\t}\n\t}\n\n\tif (!file_exists(dirname(dirname(dirname(__FILE__))) . \"/.htaccess\")) {\n\t\tif (!@copy(dirname(dirname(dirname(__FILE__))) . \"/htaccess_dist\", dirname(dirname(dirname(__FILE__))) . \"/.htaccess\")) {\n\t\t\tregister_error(elgg_view(\"messages/sanitisation/htaccess\", array('.htaccess' => file_get_contents(dirname(dirname(dirname(__FILE__))) . \"/htaccess_dist\"))));\n\t\t\t$sanitised = false;\n\t\t}\n\t}\n\n\treturn $sanitised;\n}", "function sanitise_str ($x, $flags = 0) {\n global $EscapeSequencesA, $EscapeSequencesB;\n $x = (string)$x;\n if ( $flags & STR_GPC and\n PHP_MAJOR_VERSION < 6 and\n get_magic_quotes_gpc()\n ) {\n $x = stripslashes($x);\n }\n if ( $flags & STR_ENSURE_ASCII ) { $x = ensure_valid_ascii($x); }\n else { $x = ensure_valid_utf8($x); }\n if ( $flags & STR_TO_UPPERCASE ) { $x = strtoupper($x); }\n if ( $flags & STR_TO_LOWERCASE ) { $x = strtolower($x); }\n if ( ~$flags & STR_NO_TRIM ) { $x = trim($x); }\n if ( ~$flags & STR_NO_STRIP_CR ) { $x = str_replace(\"\\r\", '', $x); }\n if ( $flags &\n ( STR_ESCAPE_HTML |\n STR_PERMIT_FORMATTING |\n STR_HANDLE_IMAGES |\n STR_PERMIT_ADMIN_HTML |\n STR_DISREGARD_GAME_STATUS |\n STR_EMAIL_FORMATTING\n )\n ) {\n $x = htmlspecialchars($x, ENT_COMPAT, 'UTF-8');\n }\n if ( $flags & STR_CONVERT_ESCAPE_SEQUENCES ) {\n $x = str_replace($EscapeSequencesA, $EscapeSequencesB, $x);\n }\n if ( $flags & STR_STRIP_TAB_AND_NEWLINE ) {\n $x = str_replace(array(\"\\n\",\"\\t\"), '', $x);\n }\n return $x;\n}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function test_input($data)\n{\n $data = trim($data); //removes whitespace from both sides\n $data = stripslashes($data); //removes backslashes\n $data = htmlspecialchars($data);\n return $data;\n}", "function quake_sanitize_twitter_handler( $input ){\n $output = sanitize_text_field( $input ); // for html charcters\n $output = str_replace('@', '', $output); // for @ chracter\n return $output;\n}", "function validate_input($data)\n{\n $data = stripslashes($data);\n // $data = preg_replace('/\\s+/', '', $data);\n $data = htmlspecialchars($data);\n \n //$data = trim($data);\n $data = str_replace(\"'\", \"\", $data);\n $data = str_replace(\" \", \"\", $data);\n $data = mb_strtolower($data);\n\n return $data;\n}", "function check_input($data)\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n\t$data = strtolower($data);\n return $data;\n}", "function sanitizeCallback(\n $var, \n $options = array('options' => 'isLowerAlpha'), \n $filterType = FILTER_CALLBACK)\n{\n\n $varOutput = filter_var( $var, $filterType, $options);\n\n return stripslashes(strip_tags(htmlentities($varOutput, ENT_QUOTES)));\n\n}", "function sanitation($postVal){\n\t$rawinfo= $postVal;\n\t$removeSpecial = htmlspecialchars($rawinfo);\n\t$finalForm = escapeshellcmd($removeSpecial);\n\treturn $finalForm;\n}", "function cleanInput($data)\n{\n    $data = trim($data);\n\n // gunakan stripslashes untuk elakkan  double escape if magic_quotes_gpc is enabledif(get_magic_quotes_gpc()){\n $data = stripslashes($data);}", "function test_input($data){ \n $data = trim($data); //Strip unnecessary characters (extra space, tab, newline) from the user input data (with the PHP trim() function)\n $data = stripslashes($data); //Remove backslashes (\\) from the user input data (with the PHP stripslashes() function)\n $data = htmlspecialchars($data); //The htmlspecialchars() function converts special characters to HTML entities.\n return $data;\n}", "function secure_input($data) {\n // strip unnecessary chars (extra space, tab, newline, etc)\n $data = trim($data);\n // remove backslashes (\\)\n $data = stripslashes($data);\n // save as HTML escaped code --> any scripts in input data will not run\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitize_mime_type($mime_type)\n {\n }", "public function sanitize($value)\n {\n }", "function sanitizeDBData($input) {\n $halfSan = filter_var($input, FILTER_SANITIZE_EMAIL);\n\n //sets slashes infront of \" ' and \\\n $output = filter_var($halfSan, FILTER_SANITIZE_MAGIC_QUOTES);\n\n return $output;\n}", "function cleanInput($input) {\n\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n\n $output = preg_replace($search, '', $input);\n return $output;\n}", "public function sanitizeFileNameUTF8FilesystemDataProvider() {}", "function validate($inputs) {\r\n $inputs = trim($inputs);\r\n $inputs = stripslashes($inputs);\r\n $inputs = htmlspecialchars($inputs);\r\n return $inputs;\r\n }", "function test_input($data) {\r\n$data = trim($data);\r\n$data = stripslashes($data);\r\n$data = htmlspecialchars($data);\r\nreturn $data;\r\n}", "function clean_unwanted_characters($oneStr){\n\t$cleaned_str = $oneStr;\r\n// \t$cleaned_str = str_ireplace(\"\\\"\", \"/\", $oneStr);\r\n// \t$cleaned_str = str_ireplace(\"\\\\\", \"/\", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\b\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\f\", \" / \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\r\", \" / \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\t\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\u\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"</\", \"<\\/\", $cleaned_str);\r\n\treturn $cleaned_str;\n\r\n}", "function check_input($data){\n if(isset($data)){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n $data = htmlentities($data);\n return $data;\n }\n}", "function fsl_scrub($string){\n \n $xss = new xss_filter();\n $string = $xss->filter_it($string); \n return $string;\n}" ]
[ "0.72457606", "0.7040492", "0.69909644", "0.66754746", "0.63956875", "0.6323625", "0.6267727", "0.62536865", "0.6215309", "0.6208184", "0.6179496", "0.614686", "0.596885", "0.594685", "0.59178436", "0.58647674", "0.58325595", "0.58259183", "0.58138895", "0.57972515", "0.577563", "0.577563", "0.57612145", "0.57279235", "0.572525", "0.57188565", "0.57110745", "0.5708961", "0.5705199", "0.5699696", "0.56973493", "0.569538", "0.5692598", "0.56787974", "0.56690115", "0.5668025", "0.5660712", "0.56468946", "0.56408584", "0.5639412", "0.56377846", "0.56321454", "0.5622706", "0.56124413", "0.560847", "0.56053936", "0.5604216", "0.56033677", "0.56008565", "0.56002533", "0.5599968", "0.5590438", "0.5584192", "0.5579167", "0.55779237", "0.55665016", "0.5566161", "0.5562633", "0.5557019", "0.55547076", "0.5546746", "0.5541956", "0.5540079", "0.5538846", "0.5535234", "0.55345273", "0.5534021", "0.55320525", "0.5522167", "0.55067694", "0.55065864", "0.550416", "0.55024207", "0.5494072", "0.54936516", "0.54927975", "0.54911566", "0.54853725", "0.5482883", "0.5474363", "0.54661196", "0.54661196", "0.54644656", "0.5464373", "0.5460306", "0.5456475", "0.5450228", "0.54476595", "0.54462427", "0.5445092", "0.54432446", "0.54295814", "0.54253334", "0.5425028", "0.54213524", "0.5418621", "0.54159266", "0.5413425", "0.54110986", "0.54100966", "0.54055065" ]
0.0
-1
Get global minimum password characters length, default value is 12.
public function GetMustHaveMinLength () { return $this->mustHaveMinLength; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public static function getCryptedStringMinLength() {\n return self::$cryptedStringMinLength;\n }", "public function getMinUsernameLength();", "public function getMinLength()\n {\n return $this->minLength;\n }", "public function getPasswordLength() {\n\t\treturn $this->_passwordLength;\n\t}", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "public function getMinLength()\n {\n return $this->_minLength;\n }", "public function getMinimumLength()\n {\n return $this->minimumLength;\n }", "public function getMaxUsernameLength();", "function minimum_password_limit( & $errors ) {\r\n\t$min_length = 12;\r\n\tif ( !empty( $_POST['pass1'] ) && $_POST['pass1'] === $_POST['pass2'] && !preg_match('/^.*(?=.{12,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', $_POST['pass1']) ) {\r\n\t\t$errors->add( 'min_pass_length', sprintf( __( '<strong>Security advice</strong>: Your password must be at least %d characters long and have at least one capital letter and one number in it.' ), $min_length ), array( 'form-field' => 'pass1' ) );\r\n\t}\r\n}", "public function getLengthMin()\n {\n return $this->lengthMin;\n }", "public static function setPasswordMinLength($length){\n Configuration::where('id', 1)\n ->update(['password_min_length' => $length]);\n }", "function reduce_min_strength_password_requirement( $strength ) {\n return 2; \n}", "protected function getCharacterLimit()\n {\n $charLimit = static::CHAR_LIMIT_DEFAULT;\n if ($this->isUsingExpectedLengthAsCharLimit()) {\n $charLimit = $this->interaction->getExpectedLength();\n }\n\n return $charLimit;\n }", "public function getMaxChars()\n {\n return $this->maxChars;\n }", "public function getMaxLength() {}", "public function setPasswordLenghtMin($num) {\n if((is_numeric($num)) && (($this->password_lenghtMax==null) || ($this->password_lenghtMax>$num))) {\n $this->password_lenghtMin = $num;\n return $this->password_lenghtMin;\n }\n return false;\n }", "public function getLengthLimit()\n {\n }", "public function getPasswordMinimumLength(): ?int {\n $val = $this->getBackingStore()->get('passwordMinimumLength');\n if (is_null($val) || is_int($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'passwordMinimumLength'\");\n }", "public function setPasswordMinimumLength(?int $value): void {\n $this->getBackingStore()->set('passwordMinimumLength', $value);\n }", "public function getMaxChars()\n {\n return intval($this->maxChars);\n }", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length,$passwordLength);\n }", "function generate_random_password($len = 8)\n {\n }", "public function getMaximumStringKeyLength()\n {\n return $this->maximumStringKeyLength;\n }", "public function getMaxLength();", "public function getSearchMinimumLength()\n\t\t{\n\t\t\treturn $this->_search_min_length;\n\t\t}", "function pwdLongEnough($password) {\n $result=true;\n if(strlen($password) < 8){\n $result =false;\n } \n else {\n $result = true;\n }\n return $result;\n}", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_STRENGTH_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length, $passwordLength);\n }", "public function setMinUsernameLength($length);", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function getMaxLength()\n {\n return $this->maxLength;\n }", "public function getCharLength();", "public function getMaxLength() {\n return $this->maxLength;\n }", "final public function searchMinLength():int\n {\n return $this->col()->searchMinLength();\n }", "public function getMaxLength()\n {\n return $this->__get(self::FIELD_MAXLENGTH); \n }", "public function getLengthMax()\n {\n return $this->lengthMax;\n }", "function must_be_24_characters_long()\n {\n $generator = new OrderConfirmationNumberGenerator;\n\n $number = $generator->generate();\n\n $this->assertEquals(24, strlen($number));\n }", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "function has_length($value, $options=array()) {\n //for first/last name [1,256]\n //for username [7, 256]\n if(strlen($value) > $options[0] && strlen($value) < $options[1]) {\n return 1;\n }\n return 0;\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "function minimumNumber($n, $password) {\n $res = 0;\n $check = 0;\n\t$free = 0;\n\n if ($n < 6) {\n $free = 6 - $n;\n }\n\t\n\t$uppercase = preg_match('@[A-Z]@', $password);\n\tif (!$uppercase) {\n\t\t$check++;\n\t}\n\t$lowercase = preg_match('@[a-z]@', $password);\n\tif (!$lowercase) {\n\t\t$check++;\n\t}\n\t$number = preg_match('@[0-9]@', $password);\n\tif (!$number) {\n\t\t$check++;\n\t}\n\t$speciaux = preg_match('#^(?=.*\\W)#', $password);\n\tif (!$speciaux) {\n\t\t$check++;\n\t}\n\t\n\t$res = $free + $check;\n\tif ($n < 6) {\n\t\t$res = ($free <= $check) ? $check : $free;\n\t}\n \n return $res;\n}", "function minsecretword($c_secretword){\n \n $counted_secretword = strlen($c_secretword);\n \n if($counted_secretword >= 8){\n \n echo \"Your Secret Word is: '\" . $c_secretword . \"' and it's correct\";\n \n }else{\n \n echo \"Your Secret Word '\" . $c_secretword . \"' cannot be less than 8 characters\";\n }\n \n }", "public function testLongPassword ()\n {\n // Function parameters\n $length = 20;\n $minPasswordRequirements = [];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{20,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "protected function get_max_length(): int\n\t{\n\t\treturn $this->end < $this->total ? $this->length : -1;\n\t}", "public function setPasswordLenghtMax($num) {\n if((is_numeric($num)) && (($this->password_lenghtMin==null) || ($this->password_lenghtMin<$num))) {\n $this->password_lenghtMax = $num;\n return $this->password_lenghtMax;\n }\n return false;\n }", "public function generatePassword() {\n $generator = new UriSafeTokenGenerator();\n $token = $generator->generateToken();\n return substr($token, 0, 6);\n }", "public function getPasswordStrength(string $password): int;", "public static function validPassword ($length = 6)\r\n\t{\r\n\t\t# Check that the URL contains an activation key string of exactly 6 lowercase letters/numbers\r\n\t\treturn (preg_match ('/^[a-z0-9]{' . $length . '}$/D', (trim ($_SERVER['QUERY_STRING']))));\r\n\t}", "function generatePassword ($length = 8)\n{\n $string = implode(\"\", range(\"a\", \"z\")) . implode(\"\", range(0, 9));\n $max = strlen($string) - 1;\n $pwd = \"\";\n\n while ($length--)\n {\n $pwd .= $string[ mt_rand(0, $max) ];\n }\n\n\n return $pwd;\n}", "public static function NumberOfValidCharacters()\n {\n return strlen(self::$charSet);\n }", "function CharMax()\n\t{\n\t\treturn 1000000000; // should be 1 Gb?\n\t}", "function wp_generate_password($length = 12, $special_chars = \\true, $extra_special_chars = \\false)\n {\n }", "public static function generatePassword() {\r\n return StringGenerator::generateRandomAlphaAndNumbersAndSpecial(12);\r\n }", "function generatePassword() {\n //Initialize the random password\n $password = '';\n\n //Initialize a random desired length\n $desired_length = rand(8, 12);\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for ($length = 0; $length < $desired_length; $length++) {\n //Append a random ASCII character (including symbols)\n $password .= $characters[mt_rand(0, strlen($characters) - 1)];\n }\n\n return $password;\n }", "public function getRequiredCharacters(): string\n {\n return $this->requiredCharacters;\n }", "function get_random_password($chars_min=6, $chars_max=8, $use_upper_case=false, $include_numbers=false, $include_special_chars=false)\n {\n $length = rand($chars_min, $chars_max);\n $selection = 'aeuoyibcdfghjklmnpqrstvwxz';\n if($include_numbers) {\n $selection .= \"1234567890\";\n }\n if($include_special_chars) {\n $selection .= \"!@04f7c318ad0360bd7b04c980f950833f11c0b1d1quot;#$%&[]{}?|\";\n }\n \n $password = \"\";\n for($i=0; $i<$length; $i++) {\n $current_letter = $use_upper_case ? (rand(0,1) ? strtoupper($selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))]; \n $password .= $current_letter;\n } \n \n return $password;\n }", "public function getMaxLength()\n {\n return 254;\n }", "function getSaltLength() ;", "public function getMaxKeyLength()\n {\n return $this->maxKeyLength;\n }", "public function get_coupon_code_length() {\n\t\t\t$coupon_code_length = get_option( 'wc_sc_coupon_code_length' );\n\t\t\treturn ! empty( $coupon_code_length ) ? $coupon_code_length : 13; // Default coupon code length is 13.\n\t\t}", "function page_length()\n\t{\n\t\t//To get Admin page length\n\t\t$get_page_length = select_single_record(GLOBAL_CONFIGURATION, \"admin_page_length\", \"\", \"LIMIT 1\");\n\t\tif($get_page_length[0]>0)\n\t\t{\n\t\t\t$set_page_length = $get_page_length[1];\n\t\t\t$admin_page_length = striptext($set_page_length['admin_page_length']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$admin_page_length = 10;\n\t\t}\n\t\t\n\t\treturn (int) $admin_page_length;\n\t}", "function generate_password($length = 20) {\n $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' .\n '0123456789``-=~!@#$%^&*()_+,./<>?;:[]{}\\|';\n $str = '';\n $max = strlen($chars) - 1;\n for ($i = 0; $i < $length; $i++)\n $str .= $chars[mt_rand(0, $max)];\n return ltrim($str);\n }", "public function GetMustHaveMaxLength () {\n\t\treturn $this->mustHaveMaxLength;\n\t}", "private function generatePassword($l = 6)\n\t{\n\n\t\treturn substr(md5(uniqid(mt_rand(), true)), 0, $l);\n\n\t}", "function passwordLength($wachtwoordbevestiging) {\n\t$count = 0;\n\n\tfor($i = 0; $i < strlen($wachtwoordbevestiging); $i++) { \n\t\tif($wachtwoordbevestiging[$i] != ' ') \n\t\t\t$count++; \n\t}\n\n\tif ($count < 6) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "function generatePassword( $length = 6 )\r\n {\r\n $password = \"\";\r\n\r\n // define possible characters\r\n $possibleChars = \"0123456789bcdfghjkmnpqrstvwxyz\";\r\n\r\n // set up a counter\r\n $i = 0;\r\n\r\n // add random characters to the password until it is the correct length\r\n while ($i < $length)\r\n {\r\n // pick a random character from the possible ones\r\n $char = substr( $possibleChars, mt_rand(0, strlen($possibleChars)-1), 1);\r\n\r\n // add the character to the password, unless it is already present\r\n if (!strstr($password, $char))\r\n {\r\n $password .= $char;\r\n $i++;\r\n }\r\n }\r\n\r\n // done\r\n return $password;\r\n }", "function random_password($length){\r\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n //Create blank string\r\n $password = '';\r\n //Get the index of the last character in our $characters string\r\n $characterListLength = mb_strlen($characters, '8bit') - 1;\r\n //Loop from 1 to the length that was specified\r\n foreach(range(1,$length) as $i){\r\n $password .=$characters[rand(0,$characterListLength)];\r\n }\r\n return $password;\r\n}", "function sloodle_random_prim_password()\n {\n return (string)mt_rand(1000000, 999999999);\n }", "public function getMaskingStringLength(): PositiveInteger;", "private function checkSymbolLength(): bool\n {\n $passwordLength = strlen($this->password);\n if ($passwordLength > 6) {\n return true;\n }\n array_push($this->errorMessages, \"Please add atleast \" . 7 - $passwordLength . \" characters to your password\");\n return false;\n }", "protected function random_password() \n {\n $length = 8;\n // 0 and O, l and 1 are all removed to prevent silly people who can't read to make mistakes.\n $characters = '23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ';\n $string = ''; \n for ($p = 0; $p < $length; $p++) {\n $string .= $characters[mt_rand(0, strlen($characters))];\n }\n return $string;\n }", "public function generatePassword($length = 8): string\r\n {\r\n $chars = 'abcdefghkmnpqrstuvwxyzABCDEFGHKMNPQRSTUVWXYZ23456789';\r\n\r\n return substr(str_shuffle($chars), 0, $length);\r\n }", "public static function generateRandomPassword($length = 8)\n {\n // Based on http://wiki.jumba.com.au/wiki/PHP_Generate_random_password\n $password = \"\";\n // The letter l (lowercase L) and the number 1 have been removed from\n // the possible options as they are commonly mistaken for each other.\n $possible = \"234567890abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $i = 0;\n\n while ($i < $length) {\n $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);\n if (!strstr($password, $char)) {\n $password .= $char;\n $i++;\n }\n }\n\n return $password;\n }", "function randomPassword() {\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n\t$max = 15;\n\t$temp = \"\";\n\t\n for ($i = 0; $i < $max; $i++) {\n $random_int = mt_rand();\n $temp .= $alphabet[$random_int % strlen($alphabet)];\n }\n return $temp;\n}", "public function getLimitationStrength()\n {\n return $this->limitationStrength;\n }", "function _get_field_size() \n {\n if (isset($this->attribs['size'])) {\n return $this->attribs['size'];\n }\n elseif ($this->attribs['maxlength'] > $this->max_size) {\n return $this->max_size;\n }\n else {\n return $this->attribs['maxlength'];\n }\n }", "public function enablePasswordStringLength()\n {\n // Add validator\n return $this->attachPasswordValidator('Zend\\Validator\\StringLength', array(\n 'min' => 8,\n 'max' => 64,\n ));\n }", "public function testRegisterLongPassword() {\n $generic = new GenericValidationTests($this);\n $generic->testMaxStringAttribute('register', 'POST', self::$headers, self::$body, 'password', 30, 'password_confirmation');\n }", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public static function generateRandomPassword ()\n {\n return rand(10000, 99999);\n }", "function randomPassword()\r\n\t{\r\n\t\t$longitud = 8;\r\n\t\t$carac = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n\t\t$pwd = '';\r\n\t\tfor ($i=0; $i<$longitud; ++$i){ \r\n\t\t\t $pwd .= substr($carac, (mt_rand() % strlen($carac)), 1);\r\n\t\t}\t \r\n\t return trim($pwd);\r\n\t}", "public function getPW() {}", "public function generatePassword()\n {\n $characters = str_shuffle('abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789');\n\n return substr($characters, 0, 6);\n }", "public function getMaximumLineLength() {}", "public function checkPasswordMinLength($password)\n {\n if (strlen($password) < 5) {\n return false;\n } else return true;\n }", "public static function password($length = 8) {\n $seed = 'abcdefhikmnrstuwxz' . '2456789';\n $ret = '';\n for ($i = 1; $i <= $length; $i++) {\n $ret .= $seed[mt_rand(0, strlen($seed) - 1)];\n }\n return $ret;\n }", "function returnGeneratedPassword ($_passwordLength) {\n\t\treturn substr(\n\t\t\tstr_shuffle(\n\t\t\t\tstrtolower(sha1(rand().time().\"245kngr6poksalmqwytwdihixqFGXYFJJUNT3ZSUAP90EB17VCMZcBHVEord8L\"))),0, $_passwordLength);\n\t}", "protected function generateAdminPassword()\n {\n return\n Util::getRandomString(1, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') .\n Util::getRandomString(1, '0123456789') .\n Util::getRandomString(1, '@*^%#()<>') .\n Util::getRandomString();\n }", "public function testPasswordLengthManagement() {\n // Create a policy and add minimum and maximum \"length\" constraints.\n $this->drupalPostForm('admin/config/security/password-policy/add', ['label' => 'Test policy', 'id' => 'test_policy'], 'Next');\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->assertText('Number of characters');\n $this->assertText('Operation');\n\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => 1], 'Save');\n $this->assertText('Password character length of at least 1');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'maximum', 'character_length' => 6], 'Save');\n $this->assertText('Password character length of at most 6');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => ''], 'Save');\n $this->assertText('The character length must be a positive number.');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => -1], 'Save');\n $this->assertText('The character length must be a positive number.');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => $this->randomMachineName()], 'Save');\n $this->assertText('The character length must be a positive number.');\n }", "private function generatePassword() {\n // account is not wide open if conventional logins are permitted\n $guid = '';\n\n for ($i = 0; ($i < 8); $i++) {\n $guid .= sprintf(\"%x\", mt_rand(0, 15));\n }\n\n return $guid;\n }", "private function generatePassword ($length = 8){\r\n $password = \"\";\r\n\r\n // define possible characters - any character in this string can be\r\n // picked for use in the password, so if you want to put vowels back in\r\n // or add special characters such as exclamation marks, this is where\r\n // you should do it\r\n $possible = \"2346789bcdfghjkmnpqrtvwxyzBCDFGHJKLMNPQRTVWXYZ\";\r\n\r\n // we refer to the length of $possible a few times, so let's grab it now\r\n $maxlength = strlen($possible);\r\n \r\n // check for length overflow and truncate if necessary\r\n if ($length > $maxlength) {\r\n $length = $maxlength;\r\n }\r\n \r\n // set up a counter for how many characters are in the password so far\r\n $i = 0; \r\n \r\n // add random characters to $password until $length is reached\r\n while ($i < $length) { \r\n\r\n // pick a random character from the possible ones\r\n $char = substr($possible, mt_rand(0, $maxlength-1), 1);\r\n \r\n // have we already used this character in $password?\r\n if (!strstr($password, $char)) { \r\n // no, so it's OK to add it onto the end of whatever we've already got...\r\n $password .= $char;\r\n // ... and increase the counter by one\r\n $i++;\r\n }\r\n\r\n }\r\n // done!\r\n return $password;\r\n }", "public function setMaxUsernameLength($length);", "protected function generateLength()\n {\n $lengthMin = $this->getLengthMin();\n $lengthMax = $this->getLengthMax();\n\n if ($lengthMin > $lengthMax) {\n $buffer = $lengthMin;\n $lengthMin = $lengthMax;\n $lengthMax = $buffer;\n }\n\n return mt_rand($lengthMin, $lengthMax);\n }", "public static function getMaximumPathLength() {}", "function validatePasswordLength(&$Model, $data, $compare) {\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$this->settings[$Model->alias]['fields']['password']];\r\n\t\t$length = strlen($compare);\r\n\t\tif ($length < $this->settings[$Model->alias]['passwordPolicies'][$this->settings[$Model->alias]['passwordPolicy']]['length']) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}" ]
[ "0.866317", "0.866317", "0.7785897", "0.73885417", "0.6801197", "0.67947876", "0.6778718", "0.676631", "0.6731377", "0.67020243", "0.66800576", "0.6550863", "0.6461658", "0.6450675", "0.64489526", "0.6371763", "0.63223386", "0.6303026", "0.6271191", "0.62562364", "0.62519395", "0.62026376", "0.6162412", "0.6127776", "0.61245674", "0.61051124", "0.60998046", "0.60982597", "0.6097891", "0.6076389", "0.6071126", "0.6071126", "0.6071126", "0.60560215", "0.60479635", "0.6032368", "0.60299766", "0.6007439", "0.6004769", "0.60020655", "0.5998486", "0.59854555", "0.5973409", "0.5964093", "0.595287", "0.5933085", "0.59154874", "0.5841336", "0.58303934", "0.5827613", "0.5824668", "0.5810087", "0.5800953", "0.5790125", "0.5779844", "0.5769056", "0.57591987", "0.5750783", "0.57496226", "0.57459265", "0.5722467", "0.5722358", "0.5704635", "0.5674246", "0.5669816", "0.5662592", "0.56512713", "0.5645481", "0.5645118", "0.5641684", "0.56351286", "0.5634041", "0.5633137", "0.5608846", "0.559079", "0.55835944", "0.5581534", "0.55815035", "0.5568946", "0.55644387", "0.55602574", "0.55590206", "0.55590206", "0.55590206", "0.5558775", "0.5554617", "0.5553773", "0.5550803", "0.55453795", "0.55371046", "0.5531302", "0.55302674", "0.5528874", "0.55193365", "0.5513084", "0.5508776", "0.55077523", "0.5505299", "0.5500179", "0.54949147" ]
0.59976834
41
Set global minimum password characters length, default value is 12.
public function SetMustHaveMinLength ($mustHaveMinLength = self::MIN_LENGTH) { /** @var \MvcCore\Ext\Forms\Validator $this */ $this->mustHaveMinLength = $mustHaveMinLength; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setPasswordMinLength($length){\n Configuration::where('id', 1)\n ->update(['password_min_length' => $length]);\n }", "public function setPasswordMinimumLength(?int $value): void {\n $this->getBackingStore()->set('passwordMinimumLength', $value);\n }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "function minimum_password_limit( & $errors ) {\r\n\t$min_length = 12;\r\n\tif ( !empty( $_POST['pass1'] ) && $_POST['pass1'] === $_POST['pass2'] && !preg_match('/^.*(?=.{12,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', $_POST['pass1']) ) {\r\n\t\t$errors->add( 'min_pass_length', sprintf( __( '<strong>Security advice</strong>: Your password must be at least %d characters long and have at least one capital letter and one number in it.' ), $min_length ), array( 'form-field' => 'pass1' ) );\r\n\t}\r\n}", "public function setMinUsernameLength($length);", "public function getMinUsernameLength();", "public function increaseLength($minLength = 100) {}", "public function increaseLength($minLength = 100) {}", "function set_field_length($len) \n {\n $this->attribs['maxlength'] = $len;\n }", "public function setMaxUsernameLength($length);", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "function reduce_min_strength_password_requirement( $strength ) {\n return 2; \n}", "public static function getCryptedStringMinLength() {\n return self::$cryptedStringMinLength;\n }", "public function setPasswordLenghtMin($num) {\n if((is_numeric($num)) && (($this->password_lenghtMax==null) || ($this->password_lenghtMax>$num))) {\n $this->password_lenghtMin = $num;\n return $this->password_lenghtMin;\n }\n return false;\n }", "public function enablePasswordStringLength()\n {\n // Add validator\n return $this->attachPasswordValidator('Zend\\Validator\\StringLength', array(\n 'min' => 8,\n 'max' => 64,\n ));\n }", "public static function setGlobalMaxLength(int $maxLength):void {\r\n\t\tself::$globalMaxLength = $maxLength;\r\n\t}", "public function increaseLength($minLength = 100);", "public function testRegisterLongPassword() {\n $generic = new GenericValidationTests($this);\n $generic->testMaxStringAttribute('register', 'POST', self::$headers, self::$body, 'password', 30, 'password_confirmation');\n }", "public function setMaxLength($maxLength) {}", "public function testLongPassword ()\n {\n // Function parameters\n $length = 20;\n $minPasswordRequirements = [];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{20,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function generate_random_password($len = 8)\n {\n }", "public function setMaxLength($length);", "public function __construct($password, $minimumChars = 8) {\n // The password is assigned to the current object's $_password property.\n\t$this->_password = $password;\n \n // Optionally overwrite the default minimum number of characters by the argument passed in register_mysqli.inc.php.\n\t$this->_minimumChars = $minimumChars;\n }", "public function setMinimumLength($length)\n {\n $this->minimumLength = $length;\n }", "function wp_generate_password($length = 12, $special_chars = \\true, $extra_special_chars = \\false)\n {\n }", "public function getMaxUsernameLength();", "public function setPasswordLenghtMax($num) {\n if((is_numeric($num)) && (($this->password_lenghtMin==null) || ($this->password_lenghtMin<$num))) {\n $this->password_lenghtMax = $num;\n return $this->password_lenghtMax;\n }\n return false;\n }", "public function testPasswordLengthManagement() {\n // Create a policy and add minimum and maximum \"length\" constraints.\n $this->drupalPostForm('admin/config/security/password-policy/add', ['label' => 'Test policy', 'id' => 'test_policy'], 'Next');\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->assertText('Number of characters');\n $this->assertText('Operation');\n\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => 1], 'Save');\n $this->assertText('Password character length of at least 1');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'maximum', 'character_length' => 6], 'Save');\n $this->assertText('Password character length of at most 6');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => ''], 'Save');\n $this->assertText('The character length must be a positive number.');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => -1], 'Save');\n $this->assertText('The character length must be a positive number.');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => $this->randomMachineName()], 'Save');\n $this->assertText('The character length must be a positive number.');\n }", "public function setLengthMin($lengthMin)\n {\n $this->lengthMin = \\RandData\\Checker::int(\n $lengthMin,\n self::LENGTH_MIN_MIN,\n self::LENGTH_MIN_MAX,\n \"lengthMin\"\n );\n }", "function setMinLength($length) {\n\n $this->field['minlength'] = $length;\n return $this;\n\n }", "public static function setLength ($length){\n\t\tself::$_length = $length;\n\t}", "public function __construct($options = array())\n\t{\n\t\tif (isset($options['minPassSize']))\n\t\t\t$this->minPassSize = $options['minPassSize'];\n\t\telse\n\t\t\t$this->minPassSize = 8;\n\t\t\t\n\t\t/* set maximum password size */\n\t\tif (isset($options['maxPassSize']))\n\t\t\t$this->maxPassSize = $options['maxPassSize'];\n\t\telse\n\t\t\t$this->maxPassSize = 15;\n\t\t\n\t\t/* set minimum char set required in password */\n\t\tif (isset($options['minCharSet']))\n\t\t\t$this->minCharSet = $options['minCharSet'];\n\t\telse\n\t\t\t$this->minCharSet = 2;\n\t\t\t\n\t\t/* set allowed symbols */\n\t\t$this->allowedSymbols = array ('!','@','#','$','%','_','&',',');\n\t\tif (isset($options['allowedSymbols']))\n\t\t{\n\t\t\tif (is_array($options['allowedSymbols']))\n\t\t\t\t$this->allowedSymbols = $options['allowedSymbols'];\n\t\t}\n\t\t\n\t\t/* set minPassSize = maxPassSize if min is > max */\n\t\tif ($this->minPassSize > $this->maxPassSize)\n\t\t\t$this->minPassSize = $this->maxPassSize;\n\t}", "public function setLength($length);", "public function testRegisterShortPassword() {\n $generic = new GenericValidationTests($this);\n $generic->testMinStringAttribute('register', 'POST', self::$headers, self::$body, 'password', 6, 'password_confirmation');\n }", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "function set_length($length) {\n $this->length = $length;\n }", "public function setMaxLength($length) {\n $this->maxlength = $length;\n }", "function must_be_24_characters_long()\n {\n $generator = new OrderConfirmationNumberGenerator;\n\n $number = $generator->generate();\n\n $this->assertEquals(24, strlen($number));\n }", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "public function setPassword(){\n\t}", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length,$passwordLength);\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "public function getPasswordLength() {\n\t\treturn $this->_passwordLength;\n\t}", "public static function validPassword ($length = 6)\r\n\t{\r\n\t\t# Check that the URL contains an activation key string of exactly 6 lowercase letters/numbers\r\n\t\treturn (preg_match ('/^[a-z0-9]{' . $length . '}$/D', (trim ($_SERVER['QUERY_STRING']))));\r\n\t}", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_STRENGTH_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length, $passwordLength);\n }", "function pwdLongEnough($password) {\n $result=true;\n if(strlen($password) < 8){\n $result =false;\n } \n else {\n $result = true;\n }\n return $result;\n}", "public function setPassword($value);", "private function checkSymbolLength(): bool\n {\n $passwordLength = strlen($this->password);\n if ($passwordLength > 6) {\n return true;\n }\n array_push($this->errorMessages, \"Please add atleast \" . 7 - $passwordLength . \" characters to your password\");\n return false;\n }", "function generatePassword ($length = 8)\n{\n $string = implode(\"\", range(\"a\", \"z\")) . implode(\"\", range(0, 9));\n $max = strlen($string) - 1;\n $pwd = \"\";\n\n while ($length--)\n {\n $pwd .= $string[ mt_rand(0, $max) ];\n }\n\n\n return $pwd;\n}", "private function generatePassword($l = 6)\n\t{\n\n\t\treturn substr(md5(uniqid(mt_rand(), true)), 0, $l);\n\n\t}", "public function getLengthLimit()\n {\n }", "function setRequestPassword($value)\n {\n $this->_props['RequestPassword'] = $value;\n }", "public function checkPasswordMinLength($password)\n {\n if (strlen($password) < 5) {\n return false;\n } else return true;\n }", "function validatePasswordLength(&$Model, $data, $compare) {\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$this->settings[$Model->alias]['fields']['password']];\r\n\t\t$length = strlen($compare);\r\n\t\tif ($length < $this->settings[$Model->alias]['passwordPolicies'][$this->settings[$Model->alias]['passwordPolicy']]['length']) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function has_length($value, $options=array()) {\n //for first/last name [1,256]\n //for username [7, 256]\n if(strlen($value) > $options[0] && strlen($value) < $options[1]) {\n return 1;\n }\n return 0;\n }", "public function setMinimumWordLength($minimum)\n {\n return $this->setOption('minimumwordlength', $minimum);\n }", "function setMaxLength($length) {\n\n $this->field['maxlength'] = $length;\n return $this;\n\n }", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "function generate_password($length = 20) {\n $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' .\n '0123456789``-=~!@#$%^&*()_+,./<>?;:[]{}\\|';\n $str = '';\n $max = strlen($chars) - 1;\n for ($i = 0; $i < $length; $i++)\n $str .= $chars[mt_rand(0, $max)];\n return ltrim($str);\n }", "public function assignRootPassword()\n {\n $this->update(['root_password' => Str::random()]);\n }", "public static function setPasswordSpecialCharactersRequired($isRequired){\n Configuration::where('id', 1)\n ->update(['password_special_characters_required' => $isRequired]);\n }", "public function testRegistrationPasswordLessChars()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->type('username', 'Tester1')\n ->type('first_name', 'Test')\n ->type('last_name', 'User')\n ->type('password', 'a1')\n ->type('password_confirmation', 'a1')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->waitForText('The password must be at least 6 characters.')\n ->assertSee('The password must be at least 6 characters.');\n });\n }", "public static function generatePassword() {\r\n return StringGenerator::generateRandomAlphaAndNumbersAndSpecial(12);\r\n }", "function generatePassword(&$Model, $length = 6) {\r\n\t\textract($this->settings[$Model->alias]);\r\n\t\t$salt = '';\r\n\t\tforeach ($passwordPolicies as $name => $policy) {\r\n\t\t\tif (isset($policy['salt'])) {\r\n\t\t\t\t$salt .= $policy['salt'];\r\n\t\t\t}\r\n\t\t\tif (isset($policy['length'])) {\r\n\t\t\t\t$length = max ($length, $policy['length']);\r\n\t\t\t}\r\n\t\t\tif ($name == $passwordPolicy) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$_id = $Model->id;\r\n\t\t$_data = $Model->data;\r\n\t\tdo {\r\n\t\t\t$Model->create();\r\n\t\t\t$password = $this->__generateRandom($length, $salt);\r\n\t\t\t$Model->data[$Model->alias][$fields['password']] = Security::hash($password, null, true);\r\n\t\t\t$Model->data[$Model->alias][$fields['password_confirm']] = $password;\r\n\t\t} while (!$Model->validates());\r\n\t\t$Model->create();\r\n\t\t$Model->id = $_id;\r\n\t\t$Model->data = $_data;\r\n\t\treturn $password;\r\n\t}", "protected function changePassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public static function generateRandomPassword($length = 8)\n {\n // Based on http://wiki.jumba.com.au/wiki/PHP_Generate_random_password\n $password = \"\";\n // The letter l (lowercase L) and the number 1 have been removed from\n // the possible options as they are commonly mistaken for each other.\n $possible = \"234567890abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $i = 0;\n\n while ($i < $length) {\n $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);\n if (!strstr($password, $char)) {\n $password .= $char;\n $i++;\n }\n }\n\n return $password;\n }", "public function setMinPostalCodeLength(int $minPostalCodeLength): self\n {\n $this->options['minPostalCodeLength'] = $minPostalCodeLength;\n return $this;\n }", "function generatePassword() {\n //Initialize the random password\n $password = '';\n\n //Initialize a random desired length\n $desired_length = rand(8, 12);\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for ($length = 0; $length < $desired_length; $length++) {\n //Append a random ASCII character (including symbols)\n $password .= $characters[mt_rand(0, strlen($characters) - 1)];\n }\n\n return $password;\n }", "public function testGeneratePassword() {\n // Asking for a password 15 characters long\n $password = security::generate_password( 15 );\n\n // Make sure it's 15 characters\n $this->assertEquals( 15, strlen( $password ) );\n }", "public function generatePassword($length = 8): string\r\n {\r\n $chars = 'abcdefghkmnpqrstuvwxyzABCDEFGHKMNPQRSTUVWXYZ23456789';\r\n\r\n return substr(str_shuffle($chars), 0, $length);\r\n }", "public function testBugReport2605()\n {\n $password = Text_Password::create(7, 'unpronounceable', '1,3,a,Q,~,[,f');\n $this->assertTrue(strlen($password) == 7);\n }", "public function setLengthMax($length)\n {\n if (!$length) {\n $length = self::LENGTH_MAX_MAX;\n }\n \n $this->lengthMax = \\RandData\\Checker::int(\n $length,\n self::LENGTH_MAX_MIN,\n self::LENGTH_MAX_MAX,\n \"lengthMax\"\n );\n }", "protected static function _maxLength() {\n if (self::$_ruleValue) {\n if (strlen(trim(self::$_elementValue)) > self::$_ruleValue) {\n self::setErrorMessage(\"Enter at most \" . self::$_ruleValue . \" charachters only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function testRandomRequirements ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 4,\n 'digit' => 3,\n 'upper' => 2,\n 'lower' => 1\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){3})(?=(?:[^a-z]*[a-z]){1})(?=(?:[^A-Z]*[A-Z]){2})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){4})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public static function password($length = 8) {\n $seed = 'abcdefhikmnrstuwxz' . '2456789';\n $ret = '';\n for ($i = 1; $i <= $length; $i++) {\n $ret .= $seed[mt_rand(0, strlen($seed) - 1)];\n }\n return $ret;\n }", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "public function setMinLength($minLength)\n {\n $this->_minLength = $minLength;\n return $this;\n }", "private function min_length($field, $value, $min_length) {\n $length = strlen($value);\n \n // Throw error is field length does not meet minimum\n if ($length < $min_length) {\n $this->errors[$field][] = self::ERROR_MIN_LENGTH;\n }\n }", "function generatePassword( $length = 6 )\r\n {\r\n $password = \"\";\r\n\r\n // define possible characters\r\n $possibleChars = \"0123456789bcdfghjkmnpqrstvwxyz\";\r\n\r\n // set up a counter\r\n $i = 0;\r\n\r\n // add random characters to the password until it is the correct length\r\n while ($i < $length)\r\n {\r\n // pick a random character from the possible ones\r\n $char = substr( $possibleChars, mt_rand(0, strlen($possibleChars)-1), 1);\r\n\r\n // add the character to the password, unless it is already present\r\n if (!strstr($password, $char))\r\n {\r\n $password .= $char;\r\n $i++;\r\n }\r\n }\r\n\r\n // done\r\n return $password;\r\n }", "function random_password($length){\r\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n //Create blank string\r\n $password = '';\r\n //Get the index of the last character in our $characters string\r\n $characterListLength = mb_strlen($characters, '8bit') - 1;\r\n //Loop from 1 to the length that was specified\r\n foreach(range(1,$length) as $i){\r\n $password .=$characters[rand(0,$characterListLength)];\r\n }\r\n return $password;\r\n}", "public static function setPassword($val) \n { \n emailSettings::$password = $val; \n }", "private function generatePassword ($length = 8){\r\n $password = \"\";\r\n\r\n // define possible characters - any character in this string can be\r\n // picked for use in the password, so if you want to put vowels back in\r\n // or add special characters such as exclamation marks, this is where\r\n // you should do it\r\n $possible = \"2346789bcdfghjkmnpqrtvwxyzBCDFGHJKLMNPQRTVWXYZ\";\r\n\r\n // we refer to the length of $possible a few times, so let's grab it now\r\n $maxlength = strlen($possible);\r\n \r\n // check for length overflow and truncate if necessary\r\n if ($length > $maxlength) {\r\n $length = $maxlength;\r\n }\r\n \r\n // set up a counter for how many characters are in the password so far\r\n $i = 0; \r\n \r\n // add random characters to $password until $length is reached\r\n while ($i < $length) { \r\n\r\n // pick a random character from the possible ones\r\n $char = substr($possible, mt_rand(0, $maxlength-1), 1);\r\n \r\n // have we already used this character in $password?\r\n if (!strstr($password, $char)) { \r\n // no, so it's OK to add it onto the end of whatever we've already got...\r\n $password .= $char;\r\n // ... and increase the counter by one\r\n $i++;\r\n }\r\n\r\n }\r\n // done!\r\n return $password;\r\n }", "function random_pass($len)\r\n{\r\n\t$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n\r\n\t$password = '';\r\n\tfor ($i = 0; $i < $len; ++$i)\r\n\t\t$password .= substr($chars, (mt_rand() % strlen($chars)), 1);\r\n\r\n\treturn $password;\r\n}", "static public function createRandomPassword($len = 8) {\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n $pass = '';\n $alphaLength = strlen($alphabet) - 1;\n for ($i = 0; $i < $len; $i++) {\n $pass .= $alphabet[rand(0, $alphaLength)];\n }\n return $pass;\n }", "public static function generateRandomPassword ()\n {\n return rand(10000, 99999);\n }", "protected function generateAdminPassword()\n {\n return\n Util::getRandomString(1, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') .\n Util::getRandomString(1, '0123456789') .\n Util::getRandomString(1, '@*^%#()<>') .\n Util::getRandomString();\n }", "public function setPassword($newPassword);", "public function testUpdatePasswordOnlyNumbers(): void { }", "public function testLengthIs191ByDefault()\n {\n $this->assertEquals(191, (new StringField('some_string'))->getLength());\n }", "public function setMinLength($minLength)\n {\n $this->minLength = $minLength;\n return $this;\n }", "public function minLength($value) {\n return $this->setProperty('minLength', $value);\n }", "function get_random_password($chars_min=6, $chars_max=8, $use_upper_case=false, $include_numbers=false, $include_special_chars=false)\n {\n $length = rand($chars_min, $chars_max);\n $selection = 'aeuoyibcdfghjklmnpqrstvwxz';\n if($include_numbers) {\n $selection .= \"1234567890\";\n }\n if($include_special_chars) {\n $selection .= \"!@04f7c318ad0360bd7b04c980f950833f11c0b1d1quot;#$%&[]{}?|\";\n }\n \n $password = \"\";\n for($i=0; $i<$length; $i++) {\n $current_letter = $use_upper_case ? (rand(0,1) ? strtoupper($selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))]; \n $password .= $current_letter;\n } \n \n return $password;\n }", "public static function generatePassword ($length = 12)\n {\n $password = '';\n $salt = 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz123456789';\n srand((double) microtime() * 1000000);\n for ($i = 0; $i < $length; $i ++) {\n $num = rand() % 33;\n $tmp = substr($salt, $num, 1);\n $password .= $tmp;\n }\n return $password;\n }", "public function setPasswordField($password = true) {}", "public static function set_code_length($length)\n {\n self::$_code_length = $length;\n }" ]
[ "0.7863441", "0.7545861", "0.7204101", "0.7204101", "0.707599", "0.6785875", "0.64868104", "0.6439458", "0.6439205", "0.64361703", "0.64239854", "0.64176124", "0.6360836", "0.6351453", "0.6337413", "0.6293192", "0.6291461", "0.62632596", "0.62354416", "0.6235107", "0.6219922", "0.62096506", "0.6189673", "0.61873424", "0.61320883", "0.60390675", "0.6000946", "0.5975294", "0.5961049", "0.5955505", "0.59508693", "0.5937179", "0.59278023", "0.5908953", "0.58870506", "0.5882868", "0.5882868", "0.5882868", "0.5874068", "0.5847825", "0.5847417", "0.5842976", "0.58151275", "0.5805805", "0.5800265", "0.57811373", "0.5776609", "0.5740947", "0.573658", "0.57135665", "0.57090557", "0.5708472", "0.5670816", "0.5670635", "0.56551623", "0.5654309", "0.56399643", "0.5639875", "0.56365997", "0.5628696", "0.5600542", "0.56000775", "0.5596193", "0.55893105", "0.5569788", "0.55477226", "0.5535788", "0.5529278", "0.55265546", "0.55265546", "0.55265546", "0.5519197", "0.55174726", "0.5516185", "0.551348", "0.5513446", "0.55102175", "0.5507398", "0.55044746", "0.55011934", "0.54946136", "0.5493214", "0.5490739", "0.5482215", "0.54778934", "0.5476647", "0.547516", "0.5473063", "0.5471151", "0.5468391", "0.5454044", "0.5451291", "0.54506975", "0.54400814", "0.54331243", "0.5431917", "0.54308337", "0.54244417", "0.54187053", "0.54186827", "0.54147553" ]
0.0
-1
Get global maximum password characters length, default value is 255.
public function GetMustHaveMaxLength () { return $this->mustHaveMaxLength; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function getMaxChars()\n {\n return $this->maxChars;\n }", "public function getMaxLength()\n {\n return $this->__get(self::FIELD_MAXLENGTH); \n }", "public function getMaxUsernameLength();", "public function getMaxLength()\n {\n return $this->maxLength;\n }", "public function getMaxLength() {\n return $this->maxLength;\n }", "public function getMaxLength() {}", "public function getPasswordLength() {\n\t\treturn $this->_passwordLength;\n\t}", "public function getMaxLength()\n {\n return 254;\n }", "public function getMaxChars()\n {\n return intval($this->maxChars);\n }", "public function getLengthMax()\n {\n return $this->lengthMax;\n }", "public function getMaxLength();", "public function getMaximumStringKeyLength()\n {\n return $this->maximumStringKeyLength;\n }", "protected function get_max_length(): int\n\t{\n\t\treturn $this->end < $this->total ? $this->length : -1;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function getLengthLimit()\n {\n }", "public function getMaxKeyLength()\n {\n return $this->maxKeyLength;\n }", "protected function getCharacterLimit()\n {\n $charLimit = static::CHAR_LIMIT_DEFAULT;\n if ($this->isUsingExpectedLengthAsCharLimit()) {\n $charLimit = $this->interaction->getExpectedLength();\n }\n\n return $charLimit;\n }", "function CharMax()\n\t{\n\t\treturn 1000000000; // should be 1 Gb?\n\t}", "public function getMaxIssuerPathLengthValue()\n {\n return $this->readWrapperValue(\"max_issuer_path_length\");\n }", "public static function getCryptedStringMinLength() {\n return self::$cryptedStringMinLength;\n }", "public static function getMaximumPathLength() {}", "public function getMaximumLineLength() {}", "public function get_max_query_length() {\n\t\treturn $this->max_query_length;\n\t}", "public function getMaxLength(): ?int\n {\n return $this->maxLength;\n }", "public function getMinUsernameLength();", "public function setPasswordLenghtMax($num) {\n if((is_numeric($num)) && (($this->password_lenghtMin==null) || ($this->password_lenghtMin<$num))) {\n $this->password_lenghtMax = $num;\n return $this->password_lenghtMax;\n }\n return false;\n }", "public function getMaxlength(): ?int\n {\n return $this->maxlength;\n }", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "function _get_field_size() \n {\n if (isset($this->attribs['size'])) {\n return $this->attribs['size'];\n }\n elseif ($this->attribs['maxlength'] > $this->max_size) {\n return $this->max_size;\n }\n else {\n return $this->attribs['maxlength'];\n }\n }", "public function getCharLength();", "function has_max_length($value, $max) {\r\n\treturn strlen($value) <= $max;\r\n}", "function has_max_length($value, $max) {\n\t\treturn strlen($value) <= $max;\n\t\t}", "public function getMaxSize(): int;", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length,$passwordLength);\n }", "public function setMaxLength($maxLength) {}", "public function getMaxPadSize() {\n\treturn $this->textStorageSize - $this->getOverheadSize($this->algoBlockSize - 1);\n }", "public function GetMaxSize ();", "public static function setGlobalMaxLength(int $maxLength):void {\r\n\t\tself::$globalMaxLength = $maxLength;\r\n\t}", "function has_max_length($value, $max) {\n\treturn strlen($value) <= $max;\n}", "function has_max_length($value, $max) {\n\treturn strlen($value) <= $max;\n}", "public function getMaxIssuerPathLength()\n {\n return $this->max_issuer_path_length;\n }", "public function getLimitLength()\n\t\t{\n\t\t\tif($this->hasLimit())\n\t\t\t{\n\t\t\t\treturn $this->limit[1];\n\t\t\t}\n\t\t\tthrow new \\Exception('Retrieving non-existant limit length');\n\t\t}", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_STRENGTH_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length, $passwordLength);\n }", "function getSaltLength() ;", "function wp_get_comment_fields_max_lengths()\n {\n }", "public function get_logger_limit() {\n\t\treturn $this->get_option('ring_logger_limit', 20);\n\t}", "function generate_random_password($len = 8)\n {\n }", "public function setMaxUsernameLength($length);", "public function getMaxUploadFileSize()\n\t{\n\t\t$objResult = \\Database::getInstance()->prepare(\"SELECT MAX(maxlength) AS maxlength FROM tl_form_field WHERE pid=? AND invisible='' AND type='upload' AND maxlength>0\")\n\t\t\t\t\t\t\t\t\t\t\t ->execute($this->id);\n\n\t\tif ($objResult->numRows > 0 && $objResult->maxlength > 0)\n\t\t{\n\t\t\treturn $objResult->maxlength;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \\Config::get('maxFileSize');\n\t\t}\n\t}", "public function getQueryStringLengthValue()\n {\n return $this->readWrapperValue(\"query_string_length\");\n }", "static function getMaxLength(int $type): int\n {\n if ($type === self::SHOUTBOX_ENTRY) {\n return 255;\n }\n\n return 16384;\n }", "function validMaxLength($value, $max)\n {\n return strlen($value) <= $max;\n }", "public function getSaltLength() {}", "public function getSaltLength() {}", "public function getMaxAttributeLength()\n {\n return (int)$this->floatValue('recorded.value.max.length', 1200);\n }", "public function getMaxColumnNameLength();", "protected static function _maxLength() {\n if (self::$_ruleValue) {\n if (strlen(trim(self::$_elementValue)) > self::$_ruleValue) {\n self::setErrorMessage(\"Enter at most \" . self::$_ruleValue . \" charachters only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function getMaxLineLength()\n {\n return $this->maxLineLength;\n }", "function pwdLongEnough($password) {\n $result=true;\n if(strlen($password) < 8){\n $result =false;\n } \n else {\n $result = true;\n }\n return $result;\n}", "public function getMaxLimit()\n {\n return $this->max_limit;\n }", "function getMaxKeySize()\n {\n return $this->_key_size;\n }", "public function getExtensionLength()\n {\n return $this->_fields['ExtensionLength']['FieldValue'];\n }", "function page_length()\n\t{\n\t\t//To get Admin page length\n\t\t$get_page_length = select_single_record(GLOBAL_CONFIGURATION, \"admin_page_length\", \"\", \"LIMIT 1\");\n\t\tif($get_page_length[0]>0)\n\t\t{\n\t\t\t$set_page_length = $get_page_length[1];\n\t\t\t$admin_page_length = striptext($set_page_length['admin_page_length']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$admin_page_length = 10;\n\t\t}\n\t\t\n\t\treturn (int) $admin_page_length;\n\t}", "public function generatePassword() {\n $generator = new UriSafeTokenGenerator();\n $token = $generator->generateToken();\n return substr($token, 0, 6);\n }", "public function checkPasswordMaxLength($password)\n {\n if (strlen($password) > 20) {\n return false;\n } else return true;\n }", "protected function isPasswordTooLong($password)\r\n {\r\n return strlen($password) > static::MAX_PASSWORD_LENGTH;\r\n }", "public function getMaxSize()\r\n {\r\n return $this->max_size;\r\n }", "private function get_userMaskLen()\n\t{\n\t\treturn $this->m_userMaskLen;\n\t}", "public function getFieldLength()\n {\n return $this->FieldLength;\n }", "public function testLongPassword ()\n {\n // Function parameters\n $length = 20;\n $minPasswordRequirements = [];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{20,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function testMaxlen(){\n\t\t#mdx:maxlen\t\t\n\t\tParam::get('description')->filters()->maxlen(30, \"Description must be less than %d characters long!\");\n\t\t$error = Param::get('description')\n\t\t\t->process(['description'=>str_repeat('lorem ipsum', 10)])\n\t\t\t->error;\n\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 30\", $error);\n\t}", "public static function getParameterKeyMaxId()\n {\n return config('consts.ParameterMaxId');\n }", "protected function generateLength()\n {\n $lengthMin = $this->getLengthMin();\n $lengthMax = $this->getLengthMax();\n\n if ($lengthMin > $lengthMax) {\n $buffer = $lengthMin;\n $lengthMin = $lengthMax;\n $lengthMax = $buffer;\n }\n\n return mt_rand($lengthMin, $lengthMax);\n }", "public static function getPostMaxSize(): int\n {\n $result = static::getIniValue('post_max_size');\n $result = Convert::valueToBytes($result);\n\n return $result;\n }", "function generatePassword ($length = 8)\n{\n $string = implode(\"\", range(\"a\", \"z\")) . implode(\"\", range(0, 9));\n $max = strlen($string) - 1;\n $pwd = \"\";\n\n while ($length--)\n {\n $pwd .= $string[ mt_rand(0, $max) ];\n }\n\n\n return $pwd;\n}", "public function getPostMaxSize()\n {\n $iniMax = $this->getNormalizedIniPostMaxSize();\n\n if ('' === $iniMax) {\n return null;\n }\n\n if (preg_match('#^(\\d+)([bkmgt])#i', $iniMax, $match)) {\n $shift = array('b' => 0, 'k' => 10, 'm' => 20, 'g' => 30, 't' => 40);\n $iniMax = ($match[1] * (1 << $shift[strtolower($match[2])]));\n }\n\n return (int) $iniMax;\n }", "public function setMaxLength($length);", "function getMaxTextboxWidth()\n\t{\n\t\t$maxwidth = 0;\n\t\tforeach ($this->answers as $answer)\n\t\t{\n\t\t\t$len = strlen($answer->getAnswertext());\n\t\t\tif ($len > $maxwidth) $maxwidth = $len;\n\t\t}\n\t\treturn $maxwidth + 3;\n\t}", "function set_field_length($len) \n {\n $this->attribs['maxlength'] = $len;\n }", "protected function get_limit()\n {\n $bytes = ini_get('memory_limit');\n\n return $this->formatBytes($bytes);\n }", "function getMaxFileSize()\n {\n $val = trim(ini_get('post_max_size'));\n $last = strtolower($val[strlen($val)-1]);\n $val = intval($val);\n switch($last) {\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n $postMaxSize = $val;\n\n return($postMaxSize);\n }", "function TextMax()\n\t{\n\t\treturn 1000000000; // should be 1 Gb?\n\t}", "function maxlength($text, $max, $shorten=true)\n{\nif(strlen($text) >= $max) {\nif($shorten) {\n$text = substr($text, 0, ($max-3)).\"...\";\n} else {\n$text = substr($text, 0, ($max));\n} }\nreturn $text;\n}", "function random_password($length){\r\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n //Create blank string\r\n $password = '';\r\n //Get the index of the last character in our $characters string\r\n $characterListLength = mb_strlen($characters, '8bit') - 1;\r\n //Loop from 1 to the length that was specified\r\n foreach(range(1,$length) as $i){\r\n $password .=$characters[rand(0,$characterListLength)];\r\n }\r\n return $password;\r\n}", "function has_length($value, $options=array()) {\n //for first/last name [1,256]\n //for username [7, 256]\n if(strlen($value) > $options[0] && strlen($value) < $options[1]) {\n return 1;\n }\n return 0;\n }", "public function getLength()\n {\n return $this->int_length;\n }", "public function getMaxSize(): int\n {\n return $this->maxSize;\n }", "public static function _maxlength($value, $field, $max_length) {\n\t\treturn strlen($value) <= $max_length;\n\t}", "public function setMaximumStringKeyLength($value)\n {\n $this->maximumStringKeyLength = (int) $value;\n\n return $this;\n }", "private function getMaxFileSize()\n {\n $iniMax = strtolower(ini_get('upload_max_filesize'));\n\n if ('' === $iniMax) {\n return PHP_INT_MAX;\n }\n\n $max = ltrim($iniMax, '+');\n if (0 === strpos($max, '0x')) {\n $max = intval($max, 16);\n } elseif (0 === strpos($max, '0')) {\n $max = intval($max, 8);\n } else {\n $max = (int) $max;\n }\n\n switch (substr($iniMax, -1)) {\n case 't': $max *= 1024;\n case 'g': $max *= 1024;\n case 'm': $max *= 1024;\n case 'k': $max *= 1024;\n }\n\n return $max;\n }", "public function getPasswordStrength(string $password): int;", "public function getMaxSize(){\n return $this->maxSize;\n }", "public function testGetMaxLength() {\r\n\t\t$this->assertTrue ( 255 == $this->testObject->getMaxLength (), 'invalid max length was returned' );\r\n\t}", "public function getTextLength();", "public function testRegisterLongPassword() {\n $generic = new GenericValidationTests($this);\n $generic->testMaxStringAttribute('register', 'POST', self::$headers, self::$body, 'password', 30, 'password_confirmation');\n }", "function getMaxAttachmentSize()\n {\n $size = Misc::return_bytes(ini_get('upload_max_filesize'));\n return Misc::formatFileSize($size);\n }" ]
[ "0.76154864", "0.76154864", "0.75920796", "0.7544912", "0.7521918", "0.75145006", "0.75063574", "0.7504605", "0.75028443", "0.7425819", "0.74174374", "0.7390486", "0.7283338", "0.71379286", "0.705154", "0.69496995", "0.69496995", "0.69496995", "0.68923694", "0.6869895", "0.68605095", "0.67439604", "0.66803557", "0.6679233", "0.66193867", "0.64865893", "0.64751726", "0.64228415", "0.64208317", "0.6407408", "0.6362167", "0.62961835", "0.6274526", "0.6270118", "0.6260342", "0.6204279", "0.6200357", "0.61960703", "0.61848414", "0.61840254", "0.6171862", "0.6156489", "0.6153139", "0.6153139", "0.61489624", "0.6138616", "0.61303794", "0.61295044", "0.6095589", "0.6083644", "0.6060234", "0.60378134", "0.6013054", "0.6003523", "0.59935546", "0.597819", "0.5958725", "0.5958725", "0.59540147", "0.5952116", "0.5948261", "0.5943599", "0.5940062", "0.5934672", "0.59281176", "0.59243923", "0.5909309", "0.5897442", "0.58883756", "0.5877511", "0.5870508", "0.58666", "0.58539456", "0.58440727", "0.58362764", "0.5830662", "0.58191645", "0.58130854", "0.5801485", "0.5789917", "0.5785381", "0.5785137", "0.57617587", "0.5758747", "0.57541597", "0.5753185", "0.57335454", "0.573246", "0.5719654", "0.5709314", "0.5703454", "0.56970835", "0.569688", "0.5691874", "0.569133", "0.56863564", "0.5683955", "0.5680218", "0.56718874", "0.56716937" ]
0.5758813
83
Set global maximum password characters length, default value is 255.
public function SetMustHaveMaxLength ($mustHaveMaxLength = self::MAX_LENGTH) { /** @var \MvcCore\Ext\Forms\Validator $this */ $this->mustHaveMaxLength = $mustHaveMaxLength; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMaxLength($maxLength) {}", "public static function setGlobalMaxLength(int $maxLength):void {\r\n\t\tself::$globalMaxLength = $maxLength;\r\n\t}", "public function setMaxUsernameLength($length);", "public function setMaxLength($length);", "function set_field_length($len) \n {\n $this->attribs['maxlength'] = $len;\n }", "public function getMaxUsernameLength();", "public static function setPasswordMinLength($length){\n Configuration::where('id', 1)\n ->update(['password_min_length' => $length]);\n }", "public function setMaxLength($length) {\n $this->maxlength = $length;\n }", "public function setPasswordMinimumLength(?int $value): void {\n $this->getBackingStore()->set('passwordMinimumLength', $value);\n }", "public function setPasswordLenghtMax($num) {\n if((is_numeric($num)) && (($this->password_lenghtMin==null) || ($this->password_lenghtMin<$num))) {\n $this->password_lenghtMax = $num;\n return $this->password_lenghtMax;\n }\n return false;\n }", "public function setLengthMax($length)\n {\n if (!$length) {\n $length = self::LENGTH_MAX_MAX;\n }\n \n $this->lengthMax = \\RandData\\Checker::int(\n $length,\n self::LENGTH_MAX_MIN,\n self::LENGTH_MAX_MAX,\n \"lengthMax\"\n );\n }", "function setMaxLength($length) {\n\n $this->field['maxlength'] = $length;\n return $this;\n\n }", "public function setMaxLength(int $max):void {\r\n\t\t$this->maxLength = $max;\r\n\t}", "public function getMaxLength() {}", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function getPasswordLength() {\n\t\treturn $this->_passwordLength;\n\t}", "public function testRegisterLongPassword() {\n $generic = new GenericValidationTests($this);\n $generic->testMaxStringAttribute('register', 'POST', self::$headers, self::$body, 'password', 30, 'password_confirmation');\n }", "public function getLengthLimit()\n {\n }", "public function getMaxLength()\n {\n return 254;\n }", "public function setMaxLength($maxLength) {\n $this->maxLength = $maxLength;\n return $this;\n }", "public function setMaxIssuerPathLengthValue($var)\n {\n $this->writeWrapperValue(\"max_issuer_path_length\", $var);\n return $this;}", "public function getMaxChars()\n {\n return $this->maxChars;\n }", "public function setMaximumStringKeyLength($value)\n {\n $this->maximumStringKeyLength = (int) $value;\n\n return $this;\n }", "public function setMaxLength($max)\n {\n $this->__set(self::FIELD_MAXLENGTH,$max);\n return $this;\n }", "public function setMaxChars($value)\n {\n if (is_int($value) === false)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value');\n if ($value <= 0)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value; value must be greater than 0.');\n \n $this->maxChars = $value;\n }", "public function setMaxLength($maxLength)\n {\n $this->maxLength = $maxLength;\n return $this;\n }", "public function getMaxLength();", "public static function setLength ($length){\n\t\tself::$_length = $length;\n\t}", "function generate_random_password($len = 8)\n {\n }", "public function getLengthMax()\n {\n return $this->lengthMax;\n }", "public function setMaxChars($value)\n {\n if (!is_int($value))\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter \\'value\\' must be of type \\'int\\'');\n $this->maxChars = $value;\n }", "public function testLongPassword ()\n {\n // Function parameters\n $length = 20;\n $minPasswordRequirements = [];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{20,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function enablePasswordStringLength()\n {\n // Add validator\n return $this->attachPasswordValidator('Zend\\Validator\\StringLength', array(\n 'min' => 8,\n 'max' => 64,\n ));\n }", "public function getMaxLength()\n {\n return $this->maxLength;\n }", "public function setMaxLength(int $maxLength)\n {\n $this->getElement()->setAttribute('maxlength', $maxLength);\n return $this;\n }", "public function getMaxLength()\n {\n return $this->__get(self::FIELD_MAXLENGTH); \n }", "function set_length($length) {\n $this->length = $length;\n }", "public function setMaximumWordLength($maximum)\n {\n return $this->setOption('maximumwordlength', $maximum);\n }", "public function setLength($length);", "protected static function _maxLength() {\n if (self::$_ruleValue) {\n if (strlen(trim(self::$_elementValue)) > self::$_ruleValue) {\n self::setErrorMessage(\"Enter at most \" . self::$_ruleValue . \" charachters only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function getMaxLength() {\n return $this->maxLength;\n }", "function Set_max_size($ServerName, $max_size){\n\t\tself::Run_flushctl_command($ServerName, \" set max_size \".$max_size);\n\t}", "public function setMinUsernameLength($length);", "public function getMaximumStringKeyLength()\n {\n return $this->maximumStringKeyLength;\n }", "public function getMaxChars()\n {\n return intval($this->maxChars);\n }", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "public function checkPasswordMaxLength($password)\n {\n if (strlen($password) > 20) {\n return false;\n } else return true;\n }", "public function setMaxLength($length)\n {\n $this->max_length = $length;\n return $this;\n }", "public function setMaxlength(int $maxlength): self\n {\n $this->maxlength = $maxlength;\n\n return $this;\n }", "public function setIfMaxKeyLength($length)\n {\n return $this->setMaxKeyLength(\n max($this->getMaxKeyLength(), $length)\n );\n }", "protected function isPasswordTooLong($password)\r\n {\r\n return strlen($password) > static::MAX_PASSWORD_LENGTH;\r\n }", "function testMaxlen(){\n\t\t#mdx:maxlen\t\t\n\t\tParam::get('description')->filters()->maxlen(30, \"Description must be less than %d characters long!\");\n\t\t$error = Param::get('description')\n\t\t\t->process(['description'=>str_repeat('lorem ipsum', 10)])\n\t\t\t->error;\n\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 30\", $error);\n\t}", "function minimum_password_limit( & $errors ) {\r\n\t$min_length = 12;\r\n\tif ( !empty( $_POST['pass1'] ) && $_POST['pass1'] === $_POST['pass2'] && !preg_match('/^.*(?=.{12,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', $_POST['pass1']) ) {\r\n\t\t$errors->add( 'min_pass_length', sprintf( __( '<strong>Security advice</strong>: Your password must be at least %d characters long and have at least one capital letter and one number in it.' ), $min_length ), array( 'form-field' => 'pass1' ) );\r\n\t}\r\n}", "public function setPassword(){\n\t}", "public function param_character_limit($value = 0)\n {\n return form_input(array(\n 'type' => 'text',\n 'name' => 'character_limit'\n ), $value);\n }", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length,$passwordLength);\n }", "public function getMinUsernameLength();", "public function setPassword($value);", "public function testPasswordLengthManagement() {\n // Create a policy and add minimum and maximum \"length\" constraints.\n $this->drupalPostForm('admin/config/security/password-policy/add', ['label' => 'Test policy', 'id' => 'test_policy'], 'Next');\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->assertText('Number of characters');\n $this->assertText('Operation');\n\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => 1], 'Save');\n $this->assertText('Password character length of at least 1');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'maximum', 'character_length' => 6], 'Save');\n $this->assertText('Password character length of at most 6');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => ''], 'Save');\n $this->assertText('The character length must be a positive number.');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => -1], 'Save');\n $this->assertText('The character length must be a positive number.');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => $this->randomMachineName()], 'Save');\n $this->assertText('The character length must be a positive number.');\n }", "function has_max_length($value, $max) {\n\t\treturn strlen($value) <= $max;\n\t\t}", "public function settings()\n {\n $this->settings = ['max_token_length' => ['integer', 255] ];\n }", "public function setMaxLineLength(?int $maxLineLength): void {\n\t\t$this->maxLineLength = $maxLineLength;\n\t}", "public function testGenerateLength()\n {\n $length = mt_rand(10, 1000);\n $password = PasswordGenerator::generate($length, PasswordGenerator::PASSWORD_STRENGTH_HARD);\n $passwordLength = mb_strlen($password);\n\n $this->assertEquals($length, $passwordLength);\n }", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "public function setQueryStringLengthValue($var)\n {\n $this->writeWrapperValue(\"query_string_length\", $var);\n return $this;}", "function generatePassword ($length = 8)\n{\n $string = implode(\"\", range(\"a\", \"z\")) . implode(\"\", range(0, 9));\n $max = strlen($string) - 1;\n $pwd = \"\";\n\n while ($length--)\n {\n $pwd .= $string[ mt_rand(0, $max) ];\n }\n\n\n return $pwd;\n}", "public function setMaxKeyLength($length)\n {\n $this->maxKeyLength = $length;\n\n return $this;\n }", "public function testTooLongString()\n {\n $maxKeyLength = 128;\n $store = new \\Loom\\Settable();\n\n $this->assertNull($store->set(str_repeat(\"a\", $maxKeyLength + 1), \"myvalue\"));\n $this->assertEmpty($store->get());\n }", "function validatePasswordLength(&$Model, $data, $compare) {\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$this->settings[$Model->alias]['fields']['password']];\r\n\t\t$length = strlen($compare);\r\n\t\tif ($length < $this->settings[$Model->alias]['passwordPolicies'][$this->settings[$Model->alias]['passwordPolicy']]['length']) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function has_max_length($value, $max) {\r\n\treturn strlen($value) <= $max;\r\n}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "public function get_max_length_code() {\n\t\treturn self::MAX_LENGTH_CODE;\n\t}", "function wp_generate_password($length = 12, $special_chars = \\true, $extra_special_chars = \\false)\n {\n }", "public function testMaxLength(){\n \t/*\n \t * Visit the registration page and enter fields that are too long\n \t */\n \t$this->visit('/register')\n \t\t->see('E-Mail Address');\n \t\n \t/*\n \t * Confirm the error text when submitting oversized data\n \t */\n \t$clearpass = str_random(7);\n \t$name = str_random(256);\n \t$this->type($name , 'name')\n \t\t->type(str_random(256) . '@example.com', 'email')\n \t\t->type($clearpass, 'password')\n \t\t->type($clearpass, 'password_confirmation')\n \t\t->press('Register')\n \t\t->see('The name may not be greater than 255 characters.')\n \t\t->see('The email must be a valid email address.')\n \t\t->see('The email may not be greater than 255 characters.')\n \t\t->assertTrue(App\\User::where('name', $name)->get()->isEmpty());\n \t\n \t/*\n \t * Confirm the error session keys when explicitly posting the registration form\n \t */\n \t\t \n \t$this->post('/register', [\n \t\t\t'name' => $name, \n \t\t\t'email' => str_random(256) . '@example.com', \n \t\t\t'password' => $clearpass, \n \t\t\t'password_confirmation' => $clearpass, \n \t\t\t'_token' => csrf_token()\n \t\t])\n \t\t->assertRedirectedTo('/register')\n \t\t->assertSessionHasErrors(['name', 'email']);\n \t\n \t$this->assertTrue(App\\User::where('name', $name)->get()->isEmpty());\n }", "function edd_stripe_max_length_statement_descriptor( $html, $args ) {\n\tif ( 'stripe_statement_descriptor' !== $args['id'] ) {\n\t\treturn $html;\n\t}\n\n\t$html = str_replace( '<input type=\"text\"', '<input type=\"text\" maxlength=\"22\"', $html );\n\n\treturn $html;\n}", "public static function setPassword($val) \n { \n emailSettings::$password = $val; \n }", "public function getMaxKeyLength()\n {\n return $this->maxKeyLength;\n }", "function has_max_length($value, $max) {\n\treturn strlen($value) <= $max;\n}", "function has_max_length($value, $max) {\n\treturn strlen($value) <= $max;\n}", "public function setMaximumCalcLength($length = 200)\n {\n $this->_maxNameCalcLength = $length;\n\n return $this;\n }", "function CharMax()\n\t{\n\t\treturn 1000000000; // should be 1 Gb?\n\t}", "function generatePassword(&$Model, $length = 6) {\r\n\t\textract($this->settings[$Model->alias]);\r\n\t\t$salt = '';\r\n\t\tforeach ($passwordPolicies as $name => $policy) {\r\n\t\t\tif (isset($policy['salt'])) {\r\n\t\t\t\t$salt .= $policy['salt'];\r\n\t\t\t}\r\n\t\t\tif (isset($policy['length'])) {\r\n\t\t\t\t$length = max ($length, $policy['length']);\r\n\t\t\t}\r\n\t\t\tif ($name == $passwordPolicy) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$_id = $Model->id;\r\n\t\t$_data = $Model->data;\r\n\t\tdo {\r\n\t\t\t$Model->create();\r\n\t\t\t$password = $this->__generateRandom($length, $salt);\r\n\t\t\t$Model->data[$Model->alias][$fields['password']] = Security::hash($password, null, true);\r\n\t\t\t$Model->data[$Model->alias][$fields['password_confirm']] = $password;\r\n\t\t} while (!$Model->validates());\r\n\t\t$Model->create();\r\n\t\t$Model->id = $_id;\r\n\t\t$Model->data = $_data;\r\n\t\treturn $password;\r\n\t}", "public function setPasswordLenghtMin($num) {\n if((is_numeric($num)) && (($this->password_lenghtMax==null) || ($this->password_lenghtMax>$num))) {\n $this->password_lenghtMin = $num;\n return $this->password_lenghtMin;\n }\n return false;\n }", "function pwdLongEnough($password) {\n $result=true;\n if(strlen($password) < 8){\n $result =false;\n } \n else {\n $result = true;\n }\n return $result;\n}", "public function setLen($value)\n {\n return $this->set(self::LEN, $value);\n }", "function random_password($length){\r\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n //Create blank string\r\n $password = '';\r\n //Get the index of the last character in our $characters string\r\n $characterListLength = mb_strlen($characters, '8bit') - 1;\r\n //Loop from 1 to the length that was specified\r\n foreach(range(1,$length) as $i){\r\n $password .=$characters[rand(0,$characterListLength)];\r\n }\r\n return $password;\r\n}", "function maxlength($text, $max, $shorten=true)\n{\nif(strlen($text) >= $max) {\nif($shorten) {\n$text = substr($text, 0, ($max-3)).\"...\";\n} else {\n$text = substr($text, 0, ($max));\n} }\nreturn $text;\n}", "public function setPassword($value)\r\n\t{\r\n\t\t$this->password = $value;\r\n\t}", "function validMaxLength($value, $max)\n {\n return strlen($value) <= $max;\n }", "function generate_password($length = 20) {\n $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' .\n '0123456789``-=~!@#$%^&*()_+,./<>?;:[]{}\\|';\n $str = '';\n $max = strlen($chars) - 1;\n for ($i = 0; $i < $length; $i++)\n $str .= $chars[mt_rand(0, $max)];\n return ltrim($str);\n }", "public function setMaxSizeOfInstructions($value) {}", "public function setMaxLength(int $length): self\n {\n if ($length < 1) {\n throw new \\InvalidArgumentException(sprintf('The argument of the \"%s()\" method must be 1 or higher (%d given).', __METHOD__, $length));\n }\n\n $this->setCustomOption(self::OPTION_MAX_LENGTH, $length);\n\n return $this;\n }", "public function setLength($length)\n {\n $this->length = $length;\n }", "public function setLength($length)\n {\n $this->length = $length;\n }", "public function setMaxLength($maxLength) {\n if (!is_integer($maxLength) || $maxLength < 0) {\n throw new \\InvalidArgumentException('Maximal length must be numeric and greather or equal to zero. Get: \"' . $maxLength . '\"');\n }\n $this->maxLength = $maxLength;\n return $this;\n }", "public static function getCryptedStringMinLength() {\n return self::$cryptedStringMinLength;\n }", "function random_pass($len)\r\n{\r\n\t$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n\r\n\t$password = '';\r\n\tfor ($i = 0; $i < $len; ++$i)\r\n\t\t$password .= substr($chars, (mt_rand() % strlen($chars)), 1);\r\n\r\n\treturn $password;\r\n}", "public function limit($length)\n {\n $this->randomStringLength = $length;\n return $this;\n }", "public function setPassword($value)\n {\n $this->_password = $value;\n }" ]
[ "0.71629906", "0.71249366", "0.6992721", "0.6971656", "0.69254595", "0.67821264", "0.67731225", "0.67175984", "0.66662353", "0.65283674", "0.6517029", "0.6452255", "0.64355826", "0.6369309", "0.63186795", "0.63186795", "0.63152295", "0.62809384", "0.62714934", "0.6253397", "0.6209631", "0.6198772", "0.61963665", "0.61940044", "0.6159404", "0.6157512", "0.61426413", "0.6141904", "0.61350405", "0.6129748", "0.6111302", "0.6090154", "0.60869056", "0.60791415", "0.60761106", "0.6073226", "0.60728395", "0.60687983", "0.6064429", "0.6063015", "0.60403883", "0.60341835", "0.6032544", "0.597215", "0.596769", "0.5962177", "0.59542674", "0.59402424", "0.5895775", "0.58711404", "0.5862585", "0.58132315", "0.57952607", "0.5794508", "0.5780631", "0.57734215", "0.5770785", "0.5741248", "0.5736928", "0.57260513", "0.57148725", "0.57104707", "0.5704541", "0.57043576", "0.5690801", "0.5679776", "0.56760114", "0.5664824", "0.5646783", "0.56437695", "0.563198", "0.5627074", "0.5627074", "0.5627074", "0.5617181", "0.5609914", "0.56087327", "0.55954057", "0.5589704", "0.5579056", "0.5579056", "0.5572691", "0.5568354", "0.5561125", "0.55445343", "0.5532776", "0.55261886", "0.55251116", "0.5524544", "0.5521812", "0.55205226", "0.5508929", "0.5508102", "0.5501611", "0.5496132", "0.5496132", "0.5492402", "0.5490591", "0.5476994", "0.54706275", "0.5467225" ]
0.0
-1
Get password strength rule to have any lower case character presented in password. Default value is `TRUE` to must have lower case character in password. Lower case characters from latin alphabet: abcdefghijklmnopqrstuvwxyz. This function returns array with the rule `boolean` as first item and second item is minimum lower case characters count i n password as `integer`. If you set function first argument to `FALSE`, function returns only array `[TRUE]`, if the rule is `TRUE` or an empty array `[]` if the rule is `FALSE`.
public function GetMustHaveLowerCaseChars ($getWithMinCount = TRUE) { if ($getWithMinCount) return [$this->mustHaveLowerCaseChars, $this->mustHaveLowerCaseCharsCount]; return $this->mustHaveLowerCaseChars ? [TRUE] : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testManyLowercaseCharacter ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 1,\n 'digit' => 1,\n 'upper' => 1,\n 'lower' => 5\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^a-z]*[a-z]){5})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){1})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function check_strength($user_password) {\n $characters = 0;\n $capitalletters = 0;\n $loweletters = 0;\n $number = 0;\n\n if (strlen ($user_password) > 11) {\n $characters = 1;\n } else {\n $characters = 0;\n };\n if (preg_match('/[A-Z]/', $user_password)) {\n $capitalletters = 1;\n } else {\n $capitalletters = 0;\n };\n if (preg_match('/[a-z]/', $user_password)) {\n $loweletters = 1;\n } else {\n $loweletters = 0;\n };\n if (preg_match('/[0-9]/', $user_password)) {\n $number = 1;\n } else {\n $number = 0;\n };\n\n $total = $characters + $capitalletters + $loweletters + $number;\n\n return GetPercentage(4, $total);\n}", "private function passwordRules() {\n return [\n 'password' => 'required|alpha_num|between:3,20|confirmed',\n 'password_confirmation' => 'required|alpha_num|between:3,20',\n ];\n }", "public function getStrength($password, $username = null)\n {\n if (!empty($username)) {\n $password = str_replace($username, '', $password);\n }\n\n $password_length = strlen($password);\n\n $strength = $password_length * 4;\n\n for ($i = 2; $i <= 4; $i++) {\n $temp = str_split($password, $i);\n\n $strength -= (ceil($password_length / $i) - count(array_unique($temp)));\n }\n\n preg_match_all('/[0-9]/', $password, $numbers);\n\n if (!empty($numbers)) {\n $numbers = count($numbers[0]);\n\n if ($numbers >= 3) {\n $strength += 5;\n }\n } else {\n $numbers = 0;\n }\n\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^¨\\\\\\]/', $password, $symbols);\n\n if (!empty($symbols)) {\n $symbols = count($symbols[0]);\n\n if ($symbols >= 2) {\n $strength += 5;\n }\n } else {\n $symbols = 0;\n }\n\n preg_match_all('/[a-z]/', $password, $lowercase_characters);\n preg_match_all('/[A-Z]/', $password, $uppercase_characters);\n\n if (!empty($lowercase_characters)) {\n $lowercase_characters = count($lowercase_characters[0]);\n } else {\n $lowercase_characters = 0;\n }\n\n if (!empty($uppercase_characters)) {\n $uppercase_characters = count($uppercase_characters[0]);\n } else {\n $uppercase_characters = 0;\n }\n\n if (($lowercase_characters > 0) && ($uppercase_characters > 0)) {\n $strength += 10;\n }\n\n $characters = $lowercase_characters + $uppercase_characters;\n\n if (($numbers > 0) && ($symbols > 0)) {\n $strength += 15;\n }\n\n if (($numbers > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($symbols > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($numbers == 0) && ($symbols == 0)) {\n $strength -= 10;\n }\n\n if (($symbols == 0) && ($characters == 0)) {\n $strength -= 10;\n }\n\n if ($strength < 0) {\n $strength = 0;\n }\n\n if ($strength > 100) {\n $strength = 100;\n }\n\n return $strength;\n }", "public function passStrength($str){\n $error = FALSE;\n // make sure it is long enough\n if(strlen($str) < 8){\n $error['length'] = 'must be 8 characters minimum.';\n }\n // must contain letters & numbers and must have 1 upper case letter!\n if( ! preg_match('/[A-Za-z]/', $str) && preg_match('/[0-9]/', $str)){\n $error['alphanum'] = 'Must be alphanumeric and contain capitals and lower case.';\n }\n return $error;\n }", "function cjpopups_is_password_strong($pass_string, $compare = 1) {\n $r1='/[A-Z]/'; //Uppercase\n $r2='/[a-z]/'; //lowercase\n $r3='/[!@#$%^&*()\\-_=+{};:,<.>]/'; // whatever you mean by 'special char'\n $r4='/[0-9]/'; //numbers\n if(preg_match_all($r1,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r2,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r3,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r4,$pass_string, $o) < $compare) return FALSE;\n if(strlen($pass_string) < 8) return FALSE;\n return TRUE;\n}", "function testPass($pass){\n$level=0;\nif(eight($pass)){$level+=1;}\nif(upper($pass)){$level+=1;}\nif(lower($pass)){$level+=1;}\nif(hasDigit($pass)){$level+=1;}\nif(hasSpecial($pass)){$level+=1;}\n\nswitch($level){\ncase 1: echo 'Password strength : <b><font color=red\">Very weak.</font></b>';return false; break;\ncase 2: echo 'Password strength : <b><font color=\"orange\">Weak.</font></b>';return true; break;\ncase 3: echo 'Password strength : <b><font color=\"grey\">Medium</font></b>';return true; break;\ncase 4: echo 'Password strength : <b><font color=\"blue\">Good</font></b>';return true; break;\ncase 5: echo 'Password strength : <b><font color=\"green\">Strong.</font></b>';return true; break;\ndefault : echo 'Password strength : <b><font color=\"red\">Very weak.</font></b>'; break;}\n}", "public function password_strength_check($str)\n\t{\n\t\tif (preg_match('#[0-9]#', $str) && preg_match('#[a-zA-Z]#', $str)) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\t$this->form_validation->set_message('password_strength_check', 'Your password must be at least 6-19 characters in length and contain a number and both uppercase and lowercase letters');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\n\t}", "function CheckStrength($attribute, $params) {\n if (isset($this->$attribute)) { // Edit 2013-06-01\n $password = $this->$attribute;\n if (strlen($password) == 0)\n $strength = -10;\n else\n $strength = 0;\n /* * * get the length of the password ** */\n $length = strlen($password);\n /* * * check if password is not all lower case ** */\n if (strtolower($password) != $password) {\n $strength += 1;\n }\n /* * * check if password is not all upper case ** */\n if (strtoupper($password) == $password) {\n $strength += 1;\n }\n /* * * check string length is 8 -15 chars ** */\n if ($length >= 8 && $length <= 15) {\n $strength += 2;\n }\n /* * * check if lenth is 16 - 35 chars ** */\n if ($length >= 16 && $length <= 35) {\n $strength += 2;\n }\n /* * * check if length greater than 35 chars ** */\n if ($length > 35) {\n $strength += 3;\n }\n /* * * get the numbers in the password ** */\n preg_match_all('/[0-9]/', $password, $numbers);\n $strength += count($numbers[0]);\n /* * * check for special chars ** */\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^\\\\\\]/', $password, $specialchars);\n $strength += sizeof($specialchars[0]);\n /* * * get the number of unique chars ** */\n $chars = str_split($password);\n $num_unique_chars = sizeof(array_unique($chars));\n $strength += $num_unique_chars * 2;\n /* * * strength is a number 1-100; ** */\n $strength = $strength > 99 ? 99 : $strength;\n //$strength = floor($strength / 10 + 1);\n if ($strength < $params['score'])\n $this->addError($attribute, \"Password is too weak - try using CAPITALS, Num8er5, AND sp€c!al characters. Your score was \" . $strength . \"/\" . $params['score']);\n else\n return true;\n }\n }", "protected function password_strength($password)\n\t{\n\t\t$strength = 0;\n\t\t$patterns = array('/[a-z]/','/[A-Z]/','/\\d/','/\\W/','/.{12,}/');\n\t\tforeach($patterns as $pattern)\n\t\t{\n\t\t\t$strength += (int) preg_match($pattern,$password);\n\t\t}\n\t\treturn $strength;\n\t\t// 1 - weak\n\t\t// 2 - not weak\n\t\t// 3 - acceptable\n\t\t// 4 - strong\n\t}", "public function getPasswordStrength(string $password): int;", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "function reduce_min_strength_password_requirement( $strength ) {\n return 2; \n}", "public function getMinUsernameLength();", "function validate_password($candidate) \n{\n if (!empty($candidate))\n {\n // Declare and Initialize Local Variables\n $CritCount = 0; //Tabulator for keeping track of number of criteria matched\n\n /*\n Regular Expression Example $\\S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S*$\n $ = beginning of string\n \\S* = any set of characters\n (?=\\S{8,}) = of at least length 8\n (?=\\S*[a-z]) = containing at least one lowercase letter\n (?=\\S*[A-Z]) = and at least one uppercase letter\n (?=\\S*[\\d]) = and at least one number\n (?=\\S*[\\W]) = and at least a special character (non-word characters)\n $ = end of the string\n\n */\n // Test for each requirement \n if (strlen($candidate) >= 8) $CritCount = $CritCount + 10; // Value of 10 for minimum length\n if (preg_match('/[a-z]/', $candidate)) $CritCount = $CritCount + 1; //Contains lower case a-z\n if (preg_match('/[A-Z]/', $candidate)) $CritCount = $CritCount + 1; //Contains UPPER case A-Z\n if (preg_match('/[\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one numeric digit\n if (preg_match('/[^a-zA-Z\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one special Character (!@#$%^&*()-_, etc.)\n \n if ($CritCount > 12) //Meets minimum length, plus 3 additional criteria\n {\n return TRUE;\n }\n else \n {\n return FALSE;\n }\n }\n else\n return false;\n}", "function checkPasswordPolicy( $password, $admin=\"y\" ) {\n\t\n\tglobal $CONF;\n\t\n\t$smallLetters\t\t= preg_match( '/[a-z]/', $password );\n\t$capitalLetters\t\t= preg_match( '/[A-Z]/', $password );\n\t$numbers\t\t\t= preg_match( '/[0-9]/', $password );\n\tif( isset( $CONF['passwordSpecialChars'] ) ) {\n\t\t$pattern\t\t= '/'.$CONF['passwordSpecialChars'].'/';\n\t} else {\n\t\t$pattern\t\t= '/'.'[\\!\\\"\\§\\$\\%\\/\\(\\)=\\?\\*\\+\\#\\-\\_\\.\\:\\,\\;\\<\\>\\|\\@]'.'/';\n\t}\n\t$specialChars\t\t= preg_match( $pattern, $password );\n\t$passwordLength\t\t= strlen( $password );\n\t$groups\t\t\t\t= 0;\n\t\n\tif( $smallLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $capitalLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $numbers != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $specialChars != 0 ) {\t\t\n\t\t$groups++;\n\t}\n\t\n\tif( $admin == \"y\" ) {\n\t\t\n\t\tif( isset($CONF['minPasswordlength']) ) {\n\t\t\t$minPasswordLength\t= $CONF['minPasswordlength'];\n\t\t} else {\n\t\t\t$minPasswordLength\t= 14;\n\t\t}\n\t\tif( $passwordLength < $minPasswordLength ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset( $CONF['minPasswordGroups'] ) ) {\n\t\t\t\t$minPasswordGroups\t= $CONF['minPasswordGroups'];\n\t\t\t} else {\n\t\t\t\t$minPasswordGroups\t= 4;\n\t\t\t}\n\t\t\tif( isset( $minPasswordGroups ) ) {\n\t\t\t\n\t\t\t\tif( ($minPasswordGroups < 1) or ($minPasswordGroups > 4) ) {\n\t\t\t\t\t$minGroups\t= 4;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroups\t= $minPasswordGroups;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroups\t\t= 4;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroups ) {\n\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\n\t} else {\n\t\t\n\t\tif( isset( $CONF['minPasswordlengthUser'] ) ) {\n\t\t\t$minPasswordlengthUser\t\t= $CONF['minPasswordlengthUser'];\n\t\t} else {\n\t\t\t$minPasswordLengthUser\t\t= 8;\n\t\t}\n\t\tif( $passwordLength < $CONF['minPasswordlengthUser'] ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset($CONF['minPasswordGroupsUser']) ) {\n\t\t\t\t\n\t\t\t\tif( ($CONF['minPasswordGroupsUser'] < 1) or ($CONF['minPasswordGroupsUser'] > 4 ) ) {\n\t\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroupsUser\t= $CONF['minPasswordGroupsUser'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroupsUser ) {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\treturn $retval;\n}", "function isValidPassword($password){\n $hasLower = false;\n $hasDigit = false;\n $hasUpper = false;\n\n if(strlen($password) >= 8 && strlen($password) <= 20){\n $splitStringArray = str_split($password);\n\n for($i = 0; $i < count($splitStringArray); $i++){\n if(ctype_lower($splitStringArray[$i])){\n $hasLower = true;\n }\n else if(ctype_digit($splitStringArray[$i])){\n $hasDigit = true;\n }\n else if(ctype_upper($splitStringArray[$i])){\n $hasUpper = true;\n }\n if($hasLower && $hasDigit && $hasUpper){\n return true;\n }\n }\n }\n return false;\n }", "protected function passwordRules()\n {\n return ['required', 'string', new Password, 'confirmed', new \\Valorin\\Pwned\\Pwned(300),];\n }", "function checkPasswordErrors($password, $username = false) {\n $returns = array(\n 'strength' => 0,\n 'error' => 0,\n 'text' => ''\n );\n\n $length = strlen($password);\n\n if ($length < 8) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is not long enough';\n } elseif ($length > 32) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is too long';\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n $returns['error'] = 4;\n $returns['text'] = 'Password cannot be the same as your Username';\n } elseif (strtolower($password) == 'password') {\n $returns['error'] = 3;\n $returns['text'] = 'Password is too common';\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n $returns['error'] = 2;\n $returns['text'] = 'Too many consecutive characters';\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n $returns['strength'] = 5;\n $returns['text'] = 'Virtually Bulletproof';\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n $returns['strength'] = 4;\n $returns['text'] = 'Very Strong';\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n $returns['strength'] = 3;\n $returns['text'] = 'Strong';\n } else if ($numbers > 1) {\n//fair\n $returns['strength'] = 2;\n $returns['text'] = 'Fair';\n } else {\n//weak\n $returns['strength'] = 1;\n $returns['text'] = 'Weak';\n }\n }\n }\n return $returns;\n}", "protected function rulesChange()\n {\n return [\n 'password' => 'required|confirmed|min:'.config('db_limits.users.minPasswordLength'),\n ];\n }", "public function cases_lower()\n\t{\n\t\treturn array(\n\t\t\tarray(2, 7, true, false, 0, null, true),\n\t\t\tarray(2, 7, true, false, 6, 5, false),\n\t\t\tarray(2, 7, true, false, 7, 6, false),\n\t\t\tarray(2, 7, true, false, 8, 6, false),\n\t\t\tarray(2, 7, true, true, 0, null, true),\n\t\t\tarray(2, 7, true, true, 6, 5, false),\n\t\t\tarray(2, 7, true, true, 7, 6, false),\n\t\t\tarray(2, 7, true, true, 8, 7, false),\n\t\t\tarray(2, 7, true, true, 9, 7, false),\n\t\t\tarray(2, 7, false, false, 0, null, true),\n\t\t\tarray(2, 7, false, false, 2, null, true),\n\t\t\tarray(2, 7, false, false, 3, null, true),\n\t\t\tarray(2, 7, false, false, 4, 3, false),\n\t\t\tarray(2, 7, false, false, 6, 5, false),\n\t\t\tarray(2, 7, false, false, 7, 6, false),\n\t\t\tarray(2, 7, false, false, 8, 6, false),\n\t\t\tarray(2, 7, false, true, 0, null, true),\n\t\t\tarray(2, 7, false, true, 2, null, true),\n\t\t\tarray(2, 7, false, true, 3, null, true),\n\t\t\tarray(2, 7, false, true, 4, 3, false),\n\t\t\tarray(2, 7, false, true, 6, 5, false),\n\t\t\tarray(2, 7, false, true, 7, 6, false),\n\t\t\tarray(2, 7, false, true, 8, 7, false),\n\t\t\tarray(null, 7, null, false, 0, null, true),\n\t\t\tarray(null, 7, null, false, 1, 0, false),\n\t\t\tarray(null, 7, null, false, 7, 6, false),\n\t\t\tarray(null, 7, null, false, 8, 6, false),\n\t\t\tarray(9, -1, true, false, 0, null, true),\n\t\t\tarray(9, -1, true, false, 6, null, true),\n\t\t);\n\t}", "function minimumNumber($n, $password) {\n $res = 0;\n $check = 0;\n\t$free = 0;\n\n if ($n < 6) {\n $free = 6 - $n;\n }\n\t\n\t$uppercase = preg_match('@[A-Z]@', $password);\n\tif (!$uppercase) {\n\t\t$check++;\n\t}\n\t$lowercase = preg_match('@[a-z]@', $password);\n\tif (!$lowercase) {\n\t\t$check++;\n\t}\n\t$number = preg_match('@[0-9]@', $password);\n\tif (!$number) {\n\t\t$check++;\n\t}\n\t$speciaux = preg_match('#^(?=.*\\W)#', $password);\n\tif (!$speciaux) {\n\t\t$check++;\n\t}\n\t\n\t$res = $free + $check;\n\tif ($n < 6) {\n\t\t$res = ($free <= $check) ? $check : $free;\n\t}\n \n return $res;\n}", "protected function rules()\n {\n return [\n 'password' => ['required', 'string', 'min:8', 'confirmed','regex:/^(?=.*?[a-z])(?=.*?[#?!@$%^&*-_]).{8,}$/']\n ];\n }", "function isPasswordStrong($password){\r\n\t\tif(strlen($password) < 8)\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[0-9]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[A-Z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[a-z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[\\W_]+#\",$password))\r\n\t\treturn false;\r\n\r\n\t\treturn true;\r\n\t}", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK)\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n elseif ($params['strength'] === self::STRONG)\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n\n if (!preg_match($pattern, $this->$attribute) || strlen($this->$attribute) < 8)\n $this->addError($attribute, 'New password is not strong enough!' . \" \\n\" . \" Minimal length 8 digit and \" . \" \\n includes alphanumeric string\");\n }", "public function rules()\n {\n $maxChars = config('tweetRules.maxCharCount');\n $minChars = config('tweetRules.minCharCount');\n\n return [\n 'message' => \"min:$minChars|max:$maxChars\",\n ];\n }", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK) {\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n } elseif ($params['strength'] === self::STRONG) {\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n }\n if (!preg_match($pattern, $this->$attribute)) {\n $this->addError($attribute, 'your password is not strong enough!');\n }\n }", "private function hasLowercase(): bool\n {\n if (1 == preg_match('/\\p{Ll}/', $this->password)) {\n return true;\n }\n array_push($this->errorMessages, \"Lowercase letter missing.\");\n return false;\n }", "public function rules()\n {\n return [\n 'password' => ['required', 'confirmed', 'regex:+(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[,.;:#?!@$^%&*-]).{6,}+']\n ];\n }", "public function rules()\n {\n return [\n 'email' => ['required', 'email'],\n 'password' => ['required', Password::min(8)->symbols(true)->mixedCase(true)],\n ];\n }", "public function rules()\n {\n return [\n 'username' => ['required',\n 'min:3',\n 'max:255',\n 'regex:/^(\\w)+$/i',\n ],\n 'password' => ['required',\n 'min:3',\n 'max:35',\n ],\n ];\n }", "function valid_pass($password)\n {\n $r2 = '/[A-z]/'; //lowercase\n $r3 = '/[0-9]/'; //numbers\n $r4 = '/[~!@#$%^&*()\\-_=+{};:<,.>?]/'; // special char\n\n /*if (preg_match_all($r1, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个大写字母,请返回修改!\";\n return FALSE;\n }*/\n if (preg_match_all($r2, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个字母,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n if (preg_match_all($r3, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个数字,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n /*if (preg_match_all($r4, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个特殊符号:[~!@#$%^&*()\\-_=+{};:<,.>?],请返回修改!\";\n return FALSE;\n }*/\n if (strlen($password) < 8) {\n $msg = \"密码必须包含至少含有8个字符,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n return ['code' => 0, 'msg' => 'success'];\n }", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "public function strength($pwd = '', $data = array()) {\n if($pwd=='') {\n $pwd = $this->password;\n }\n $this->setUserdata($data);\n if((isset($pwd)) && ($pwd!='') && ($pwd!=null)) {\n if(class_exists('\\ZxcvbnPhp\\Zxcvbn')) {\n $zxcvbn = new \\ZxcvbnPhp\\Zxcvbn(); // https://github.com/bjeavons/zxcvbn-php\n $strength = $zxcvbn->passwordStrength($pwd, $this->userdata);\n\n return $strength;\n }\n }\n return false;\n }", "public function rules()\n {\n return [\n 'current_password' => [\n 'required',\n function ($attribute, $value, $fail) {\n if (!password_verify ($value, auth()->user()->password)) {\n $fail(\"$attribute không đúng\");\n }\n },\n ],\n 'password' => [\n 'required',\n 'max:128',\n 'regex:/^(?=.*[a-z])+(?=.*[A-Z])+(?=.*\\d)+(?=.*[$~!#^()@$!%*?&])[A-Za-z\\d$~!#^()@$!%*?&]{8,}/',\n ],\n ];\n }", "public static function getPasswordCriteria(){\n $config = Configuration::where('id', 1)->first();\n\n $regex = \"/^\";\n\n if($config->password_lower_case_required == 1){\n $regex.=\"(?=.*[a-z])\";\n }\n\n if($config->password_upper_case_required == 1){\n $regex.=\"(?=.*[A-Z])\";\n }\n\n if($config->password_special_characters_required == 1){\n $regex.=\"(?=.*[!$#@%*&])\";\n }\n\n if($config->password_number_required == 1){\n $regex.=\"(?=.*[0-9])\";\n }\n\n if($config->password_min_length > 6){\n $regex.=\".{\".$config->password_min_length.\",}$\";\n }\n else{\n $regex.=\".{6,}$\";\n }\n\n return $regex.\"/m\";\n }", "function __construct ($params=array())\n {\n /**\n * Define Rules\n * Key is rule identifier\n * Value is rule parameter\n * false is disabled (default)\n * Type is type of parameter data\n * permitted values are 'integer' or 'boolean'\n * Test is php code condition returning true if rule is passed\n * password string is $p\n * rule value is $v\n * Error is rule string definition\n * use #VALUE# to insert value\n */\n $this->rules['min_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return strlen($p)>=$v;',\n 'error' => 'Password must be more than #VALUE# characters long');\n\n $this->rules['max_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return (strlen($p)<=$v);',\n 'error' => 'Password must be less than #VALUE# characters long');\n\n $this->rules['min_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# lowercase characters');\n\n $this->rules['max_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# lowercase characters');\n\n $this->rules['min_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# uppercase characters');\n\n $this->rules['max_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# uppercase characters');\n\n $this->rules['disallow_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)==0;',\n 'error' => 'Password may not contain numbers');\n\n $this->rules['disallow_numeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[0-9]/\",$p,$x)==0;',\n 'error' => 'First character cannot be numeric');\n\n $this->rules['disallow_numeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be numeric');\n\n $this->rules['min_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# numbers');\n\n $this->rules['max_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# numbers');\n\n $this->rules['disallow_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)==0;',\n 'error' => 'Password may not contain non-alphanumeric characters');\n\n $this->rules['disallow_nonalphanumeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[\\W]/\",$p,$x)==0;',\n 'error' => 'First character cannot be non-alphanumeric');\n\n $this->rules['disallow_nonalphanumeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be non-alphanumeric');\n\n $this->rules['min_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# non-aplhanumeric characters');\n\n $this->rules['max_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# non-alphanumeric characters');\n\n // Apply params from constructor array\n foreach( $params as $k=>$v ) { $this->$k = $v; }\n\n // Errors defaults empty\n $this->errors = array();\n\n return 1;\n }", "function lowercase($letter1)\n {\n for ($i = 0; $i < strlen($letter1); $i++) {\n\t if (ord($letter1[$i]) >= ord('A') &&\n ord($letter1[$i]) <= ord('Z')) {\n return false;\n }\n }\n return true;\n }", "public function rules(): array\n {\n return [\n 'oldPassword' => ['required', 'string'],\n 'newPassword' => [\n 'required',\n 'string',\n 'min:8',\n new ContainsNumeral(),\n new ContainsLowercase(),\n new ContainsUppercase(),\n ],\n ];\n }", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "public function rules()\n {\n $validations = [\n 'username' => 'required|string',\n 'password' => 'required|string',\n ];\n\n return $validations;\n }", "public function rules()\n {\n return [\n 'username' => 'required|string|between:6,20',\n 'password' => 'required|between:6,16',\n ];\n }", "public function rules()\n {\n\t\t$id = $this->route('admin_user');\n\t\t$rules = [\n\t\t\t'password' => 'nullable|between:6,20',\n\t\t\t'name' => 'required|between:2,20|allow_letter|unique:admin_users,name,'.$id\n\t\t];\n\n\t\tif (!$id) {\n\t\t\t$rules['password'] = 'required';\n\t\t}\n\t\treturn $rules;\n }", "public function rules()\n {\n return [\n 'username' => ['required','min:6','max:12',new IsUsernameExist()],\n 'password'=> 'required|string|min:8|max:20|confirmed|regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/',\n 'password_confirmation' => 'required',\n ];\n }", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "public function provideCheckInputPasswordRange()\n {\n return [\n [1, 1],\n [11, false],\n [2, 2],\n [9, 9],\n [0, false]\n ];\n }", "public function rules(): array\n {\n return [\n 'password' => ['required', 'string', new Password(8), 'confirmed'],\n ];\n }", "public function testRandomRequirements ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 4,\n 'digit' => 3,\n 'upper' => 2,\n 'lower' => 1\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){3})(?=(?:[^a-z]*[a-z]){1})(?=(?:[^A-Z]*[A-Z]){2})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){4})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function rules()\n {\n $user = auth()->user();\n\n return [\n /*'password' => [\n 'nullable',\n function ($attribute, $value, $fail) use ($user) {\n if (!Hash::check($value, $user->password)) {\n return $fail(__('The password is incorrect.'));\n }\n }\n ],*/\n ];\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public static function validatePassword()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 11),\n );\n }", "public function testManySpecialCharacter ()\n {\n // Function parameters\n $length = 10;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 6,\n 'digit' => 1,\n 'upper' => 1,\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){6})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function rules()\r\n {\r\n $route = \\Route::currentRouteName();\r\n switch ($route) {\r\n case 'api.v1.user.changePassword':\r\n $rules = [\r\n 'password' => 'required|min:3',\r\n 'new_password' => 'required|min:3',\r\n ];\r\n break;\r\n default:\r\n $rules = User::$rulesLogin;\r\n break;\r\n }\r\n\r\n return $rules;\r\n }", "public function provideValidatePassword()\n {\n return [\n [123456, 234567, true],\n [\"123457\", 234567, true],\n [\"12345v\", 234567, false],\n ['asdfgh', 'asdfgh', false]\n ];\n }", "public function rules()\n {\n $rules['txt_username'] = 'required';\n $rules['txt_password'] = 'required|min:6|max:15';\n\n return $rules;\n }", "public function rules()\n {\n $id = Auth::user()->id;\n\n $rules = [\n 'username' => 'required|string',\n 'phone' => 'required|digits:9|starts_with:5|unique:users,phone,'.$id,\n 'email' => 'required|email|unique:users,email,'.$id,\n ];\n\n if($this->password){\n $rules['password'] = 'required|string|min:8';\n }\n\n return $rules;\n\n }", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "function nrua_check_password($pwd) {\n\t$errors = [];\n\t\n\tif (strlen($pwd) < 8) {\n\t$errors[] = \"Password too short!\";\n\t}\n\t\n\tif (!preg_match(\"#[0-9]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one number!\";\n\t}\n\t\n\tif (!preg_match(\"#[a-zA-Z]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one letter!\";\n\t}\n\t\n\treturn $errors;\n}", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "public function rules()\n {\n $rules = [\n 'name' => ['nullable', 'min:3', 'string', 'max:100'],\n 'email' => ['sometimes', 'email:rfc', 'min:8'],\n 'current_password' => ['sometimes', 'nullable', 'min:8', new MatchOldPassword],\n 'new_password' => ['sometimes', 'nullable', 'min:8'],\n 'confirm_new_password' => ['sometimes', 'same:new_password']\n ];\n\n return $rules;\n }", "public function rules() {\n\n $rules = [\n 'username' => 'required',\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'email' => 'required|email',\n\n ];\n\n if (Input::filled('password')) {\n $rules['password'] = 'confirmed|min:6';\n }\n\n return $rules;\n\n }", "public function rules()\n {\n $rules = [\n 'password' => 'required|min:6|max:60',\n 'password_confirmation' => 'same:password',\n ];\n\n if (Auth::user()->isSuperUser()) {\n return $rules;\n }\n\n return ['old_password' => 'required|min:6|max:60'] + $rules;\n }", "function is_lower($car ) {\nreturn ($car >= 'a' && $car <= 'z');\n}", "public function rules()\n {\n return [\n 'password' => 'max:30|min:3',\n ];\n }", "public function rules() {\n $user_table = User::$tableName;\n return [\n 'mobile' => array('required', 'digits:10', \"exists:$user_table,mobile\"),\n 'password' => array('required')\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'email' => 'required|email',\n ];\n\n if($this->register_using == UserAccountProvider::SSO_PROVIDER){\n $rules = array_merge($rules, [\n 'password' => 'required|min:8',\n 'confirm_password' => 'required|same:password|min:8',\n ]);\n }\n\n return $rules;\n }", "protected function rules()\n {\n return [\n 'token' => 'required',\n 'email' => 'required|email',\n 'password' => 'required|confirmed|min:'.config('db_limits.users.minPasswordLength'),\n ];\n }", "public function rules()\n {\n $rules = [\n 'password' => [\n 'required',\n 'min:8',\n 'confirmed'\n ]\n ];\n if ($this->user()->password != 'not_set') {\n $rules['current_password'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return [\n 'password' => 'required|min:4|max:20|regex:/^([a-zA-Z0-9\\.\\-_\\/\\+=\\.\\~\\!@#\\$\\%\\^\\&\\*\\(\\)\\[\\]\\{\\}]){4,20}$/',\n ];\n }", "public static function getStrength(string $password):int\n {\n\n // Get score\n $score = 0;\n if (strlen($password) >= 8) { $score++; }\n if (strlen($password) >= 12) { $score++; }\n if (preg_match(\"/\\d/\", $password)) { $score++; }\n if (preg_match(\"/[a-z]/\", $password) && preg_match(\"/[A-Z]/\", $password)) { $score++; }\n if (preg_match(\"/\\W/\", $password)) { $score++; }\n\n // Return\n return $score;\n }", "function checkPassword($clientPassword){\r\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\r\n return preg_match($pattern, $clientPassword);\r\n }", "public function rules()\n {\n return array(\n // username and password are required\n array('currentPassword, newPassword, comparePassword', 'required'),\n //array('column', 'in', 'range'=> CActiveRecord::model(Yii::app()->getModule('pii')->userClass)->attributeNames()),\n // password needs to be authenticated\n //array('password', 'authenticate'),\n array('newPassword', 'match', 'pattern' => '/^[a-z0-9_-]{4,20}$/i',\n 'message' => 'The {attribute} ca only contain letters, numbers, the underscore, and the hyphen.'),\n array('comparePassword', 'compare', 'compareAttribute' => 'newPassword'),\n );\n }", "function getLettersArray()\n{\n return [\n 'a' => true,\n 'b' => true,\n 'c' => true,\n 'd' => true,\n 'e' => true,\n 'f' => true,\n 'g' => true,\n 'h' => true,\n 'i' => true,\n 'j' => true,\n 'k' => true,\n 'l' => true,\n 'm' => true,\n 'n' => true,\n 'o' => true,\n 'p' => true,\n 'q' => true,\n 'r' => true,\n 's' => true,\n 't' => true,\n 'u' => true,\n 'v' => true,\n 'w' => true,\n 'x' => true,\n 'y' => true,\n 'z' => true,\n ];\n}", "public function rules()\n {\n return [\n 'name' => 'max:20',\n 'city' => 'max:10',\n 'school' => 'max:10',\n 'intro' => 'max:50',\n 'password' => 'sometimes|same:password_confirm|min:6'\n ];\n }", "public function rules() {\n\t\treturn [\n\t\t\t'username' => 'required|between:6,32',\n\t\t\t'email' => 'email|required|between:6,32',\n\t\t\t'password' => 'required|between:6,32',\n\t\t\t'confirm_pass' => 'required|same:password'\n\t\t];\n\t}", "protected function rules()\n {\n return [\n 'token' => 'required',\n 'email' => 'required|email',\n 'password' => 'required|min:8|confirmed|regex:\"^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{8,}$\"',\n ];\n }", "public function rules()\n {\n $validasi = [ \n 'email' => 'required|email|unique:users,email,'.auth()->user()->id,\n 'phone' => 'required|unique:users,phone,'.auth()->user()->id, \n 'password_confirm' => 'required|min:8'\n ];\n\n if(request()->filled(\"password\")){\n $validasi = array_merge($validasi,[\n \"password\" => \"min:8\"\n ]);\n }\n\n return $validasi;\n }", "function checkPassword($clientPassword)\n{\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\n return preg_match($pattern, $clientPassword);\n}", "public function rules()\n {\n return [\n\t 'username' => 'required|max:16|min:6',\n\t 'password' => 'required|min:6'\n ];\n }", "function vPassword( $password )\r\n\t\t{\r\n\t\t\t\treturn preg_match( '/^(?=^.{8,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$/', $password );\r\n\t\t\t\t\r\n\t\t}", "public function rules()\n {\n return [\n 'username' => 'required|filled|alpha_num|max:30',\n 'password' => 'required|filled|between:6,20|',\n 'telephone' => 'string|max:11',\n 'jobnumber' => 'string|max:6',\n ];\n }", "function passwordGood($pass) {\n\t// default encoding/encoding specified in php.ini for nginx's php fpm module\n\t// is 'UTF-8'\n\t$len = mb_strlen($pass);\n\t//$len = strlen($pass);\n\t// original code of ($len >= 8 && $len <= 24) doesn't seem to work since I think\n\t// when true these return 1, when false they seem to return nothing, when printed empty string\n\t// be careful, these seem to return nothing or they don't print properly\n\t// this does work though :P\n\tif ( ( $len < 8 ) || ( $len > 24 ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function rules()\n {\n return [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:admins,email',\n 'password' => 'required|confirmed|regex:/\\A(?=.*?[a-zA-Z])(?=.*?\\d)[a-zA-Z\\d]{8,}+\\z/'\n ];\n }", "public function rules()\r\n {\r\n\r\n\t\t$rules = [\r\n 'name' => 'required|min:3',\r\n ];\r\n return $rules;\r\n }", "public function rules()\n {\n return [\n 'username' => 'required',\n 'email' => 'required|email',\n 'type' => 'required',\n 'cpassword' => 'required',\n 'npassword' => 'required',\n 'confirm_password' => 'required'\n ];\n }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n ];\n\n //no need for name in instagram\n if($this->getPathInfo() == '/instagram/connect') {\n $rules['password'] = str_replace('|confirmed', '', $rules['password']);\n $rules['username'] = 'required';\n unset($rules['name']);\n unset($rules['email']);\n }\n\n return $rules;\n }", "function checkPasswordForPolicy($password, $handle = '') {\n $minLength = $this->getProperty('PASSWORD_MIN_LENGTH', 0);\n $compareToHandle = $this->getProperty('PASSWORD_NOT_EQUALS_HANDLE', 0);\n $checkAgainstBlacklist = $this->getProperty('PASSWORD_BLACKLIST_CHECK', 0);\n $result = 0;\n if ($minLength > 0 && strlen($password) < $minLength) {\n $result -= 1;\n }\n if ($compareToHandle && $handle != '' && strtolower($password) == strtolower($handle)) {\n $result -= 2;\n }\n if ($checkAgainstBlacklist && $this->checkPasswordAgainstBlacklist($password) === FALSE) {\n $result -= 4;\n }\n return $result;\n }", "function isLower(){ return $this->length()>0 && $this->toString()===$this->downcase()->toString(); }", "public function createRules(){\n return [\n 'email' => 'required|string|max:50',\n 'password' => 'required|string',\n ];\n }", "function mPN_CHARS_BASE(){\n try {\n // Tokenizer11.g:517:3: ( 'a' .. 'z' | '\\\\u00C0' .. '\\\\u00D6' | '\\\\u00D8' .. '\\\\u00F6' | '\\\\u00F8' .. '\\\\u02FF' | '\\\\u0370' .. '\\\\u037D' | '\\\\u037F' .. '\\\\u1FFF' | '\\\\u200C' .. '\\\\u200D' | '\\\\u2070' .. '\\\\u218F' | '\\\\u2C00' .. '\\\\u2FEF' | '\\\\u3001' .. '\\\\uD7FF' | '\\\\uF900' .. '\\\\uFDCF' | '\\\\uFDF0' .. '\\\\uFFFD' ) \n // Tokenizer11.g: \n {\n if ( ($this->input->LA(1)>=$this->getToken('97') && $this->input->LA(1)<=$this->getToken('122'))||($this->input->LA(1)>=$this->getToken('192') && $this->input->LA(1)<=$this->getToken('214'))||($this->input->LA(1)>=$this->getToken('216') && $this->input->LA(1)<=$this->getToken('246'))||($this->input->LA(1)>=$this->getToken('248') && $this->input->LA(1)<=$this->getToken('767'))||($this->input->LA(1)>=$this->getToken('880') && $this->input->LA(1)<=$this->getToken('893'))||($this->input->LA(1)>=$this->getToken('895') && $this->input->LA(1)<=$this->getToken('8191'))||($this->input->LA(1)>=$this->getToken('8204') && $this->input->LA(1)<=$this->getToken('8205'))||($this->input->LA(1)>=$this->getToken('8304') && $this->input->LA(1)<=$this->getToken('8591'))||($this->input->LA(1)>=$this->getToken('11264') && $this->input->LA(1)<=$this->getToken('12271'))||($this->input->LA(1)>=$this->getToken('12289') && $this->input->LA(1)<=$this->getToken('55295'))||($this->input->LA(1)>=$this->getToken('63744') && $this->input->LA(1)<=$this->getToken('64975'))||($this->input->LA(1)>=$this->getToken('65008') && $this->input->LA(1)<=$this->getToken('65533')) ) {\n $this->input->consume();\n\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n $this->recover($mse);\n throw $mse;}\n\n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "public function rules()\n {\n return [\n 'phone' => 'required|exists:users,phone|digits:11|regex:/(01)[0-9]{9}/',\n 'code' => 'required|digits:4',\n 'password' => ['required','string','max:32','confirmed',\n Password::min(8)\n ->mixedCase()\n ->letters()\n ->numbers()\n ->symbols()\n// ->uncompromised()\n ,]\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'string|min:3|max:20|required',\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:8|regex:/^(?=.*[a-z])(?=.*[A-Z]).*$/',\n 'role_name' => 'required|string',\n ];\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "public function rules()\n {\n return [\n 'olduser_pass'=>'required|max:16|alpha_dash',\n 'newuser_pass'=>'required|max:16|alpha_dash',\n ];\n }" ]
[ "0.67045766", "0.59745455", "0.5836599", "0.5835646", "0.5813332", "0.58103323", "0.5789298", "0.5734077", "0.5704969", "0.56844664", "0.5608058", "0.56071633", "0.5599391", "0.5581891", "0.5555354", "0.5521866", "0.5488675", "0.54772234", "0.5431684", "0.53933555", "0.53801066", "0.53742856", "0.5350488", "0.53397137", "0.5325839", "0.5322335", "0.53217685", "0.5319071", "0.53151786", "0.5310934", "0.5308926", "0.53074604", "0.52987593", "0.5295685", "0.5292943", "0.5209201", "0.52085584", "0.5183785", "0.5182819", "0.51803225", "0.5172719", "0.5149438", "0.51482475", "0.51386994", "0.51205087", "0.511809", "0.51111037", "0.51102936", "0.5108418", "0.51041424", "0.5094644", "0.50781304", "0.50721943", "0.50648975", "0.5061206", "0.5060425", "0.50589234", "0.50529975", "0.50529975", "0.50529975", "0.5051351", "0.50414175", "0.5031097", "0.5027832", "0.5022375", "0.5007788", "0.5007417", "0.49939173", "0.49935177", "0.49918658", "0.49852204", "0.49843955", "0.4983953", "0.4983287", "0.49787542", "0.49742034", "0.49675208", "0.4967101", "0.49635035", "0.49503228", "0.4940774", "0.49149933", "0.49114427", "0.49104562", "0.4906253", "0.4900607", "0.4889115", "0.48851264", "0.48846686", "0.48846686", "0.48744103", "0.48695952", "0.4869435", "0.486656", "0.4864418", "0.4863681", "0.486003", "0.48597592", "0.48526442", "0.48523903" ]
0.6121028
1
Set password strength rule to have any lower case character presented in password. Default value is `TRUE` to must have lower case character in password. Lower case characters from latin alphabet: abcdefghijklmnopqrstuvwxyz. Function has second argument to set minimum lower case characters in password. Default value is at least one lower case character in password.
public function SetMustHaveLowerCaseChars ($mustHaveLowerCaseChars = TRUE, $minCount = self::MIN_LOWERCASE_CHARS_COUNT) { /** @var \MvcCore\Ext\Forms\Validator $this */ $this->mustHaveLowerCaseChars = $mustHaveLowerCaseChars; $this->mustHaveLowerCaseCharsCount = $minCount; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdatePasswordOnlyLowerCase(): void { }", "public function testManyLowercaseCharacter ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 1,\n 'digit' => 1,\n 'upper' => 1,\n 'lower' => 5\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^a-z]*[a-z]){5})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){1})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public static function setPasswordLowerCaseRequired($isRequired){\n Configuration::where('id', 1)\n ->update(['password_lower_case_required' => $isRequired]);\n }", "function reduce_min_strength_password_requirement( $strength ) {\n return 2; \n}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK)\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n elseif ($params['strength'] === self::STRONG)\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n\n if (!preg_match($pattern, $this->$attribute) || strlen($this->$attribute) < 8)\n $this->addError($attribute, 'New password is not strong enough!' . \" \\n\" . \" Minimal length 8 digit and \" . \" \\n includes alphanumeric string\");\n }", "public function password_strength_check($str)\n\t{\n\t\tif (preg_match('#[0-9]#', $str) && preg_match('#[a-zA-Z]#', $str)) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\t$this->form_validation->set_message('password_strength_check', 'Your password must be at least 6-19 characters in length and contain a number and both uppercase and lowercase letters');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\n\t}", "private function hasLowercase(): bool\n {\n if (1 == preg_match('/\\p{Ll}/', $this->password)) {\n return true;\n }\n array_push($this->errorMessages, \"Lowercase letter missing.\");\n return false;\n }", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function passStrength($str){\n $error = FALSE;\n // make sure it is long enough\n if(strlen($str) < 8){\n $error['length'] = 'must be 8 characters minimum.';\n }\n // must contain letters & numbers and must have 1 upper case letter!\n if( ! preg_match('/[A-Za-z]/', $str) && preg_match('/[0-9]/', $str)){\n $error['alphanum'] = 'Must be alphanumeric and contain capitals and lower case.';\n }\n return $error;\n }", "public function letterCase($letterCase) {\n\n if ($letterCase == 'Upper') {\n $this->password = strtoupper($this->password);\n }elseif ($letterCase == 'Lower') {\n $this->password = strtolower($this->password);\n }else {\n $this->password = $this->password;\n }\n }", "function CheckStrength($attribute, $params) {\n if (isset($this->$attribute)) { // Edit 2013-06-01\n $password = $this->$attribute;\n if (strlen($password) == 0)\n $strength = -10;\n else\n $strength = 0;\n /* * * get the length of the password ** */\n $length = strlen($password);\n /* * * check if password is not all lower case ** */\n if (strtolower($password) != $password) {\n $strength += 1;\n }\n /* * * check if password is not all upper case ** */\n if (strtoupper($password) == $password) {\n $strength += 1;\n }\n /* * * check string length is 8 -15 chars ** */\n if ($length >= 8 && $length <= 15) {\n $strength += 2;\n }\n /* * * check if lenth is 16 - 35 chars ** */\n if ($length >= 16 && $length <= 35) {\n $strength += 2;\n }\n /* * * check if length greater than 35 chars ** */\n if ($length > 35) {\n $strength += 3;\n }\n /* * * get the numbers in the password ** */\n preg_match_all('/[0-9]/', $password, $numbers);\n $strength += count($numbers[0]);\n /* * * check for special chars ** */\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^\\\\\\]/', $password, $specialchars);\n $strength += sizeof($specialchars[0]);\n /* * * get the number of unique chars ** */\n $chars = str_split($password);\n $num_unique_chars = sizeof(array_unique($chars));\n $strength += $num_unique_chars * 2;\n /* * * strength is a number 1-100; ** */\n $strength = $strength > 99 ? 99 : $strength;\n //$strength = floor($strength / 10 + 1);\n if ($strength < $params['score'])\n $this->addError($attribute, \"Password is too weak - try using CAPITALS, Num8er5, AND sp€c!al characters. Your score was \" . $strength . \"/\" . $params['score']);\n else\n return true;\n }\n }", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "function isLower(){ return $this->length()>0 && $this->toString()===$this->downcase()->toString(); }", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK) {\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n } elseif ($params['strength'] === self::STRONG) {\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n }\n if (!preg_match($pattern, $this->$attribute)) {\n $this->addError($attribute, 'your password is not strong enough!');\n }\n }", "public function testUpdatePasswordOnlyUpperCase(): void { }", "function check_strength($user_password) {\n $characters = 0;\n $capitalletters = 0;\n $loweletters = 0;\n $number = 0;\n\n if (strlen ($user_password) > 11) {\n $characters = 1;\n } else {\n $characters = 0;\n };\n if (preg_match('/[A-Z]/', $user_password)) {\n $capitalletters = 1;\n } else {\n $capitalletters = 0;\n };\n if (preg_match('/[a-z]/', $user_password)) {\n $loweletters = 1;\n } else {\n $loweletters = 0;\n };\n if (preg_match('/[0-9]/', $user_password)) {\n $number = 1;\n } else {\n $number = 0;\n };\n\n $total = $characters + $capitalletters + $loweletters + $number;\n\n return GetPercentage(4, $total);\n}", "function cjpopups_is_password_strong($pass_string, $compare = 1) {\n $r1='/[A-Z]/'; //Uppercase\n $r2='/[a-z]/'; //lowercase\n $r3='/[!@#$%^&*()\\-_=+{};:,<.>]/'; // whatever you mean by 'special char'\n $r4='/[0-9]/'; //numbers\n if(preg_match_all($r1,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r2,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r3,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r4,$pass_string, $o) < $compare) return FALSE;\n if(strlen($pass_string) < 8) return FALSE;\n return TRUE;\n}", "function minimum_password_limit( & $errors ) {\r\n\t$min_length = 12;\r\n\tif ( !empty( $_POST['pass1'] ) && $_POST['pass1'] === $_POST['pass2'] && !preg_match('/^.*(?=.{12,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', $_POST['pass1']) ) {\r\n\t\t$errors->add( 'min_pass_length', sprintf( __( '<strong>Security advice</strong>: Your password must be at least %d characters long and have at least one capital letter and one number in it.' ), $min_length ), array( 'form-field' => 'pass1' ) );\r\n\t}\r\n}", "public function setPasswordStrength($num) {\n if((is_numeric($num)) && (($num>=0) && ($num<=4))) {\n $this->password_strength = $num;\n return $this->password_strength;\n }\n return false;\n }", "public function testRegistrationPasswordOnlyLowerCase(): void { }", "public function increaseLength($minLength = 100) {}", "public function increaseLength($minLength = 100) {}", "public function getMinUsernameLength();", "public static function setPasswordMinLength($length){\n Configuration::where('id', 1)\n ->update(['password_min_length' => $length]);\n }", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "public function setPasswordLenghtMin($num) {\n if((is_numeric($num)) && (($this->password_lenghtMax==null) || ($this->password_lenghtMax>$num))) {\n $this->password_lenghtMin = $num;\n return $this->password_lenghtMin;\n }\n return false;\n }", "function isPasswordStrong($password){\r\n\t\tif(strlen($password) < 8)\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[0-9]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[A-Z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[a-z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[\\W_]+#\",$password))\r\n\t\treturn false;\r\n\r\n\t\treturn true;\r\n\t}", "function testPass($pass){\n$level=0;\nif(eight($pass)){$level+=1;}\nif(upper($pass)){$level+=1;}\nif(lower($pass)){$level+=1;}\nif(hasDigit($pass)){$level+=1;}\nif(hasSpecial($pass)){$level+=1;}\n\nswitch($level){\ncase 1: echo 'Password strength : <b><font color=red\">Very weak.</font></b>';return false; break;\ncase 2: echo 'Password strength : <b><font color=\"orange\">Weak.</font></b>';return true; break;\ncase 3: echo 'Password strength : <b><font color=\"grey\">Medium</font></b>';return true; break;\ncase 4: echo 'Password strength : <b><font color=\"blue\">Good</font></b>';return true; break;\ncase 5: echo 'Password strength : <b><font color=\"green\">Strong.</font></b>';return true; break;\ndefault : echo 'Password strength : <b><font color=\"red\">Very weak.</font></b>'; break;}\n}", "public function increaseLength($minLength = 100);", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "function FixCaseLower ( $bFixCaseLower=null )\n{\n if ( isset($bFixCaseLower) ) {\n $this->_FixCaseLower = $bFixCaseLower;\n return true;\n } else {\n return $this->_FixCaseLower;\n }\n}", "protected function EncryptPassword($strPassword) {\n\t\t\t$strPassword = trim(strtolower($strPassword));\n\t\t\t$strMd5 = md5(SALT . $strPassword);\n\t\t\treturn strtolower($strMd5);\n\t\t}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "public function setMinUsernameLength($length);", "public function getStrength($password, $username = null)\n {\n if (!empty($username)) {\n $password = str_replace($username, '', $password);\n }\n\n $password_length = strlen($password);\n\n $strength = $password_length * 4;\n\n for ($i = 2; $i <= 4; $i++) {\n $temp = str_split($password, $i);\n\n $strength -= (ceil($password_length / $i) - count(array_unique($temp)));\n }\n\n preg_match_all('/[0-9]/', $password, $numbers);\n\n if (!empty($numbers)) {\n $numbers = count($numbers[0]);\n\n if ($numbers >= 3) {\n $strength += 5;\n }\n } else {\n $numbers = 0;\n }\n\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^¨\\\\\\]/', $password, $symbols);\n\n if (!empty($symbols)) {\n $symbols = count($symbols[0]);\n\n if ($symbols >= 2) {\n $strength += 5;\n }\n } else {\n $symbols = 0;\n }\n\n preg_match_all('/[a-z]/', $password, $lowercase_characters);\n preg_match_all('/[A-Z]/', $password, $uppercase_characters);\n\n if (!empty($lowercase_characters)) {\n $lowercase_characters = count($lowercase_characters[0]);\n } else {\n $lowercase_characters = 0;\n }\n\n if (!empty($uppercase_characters)) {\n $uppercase_characters = count($uppercase_characters[0]);\n } else {\n $uppercase_characters = 0;\n }\n\n if (($lowercase_characters > 0) && ($uppercase_characters > 0)) {\n $strength += 10;\n }\n\n $characters = $lowercase_characters + $uppercase_characters;\n\n if (($numbers > 0) && ($symbols > 0)) {\n $strength += 15;\n }\n\n if (($numbers > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($symbols > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($numbers == 0) && ($symbols == 0)) {\n $strength -= 10;\n }\n\n if (($symbols == 0) && ($characters == 0)) {\n $strength -= 10;\n }\n\n if ($strength < 0) {\n $strength = 0;\n }\n\n if ($strength > 100) {\n $strength = 100;\n }\n\n return $strength;\n }", "public function setPasswordMinimumLength(?int $value): void {\n $this->getBackingStore()->set('passwordMinimumLength', $value);\n }", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "function lowercase($letter1)\n {\n for ($i = 0; $i < strlen($letter1); $i++) {\n\t if (ord($letter1[$i]) >= ord('A') &&\n ord($letter1[$i]) <= ord('Z')) {\n return false;\n }\n }\n return true;\n }", "public static function setPasswordUpperCaseRequired($isRequired){\n Configuration::where('id', 1)\n ->update(['password_upper_case_required' => $isRequired]);\n }", "public function enablePasswordStringLength()\n {\n // Add validator\n return $this->attachPasswordValidator('Zend\\Validator\\StringLength', array(\n 'min' => 8,\n 'max' => 64,\n ));\n }", "protected function changePassword() {}", "public function addLetters() {\n\n for ($i=0; $i <$this->letterPorsion ; $i++) {\n $this->password = $this->password.substr($this->str, rand(0, strlen($this->str) - 1), 1);\n }\n }", "protected static function _minLength() {\n if (self::$_ruleValue) {\n if (self::$_ruleValue > strlen(trim(self::$_elementValue))) {\n self::setErrorMessage(\"Enter at least \" . self::$_ruleValue . \" charachters \");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public static function setPasswordSpecialCharactersRequired($isRequired){\n Configuration::where('id', 1)\n ->update(['password_special_characters_required' => $isRequired]);\n }", "function validatePasswordCase(&$Model, $data, $compare) {\r\n\t\tif (in_array($this->settings[$Model->alias]['passwordPolicy'], array('weak', 'normal'))) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$compare[0]];\r\n\t\tif (!(preg_match('/.*[a-z].*/', $compare))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!(preg_match('/.*[A-Z].*/', $compare))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function setPassword(){\n\t}", "public function __construct($password, $minimumChars = 8) {\n // The password is assigned to the current object's $_password property.\n\t$this->_password = $password;\n \n // Optionally overwrite the default minimum number of characters by the argument passed in register_mysqli.inc.php.\n\t$this->_minimumChars = $minimumChars;\n }", "public final function setLowerAlpha($lowerAlpha) {\n\t\t\t$this->lowerAlpha = (bool)$lowerAlpha;\n\t\t}", "function is_lower($car ) {\nreturn ($car >= 'a' && $car <= 'z');\n}", "public function setPassword($newPassword);", "public function getPasswordStrength(string $password): int;", "public function setPassword($value);", "function __construct ($params=array())\n {\n /**\n * Define Rules\n * Key is rule identifier\n * Value is rule parameter\n * false is disabled (default)\n * Type is type of parameter data\n * permitted values are 'integer' or 'boolean'\n * Test is php code condition returning true if rule is passed\n * password string is $p\n * rule value is $v\n * Error is rule string definition\n * use #VALUE# to insert value\n */\n $this->rules['min_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return strlen($p)>=$v;',\n 'error' => 'Password must be more than #VALUE# characters long');\n\n $this->rules['max_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return (strlen($p)<=$v);',\n 'error' => 'Password must be less than #VALUE# characters long');\n\n $this->rules['min_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# lowercase characters');\n\n $this->rules['max_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# lowercase characters');\n\n $this->rules['min_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# uppercase characters');\n\n $this->rules['max_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# uppercase characters');\n\n $this->rules['disallow_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)==0;',\n 'error' => 'Password may not contain numbers');\n\n $this->rules['disallow_numeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[0-9]/\",$p,$x)==0;',\n 'error' => 'First character cannot be numeric');\n\n $this->rules['disallow_numeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be numeric');\n\n $this->rules['min_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# numbers');\n\n $this->rules['max_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# numbers');\n\n $this->rules['disallow_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)==0;',\n 'error' => 'Password may not contain non-alphanumeric characters');\n\n $this->rules['disallow_nonalphanumeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[\\W]/\",$p,$x)==0;',\n 'error' => 'First character cannot be non-alphanumeric');\n\n $this->rules['disallow_nonalphanumeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be non-alphanumeric');\n\n $this->rules['min_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# non-aplhanumeric characters');\n\n $this->rules['max_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# non-alphanumeric characters');\n\n // Apply params from constructor array\n foreach( $params as $k=>$v ) { $this->$k = $v; }\n\n // Errors defaults empty\n $this->errors = array();\n\n return 1;\n }", "public function testLowercaseSingleLetter() : void\n {\n $word = 'a';\n $this->assertEquals(1, score($word));\n }", "function validate_password($candidate) \n{\n if (!empty($candidate))\n {\n // Declare and Initialize Local Variables\n $CritCount = 0; //Tabulator for keeping track of number of criteria matched\n\n /*\n Regular Expression Example $\\S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S*$\n $ = beginning of string\n \\S* = any set of characters\n (?=\\S{8,}) = of at least length 8\n (?=\\S*[a-z]) = containing at least one lowercase letter\n (?=\\S*[A-Z]) = and at least one uppercase letter\n (?=\\S*[\\d]) = and at least one number\n (?=\\S*[\\W]) = and at least a special character (non-word characters)\n $ = end of the string\n\n */\n // Test for each requirement \n if (strlen($candidate) >= 8) $CritCount = $CritCount + 10; // Value of 10 for minimum length\n if (preg_match('/[a-z]/', $candidate)) $CritCount = $CritCount + 1; //Contains lower case a-z\n if (preg_match('/[A-Z]/', $candidate)) $CritCount = $CritCount + 1; //Contains UPPER case A-Z\n if (preg_match('/[\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one numeric digit\n if (preg_match('/[^a-zA-Z\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one special Character (!@#$%^&*()-_, etc.)\n \n if ($CritCount > 12) //Meets minimum length, plus 3 additional criteria\n {\n return TRUE;\n }\n else \n {\n return FALSE;\n }\n }\n else\n return false;\n}", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "function vPassword2() \r\n\t\t{\r\n\t\t\t# Check password strength\r\n\t\t\t$p = $p1;\r\n\t\t\t\r\n\t\t\tif( strlen($p) < 8 ) $reg_errors[] = \"Password too short!\";\r\n\t\t\t\r\n\t\t\tif( strlen($p) > 20 ) $reg_errors[] = \"Password too long!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[0-9]+#\", $p) ) $reg_errors[] = \"Password must include at least one number!\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[a-z]+#\", $p) ) $reg_errors[] = \"Password must include at least one letter!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[A-Z]+#\", $p) ) $reg_errors[] = \"Password must include at least one CAPS!\";\r\n\t\t\t\r\n\t\t\t/* if( !preg_match(\"#\\W+#\", $p) ) $errors[] = \"Password must include at least one symbol!\"; */\t\r\n\t\t\t\r\n\t\t}", "public function encryptPassword($pass){\r\n\t\t$this->string = array(\r\n\t\t\t\"string\" => $pass,\r\n\t\t\t\"count\" => strlen($pass)\r\n\t\t);\r\n\t\t//the function setCharacters() is executed to get all the initial characters to use for password encryption.\r\n\t\t$characters = $this->setCharacters();\r\n\t\t/* \r\n\t\t\tIn order to encrypt this password with a unique pattern I took the password and found the position\r\n\t\t\ton my character table. I took all positions that are found on my character table and use those numbers like patters\r\n\t\t\tI set the characters location as ranges in my $start_range variable.\r\n\t\t*/\r\n\t\t$start_range = array();\r\n\t\tfor($x=0; $x<$this->string['count']; $x++){\r\n\t\t\t$start_range[$x] = array_search($this->string['string'][$x], $characters);\r\n\t\t}\r\n\t\tforeach ($start_range as $key => $value) {\r\n\t\t\tif($value == null){\r\n\t\t\t\t$start_range[$key] = $this->string['count'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//doubles the range to make the password more complex base on mathematical additions; submitted on the 1.2 update\r\n\t\t$a = 0;\r\n\t\tfor ($i=0; $i < $this->string['count']; $i++) {\r\n\t\t\t$start_range[$this->string['count'] + $a] = round(($start_range[$i] * ($this->string['count'] + $a))); \r\n\t\t\t$a++;\r\n\t\t}\r\n\t\t/*\r\n\t\t\tUnique matrix is created depending on number of characters and the location of the characters\r\n\t\t\tI set for what i call my matrix to be 5000 characters to make the mattern more complex. you can set that to your liking i dont recommend going lower than 1000 characters.\r\n\t\t*/\r\n\t\t$matrix = $this->generateMatrix($characters, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\t@param array will make sure the matrix is as complex as possible.\r\n\t\t*/\r\n\t\t$matrix_final = $this->generateMatrix($matrix, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\tI have tested with 128 characters, havent test for less or more yet.\r\n\t\t\tthis is where the magic happens and i use the same consept of creating a matrix to create the final encryption.\r\n\t\t*/\r\n\t\t$final_password = $this->generateMatrix($matrix_final, $start_range, $this->passwordEncryptionLenght);\r\n\t\t$this->encPassword = implode('',$final_password);\r\n\t}", "public function requireMixedCase()\n {\n $this->mixedCase = true;\n }", "function allowPasswordChange() {\r\n\t\treturn true;\r\n\t}", "protected function password_strength($password)\n\t{\n\t\t$strength = 0;\n\t\t$patterns = array('/[a-z]/','/[A-Z]/','/\\d/','/\\W/','/.{12,}/');\n\t\tforeach($patterns as $pattern)\n\t\t{\n\t\t\t$strength += (int) preg_match($pattern,$password);\n\t\t}\n\t\treturn $strength;\n\t\t// 1 - weak\n\t\t// 2 - not weak\n\t\t// 3 - acceptable\n\t\t// 4 - strong\n\t}", "function checkPasswordPolicy( $password, $admin=\"y\" ) {\n\t\n\tglobal $CONF;\n\t\n\t$smallLetters\t\t= preg_match( '/[a-z]/', $password );\n\t$capitalLetters\t\t= preg_match( '/[A-Z]/', $password );\n\t$numbers\t\t\t= preg_match( '/[0-9]/', $password );\n\tif( isset( $CONF['passwordSpecialChars'] ) ) {\n\t\t$pattern\t\t= '/'.$CONF['passwordSpecialChars'].'/';\n\t} else {\n\t\t$pattern\t\t= '/'.'[\\!\\\"\\§\\$\\%\\/\\(\\)=\\?\\*\\+\\#\\-\\_\\.\\:\\,\\;\\<\\>\\|\\@]'.'/';\n\t}\n\t$specialChars\t\t= preg_match( $pattern, $password );\n\t$passwordLength\t\t= strlen( $password );\n\t$groups\t\t\t\t= 0;\n\t\n\tif( $smallLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $capitalLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $numbers != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $specialChars != 0 ) {\t\t\n\t\t$groups++;\n\t}\n\t\n\tif( $admin == \"y\" ) {\n\t\t\n\t\tif( isset($CONF['minPasswordlength']) ) {\n\t\t\t$minPasswordLength\t= $CONF['minPasswordlength'];\n\t\t} else {\n\t\t\t$minPasswordLength\t= 14;\n\t\t}\n\t\tif( $passwordLength < $minPasswordLength ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset( $CONF['minPasswordGroups'] ) ) {\n\t\t\t\t$minPasswordGroups\t= $CONF['minPasswordGroups'];\n\t\t\t} else {\n\t\t\t\t$minPasswordGroups\t= 4;\n\t\t\t}\n\t\t\tif( isset( $minPasswordGroups ) ) {\n\t\t\t\n\t\t\t\tif( ($minPasswordGroups < 1) or ($minPasswordGroups > 4) ) {\n\t\t\t\t\t$minGroups\t= 4;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroups\t= $minPasswordGroups;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroups\t\t= 4;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroups ) {\n\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\n\t} else {\n\t\t\n\t\tif( isset( $CONF['minPasswordlengthUser'] ) ) {\n\t\t\t$minPasswordlengthUser\t\t= $CONF['minPasswordlengthUser'];\n\t\t} else {\n\t\t\t$minPasswordLengthUser\t\t= 8;\n\t\t}\n\t\tif( $passwordLength < $CONF['minPasswordlengthUser'] ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset($CONF['minPasswordGroupsUser']) ) {\n\t\t\t\t\n\t\t\t\tif( ($CONF['minPasswordGroupsUser'] < 1) or ($CONF['minPasswordGroupsUser'] > 4 ) ) {\n\t\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroupsUser\t= $CONF['minPasswordGroupsUser'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroupsUser ) {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\treturn $retval;\n}", "public function checkPassword($value);", "public function testRandomRequirements ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 4,\n 'digit' => 3,\n 'upper' => 2,\n 'lower' => 1\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){3})(?=(?:[^a-z]*[a-z]){1})(?=(?:[^A-Z]*[A-Z]){2})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){4})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "protected function rulesChange()\n {\n return [\n 'password' => 'required|confirmed|min:'.config('db_limits.users.minPasswordLength'),\n ];\n }", "public function setPasswordLetter($num) {\n if(is_numeric($num)) {\n $this->password_letter = $num;\n return $this->password_letter;\n }\n return false;\n }", "function setPassword($password){\n\t\t$password = base64_encode($password);\n\t\t$salt5 = mt_rand(10000,99999);\t\t\n\t\t$salt3 = mt_rand(100,999);\t\t\n\t\t$salt1 = mt_rand(0,25);\n\t\t$letter1 = range(\"a\",\"z\");\n\t\t$salt2 = mt_rand(0,25);\n\t\t$letter2 = range(\"A\",\"Z\");\n\t\t$password = base64_encode($letter2[$salt2].$salt5.$letter1[$salt1].$password.$letter1[$salt2].$salt3.$letter2[$salt1]);\n\t\treturn str_replace(\"=\", \"#\", $password);\n\t}", "public function testRegistrationPasswordOnlyUpperCase(): void { }", "public function toLower(): self\n {\n if ($this->cache['i' . self::LOWER_CASE] ?? false) {\n return clone $this;\n }\n return new static($this->getMappedCodes(self::LOWER_CASE));\n }", "public function testRegisterShortPassword() {\n $generic = new GenericValidationTests($this);\n $generic->testMinStringAttribute('register', 'POST', self::$headers, self::$body, 'password', 6, 'password_confirmation');\n }", "public static function isStrong($password = '', int $length = 8) : bool\n {\n if ( $length < 8 ) {\n $length = 8;\n }\n \n $uppercase = Stringify::match('@[A-Z]@', $password);\n $lowercase = Stringify::match('@[a-z]@', $password);\n $number = Stringify::match('@[0-9]@', $password);\n $special = Stringify::match('@[^\\w]@', $password);\n\n if ( !$uppercase \n || !$lowercase \n || !$number \n || !$special \n || strlen($password) < $length \n ) {\n return false;\n }\n return true;\n }", "public function setMinimumWordLength($minimum)\n {\n return $this->setOption('minimumwordlength', $minimum);\n }", "public function usePassword($password)\n {\n // CODE...\n }", "function ModifMiniNombreUser( $nameUser ){\r\n return strtolower($nameUser);\r\n}", "function low($str) {\n\t\treturn strtolower($str);\n\t}", "function containsUpperAndLower($password)\n{\n if (strtoupper($password) == $password) return false;\n if (strtolower($password) == $password) return false;\n return true;\n}", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "function allowPasswordChange() {\n global $shib_pretend;\n\n return $shib_pretend;\n\n }", "public function setPassword($newPassword){\n\t}", "function checkPasswordErrors($password, $username = false) {\n $returns = array(\n 'strength' => 0,\n 'error' => 0,\n 'text' => ''\n );\n\n $length = strlen($password);\n\n if ($length < 8) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is not long enough';\n } elseif ($length > 32) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is too long';\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n $returns['error'] = 4;\n $returns['text'] = 'Password cannot be the same as your Username';\n } elseif (strtolower($password) == 'password') {\n $returns['error'] = 3;\n $returns['text'] = 'Password is too common';\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n $returns['error'] = 2;\n $returns['text'] = 'Too many consecutive characters';\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n $returns['strength'] = 5;\n $returns['text'] = 'Virtually Bulletproof';\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n $returns['strength'] = 4;\n $returns['text'] = 'Very Strong';\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n $returns['strength'] = 3;\n $returns['text'] = 'Strong';\n } else if ($numbers > 1) {\n//fair\n $returns['strength'] = 2;\n $returns['text'] = 'Fair';\n } else {\n//weak\n $returns['strength'] = 1;\n $returns['text'] = 'Weak';\n }\n }\n }\n return $returns;\n}", "public function password($username)\n {\n }", "function set_password($string) {\r\n echo PHP_EOL;\r\n $this->action(\"setting new password of: $string\");\r\n $this->hashed_password = hash('sha256', $string . $this->vehicle_salt);\r\n $this->action(\"successfully set new password\");\r\n }", "function generatePassword($password)\n{\n $password = hash('sha256', hash('sha256', $password)); // . \"brightisagoodguy1234567890\" . strtolower($password));\n \n return $password;\n \n}", "public function check() {\n // Use preg_match() with a regular expression to check the password for whitespace.\n if (preg_match('/\\s/', $this->_password)) {\n // if there is a whitespace, an error message is stored in the current instance's $_errors array property.\n $this->_errors[] = 'Password cannot contain spaces.';\t\n }\n \n // Check that the value in the current instance's $_password property is less than our set minimum.\n if (strlen($this->_password) < $this->_minimumChars) {\n\t $this->_errors[] = \"Password must be at least $this->_minimumChars characters.\";\n } \n \n // This runs only if the requireMixedCase method is called before check().\n // If $_mixedCase is set to true\n\tif ($this->_mixedCase) {\n // Create a regex pattern to match the value against (checks for characters that are upper and lowercase).\n\t $pattern = '/(?=.*[a-z])(?=.*[A-Z])/';\n // Using preg_match, test characters inside the current instance's $_password property for upper and lowercase.\n\t if (!preg_match($pattern, $this->_password)) {\n\t\t$this->_errors[] = 'Password should include uppercase and lowercase characters.';\n\t }\n\t}\n \n // This runs only if the requireNumbers method is called before check().\n\tif ($this->_minimumNumbers) { \n // Create a regex pattern to check the value in $_password against.\n\t $pattern = '/\\d/'; \n\t $found = preg_match_all($pattern, $this->_password, $matches); // number of matches stored in $found\n \n // If the number of matches is less than the set minimum number property, an error message is passed to the \n // current instance's $_errors property.\n\t if ($found < $this->_minimumNumbers) {\n\t\t$this->_errors[] = \"Password should include at least $this->_minimumNumbers number(s).\";\n\t }\n\t}\n \n // If $_errors has values, check() returns false, indicating the password failed validation; otherwise check() returns true.\n\treturn $this->_errors ? false : true;\n }", "function vPassword( $password )\r\n\t\t{\r\n\t\t\t\treturn preg_match( '/^(?=^.{8,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$/', $password );\r\n\t\t\t\t\r\n\t\t}", "public function setLengthMin($lengthMin)\n {\n $this->lengthMin = \\RandData\\Checker::int(\n $lengthMin,\n self::LENGTH_MIN_MIN,\n self::LENGTH_MIN_MAX,\n \"lengthMin\"\n );\n }" ]
[ "0.6898676", "0.6826555", "0.678818", "0.6520522", "0.6295156", "0.6295156", "0.6295156", "0.6226012", "0.6080737", "0.607918", "0.6072198", "0.6072198", "0.6072198", "0.6043468", "0.6034816", "0.60220027", "0.6017721", "0.6017721", "0.6017721", "0.59477824", "0.5941147", "0.59362763", "0.58579034", "0.5838762", "0.58382094", "0.5832811", "0.5781632", "0.5677397", "0.5677345", "0.56756276", "0.56669015", "0.5659289", "0.5659289", "0.5659289", "0.5629588", "0.5600109", "0.55994314", "0.5592664", "0.558727", "0.55630064", "0.5547529", "0.55465", "0.5535769", "0.5535769", "0.5535769", "0.55290556", "0.55067766", "0.5503152", "0.546812", "0.54498017", "0.5449277", "0.5410104", "0.53995526", "0.5380485", "0.5338049", "0.5335453", "0.5333034", "0.5317144", "0.53136796", "0.53076565", "0.5306764", "0.52941966", "0.52909946", "0.52769756", "0.52672607", "0.52619237", "0.52404994", "0.52397496", "0.5235926", "0.5235919", "0.52326256", "0.52281", "0.5222289", "0.5219008", "0.52094626", "0.52087224", "0.51728857", "0.5169463", "0.51623785", "0.5158228", "0.5105948", "0.5102282", "0.50873953", "0.5084868", "0.50810474", "0.50804585", "0.50798374", "0.50761545", "0.50647926", "0.5043664", "0.50388896", "0.5035349", "0.50321764", "0.50232315", "0.5019933", "0.5015222", "0.5009052", "0.50056046", "0.5002464", "0.50001734" ]
0.62140644
8
Get password strength rule to have any upper case character presented in password. Default value is `TRUE` to must have upper case character in password. Upper case characters from latin alphabet: abcdefghijklmnopqrstuvwxyz. This function returns array with the rule `boolean` as first item and second item is minimum upper case characters count i n password as `integer`. If you set function first argument to `FALSE`, function returns only array `[TRUE]`, if the rule is `TRUE` or an empty array `[]` if the rule is `FALSE`.
public function GetMustHaveUpperCaseChars ($getWithMinCount = TRUE) { if ($getWithMinCount) return [$this->mustHaveUpperCaseChars, $this->mustHaveUpperCaseCharsCount]; return $this->mustHaveUpperCaseChars ? [TRUE] : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function passwordRules() {\n return [\n 'password' => 'required|alpha_num|between:3,20|confirmed',\n 'password_confirmation' => 'required|alpha_num|between:3,20',\n ];\n }", "function testPass($pass){\n$level=0;\nif(eight($pass)){$level+=1;}\nif(upper($pass)){$level+=1;}\nif(lower($pass)){$level+=1;}\nif(hasDigit($pass)){$level+=1;}\nif(hasSpecial($pass)){$level+=1;}\n\nswitch($level){\ncase 1: echo 'Password strength : <b><font color=red\">Very weak.</font></b>';return false; break;\ncase 2: echo 'Password strength : <b><font color=\"orange\">Weak.</font></b>';return true; break;\ncase 3: echo 'Password strength : <b><font color=\"grey\">Medium</font></b>';return true; break;\ncase 4: echo 'Password strength : <b><font color=\"blue\">Good</font></b>';return true; break;\ncase 5: echo 'Password strength : <b><font color=\"green\">Strong.</font></b>';return true; break;\ndefault : echo 'Password strength : <b><font color=\"red\">Very weak.</font></b>'; break;}\n}", "function check_strength($user_password) {\n $characters = 0;\n $capitalletters = 0;\n $loweletters = 0;\n $number = 0;\n\n if (strlen ($user_password) > 11) {\n $characters = 1;\n } else {\n $characters = 0;\n };\n if (preg_match('/[A-Z]/', $user_password)) {\n $capitalletters = 1;\n } else {\n $capitalletters = 0;\n };\n if (preg_match('/[a-z]/', $user_password)) {\n $loweletters = 1;\n } else {\n $loweletters = 0;\n };\n if (preg_match('/[0-9]/', $user_password)) {\n $number = 1;\n } else {\n $number = 0;\n };\n\n $total = $characters + $capitalletters + $loweletters + $number;\n\n return GetPercentage(4, $total);\n}", "protected function passwordRules()\n {\n return ['required', 'string', new Password, 'confirmed', new \\Valorin\\Pwned\\Pwned(300),];\n }", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "protected function password_strength($password)\n\t{\n\t\t$strength = 0;\n\t\t$patterns = array('/[a-z]/','/[A-Z]/','/\\d/','/\\W/','/.{12,}/');\n\t\tforeach($patterns as $pattern)\n\t\t{\n\t\t\t$strength += (int) preg_match($pattern,$password);\n\t\t}\n\t\treturn $strength;\n\t\t// 1 - weak\n\t\t// 2 - not weak\n\t\t// 3 - acceptable\n\t\t// 4 - strong\n\t}", "public function getStrength($password, $username = null)\n {\n if (!empty($username)) {\n $password = str_replace($username, '', $password);\n }\n\n $password_length = strlen($password);\n\n $strength = $password_length * 4;\n\n for ($i = 2; $i <= 4; $i++) {\n $temp = str_split($password, $i);\n\n $strength -= (ceil($password_length / $i) - count(array_unique($temp)));\n }\n\n preg_match_all('/[0-9]/', $password, $numbers);\n\n if (!empty($numbers)) {\n $numbers = count($numbers[0]);\n\n if ($numbers >= 3) {\n $strength += 5;\n }\n } else {\n $numbers = 0;\n }\n\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^¨\\\\\\]/', $password, $symbols);\n\n if (!empty($symbols)) {\n $symbols = count($symbols[0]);\n\n if ($symbols >= 2) {\n $strength += 5;\n }\n } else {\n $symbols = 0;\n }\n\n preg_match_all('/[a-z]/', $password, $lowercase_characters);\n preg_match_all('/[A-Z]/', $password, $uppercase_characters);\n\n if (!empty($lowercase_characters)) {\n $lowercase_characters = count($lowercase_characters[0]);\n } else {\n $lowercase_characters = 0;\n }\n\n if (!empty($uppercase_characters)) {\n $uppercase_characters = count($uppercase_characters[0]);\n } else {\n $uppercase_characters = 0;\n }\n\n if (($lowercase_characters > 0) && ($uppercase_characters > 0)) {\n $strength += 10;\n }\n\n $characters = $lowercase_characters + $uppercase_characters;\n\n if (($numbers > 0) && ($symbols > 0)) {\n $strength += 15;\n }\n\n if (($numbers > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($symbols > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($numbers == 0) && ($symbols == 0)) {\n $strength -= 10;\n }\n\n if (($symbols == 0) && ($characters == 0)) {\n $strength -= 10;\n }\n\n if ($strength < 0) {\n $strength = 0;\n }\n\n if ($strength > 100) {\n $strength = 100;\n }\n\n return $strength;\n }", "public function getPasswordStrength(string $password): int;", "function CheckStrength($attribute, $params) {\n if (isset($this->$attribute)) { // Edit 2013-06-01\n $password = $this->$attribute;\n if (strlen($password) == 0)\n $strength = -10;\n else\n $strength = 0;\n /* * * get the length of the password ** */\n $length = strlen($password);\n /* * * check if password is not all lower case ** */\n if (strtolower($password) != $password) {\n $strength += 1;\n }\n /* * * check if password is not all upper case ** */\n if (strtoupper($password) == $password) {\n $strength += 1;\n }\n /* * * check string length is 8 -15 chars ** */\n if ($length >= 8 && $length <= 15) {\n $strength += 2;\n }\n /* * * check if lenth is 16 - 35 chars ** */\n if ($length >= 16 && $length <= 35) {\n $strength += 2;\n }\n /* * * check if length greater than 35 chars ** */\n if ($length > 35) {\n $strength += 3;\n }\n /* * * get the numbers in the password ** */\n preg_match_all('/[0-9]/', $password, $numbers);\n $strength += count($numbers[0]);\n /* * * check for special chars ** */\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^\\\\\\]/', $password, $specialchars);\n $strength += sizeof($specialchars[0]);\n /* * * get the number of unique chars ** */\n $chars = str_split($password);\n $num_unique_chars = sizeof(array_unique($chars));\n $strength += $num_unique_chars * 2;\n /* * * strength is a number 1-100; ** */\n $strength = $strength > 99 ? 99 : $strength;\n //$strength = floor($strength / 10 + 1);\n if ($strength < $params['score'])\n $this->addError($attribute, \"Password is too weak - try using CAPITALS, Num8er5, AND sp€c!al characters. Your score was \" . $strength . \"/\" . $params['score']);\n else\n return true;\n }\n }", "public function password_strength_check($str)\n\t{\n\t\tif (preg_match('#[0-9]#', $str) && preg_match('#[a-zA-Z]#', $str)) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\t$this->form_validation->set_message('password_strength_check', 'Your password must be at least 6-19 characters in length and contain a number and both uppercase and lowercase letters');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\n\t}", "function validate_password($candidate) \n{\n if (!empty($candidate))\n {\n // Declare and Initialize Local Variables\n $CritCount = 0; //Tabulator for keeping track of number of criteria matched\n\n /*\n Regular Expression Example $\\S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S*$\n $ = beginning of string\n \\S* = any set of characters\n (?=\\S{8,}) = of at least length 8\n (?=\\S*[a-z]) = containing at least one lowercase letter\n (?=\\S*[A-Z]) = and at least one uppercase letter\n (?=\\S*[\\d]) = and at least one number\n (?=\\S*[\\W]) = and at least a special character (non-word characters)\n $ = end of the string\n\n */\n // Test for each requirement \n if (strlen($candidate) >= 8) $CritCount = $CritCount + 10; // Value of 10 for minimum length\n if (preg_match('/[a-z]/', $candidate)) $CritCount = $CritCount + 1; //Contains lower case a-z\n if (preg_match('/[A-Z]/', $candidate)) $CritCount = $CritCount + 1; //Contains UPPER case A-Z\n if (preg_match('/[\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one numeric digit\n if (preg_match('/[^a-zA-Z\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one special Character (!@#$%^&*()-_, etc.)\n \n if ($CritCount > 12) //Meets minimum length, plus 3 additional criteria\n {\n return TRUE;\n }\n else \n {\n return FALSE;\n }\n }\n else\n return false;\n}", "function isValidPassword($password){\n $hasLower = false;\n $hasDigit = false;\n $hasUpper = false;\n\n if(strlen($password) >= 8 && strlen($password) <= 20){\n $splitStringArray = str_split($password);\n\n for($i = 0; $i < count($splitStringArray); $i++){\n if(ctype_lower($splitStringArray[$i])){\n $hasLower = true;\n }\n else if(ctype_digit($splitStringArray[$i])){\n $hasDigit = true;\n }\n else if(ctype_upper($splitStringArray[$i])){\n $hasUpper = true;\n }\n if($hasLower && $hasDigit && $hasUpper){\n return true;\n }\n }\n }\n return false;\n }", "public function testManyLowercaseCharacter ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 1,\n 'digit' => 1,\n 'upper' => 1,\n 'lower' => 5\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^a-z]*[a-z]){5})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){1})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function rules()\n {\n $user = auth()->user();\n\n return [\n /*'password' => [\n 'nullable',\n function ($attribute, $value, $fail) use ($user) {\n if (!Hash::check($value, $user->password)) {\n return $fail(__('The password is incorrect.'));\n }\n }\n ],*/\n ];\n }", "public function provideValidatePassword()\n {\n return [\n [123456, 234567, true],\n [\"123457\", 234567, true],\n [\"12345v\", 234567, false],\n ['asdfgh', 'asdfgh', false]\n ];\n }", "function checkPasswordPolicy( $password, $admin=\"y\" ) {\n\t\n\tglobal $CONF;\n\t\n\t$smallLetters\t\t= preg_match( '/[a-z]/', $password );\n\t$capitalLetters\t\t= preg_match( '/[A-Z]/', $password );\n\t$numbers\t\t\t= preg_match( '/[0-9]/', $password );\n\tif( isset( $CONF['passwordSpecialChars'] ) ) {\n\t\t$pattern\t\t= '/'.$CONF['passwordSpecialChars'].'/';\n\t} else {\n\t\t$pattern\t\t= '/'.'[\\!\\\"\\§\\$\\%\\/\\(\\)=\\?\\*\\+\\#\\-\\_\\.\\:\\,\\;\\<\\>\\|\\@]'.'/';\n\t}\n\t$specialChars\t\t= preg_match( $pattern, $password );\n\t$passwordLength\t\t= strlen( $password );\n\t$groups\t\t\t\t= 0;\n\t\n\tif( $smallLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $capitalLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $numbers != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $specialChars != 0 ) {\t\t\n\t\t$groups++;\n\t}\n\t\n\tif( $admin == \"y\" ) {\n\t\t\n\t\tif( isset($CONF['minPasswordlength']) ) {\n\t\t\t$minPasswordLength\t= $CONF['minPasswordlength'];\n\t\t} else {\n\t\t\t$minPasswordLength\t= 14;\n\t\t}\n\t\tif( $passwordLength < $minPasswordLength ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset( $CONF['minPasswordGroups'] ) ) {\n\t\t\t\t$minPasswordGroups\t= $CONF['minPasswordGroups'];\n\t\t\t} else {\n\t\t\t\t$minPasswordGroups\t= 4;\n\t\t\t}\n\t\t\tif( isset( $minPasswordGroups ) ) {\n\t\t\t\n\t\t\t\tif( ($minPasswordGroups < 1) or ($minPasswordGroups > 4) ) {\n\t\t\t\t\t$minGroups\t= 4;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroups\t= $minPasswordGroups;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroups\t\t= 4;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroups ) {\n\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\n\t} else {\n\t\t\n\t\tif( isset( $CONF['minPasswordlengthUser'] ) ) {\n\t\t\t$minPasswordlengthUser\t\t= $CONF['minPasswordlengthUser'];\n\t\t} else {\n\t\t\t$minPasswordLengthUser\t\t= 8;\n\t\t}\n\t\tif( $passwordLength < $CONF['minPasswordlengthUser'] ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset($CONF['minPasswordGroupsUser']) ) {\n\t\t\t\t\n\t\t\t\tif( ($CONF['minPasswordGroupsUser'] < 1) or ($CONF['minPasswordGroupsUser'] > 4 ) ) {\n\t\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroupsUser\t= $CONF['minPasswordGroupsUser'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroupsUser ) {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\treturn $retval;\n}", "public function rules()\n {\n return [\n 'password' => ['required', 'confirmed', 'regex:+(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[,.;:#?!@$^%&*-]).{6,}+']\n ];\n }", "public function passStrength($str){\n $error = FALSE;\n // make sure it is long enough\n if(strlen($str) < 8){\n $error['length'] = 'must be 8 characters minimum.';\n }\n // must contain letters & numbers and must have 1 upper case letter!\n if( ! preg_match('/[A-Za-z]/', $str) && preg_match('/[0-9]/', $str)){\n $error['alphanum'] = 'Must be alphanumeric and contain capitals and lower case.';\n }\n return $error;\n }", "protected function rules()\n {\n return [\n 'password' => ['required', 'string', 'min:8', 'confirmed','regex:/^(?=.*?[a-z])(?=.*?[#?!@$%^&*-_]).{8,}$/']\n ];\n }", "public static function validatePassword()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 11),\n );\n }", "protected function passwordRules($utype)\n {\n if($utype == 1){\n return ['required', 'string', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^A-Za-z0-9@]).{8,}$/','confirmed'];\n }elseif ($utype == 2){\n return ['required', 'string', 'regex:/^(?=.*?[A-Za-z])(?=.*?[0-9])(?=.*?[^A-Za-z0-9]).{8,}$/','confirmed'];\n }else{\n return ['required', 'string', 'regex:/^(?=.*?[A-Za-z])(?=.*?[0-9]).{6,16}$/', 'confirmed'];\n }\n }", "function checkPasswordErrors($password, $username = false) {\n $returns = array(\n 'strength' => 0,\n 'error' => 0,\n 'text' => ''\n );\n\n $length = strlen($password);\n\n if ($length < 8) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is not long enough';\n } elseif ($length > 32) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is too long';\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n $returns['error'] = 4;\n $returns['text'] = 'Password cannot be the same as your Username';\n } elseif (strtolower($password) == 'password') {\n $returns['error'] = 3;\n $returns['text'] = 'Password is too common';\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n $returns['error'] = 2;\n $returns['text'] = 'Too many consecutive characters';\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n $returns['strength'] = 5;\n $returns['text'] = 'Virtually Bulletproof';\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n $returns['strength'] = 4;\n $returns['text'] = 'Very Strong';\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n $returns['strength'] = 3;\n $returns['text'] = 'Strong';\n } else if ($numbers > 1) {\n//fair\n $returns['strength'] = 2;\n $returns['text'] = 'Fair';\n } else {\n//weak\n $returns['strength'] = 1;\n $returns['text'] = 'Weak';\n }\n }\n }\n return $returns;\n}", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "function __construct ($params=array())\n {\n /**\n * Define Rules\n * Key is rule identifier\n * Value is rule parameter\n * false is disabled (default)\n * Type is type of parameter data\n * permitted values are 'integer' or 'boolean'\n * Test is php code condition returning true if rule is passed\n * password string is $p\n * rule value is $v\n * Error is rule string definition\n * use #VALUE# to insert value\n */\n $this->rules['min_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return strlen($p)>=$v;',\n 'error' => 'Password must be more than #VALUE# characters long');\n\n $this->rules['max_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return (strlen($p)<=$v);',\n 'error' => 'Password must be less than #VALUE# characters long');\n\n $this->rules['min_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# lowercase characters');\n\n $this->rules['max_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# lowercase characters');\n\n $this->rules['min_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# uppercase characters');\n\n $this->rules['max_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# uppercase characters');\n\n $this->rules['disallow_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)==0;',\n 'error' => 'Password may not contain numbers');\n\n $this->rules['disallow_numeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[0-9]/\",$p,$x)==0;',\n 'error' => 'First character cannot be numeric');\n\n $this->rules['disallow_numeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be numeric');\n\n $this->rules['min_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# numbers');\n\n $this->rules['max_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# numbers');\n\n $this->rules['disallow_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)==0;',\n 'error' => 'Password may not contain non-alphanumeric characters');\n\n $this->rules['disallow_nonalphanumeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[\\W]/\",$p,$x)==0;',\n 'error' => 'First character cannot be non-alphanumeric');\n\n $this->rules['disallow_nonalphanumeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be non-alphanumeric');\n\n $this->rules['min_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# non-aplhanumeric characters');\n\n $this->rules['max_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# non-alphanumeric characters');\n\n // Apply params from constructor array\n foreach( $params as $k=>$v ) { $this->$k = $v; }\n\n // Errors defaults empty\n $this->errors = array();\n\n return 1;\n }", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules(): array\n {\n return [\n 'password' => ['required', 'string', new Password(8), 'confirmed'],\n ];\n }", "public function rules()\n {\n\t\t$id = $this->route('admin_user');\n\t\t$rules = [\n\t\t\t'password' => 'nullable|between:6,20',\n\t\t\t'name' => 'required|between:2,20|allow_letter|unique:admin_users,name,'.$id\n\t\t];\n\n\t\tif (!$id) {\n\t\t\t$rules['password'] = 'required';\n\t\t}\n\t\treturn $rules;\n }", "public function provideCheckInputPasswordRange()\n {\n return [\n [1, 1],\n [11, false],\n [2, 2],\n [9, 9],\n [0, false]\n ];\n }", "public function rules()\n {\n return [\n 'current_password' => [\n 'required',\n function ($attribute, $value, $fail) {\n if (!password_verify ($value, auth()->user()->password)) {\n $fail(\"$attribute không đúng\");\n }\n },\n ],\n 'password' => [\n 'required',\n 'max:128',\n 'regex:/^(?=.*[a-z])+(?=.*[A-Z])+(?=.*\\d)+(?=.*[$~!#^()@$!%*?&])[A-Za-z\\d$~!#^()@$!%*?&]{8,}/',\n ],\n ];\n }", "public function strength($pwd = '', $data = array()) {\n if($pwd=='') {\n $pwd = $this->password;\n }\n $this->setUserdata($data);\n if((isset($pwd)) && ($pwd!='') && ($pwd!=null)) {\n if(class_exists('\\ZxcvbnPhp\\Zxcvbn')) {\n $zxcvbn = new \\ZxcvbnPhp\\Zxcvbn(); // https://github.com/bjeavons/zxcvbn-php\n $strength = $zxcvbn->passwordStrength($pwd, $this->userdata);\n\n return $strength;\n }\n }\n return false;\n }", "protected function rulesChange()\n {\n return [\n 'password' => 'required|confirmed|min:'.config('db_limits.users.minPasswordLength'),\n ];\n }", "function valid_pass($password)\n {\n $r2 = '/[A-z]/'; //lowercase\n $r3 = '/[0-9]/'; //numbers\n $r4 = '/[~!@#$%^&*()\\-_=+{};:<,.>?]/'; // special char\n\n /*if (preg_match_all($r1, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个大写字母,请返回修改!\";\n return FALSE;\n }*/\n if (preg_match_all($r2, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个字母,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n if (preg_match_all($r3, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个数字,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n /*if (preg_match_all($r4, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个特殊符号:[~!@#$%^&*()\\-_=+{};:<,.>?],请返回修改!\";\n return FALSE;\n }*/\n if (strlen($password) < 8) {\n $msg = \"密码必须包含至少含有8个字符,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n return ['code' => 0, 'msg' => 'success'];\n }", "function checkPasswordForPolicy($password, $handle = '') {\n $minLength = $this->getProperty('PASSWORD_MIN_LENGTH', 0);\n $compareToHandle = $this->getProperty('PASSWORD_NOT_EQUALS_HANDLE', 0);\n $checkAgainstBlacklist = $this->getProperty('PASSWORD_BLACKLIST_CHECK', 0);\n $result = 0;\n if ($minLength > 0 && strlen($password) < $minLength) {\n $result -= 1;\n }\n if ($compareToHandle && $handle != '' && strtolower($password) == strtolower($handle)) {\n $result -= 2;\n }\n if ($checkAgainstBlacklist && $this->checkPasswordAgainstBlacklist($password) === FALSE) {\n $result -= 4;\n }\n return $result;\n }", "function cjpopups_is_password_strong($pass_string, $compare = 1) {\n $r1='/[A-Z]/'; //Uppercase\n $r2='/[a-z]/'; //lowercase\n $r3='/[!@#$%^&*()\\-_=+{};:,<.>]/'; // whatever you mean by 'special char'\n $r4='/[0-9]/'; //numbers\n if(preg_match_all($r1,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r2,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r3,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r4,$pass_string, $o) < $compare) return FALSE;\n if(strlen($pass_string) < 8) return FALSE;\n return TRUE;\n}", "public function rules()\r\n {\r\n $route = \\Route::currentRouteName();\r\n switch ($route) {\r\n case 'api.v1.user.changePassword':\r\n $rules = [\r\n 'password' => 'required|min:3',\r\n 'new_password' => 'required|min:3',\r\n ];\r\n break;\r\n default:\r\n $rules = User::$rulesLogin;\r\n break;\r\n }\r\n\r\n return $rules;\r\n }", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK) {\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n } elseif ($params['strength'] === self::STRONG) {\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n }\n if (!preg_match($pattern, $this->$attribute)) {\n $this->addError($attribute, 'your password is not strong enough!');\n }\n }", "function reduce_min_strength_password_requirement( $strength ) {\n return 2; \n}", "public function rules()\n {\n $maxChars = config('tweetRules.maxCharCount');\n $minChars = config('tweetRules.minCharCount');\n\n return [\n 'message' => \"min:$minChars|max:$maxChars\",\n ];\n }", "function nrua_check_password($pwd) {\n\t$errors = [];\n\t\n\tif (strlen($pwd) < 8) {\n\t$errors[] = \"Password too short!\";\n\t}\n\t\n\tif (!preg_match(\"#[0-9]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one number!\";\n\t}\n\t\n\tif (!preg_match(\"#[a-zA-Z]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one letter!\";\n\t}\n\t\n\treturn $errors;\n}", "public static function getPasswordCriteria(){\n $config = Configuration::where('id', 1)->first();\n\n $regex = \"/^\";\n\n if($config->password_lower_case_required == 1){\n $regex.=\"(?=.*[a-z])\";\n }\n\n if($config->password_upper_case_required == 1){\n $regex.=\"(?=.*[A-Z])\";\n }\n\n if($config->password_special_characters_required == 1){\n $regex.=\"(?=.*[!$#@%*&])\";\n }\n\n if($config->password_number_required == 1){\n $regex.=\"(?=.*[0-9])\";\n }\n\n if($config->password_min_length > 6){\n $regex.=\".{\".$config->password_min_length.\",}$\";\n }\n else{\n $regex.=\".{6,}$\";\n }\n\n return $regex.\"/m\";\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'email' => 'required|email',\n ];\n\n if($this->register_using == UserAccountProvider::SSO_PROVIDER){\n $rules = array_merge($rules, [\n 'password' => 'required|min:8',\n 'confirm_password' => 'required|same:password|min:8',\n ]);\n }\n\n return $rules;\n }", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "public function rules()\n {\n $rules = [\n 'password' => 'required|min:6|max:60',\n 'password_confirmation' => 'same:password',\n ];\n\n if (Auth::user()->isSuperUser()) {\n return $rules;\n }\n\n return ['old_password' => 'required|min:6|max:60'] + $rules;\n }", "public function rules()\n {\n $rules = [\n 'password' => [\n 'required',\n 'min:8',\n 'confirmed'\n ]\n ];\n if ($this->user()->password != 'not_set') {\n $rules['current_password'] = 'required';\n }\n\n return $rules;\n }", "public function rules(): array\n {\n return [\n 'oldPassword' => ['required', 'string'],\n 'newPassword' => [\n 'required',\n 'string',\n 'min:8',\n new ContainsNumeral(),\n new ContainsLowercase(),\n new ContainsUppercase(),\n ],\n ];\n }", "public function rules()\n {\n return array(\n // username and password are required\n array('currentPassword, newPassword, comparePassword', 'required'),\n //array('column', 'in', 'range'=> CActiveRecord::model(Yii::app()->getModule('pii')->userClass)->attributeNames()),\n // password needs to be authenticated\n //array('password', 'authenticate'),\n array('newPassword', 'match', 'pattern' => '/^[a-z0-9_-]{4,20}$/i',\n 'message' => 'The {attribute} ca only contain letters, numbers, the underscore, and the hyphen.'),\n array('comparePassword', 'compare', 'compareAttribute' => 'newPassword'),\n );\n }", "public function rules()\n {\n return [\n 'email' => ['required', 'email'],\n 'password' => ['required', Password::min(8)->symbols(true)->mixedCase(true)],\n ];\n }", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK)\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n elseif ($params['strength'] === self::STRONG)\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n\n if (!preg_match($pattern, $this->$attribute) || strlen($this->$attribute) < 8)\n $this->addError($attribute, 'New password is not strong enough!' . \" \\n\" . \" Minimal length 8 digit and \" . \" \\n includes alphanumeric string\");\n }", "function vPassword( $password )\r\n\t\t{\r\n\t\t\t\treturn preg_match( '/^(?=^.{8,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$/', $password );\r\n\t\t\t\t\r\n\t\t}", "public function rules()\n {\n return [\n 'username' => ['required','min:6','max:12',new IsUsernameExist()],\n 'password'=> 'required|string|min:8|max:20|confirmed|regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/',\n 'password_confirmation' => 'required',\n ];\n }", "public function test($password) {\n $error = array();\n if($password == trim($password) && strpos($password, ' ') !== false) {\n $error[] = \"Password can not contain spaces!\";\n }\n \n if(($this->password_lenghtMin!=null) && (strlen($password) < $this->password_lenghtMin)) {\n $error[] = \"Password too short! Minimum \".$this->password_lenghtMin.\" characters.\";\n }\n if(($this->password_lenghtMax!=null) && (strlen($password) > $this->password_lenghtMax)) {\n $error[] = \"Password too long! Maximum \".$this->password_lenghtMax.\" characters.\";\n }\n \n if(($this->password_number!=null) && (!preg_match(\"#[0-9]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_number.\" number(s)!\";\n } elseif($this->password_number>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_number) {\n $error[] = \"Password must include at least \".$this->password_number.\" number(s)!\";\n }\n }\n\n if(($this->password_letter!=null) && (!preg_match(\"#[a-z]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_letter.\" letter(s)! \";\n } elseif($this->password_letter>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_letter) {\n $error[] = \"Password must include at least \".$this->password_letter.\" letter(s)! \";\n }\n }\n\n if(($this->password_capital!=null) && (!preg_match(\"#[A-Z]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_capital.\" capital letter(s)! \";\n } elseif($this->password_capital>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_capital) {\n $error[] = \"Password must include at least \".$this->password_capital.\" capital letter(s)! \";\n }\n }\n \n \n if(($this->password_symbol!=null) && (!preg_match(\"/\\W+/\", $password))) {\n $error[] = \"Password must include at least \".$this->password_symbol.\" symbol(s)!\";\n } elseif($this->password_symbol>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_symbol) {\n $error[] = \"Password must include at least \".$this->password_symbol.\" symbol(s)!\";\n }\n }\n \n if(($this->password_strength!=null) && (($this->strength($password)!==false) && ($this->strength($password)['score']<$this->password_strength))) {\n $error[] = \"Password too weak! \".$this->strength($password)['score'].'/4 minimum '.$this->password_strength;\n }\n\n if(!empty($error)){\n return $error;\n } else {\n return true;\n }\n }", "public function rules() {\n\n $rules = [\n 'username' => 'required',\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'email' => 'required|email',\n\n ];\n\n if (Input::filled('password')) {\n $rules['password'] = 'confirmed|min:6';\n }\n\n return $rules;\n\n }", "public function rules()\n {\n return [\n 'name' => 'max:20',\n 'city' => 'max:10',\n 'school' => 'max:10',\n 'intro' => 'max:50',\n 'password' => 'sometimes|same:password_confirm|min:6'\n ];\n }", "public function rules()\n {\n return [\n 'password' => 'max:30|min:3',\n ];\n }", "public function rules()\n {\n return [\n 'username' => 'required|string|unique:users',\n 'password' => 'required|string|min:6',\n 'password_repeat' => 'same:password',\n 'account_type' => [\n 'integer',\n Rule::in([User::TYPE_DEFAULT, User::TYPE_FINANCE, User::TYPE_MEDICINE, User::TYPE_BUSINESS])\n ]\n ];\n }", "function validate_password($password)\n {\n $reg1='/[A-Z]/'; //Upper case Check\n $reg2='/[a-z]/'; //Lower case Check\n $reg3='/[^a-zA-Z\\d\\s]/'; // Special Character Check\n $reg4='/[0-9]/'; // Number Digit Check\n $reg5='/[\\s]/'; // Number Digit Check\n\n if(preg_match_all($reg1,$password, $out)<1) \n return \"There should be atleast one Upper Case Letter...\";\n\n if(preg_match_all($reg2,$password, $out)<1) \n return \"There should be atleast one Lower Case Letter...\";\n\n if(preg_match_all($reg3,$password, $out)<1) \n return \"There should be atleast one Special Character...\";\n\n if(preg_match_all($reg4,$password, $out)<1) \n return \"There should be atleast one numeric digit...\";\n \n if(preg_match_all($reg5,$password, $out)>=1) \n return \"Spaces are not allowed...\";\n\n if(strlen($password) <= 8 || strlen($password) >= 16 ) \n return \"Password Length should be between 8 and 16\";\n\n return \"OK\";\n }", "public function rules()\n {\n return [\n 'username' => 'required|string|between:6,20',\n 'password' => 'required|between:6,16',\n ];\n }", "function validate_password($field) {\n\t\tif ($field == \"\") return \"No Password was entered.<br>\";\n\t\telse if (strlen($field) < 6)\n\t\t\treturn \"Password must be at least 6 characters.<br>\";\n\t\telse if (!preg_match(\"/[a-z]/\",$field) || !preg_match(\"/[A-Z]/\",$field) || !preg_match(\"/[0-9]/\",$field) )\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.<br>\";\n\t\treturn \"\";\n\t}", "public function retrievePasswordValidationRules()\n {\n return $this->startAnonymous()->uri(\"/api/tenant/password-validation-rules\")\n ->get()\n ->go();\n }", "public function rules()\n {\n $validations = [\n 'username' => 'required|string',\n 'password' => 'required|string',\n ];\n\n return $validations;\n }", "function isValidPassword2($password)\n{\n return checkLength($password) && specialChar($password) && containsUpperAndLower($password);\n}", "public function rules()\n {\n return [\n 'username' => ['required',\n 'min:3',\n 'max:255',\n 'regex:/^(\\w)+$/i',\n ],\n 'password' => ['required',\n 'min:3',\n 'max:35',\n ],\n ];\n }", "function vPassword2() \r\n\t\t{\r\n\t\t\t# Check password strength\r\n\t\t\t$p = $p1;\r\n\t\t\t\r\n\t\t\tif( strlen($p) < 8 ) $reg_errors[] = \"Password too short!\";\r\n\t\t\t\r\n\t\t\tif( strlen($p) > 20 ) $reg_errors[] = \"Password too long!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[0-9]+#\", $p) ) $reg_errors[] = \"Password must include at least one number!\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[a-z]+#\", $p) ) $reg_errors[] = \"Password must include at least one letter!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[A-Z]+#\", $p) ) $reg_errors[] = \"Password must include at least one CAPS!\";\r\n\t\t\t\r\n\t\t\t/* if( !preg_match(\"#\\W+#\", $p) ) $errors[] = \"Password must include at least one symbol!\"; */\t\r\n\t\t\t\r\n\t\t}", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "public function rules()\n {\n $rules['txt_username'] = 'required';\n $rules['txt_password'] = 'required|min:6|max:15';\n\n return $rules;\n }", "public function rules()\n {\n return [\n 'pass' => \"required|min:8|same:confirmpass\",\n \"confirmpass\" => 'required',\n 'currentpass' => ['required', function($attribute, $value, $fail){\n $user = User::where('userid', Session::get('username'))\n ->where('password', $value)\n ->first();\n if($user == null){\n $fail('current password is incorrect');\n }\n }]\n ];\n }", "function checkPassword($clientPassword){\r\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\r\n return preg_match($pattern, $clientPassword);\r\n }", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n ];\n\n //no need for name in instagram\n if($this->getPathInfo() == '/instagram/connect') {\n $rules['password'] = str_replace('|confirmed', '', $rules['password']);\n $rules['username'] = 'required';\n unset($rules['name']);\n unset($rules['email']);\n }\n\n return $rules;\n }", "public function createRules(){\n return [\n 'email' => 'required|string|max:50',\n 'password' => 'required|string',\n ];\n }", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "abstract public function getValidationRules(): array;", "public function profileRules()\n {\n return [\n [['username', 'password', 'email'], 'required', 'on' => self::SCENARIO_CREATE],\n\n ['username', 'match', 'pattern' => '/^[A-Za-z][A-Za-z0-9\\-\\.\\ ]+$/i',\n 'message' => Yii::t($this->tcModule, 'Only latin letters, digits, hyphen, points and blanks begin with letter')\n ],\n ['username', 'string', 'min' => $this->minUsernameLength, 'max' => $this->maxUsernameLength],\n\n ['password', 'string', 'min' => $this->minPasswordLength, 'max' => $this->maxPasswordLength],\n\n ['email', 'string', 'max' => 255],\n ['email', 'email'],\n ];\n }", "function isPasswordStrong($password){\r\n\t\tif(strlen($password) < 8)\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[0-9]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[A-Z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[a-z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[\\W_]+#\",$password))\r\n\t\treturn false;\r\n\r\n\t\treturn true;\r\n\t}", "public function rules()\n {\n $rules = [\n 'name' => ['nullable', 'min:3', 'string', 'max:100'],\n 'email' => ['sometimes', 'email:rfc', 'min:8'],\n 'current_password' => ['sometimes', 'nullable', 'min:8', new MatchOldPassword],\n 'new_password' => ['sometimes', 'nullable', 'min:8'],\n 'confirm_new_password' => ['sometimes', 'same:new_password']\n ];\n\n return $rules;\n }", "function checkPassword($clientPassword)\n{\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\n return preg_match($pattern, $clientPassword);\n}", "public function rules()\n {\n $rules = [\n 'username' => ['required', 'alpha_num', 'min:3', 'max:30', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'email' => ['required', 'email', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'password' => ['required', 'min:5', 'max:20', 'confirmed'],\n ];\n\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $rules['password'] = ['sometimes', 'min:5', 'max:20', 'confirmed'];\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function providerForValidPassword()\n {\n return [\n ['password1'],\n ['pass-word1'],\n ['Pass word'],\n ['Password1'],\n ['Pass1'],\n ['Pass1#!']\n ];\n }", "function passwordLength($wachtwoordbevestiging) {\n\t$count = 0;\n\n\tfor($i = 0; $i < strlen($wachtwoordbevestiging); $i++) { \n\t\tif($wachtwoordbevestiging[$i] != ' ') \n\t\t\t$count++; \n\t}\n\n\tif ($count < 6) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "public function rules() {\n\t\treturn [\n\t\t\t'username' => 'required|between:6,32',\n\t\t\t'email' => 'email|required|between:6,32',\n\t\t\t'password' => 'required|between:6,32',\n\t\t\t'confirm_pass' => 'required|same:password'\n\t\t];\n\t}", "public function rules()\n {\n return [\n 'olduser_pass'=>'required|max:16|alpha_dash',\n 'newuser_pass'=>'required|max:16|alpha_dash',\n ];\n }", "function validatePasswordCase(&$Model, $data, $compare) {\r\n\t\tif (in_array($this->settings[$Model->alias]['passwordPolicy'], array('weak', 'normal'))) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$compare[0]];\r\n\t\tif (!(preg_match('/.*[a-z].*/', $compare))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!(preg_match('/.*[A-Z].*/', $compare))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function rules()\n {\n return [\n 'username' => 'required',\n 'email' => 'required|email',\n 'type' => 'required',\n 'cpassword' => 'required',\n 'npassword' => 'required',\n 'confirm_password' => 'required'\n ];\n }", "public function pw_test($password) {\r\n\r\n $errors = 0;\r\n $error_msg = \"\";\r\n\r\n $password = trim($password);\r\n\r\n\r\n if($password == \"\") {\r\n $error_msg .= \"Vous devez spécifier un mot de passe. <br />\";\r\n $errors++;\r\n } elseif(strlen($password) < 4) {\r\n $error_msg .= \"Votre mot de passe est trop court<br />\";\r\n $errors++;\r\n } elseif(strlen($password) > 50) {\r\n $error_msg .= \"Votre mot de passe est trop long<br />\";\r\n $errors++;\r\n }\r\n\r\n return array(\r\n \"value\" => $password,\r\n \"error_msg\" => $error_msg,\r\n \"errors\" => $errors\r\n );\r\n\r\n }", "protected function rules()\n {\n return [\n 'token' => 'required',\n 'email' => 'required|email',\n 'password' => 'required|confirmed|min:'.config('db_limits.users.minPasswordLength'),\n ];\n }", "public function rules()\n {\n $rules = [\n 'email'=>'required',\n ];\n\n if ((Request::input('nip') !== null)) {\n $rules['nip'] = 'digits:10';\n }\n\n if (Request::input('new_password')!== null) {\n $rules['new_password'] = 'min:6|required_with:confirm_password|same:confirm_password';\n $rules['confirm_password'] = 'min:6';\n }\n\n return $rules;\n }", "function passwordGood($pass) {\n\t// default encoding/encoding specified in php.ini for nginx's php fpm module\n\t// is 'UTF-8'\n\t$len = mb_strlen($pass);\n\t//$len = strlen($pass);\n\t// original code of ($len >= 8 && $len <= 24) doesn't seem to work since I think\n\t// when true these return 1, when false they seem to return nothing, when printed empty string\n\t// be careful, these seem to return nothing or they don't print properly\n\t// this does work though :P\n\tif ( ( $len < 8 ) || ( $len > 24 ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function rules() {\n $user_table = User::$tableName;\n return [\n 'mobile' => array('required', 'digits:10', \"exists:$user_table,mobile\"),\n 'password' => array('required')\n ];\n }", "function containsUpperAndLower($password)\n{\n if (strtoupper($password) == $password) return false;\n if (strtolower($password) == $password) return false;\n return true;\n}", "public function parameterRules()\n\t{\n\t\treturn [\n\t\t\t[['account','password'],'required'],\n\t\t\t['account','inlineAccountExists'],\n\t\t\t['remember','default','value'=>0],\n\t\t\t['remember','in','range'=>[0,1]]\n\t\t];\n\t}", "protected function rules()\n {\n return [\n 'token' => 'required',\n 'email' => 'required|email',\n 'password' => 'required|min:8|confirmed|regex:\"^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{8,}$\"',\n ];\n }", "public static function getRules(): array;", "public function rules()\n {\n return [\n 'password' => 'required|min:4|max:20|regex:/^([a-zA-Z0-9\\.\\-_\\/\\+=\\.\\~\\!@#\\$\\%\\^\\&\\*\\(\\)\\[\\]\\{\\}]){4,20}$/',\n ];\n }", "public function rules()\n {\n $named = $this->route()->getName();\n switch ($named) {\n case 'admin.auth.change.password':\n return [\n 'password' => 'required|between:8,16',\n 'password_confirmation' => 'required|between:8,16'\n ];\n case 'admin.auth.edit.profile':\n return [\n 'email' => 'email',\n 'name' => 'between:1,128',\n ];\n default:\n return [\n //\n ];\n }\n }", "public function getValidationRules() : array;" ]
[ "0.61229396", "0.61223096", "0.607677", "0.59833336", "0.5900933", "0.5883375", "0.58818406", "0.5803759", "0.57666826", "0.5710612", "0.5707325", "0.57013893", "0.5664909", "0.5650017", "0.56430817", "0.56130135", "0.5598602", "0.55912095", "0.55382675", "0.5533826", "0.55251247", "0.549068", "0.5484837", "0.54741085", "0.54652816", "0.5432069", "0.54289067", "0.5408731", "0.540617", "0.5404645", "0.54026765", "0.5399034", "0.53922", "0.53579473", "0.5351176", "0.5343946", "0.5340823", "0.5334758", "0.53323925", "0.53270745", "0.53050977", "0.53050745", "0.5303689", "0.5301806", "0.5278392", "0.5265586", "0.525911", "0.5245742", "0.5226739", "0.5195085", "0.51883966", "0.5185271", "0.51824445", "0.5169153", "0.5144428", "0.51409966", "0.5139687", "0.5136455", "0.51345897", "0.5131454", "0.5124929", "0.5123121", "0.51196617", "0.5117365", "0.511731", "0.51139915", "0.5112816", "0.51094663", "0.50988334", "0.50908464", "0.50809044", "0.5066182", "0.5065909", "0.5065909", "0.5065909", "0.50567496", "0.50525546", "0.5051973", "0.50497097", "0.50445116", "0.5036708", "0.50153404", "0.5013852", "0.5005872", "0.50054777", "0.5003608", "0.50029796", "0.5000874", "0.49991626", "0.49986687", "0.49957144", "0.49893665", "0.49841383", "0.49828058", "0.49716255", "0.49715272", "0.49671566", "0.49573478", "0.49531454", "0.49479833" ]
0.5482387
23
Set password strength rule to have any upper case character presented in password. Default value is `TRUE` to must have upper case character in password. Upper case characters from latin alphabet: abcdefghijklmnopqrstuvwxyz. Function has second argument to set minimum upper case characters in password. Default value is at least one upper case character in password.
public function SetMustHaveUpperCaseChars ($mustHaveUpperCaseChars = TRUE, $minCount = self::MIN_UPPERCASE_CHARS_COUNT) { /** @var \MvcCore\Ext\Forms\Validator $this */ $this->mustHaveUpperCaseChars = $mustHaveUpperCaseChars; $this->mustHaveUpperCaseCharsCount = $minCount; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdatePasswordOnlyUpperCase(): void { }", "public static function setPasswordUpperCaseRequired($isRequired){\n Configuration::where('id', 1)\n ->update(['password_upper_case_required' => $isRequired]);\n }", "public function testUpdatePasswordOnlyLowerCase(): void { }", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function setPasswordCapital($num) {\n if(is_numeric($num)) {\n $this->password_capital = $num;\n return $this->password_capital;\n }\n return false;\n }", "function reduce_min_strength_password_requirement( $strength ) {\n return 2; \n}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function letterCase($letterCase) {\n\n if ($letterCase == 'Upper') {\n $this->password = strtoupper($this->password);\n }elseif ($letterCase == 'Lower') {\n $this->password = strtolower($this->password);\n }else {\n $this->password = $this->password;\n }\n }", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK)\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n elseif ($params['strength'] === self::STRONG)\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n\n if (!preg_match($pattern, $this->$attribute) || strlen($this->$attribute) < 8)\n $this->addError($attribute, 'New password is not strong enough!' . \" \\n\" . \" Minimal length 8 digit and \" . \" \\n includes alphanumeric string\");\n }", "public function testRegistrationPasswordOnlyUpperCase(): void { }", "public function password_strength_check($str)\n\t{\n\t\tif (preg_match('#[0-9]#', $str) && preg_match('#[a-zA-Z]#', $str)) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\t$this->form_validation->set_message('password_strength_check', 'Your password must be at least 6-19 characters in length and contain a number and both uppercase and lowercase letters');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\n\t}", "function CheckStrength($attribute, $params) {\n if (isset($this->$attribute)) { // Edit 2013-06-01\n $password = $this->$attribute;\n if (strlen($password) == 0)\n $strength = -10;\n else\n $strength = 0;\n /* * * get the length of the password ** */\n $length = strlen($password);\n /* * * check if password is not all lower case ** */\n if (strtolower($password) != $password) {\n $strength += 1;\n }\n /* * * check if password is not all upper case ** */\n if (strtoupper($password) == $password) {\n $strength += 1;\n }\n /* * * check string length is 8 -15 chars ** */\n if ($length >= 8 && $length <= 15) {\n $strength += 2;\n }\n /* * * check if lenth is 16 - 35 chars ** */\n if ($length >= 16 && $length <= 35) {\n $strength += 2;\n }\n /* * * check if length greater than 35 chars ** */\n if ($length > 35) {\n $strength += 3;\n }\n /* * * get the numbers in the password ** */\n preg_match_all('/[0-9]/', $password, $numbers);\n $strength += count($numbers[0]);\n /* * * check for special chars ** */\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^\\\\\\]/', $password, $specialchars);\n $strength += sizeof($specialchars[0]);\n /* * * get the number of unique chars ** */\n $chars = str_split($password);\n $num_unique_chars = sizeof(array_unique($chars));\n $strength += $num_unique_chars * 2;\n /* * * strength is a number 1-100; ** */\n $strength = $strength > 99 ? 99 : $strength;\n //$strength = floor($strength / 10 + 1);\n if ($strength < $params['score'])\n $this->addError($attribute, \"Password is too weak - try using CAPITALS, Num8er5, AND sp€c!al characters. Your score was \" . $strength . \"/\" . $params['score']);\n else\n return true;\n }\n }", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK) {\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n } elseif ($params['strength'] === self::STRONG) {\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n }\n if (!preg_match($pattern, $this->$attribute)) {\n $this->addError($attribute, 'your password is not strong enough!');\n }\n }", "public function setPassword($value);", "function testPass($pass){\n$level=0;\nif(eight($pass)){$level+=1;}\nif(upper($pass)){$level+=1;}\nif(lower($pass)){$level+=1;}\nif(hasDigit($pass)){$level+=1;}\nif(hasSpecial($pass)){$level+=1;}\n\nswitch($level){\ncase 1: echo 'Password strength : <b><font color=red\">Very weak.</font></b>';return false; break;\ncase 2: echo 'Password strength : <b><font color=\"orange\">Weak.</font></b>';return true; break;\ncase 3: echo 'Password strength : <b><font color=\"grey\">Medium</font></b>';return true; break;\ncase 4: echo 'Password strength : <b><font color=\"blue\">Good</font></b>';return true; break;\ncase 5: echo 'Password strength : <b><font color=\"green\">Strong.</font></b>';return true; break;\ndefault : echo 'Password strength : <b><font color=\"red\">Very weak.</font></b>'; break;}\n}", "function check_strength($user_password) {\n $characters = 0;\n $capitalletters = 0;\n $loweletters = 0;\n $number = 0;\n\n if (strlen ($user_password) > 11) {\n $characters = 1;\n } else {\n $characters = 0;\n };\n if (preg_match('/[A-Z]/', $user_password)) {\n $capitalletters = 1;\n } else {\n $capitalletters = 0;\n };\n if (preg_match('/[a-z]/', $user_password)) {\n $loweletters = 1;\n } else {\n $loweletters = 0;\n };\n if (preg_match('/[0-9]/', $user_password)) {\n $number = 1;\n } else {\n $number = 0;\n };\n\n $total = $characters + $capitalletters + $loweletters + $number;\n\n return GetPercentage(4, $total);\n}", "public static function setPasswordLowerCaseRequired($isRequired){\n Configuration::where('id', 1)\n ->update(['password_lower_case_required' => $isRequired]);\n }", "public function passStrength($str){\n $error = FALSE;\n // make sure it is long enough\n if(strlen($str) < 8){\n $error['length'] = 'must be 8 characters minimum.';\n }\n // must contain letters & numbers and must have 1 upper case letter!\n if( ! preg_match('/[A-Za-z]/', $str) && preg_match('/[0-9]/', $str)){\n $error['alphanum'] = 'Must be alphanumeric and contain capitals and lower case.';\n }\n return $error;\n }", "public function setPasswordStrength($num) {\n if((is_numeric($num)) && (($num>=0) && ($num<=4))) {\n $this->password_strength = $num;\n return $this->password_strength;\n }\n return false;\n }", "public function testManyLowercaseCharacter ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 1,\n 'digit' => 1,\n 'upper' => 1,\n 'lower' => 5\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^a-z]*[a-z]){5})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){1})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "public function setPassword($newPassword);", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "protected function changePassword() {}", "public function checkPassword($value);", "public function setPassword(){\n\t}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "function isValidPassword2($password)\n{\n return checkLength($password) && specialChar($password) && containsUpperAndLower($password);\n}", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "function vPassword2() \r\n\t\t{\r\n\t\t\t# Check password strength\r\n\t\t\t$p = $p1;\r\n\t\t\t\r\n\t\t\tif( strlen($p) < 8 ) $reg_errors[] = \"Password too short!\";\r\n\t\t\t\r\n\t\t\tif( strlen($p) > 20 ) $reg_errors[] = \"Password too long!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[0-9]+#\", $p) ) $reg_errors[] = \"Password must include at least one number!\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[a-z]+#\", $p) ) $reg_errors[] = \"Password must include at least one letter!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[A-Z]+#\", $p) ) $reg_errors[] = \"Password must include at least one CAPS!\";\r\n\t\t\t\r\n\t\t\t/* if( !preg_match(\"#\\W+#\", $p) ) $errors[] = \"Password must include at least one symbol!\"; */\t\r\n\t\t\t\r\n\t\t}", "function validatePasswordCase(&$Model, $data, $compare) {\r\n\t\tif (in_array($this->settings[$Model->alias]['passwordPolicy'], array('weak', 'normal'))) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$compare[0]];\r\n\t\tif (!(preg_match('/.*[a-z].*/', $compare))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!(preg_match('/.*[A-Z].*/', $compare))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function containsUpperAndLower($password)\n{\n if (strtoupper($password) == $password) return false;\n if (strtolower($password) == $password) return false;\n return true;\n}", "function __construct ($params=array())\n {\n /**\n * Define Rules\n * Key is rule identifier\n * Value is rule parameter\n * false is disabled (default)\n * Type is type of parameter data\n * permitted values are 'integer' or 'boolean'\n * Test is php code condition returning true if rule is passed\n * password string is $p\n * rule value is $v\n * Error is rule string definition\n * use #VALUE# to insert value\n */\n $this->rules['min_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return strlen($p)>=$v;',\n 'error' => 'Password must be more than #VALUE# characters long');\n\n $this->rules['max_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return (strlen($p)<=$v);',\n 'error' => 'Password must be less than #VALUE# characters long');\n\n $this->rules['min_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# lowercase characters');\n\n $this->rules['max_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# lowercase characters');\n\n $this->rules['min_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# uppercase characters');\n\n $this->rules['max_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# uppercase characters');\n\n $this->rules['disallow_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)==0;',\n 'error' => 'Password may not contain numbers');\n\n $this->rules['disallow_numeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[0-9]/\",$p,$x)==0;',\n 'error' => 'First character cannot be numeric');\n\n $this->rules['disallow_numeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be numeric');\n\n $this->rules['min_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# numbers');\n\n $this->rules['max_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# numbers');\n\n $this->rules['disallow_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)==0;',\n 'error' => 'Password may not contain non-alphanumeric characters');\n\n $this->rules['disallow_nonalphanumeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[\\W]/\",$p,$x)==0;',\n 'error' => 'First character cannot be non-alphanumeric');\n\n $this->rules['disallow_nonalphanumeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be non-alphanumeric');\n\n $this->rules['min_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# non-aplhanumeric characters');\n\n $this->rules['max_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# non-alphanumeric characters');\n\n // Apply params from constructor array\n foreach( $params as $k=>$v ) { $this->$k = $v; }\n\n // Errors defaults empty\n $this->errors = array();\n\n return 1;\n }", "public function setPassword($newPassword){\n\t}", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "function minimum_password_limit( & $errors ) {\r\n\t$min_length = 12;\r\n\tif ( !empty( $_POST['pass1'] ) && $_POST['pass1'] === $_POST['pass2'] && !preg_match('/^.*(?=.{12,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', $_POST['pass1']) ) {\r\n\t\t$errors->add( 'min_pass_length', sprintf( __( '<strong>Security advice</strong>: Your password must be at least %d characters long and have at least one capital letter and one number in it.' ), $min_length ), array( 'form-field' => 'pass1' ) );\r\n\t}\r\n}", "function makePassword($len = 8)\r\n{\r\n $vowels = array('a', 'e', 'i', 'o', 'u', 'y');\r\n $confusing = array('I', 'l', '1', 'O', '0');\r\n $replacements = array('A', 'k', '3', 'U', '9');\r\n $choices = array(0 => rand(0, 1), 1 => rand(0, 1), 2 => rand(0, 2));\r\n $parts = array(0 => '', 1 => '', 2 => '');\r\n\r\n if ($choices[0]) $parts[0] = rand(1, rand(9,99));\r\n if ($choices[1]) $parts[2] = rand(1, rand(9,99));\r\n\r\n $len -= (strlen($parts[0]) + strlen($parts[2]));\r\n for ($i = 0; $i < $len; $i++)\r\n {\r\n if ($i % 2 == 0)\r\n {\r\n do $con = chr(rand(97, 122));\r\n while (in_array($con, $vowels));\r\n $parts[1] .= $con;\r\n }\r\n else\r\n {\r\n $parts[1] .= $vowels[array_rand($vowels)];\r\n }\r\n }\r\n if ($choices[2]) $parts[1] = ucfirst($parts[1]);\r\n if ($choices[2] == 2) $parts[1] = strrev($parts[1]);\r\n\r\n $r = $parts[0] . $parts[1] . $parts[2];\r\n $r = str_replace($confusing, $replacements, $r);\r\n return $r;\r\n}", "public function enablePasswordStringLength()\n {\n // Add validator\n return $this->attachPasswordValidator('Zend\\Validator\\StringLength', array(\n 'min' => 8,\n 'max' => 64,\n ));\n }", "public function getStrength($password, $username = null)\n {\n if (!empty($username)) {\n $password = str_replace($username, '', $password);\n }\n\n $password_length = strlen($password);\n\n $strength = $password_length * 4;\n\n for ($i = 2; $i <= 4; $i++) {\n $temp = str_split($password, $i);\n\n $strength -= (ceil($password_length / $i) - count(array_unique($temp)));\n }\n\n preg_match_all('/[0-9]/', $password, $numbers);\n\n if (!empty($numbers)) {\n $numbers = count($numbers[0]);\n\n if ($numbers >= 3) {\n $strength += 5;\n }\n } else {\n $numbers = 0;\n }\n\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^¨\\\\\\]/', $password, $symbols);\n\n if (!empty($symbols)) {\n $symbols = count($symbols[0]);\n\n if ($symbols >= 2) {\n $strength += 5;\n }\n } else {\n $symbols = 0;\n }\n\n preg_match_all('/[a-z]/', $password, $lowercase_characters);\n preg_match_all('/[A-Z]/', $password, $uppercase_characters);\n\n if (!empty($lowercase_characters)) {\n $lowercase_characters = count($lowercase_characters[0]);\n } else {\n $lowercase_characters = 0;\n }\n\n if (!empty($uppercase_characters)) {\n $uppercase_characters = count($uppercase_characters[0]);\n } else {\n $uppercase_characters = 0;\n }\n\n if (($lowercase_characters > 0) && ($uppercase_characters > 0)) {\n $strength += 10;\n }\n\n $characters = $lowercase_characters + $uppercase_characters;\n\n if (($numbers > 0) && ($symbols > 0)) {\n $strength += 15;\n }\n\n if (($numbers > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($symbols > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($numbers == 0) && ($symbols == 0)) {\n $strength -= 10;\n }\n\n if (($symbols == 0) && ($characters == 0)) {\n $strength -= 10;\n }\n\n if ($strength < 0) {\n $strength = 0;\n }\n\n if ($strength > 100) {\n $strength = 100;\n }\n\n return $strength;\n }", "public function usePassword($password)\n {\n // CODE...\n }", "private function hasUppercase(): bool\n {\n if (1 == preg_match('/\\p{Lu}/', $this->password)) {\n return true;\n }\n array_push($this->errorMessages, \"Uppercase letter missing.\");\n return false;\n }", "protected function password_strength($password)\n\t{\n\t\t$strength = 0;\n\t\t$patterns = array('/[a-z]/','/[A-Z]/','/\\d/','/\\W/','/.{12,}/');\n\t\tforeach($patterns as $pattern)\n\t\t{\n\t\t\t$strength += (int) preg_match($pattern,$password);\n\t\t}\n\t\treturn $strength;\n\t\t// 1 - weak\n\t\t// 2 - not weak\n\t\t// 3 - acceptable\n\t\t// 4 - strong\n\t}", "function isUpper(){ return $this->length()>0 && $this->toString()===$this->upcase()->toString(); }", "public function setPW($dw) {}", "public function getPasswordStrength(string $password): int;", "public function setPassword(string $password): void\n {\n }", "function setPassword($password){\n\t\t$password = base64_encode($password);\n\t\t$salt5 = mt_rand(10000,99999);\t\t\n\t\t$salt3 = mt_rand(100,999);\t\t\n\t\t$salt1 = mt_rand(0,25);\n\t\t$letter1 = range(\"a\",\"z\");\n\t\t$salt2 = mt_rand(0,25);\n\t\t$letter2 = range(\"A\",\"Z\");\n\t\t$password = base64_encode($letter2[$salt2].$salt5.$letter1[$salt1].$password.$letter1[$salt2].$salt3.$letter2[$salt1]);\n\t\treturn str_replace(\"=\", \"#\", $password);\n\t}", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "function cjpopups_is_password_strong($pass_string, $compare = 1) {\n $r1='/[A-Z]/'; //Uppercase\n $r2='/[a-z]/'; //lowercase\n $r3='/[!@#$%^&*()\\-_=+{};:,<.>]/'; // whatever you mean by 'special char'\n $r4='/[0-9]/'; //numbers\n if(preg_match_all($r1,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r2,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r3,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r4,$pass_string, $o) < $compare) return FALSE;\n if(strlen($pass_string) < 8) return FALSE;\n return TRUE;\n}", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "function validate_password($candidate) \n{\n if (!empty($candidate))\n {\n // Declare and Initialize Local Variables\n $CritCount = 0; //Tabulator for keeping track of number of criteria matched\n\n /*\n Regular Expression Example $\\S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S*$\n $ = beginning of string\n \\S* = any set of characters\n (?=\\S{8,}) = of at least length 8\n (?=\\S*[a-z]) = containing at least one lowercase letter\n (?=\\S*[A-Z]) = and at least one uppercase letter\n (?=\\S*[\\d]) = and at least one number\n (?=\\S*[\\W]) = and at least a special character (non-word characters)\n $ = end of the string\n\n */\n // Test for each requirement \n if (strlen($candidate) >= 8) $CritCount = $CritCount + 10; // Value of 10 for minimum length\n if (preg_match('/[a-z]/', $candidate)) $CritCount = $CritCount + 1; //Contains lower case a-z\n if (preg_match('/[A-Z]/', $candidate)) $CritCount = $CritCount + 1; //Contains UPPER case A-Z\n if (preg_match('/[\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one numeric digit\n if (preg_match('/[^a-zA-Z\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one special Character (!@#$%^&*()-_, etc.)\n \n if ($CritCount > 12) //Meets minimum length, plus 3 additional criteria\n {\n return TRUE;\n }\n else \n {\n return FALSE;\n }\n }\n else\n return false;\n}", "public function setPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_1'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_1'));\n\t\t\n\t\t$this->_password = $value;\n\t}", "function set_password($string) {\r\n echo PHP_EOL;\r\n $this->action(\"setting new password of: $string\");\r\n $this->hashed_password = hash('sha256', $string . $this->vehicle_salt);\r\n $this->action(\"successfully set new password\");\r\n }", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "public function testRegistrationPasswordOnlyLowerCase(): void { }", "function validate_password($field) {\n\t\tif ($field == \"\") return \"No Password was entered.<br>\";\n\t\telse if (strlen($field) < 6)\n\t\t\treturn \"Password must be at least 6 characters.<br>\";\n\t\telse if (!preg_match(\"/[a-z]/\",$field) || !preg_match(\"/[A-Z]/\",$field) || !preg_match(\"/[0-9]/\",$field) )\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.<br>\";\n\t\treturn \"\";\n\t}", "function update_password()\n {\n }", "public function password($password);", "function isPasswordStrong($password){\r\n\t\tif(strlen($password) < 8)\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[0-9]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[A-Z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[a-z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[\\W_]+#\",$password))\r\n\t\treturn false;\r\n\r\n\t\treturn true;\r\n\t}", "public function validatePassword()\n {\n $result = false;\n if (strlen($this->password) >= 5) {\n $result = true;\n }\n return $result;\n }", "function validatePassword($value){\n if (is_int($value)) throw new Exception (\"Password must consist of letters and, if needed, numbers\"); #PASS (Check the string to int if all are numbers)\n $passwordMinLength=7;\n $passwordMaxLength=18;\n if (strlen($value)<=$passwordMinLength || strlen($value)>=$passwordMaxLength){\n throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n //return;\n } else{\n //throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n }\n //return;\n}", "function checkPasswordPolicy( $password, $admin=\"y\" ) {\n\t\n\tglobal $CONF;\n\t\n\t$smallLetters\t\t= preg_match( '/[a-z]/', $password );\n\t$capitalLetters\t\t= preg_match( '/[A-Z]/', $password );\n\t$numbers\t\t\t= preg_match( '/[0-9]/', $password );\n\tif( isset( $CONF['passwordSpecialChars'] ) ) {\n\t\t$pattern\t\t= '/'.$CONF['passwordSpecialChars'].'/';\n\t} else {\n\t\t$pattern\t\t= '/'.'[\\!\\\"\\§\\$\\%\\/\\(\\)=\\?\\*\\+\\#\\-\\_\\.\\:\\,\\;\\<\\>\\|\\@]'.'/';\n\t}\n\t$specialChars\t\t= preg_match( $pattern, $password );\n\t$passwordLength\t\t= strlen( $password );\n\t$groups\t\t\t\t= 0;\n\t\n\tif( $smallLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $capitalLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $numbers != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $specialChars != 0 ) {\t\t\n\t\t$groups++;\n\t}\n\t\n\tif( $admin == \"y\" ) {\n\t\t\n\t\tif( isset($CONF['minPasswordlength']) ) {\n\t\t\t$minPasswordLength\t= $CONF['minPasswordlength'];\n\t\t} else {\n\t\t\t$minPasswordLength\t= 14;\n\t\t}\n\t\tif( $passwordLength < $minPasswordLength ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset( $CONF['minPasswordGroups'] ) ) {\n\t\t\t\t$minPasswordGroups\t= $CONF['minPasswordGroups'];\n\t\t\t} else {\n\t\t\t\t$minPasswordGroups\t= 4;\n\t\t\t}\n\t\t\tif( isset( $minPasswordGroups ) ) {\n\t\t\t\n\t\t\t\tif( ($minPasswordGroups < 1) or ($minPasswordGroups > 4) ) {\n\t\t\t\t\t$minGroups\t= 4;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroups\t= $minPasswordGroups;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroups\t\t= 4;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroups ) {\n\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\n\t} else {\n\t\t\n\t\tif( isset( $CONF['minPasswordlengthUser'] ) ) {\n\t\t\t$minPasswordlengthUser\t\t= $CONF['minPasswordlengthUser'];\n\t\t} else {\n\t\t\t$minPasswordLengthUser\t\t= 8;\n\t\t}\n\t\tif( $passwordLength < $CONF['minPasswordlengthUser'] ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset($CONF['minPasswordGroupsUser']) ) {\n\t\t\t\t\n\t\t\t\tif( ($CONF['minPasswordGroupsUser'] < 1) or ($CONF['minPasswordGroupsUser'] > 4 ) ) {\n\t\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroupsUser\t= $CONF['minPasswordGroupsUser'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroupsUser ) {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\treturn $retval;\n}", "function vPassword( $password )\r\n\t\t{\r\n\t\t\t\treturn preg_match( '/^(?=^.{8,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$/', $password );\r\n\t\t\t\t\r\n\t\t}", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "function validate($firstpw, $secondpw) {\n\tif(strcmp($firstpw, $secondpw) == 0) {\n\t\t// Booleans to check password complexity - if true, then firstpw is ok\n\t\t$uppercase = preg_match('@[A-Z]@', $firstpw);\n\t\t$lowercase = preg_match('@[a-z]@', $firstpw);\n\t\t$number = preg_match('@[0-9]@', $firstpw);\n\t\tif($uppercase && $lowercase && $number && strlen($firstpw) > 8) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "public function setPassword($value)\r\n\t{\r\n\t\t$this->password = $value;\r\n\t}", "public function validatePassword($attribute, $params)\n\t{\n\t\tif ($this->password !== $this->repeatePassword) {\n\t\t\t$this->addError($attribute, 'Пароль не совпадает.');\n\t\t}\n\t}", "public function setPasswordAttribute($value) {\n \t$this->attributes['password'] = Hash::make($value);\n\t}", "public function passes($attribute, $value)\n {\n //check that the password contains at least 86characters, one uppercase and lowercase letter and a number\n if (preg_match(\"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{6,}$/m\", $value)) {\n return true;\n } else {\n return false;\n }\n }", "function setPassword($password) {\n return false;\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n \n }", "public function setNewPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_92'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_92'));\n\t\t\n\t\t$this->_newPassword = $value;\n\t}", "function isValidPassword($password){\n $hasLower = false;\n $hasDigit = false;\n $hasUpper = false;\n\n if(strlen($password) >= 8 && strlen($password) <= 20){\n $splitStringArray = str_split($password);\n\n for($i = 0; $i < count($splitStringArray); $i++){\n if(ctype_lower($splitStringArray[$i])){\n $hasLower = true;\n }\n else if(ctype_digit($splitStringArray[$i])){\n $hasDigit = true;\n }\n else if(ctype_upper($splitStringArray[$i])){\n $hasUpper = true;\n }\n if($hasLower && $hasDigit && $hasUpper){\n return true;\n }\n }\n }\n return false;\n }", "function generate_password($length=8, $strength=9) {\n $vowels = 'aeuy';\n $consonants = 'bdghjmnpqrstvz';\n\n if ($strength & 1) {\n $consonants .= 'BDGHJLMNPQRSTVWXZ';\n }\n if ($strength & 2) {\n $vowels .= \"AEUY\";\n }\n if ($strength & 4) {\n $consonants .= '23456789';\n }\n if ($strength & 8) {\n $consonants .= '@#$%';\n }\n\n $password = '';\n $alt = time() % 2;\n for ($i = 0; $i < $length; $i++) {\n if ($alt == 1) {\n $password .= $consonants[(rand() % strlen($consonants))];\n $alt = 0;\n } else {\n $password .= $vowels[(rand() % strlen($vowels))];\n $alt = 1;\n }\n }\n // add a number, there has to be a number\n $password .= rand(1, 9);\n\n return $password;\n}", "public function password()\n {\n }", "public function actionChangePassword()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', ['required' => true]);\n $model = $this->findModel($username);\n $model->setPassword($this->prompt(Console::convertEncoding(Yii::t('app', 'New password')) . ':', [\n 'required' => true,\n 'pattern' => '#^.{4,255}$#i',\n 'error' => Console::convertEncoding(Yii::t('app', 'More than {:number} symbols', [':number' => 4])),\n ]));\n $this->log($model->save());\n }", "public function valida_password($password){\n\t\tif (preg_match(\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/\", $password)) \n\t\t\techo \"Su password es seguro.\"; \n\t\telse echo \"Su password no es seguro.\";\n\n\t}", "public function setPassword($value)\n {\n $this->_password = $value;\n }", "public function setPasswordLetter($num) {\n if(is_numeric($num)) {\n $this->password_letter = $num;\n return $this->password_letter;\n }\n return false;\n }", "public function testPlainPassword()\n {\n $user = new User();\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n $user->setPlainPassword('dd');\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n\n $user->setPlainPassword($this->createString(128));\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n }", "public function testLongPassword ()\n {\n // Function parameters\n $length = 20;\n $minPasswordRequirements = [];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{20,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function validatePassword() : bool\n {\n if($this->Password && preg_match('/^[[:alnum:]]{6,20}$/', $this->Password)) // solo numeri-lettere da 6 a 20\n {\n return true;\n }\n else\n return false;\n }", "protected function rulesChange()\n {\n return [\n 'password' => 'required|confirmed|min:'.config('db_limits.users.minPasswordLength'),\n ];\n }", "public function setPasswordAttribute($value)\n {\n \n $this->attributes['password'] = bcrypt($value);\n \n }" ]
[ "0.71533215", "0.65764797", "0.6433923", "0.6260854", "0.6260854", "0.6260854", "0.61959606", "0.61857665", "0.6180634", "0.6180634", "0.6180634", "0.614457", "0.61003035", "0.6095298", "0.6029788", "0.60043246", "0.5946834", "0.5898906", "0.5884733", "0.5857629", "0.5843983", "0.5802466", "0.5767123", "0.5759849", "0.5745983", "0.5745983", "0.5745983", "0.57374", "0.5713123", "0.5698905", "0.5678339", "0.56720734", "0.5664414", "0.5654325", "0.5654325", "0.5654325", "0.56425416", "0.56425416", "0.56425416", "0.5640498", "0.5640072", "0.55729085", "0.55662555", "0.55649245", "0.5510876", "0.5496993", "0.5493596", "0.5477622", "0.5434234", "0.5422821", "0.54170835", "0.53951335", "0.53865796", "0.53794", "0.5375518", "0.53613573", "0.53577834", "0.5355821", "0.53550637", "0.53543234", "0.5337105", "0.5337004", "0.5319193", "0.5318352", "0.53069896", "0.5299105", "0.5299105", "0.5299105", "0.52858675", "0.5284201", "0.5273149", "0.52704364", "0.5247948", "0.52378803", "0.52279955", "0.5227698", "0.52259725", "0.5224758", "0.52097905", "0.51907885", "0.51895535", "0.51876694", "0.5186622", "0.51846945", "0.5184572", "0.51755697", "0.51753", "0.5173805", "0.51602495", "0.51506764", "0.51476574", "0.5146872", "0.5138398", "0.51359034", "0.5135787", "0.51348495", "0.51330507", "0.51284325", "0.5119357", "0.51128167" ]
0.568481
30
Get password strength rule to have any digit presented in password. Default value is `TRUE` to must have digit characters in password. Digit (arabian) characters from arabian alphabet: 0123456789. This function returns array with the rule `boolean` as first item and second item is minimum digit characters count i n password as `integer`. If you set function first argument to `FALSE`, function returns only array `[TRUE]`, if the rule is `TRUE` or an empty array `[]` if the rule is `FALSE`.
public function GetMustHaveDigits ($getWithMinCount = TRUE) { if ($getWithMinCount) return [$this->mustHaveDigits, $this->mustHaveDigitsCount]; return $this->mustHaveDigits ? [TRUE] : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPasswordStrength(string $password): int;", "function check_strength($user_password) {\n $characters = 0;\n $capitalletters = 0;\n $loweletters = 0;\n $number = 0;\n\n if (strlen ($user_password) > 11) {\n $characters = 1;\n } else {\n $characters = 0;\n };\n if (preg_match('/[A-Z]/', $user_password)) {\n $capitalletters = 1;\n } else {\n $capitalletters = 0;\n };\n if (preg_match('/[a-z]/', $user_password)) {\n $loweletters = 1;\n } else {\n $loweletters = 0;\n };\n if (preg_match('/[0-9]/', $user_password)) {\n $number = 1;\n } else {\n $number = 0;\n };\n\n $total = $characters + $capitalletters + $loweletters + $number;\n\n return GetPercentage(4, $total);\n}", "protected function password_strength($password)\n\t{\n\t\t$strength = 0;\n\t\t$patterns = array('/[a-z]/','/[A-Z]/','/\\d/','/\\W/','/.{12,}/');\n\t\tforeach($patterns as $pattern)\n\t\t{\n\t\t\t$strength += (int) preg_match($pattern,$password);\n\t\t}\n\t\treturn $strength;\n\t\t// 1 - weak\n\t\t// 2 - not weak\n\t\t// 3 - acceptable\n\t\t// 4 - strong\n\t}", "private function passwordRules() {\n return [\n 'password' => 'required|alpha_num|between:3,20|confirmed',\n 'password_confirmation' => 'required|alpha_num|between:3,20',\n ];\n }", "function testPass($pass){\n$level=0;\nif(eight($pass)){$level+=1;}\nif(upper($pass)){$level+=1;}\nif(lower($pass)){$level+=1;}\nif(hasDigit($pass)){$level+=1;}\nif(hasSpecial($pass)){$level+=1;}\n\nswitch($level){\ncase 1: echo 'Password strength : <b><font color=red\">Very weak.</font></b>';return false; break;\ncase 2: echo 'Password strength : <b><font color=\"orange\">Weak.</font></b>';return true; break;\ncase 3: echo 'Password strength : <b><font color=\"grey\">Medium</font></b>';return true; break;\ncase 4: echo 'Password strength : <b><font color=\"blue\">Good</font></b>';return true; break;\ncase 5: echo 'Password strength : <b><font color=\"green\">Strong.</font></b>';return true; break;\ndefault : echo 'Password strength : <b><font color=\"red\">Very weak.</font></b>'; break;}\n}", "public function getStrength($password, $username = null)\n {\n if (!empty($username)) {\n $password = str_replace($username, '', $password);\n }\n\n $password_length = strlen($password);\n\n $strength = $password_length * 4;\n\n for ($i = 2; $i <= 4; $i++) {\n $temp = str_split($password, $i);\n\n $strength -= (ceil($password_length / $i) - count(array_unique($temp)));\n }\n\n preg_match_all('/[0-9]/', $password, $numbers);\n\n if (!empty($numbers)) {\n $numbers = count($numbers[0]);\n\n if ($numbers >= 3) {\n $strength += 5;\n }\n } else {\n $numbers = 0;\n }\n\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^¨\\\\\\]/', $password, $symbols);\n\n if (!empty($symbols)) {\n $symbols = count($symbols[0]);\n\n if ($symbols >= 2) {\n $strength += 5;\n }\n } else {\n $symbols = 0;\n }\n\n preg_match_all('/[a-z]/', $password, $lowercase_characters);\n preg_match_all('/[A-Z]/', $password, $uppercase_characters);\n\n if (!empty($lowercase_characters)) {\n $lowercase_characters = count($lowercase_characters[0]);\n } else {\n $lowercase_characters = 0;\n }\n\n if (!empty($uppercase_characters)) {\n $uppercase_characters = count($uppercase_characters[0]);\n } else {\n $uppercase_characters = 0;\n }\n\n if (($lowercase_characters > 0) && ($uppercase_characters > 0)) {\n $strength += 10;\n }\n\n $characters = $lowercase_characters + $uppercase_characters;\n\n if (($numbers > 0) && ($symbols > 0)) {\n $strength += 15;\n }\n\n if (($numbers > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($symbols > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($numbers == 0) && ($symbols == 0)) {\n $strength -= 10;\n }\n\n if (($symbols == 0) && ($characters == 0)) {\n $strength -= 10;\n }\n\n if ($strength < 0) {\n $strength = 0;\n }\n\n if ($strength > 100) {\n $strength = 100;\n }\n\n return $strength;\n }", "function minimumNumber($n, $password) {\n $res = 0;\n $check = 0;\n\t$free = 0;\n\n if ($n < 6) {\n $free = 6 - $n;\n }\n\t\n\t$uppercase = preg_match('@[A-Z]@', $password);\n\tif (!$uppercase) {\n\t\t$check++;\n\t}\n\t$lowercase = preg_match('@[a-z]@', $password);\n\tif (!$lowercase) {\n\t\t$check++;\n\t}\n\t$number = preg_match('@[0-9]@', $password);\n\tif (!$number) {\n\t\t$check++;\n\t}\n\t$speciaux = preg_match('#^(?=.*\\W)#', $password);\n\tif (!$speciaux) {\n\t\t$check++;\n\t}\n\t\n\t$res = $free + $check;\n\tif ($n < 6) {\n\t\t$res = ($free <= $check) ? $check : $free;\n\t}\n \n return $res;\n}", "public function provideCheckInputPasswordRange()\n {\n return [\n [1, 1],\n [11, false],\n [2, 2],\n [9, 9],\n [0, false]\n ];\n }", "public function provideValidatePassword()\n {\n return [\n [123456, 234567, true],\n [\"123457\", 234567, true],\n [\"12345v\", 234567, false],\n ['asdfgh', 'asdfgh', false]\n ];\n }", "function validate_password($candidate) \n{\n if (!empty($candidate))\n {\n // Declare and Initialize Local Variables\n $CritCount = 0; //Tabulator for keeping track of number of criteria matched\n\n /*\n Regular Expression Example $\\S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S*$\n $ = beginning of string\n \\S* = any set of characters\n (?=\\S{8,}) = of at least length 8\n (?=\\S*[a-z]) = containing at least one lowercase letter\n (?=\\S*[A-Z]) = and at least one uppercase letter\n (?=\\S*[\\d]) = and at least one number\n (?=\\S*[\\W]) = and at least a special character (non-word characters)\n $ = end of the string\n\n */\n // Test for each requirement \n if (strlen($candidate) >= 8) $CritCount = $CritCount + 10; // Value of 10 for minimum length\n if (preg_match('/[a-z]/', $candidate)) $CritCount = $CritCount + 1; //Contains lower case a-z\n if (preg_match('/[A-Z]/', $candidate)) $CritCount = $CritCount + 1; //Contains UPPER case A-Z\n if (preg_match('/[\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one numeric digit\n if (preg_match('/[^a-zA-Z\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one special Character (!@#$%^&*()-_, etc.)\n \n if ($CritCount > 12) //Meets minimum length, plus 3 additional criteria\n {\n return TRUE;\n }\n else \n {\n return FALSE;\n }\n }\n else\n return false;\n}", "function nrua_check_password($pwd) {\n\t$errors = [];\n\t\n\tif (strlen($pwd) < 8) {\n\t$errors[] = \"Password too short!\";\n\t}\n\t\n\tif (!preg_match(\"#[0-9]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one number!\";\n\t}\n\t\n\tif (!preg_match(\"#[a-zA-Z]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one letter!\";\n\t}\n\t\n\treturn $errors;\n}", "function CheckStrength($attribute, $params) {\n if (isset($this->$attribute)) { // Edit 2013-06-01\n $password = $this->$attribute;\n if (strlen($password) == 0)\n $strength = -10;\n else\n $strength = 0;\n /* * * get the length of the password ** */\n $length = strlen($password);\n /* * * check if password is not all lower case ** */\n if (strtolower($password) != $password) {\n $strength += 1;\n }\n /* * * check if password is not all upper case ** */\n if (strtoupper($password) == $password) {\n $strength += 1;\n }\n /* * * check string length is 8 -15 chars ** */\n if ($length >= 8 && $length <= 15) {\n $strength += 2;\n }\n /* * * check if lenth is 16 - 35 chars ** */\n if ($length >= 16 && $length <= 35) {\n $strength += 2;\n }\n /* * * check if length greater than 35 chars ** */\n if ($length > 35) {\n $strength += 3;\n }\n /* * * get the numbers in the password ** */\n preg_match_all('/[0-9]/', $password, $numbers);\n $strength += count($numbers[0]);\n /* * * check for special chars ** */\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^\\\\\\]/', $password, $specialchars);\n $strength += sizeof($specialchars[0]);\n /* * * get the number of unique chars ** */\n $chars = str_split($password);\n $num_unique_chars = sizeof(array_unique($chars));\n $strength += $num_unique_chars * 2;\n /* * * strength is a number 1-100; ** */\n $strength = $strength > 99 ? 99 : $strength;\n //$strength = floor($strength / 10 + 1);\n if ($strength < $params['score'])\n $this->addError($attribute, \"Password is too weak - try using CAPITALS, Num8er5, AND sp€c!al characters. Your score was \" . $strength . \"/\" . $params['score']);\n else\n return true;\n }\n }", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "public function password_strength_check($str)\n\t{\n\t\tif (preg_match('#[0-9]#', $str) && preg_match('#[a-zA-Z]#', $str)) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\t$this->form_validation->set_message('password_strength_check', 'Your password must be at least 6-19 characters in length and contain a number and both uppercase and lowercase letters');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\n\t}", "function valid_pass($password)\n {\n $r2 = '/[A-z]/'; //lowercase\n $r3 = '/[0-9]/'; //numbers\n $r4 = '/[~!@#$%^&*()\\-_=+{};:<,.>?]/'; // special char\n\n /*if (preg_match_all($r1, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个大写字母,请返回修改!\";\n return FALSE;\n }*/\n if (preg_match_all($r2, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个字母,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n if (preg_match_all($r3, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个数字,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n /*if (preg_match_all($r4, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个特殊符号:[~!@#$%^&*()\\-_=+{};:<,.>?],请返回修改!\";\n return FALSE;\n }*/\n if (strlen($password) < 8) {\n $msg = \"密码必须包含至少含有8个字符,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n return ['code' => 0, 'msg' => 'success'];\n }", "function checkPasswordPolicy( $password, $admin=\"y\" ) {\n\t\n\tglobal $CONF;\n\t\n\t$smallLetters\t\t= preg_match( '/[a-z]/', $password );\n\t$capitalLetters\t\t= preg_match( '/[A-Z]/', $password );\n\t$numbers\t\t\t= preg_match( '/[0-9]/', $password );\n\tif( isset( $CONF['passwordSpecialChars'] ) ) {\n\t\t$pattern\t\t= '/'.$CONF['passwordSpecialChars'].'/';\n\t} else {\n\t\t$pattern\t\t= '/'.'[\\!\\\"\\§\\$\\%\\/\\(\\)=\\?\\*\\+\\#\\-\\_\\.\\:\\,\\;\\<\\>\\|\\@]'.'/';\n\t}\n\t$specialChars\t\t= preg_match( $pattern, $password );\n\t$passwordLength\t\t= strlen( $password );\n\t$groups\t\t\t\t= 0;\n\t\n\tif( $smallLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $capitalLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $numbers != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $specialChars != 0 ) {\t\t\n\t\t$groups++;\n\t}\n\t\n\tif( $admin == \"y\" ) {\n\t\t\n\t\tif( isset($CONF['minPasswordlength']) ) {\n\t\t\t$minPasswordLength\t= $CONF['minPasswordlength'];\n\t\t} else {\n\t\t\t$minPasswordLength\t= 14;\n\t\t}\n\t\tif( $passwordLength < $minPasswordLength ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset( $CONF['minPasswordGroups'] ) ) {\n\t\t\t\t$minPasswordGroups\t= $CONF['minPasswordGroups'];\n\t\t\t} else {\n\t\t\t\t$minPasswordGroups\t= 4;\n\t\t\t}\n\t\t\tif( isset( $minPasswordGroups ) ) {\n\t\t\t\n\t\t\t\tif( ($minPasswordGroups < 1) or ($minPasswordGroups > 4) ) {\n\t\t\t\t\t$minGroups\t= 4;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroups\t= $minPasswordGroups;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroups\t\t= 4;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroups ) {\n\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\n\t} else {\n\t\t\n\t\tif( isset( $CONF['minPasswordlengthUser'] ) ) {\n\t\t\t$minPasswordlengthUser\t\t= $CONF['minPasswordlengthUser'];\n\t\t} else {\n\t\t\t$minPasswordLengthUser\t\t= 8;\n\t\t}\n\t\tif( $passwordLength < $CONF['minPasswordlengthUser'] ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset($CONF['minPasswordGroupsUser']) ) {\n\t\t\t\t\n\t\t\t\tif( ($CONF['minPasswordGroupsUser'] < 1) or ($CONF['minPasswordGroupsUser'] > 4 ) ) {\n\t\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroupsUser\t= $CONF['minPasswordGroupsUser'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroupsUser ) {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\treturn $retval;\n}", "protected function passwordRules()\n {\n return ['required', 'string', new Password, 'confirmed', new \\Valorin\\Pwned\\Pwned(300),];\n }", "function checkPasswordErrors($password, $username = false) {\n $returns = array(\n 'strength' => 0,\n 'error' => 0,\n 'text' => ''\n );\n\n $length = strlen($password);\n\n if ($length < 8) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is not long enough';\n } elseif ($length > 32) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is too long';\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n $returns['error'] = 4;\n $returns['text'] = 'Password cannot be the same as your Username';\n } elseif (strtolower($password) == 'password') {\n $returns['error'] = 3;\n $returns['text'] = 'Password is too common';\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n $returns['error'] = 2;\n $returns['text'] = 'Too many consecutive characters';\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n $returns['strength'] = 5;\n $returns['text'] = 'Virtually Bulletproof';\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n $returns['strength'] = 4;\n $returns['text'] = 'Very Strong';\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n $returns['strength'] = 3;\n $returns['text'] = 'Strong';\n } else if ($numbers > 1) {\n//fair\n $returns['strength'] = 2;\n $returns['text'] = 'Fair';\n } else {\n//weak\n $returns['strength'] = 1;\n $returns['text'] = 'Weak';\n }\n }\n }\n return $returns;\n}", "function isValidPassword($password){\n $hasLower = false;\n $hasDigit = false;\n $hasUpper = false;\n\n if(strlen($password) >= 8 && strlen($password) <= 20){\n $splitStringArray = str_split($password);\n\n for($i = 0; $i < count($splitStringArray); $i++){\n if(ctype_lower($splitStringArray[$i])){\n $hasLower = true;\n }\n else if(ctype_digit($splitStringArray[$i])){\n $hasDigit = true;\n }\n else if(ctype_upper($splitStringArray[$i])){\n $hasUpper = true;\n }\n if($hasLower && $hasDigit && $hasUpper){\n return true;\n }\n }\n }\n return false;\n }", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "public function passStrength($str){\n $error = FALSE;\n // make sure it is long enough\n if(strlen($str) < 8){\n $error['length'] = 'must be 8 characters minimum.';\n }\n // must contain letters & numbers and must have 1 upper case letter!\n if( ! preg_match('/[A-Za-z]/', $str) && preg_match('/[0-9]/', $str)){\n $error['alphanum'] = 'Must be alphanumeric and contain capitals and lower case.';\n }\n return $error;\n }", "public static function getStrength(string $password):int\n {\n\n // Get score\n $score = 0;\n if (strlen($password) >= 8) { $score++; }\n if (strlen($password) >= 12) { $score++; }\n if (preg_match(\"/\\d/\", $password)) { $score++; }\n if (preg_match(\"/[a-z]/\", $password) && preg_match(\"/[A-Z]/\", $password)) { $score++; }\n if (preg_match(\"/\\W/\", $password)) { $score++; }\n\n // Return\n return $score;\n }", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "public static function validatePassword()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 11),\n );\n }", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "function reduce_min_strength_password_requirement( $strength ) {\n return 2; \n}", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK) {\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n } elseif ($params['strength'] === self::STRONG) {\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n }\n if (!preg_match($pattern, $this->$attribute)) {\n $this->addError($attribute, 'your password is not strong enough!');\n }\n }", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "public function rules() {\n $user_table = User::$tableName;\n return [\n 'mobile' => array('required', 'digits:10', \"exists:$user_table,mobile\"),\n 'password' => array('required')\n ];\n }", "public function strength($pwd = '', $data = array()) {\n if($pwd=='') {\n $pwd = $this->password;\n }\n $this->setUserdata($data);\n if((isset($pwd)) && ($pwd!='') && ($pwd!=null)) {\n if(class_exists('\\ZxcvbnPhp\\Zxcvbn')) {\n $zxcvbn = new \\ZxcvbnPhp\\Zxcvbn(); // https://github.com/bjeavons/zxcvbn-php\n $strength = $zxcvbn->passwordStrength($pwd, $this->userdata);\n\n return $strength;\n }\n }\n return false;\n }", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK)\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n elseif ($params['strength'] === self::STRONG)\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n\n if (!preg_match($pattern, $this->$attribute) || strlen($this->$attribute) < 8)\n $this->addError($attribute, 'New password is not strong enough!' . \" \\n\" . \" Minimal length 8 digit and \" . \" \\n includes alphanumeric string\");\n }", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "public static function pass_check_complexity($pass) \n { \n $conf = $GLOBALS['CONF'];\n \n if ($conf->get_conf('pass_complex') == 'yes') \n {\n $counter = 0;\n \n if (preg_match('/[a-z]/',$pass))\n {\n $counter++; \n }\n \n if (preg_match('/[A-Z]/',$pass))\n {\n $counter++; \n }\n \n if (preg_match('/[0-9]/',$pass))\n {\n $counter++; \n }\n \n if (preg_match('/[\\!\\'\\$\\%\\&\\/\\(\\)\\|\\#\\~\\.\\,\\?\\=\\-\\_\\<\\>]/', $pass))\n { \n $counter++; \n }\n \n return ($counter < 3) ? FALSE : TRUE;\n } \n \n return TRUE; \n }", "function validatePassword($password, $part_two)\r\n{\r\n if(!strlen($password) == 6)\r\n {\r\n return false;\r\n }\r\n\r\n $chars = str_split($password);\r\n\r\n for($i = 0; $i < count($chars)-1; $i++)\r\n {\r\n if($chars[$i] > $chars[$i+1])\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n return adjacentDigits($chars, $part_two);\r\n}", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "public function rules()\n {\n return [\n 'password' => ['required', 'confirmed', 'regex:+(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[,.;:#?!@$^%&*-]).{6,}+']\n ];\n }", "function validate_password($password)\n {\n $reg1='/[A-Z]/'; //Upper case Check\n $reg2='/[a-z]/'; //Lower case Check\n $reg3='/[^a-zA-Z\\d\\s]/'; // Special Character Check\n $reg4='/[0-9]/'; // Number Digit Check\n $reg5='/[\\s]/'; // Number Digit Check\n\n if(preg_match_all($reg1,$password, $out)<1) \n return \"There should be atleast one Upper Case Letter...\";\n\n if(preg_match_all($reg2,$password, $out)<1) \n return \"There should be atleast one Lower Case Letter...\";\n\n if(preg_match_all($reg3,$password, $out)<1) \n return \"There should be atleast one Special Character...\";\n\n if(preg_match_all($reg4,$password, $out)<1) \n return \"There should be atleast one numeric digit...\";\n \n if(preg_match_all($reg5,$password, $out)>=1) \n return \"Spaces are not allowed...\";\n\n if(strlen($password) <= 8 || strlen($password) >= 16 ) \n return \"Password Length should be between 8 and 16\";\n\n return \"OK\";\n }", "public function rules(): array\n {\n return [\n 'password' => ['required', 'string', new Password(8), 'confirmed'],\n ];\n }", "function sloodle_validate_prim_password($password)\n {\n // Check that it's a string\n if (!is_string($password)) return false;\n // Check the length\n $len = strlen($password);\n if ($len < 5 || $len > 9) return false;\n // Check that it's all numbers\n if (!ctype_digit($password)) return false;\n // Check that it doesn't start with a 0\n if ($password[0] == '0') return false;\n \n // It all seems fine\n return true;\n }", "public function testRandomRequirements ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 4,\n 'digit' => 3,\n 'upper' => 2,\n 'lower' => 1\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){3})(?=(?:[^a-z]*[a-z]){1})(?=(?:[^A-Z]*[A-Z]){2})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){4})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function testManySpecialCharacter ()\n {\n // Function parameters\n $length = 10;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 6,\n 'digit' => 1,\n 'upper' => 1,\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){6})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function rules()\n {\n $user = auth()->user();\n\n return [\n /*'password' => [\n 'nullable',\n function ($attribute, $value, $fail) use ($user) {\n if (!Hash::check($value, $user->password)) {\n return $fail(__('The password is incorrect.'));\n }\n }\n ],*/\n ];\n }", "function cjpopups_is_password_strong($pass_string, $compare = 1) {\n $r1='/[A-Z]/'; //Uppercase\n $r2='/[a-z]/'; //lowercase\n $r3='/[!@#$%^&*()\\-_=+{};:,<.>]/'; // whatever you mean by 'special char'\n $r4='/[0-9]/'; //numbers\n if(preg_match_all($r1,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r2,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r3,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r4,$pass_string, $o) < $compare) return FALSE;\n if(strlen($pass_string) < 8) return FALSE;\n return TRUE;\n}", "function sloodle_validate_prim_password_verbose($password, &$errors)\n {\n // Initialise variables\n $errors = array();\n $result = true;\n \n // Check that it's a string\n if (!is_string($password)) {\n $errors[] = 'invalidtype';\n $result = false;\n }\n // Check the length\n $len = strlen($password);\n if ($len < 5) {\n $errors[] = 'tooshort';\n $result = false;\n }\n if ($len > 9) {\n $errors[] = 'toolong';\n $result = false;\n }\n \n // Check that it's all numbers\n if (!ctype_digit($password)) {\n $errors[] = 'numonly';\n $result = false;\n }\n \n // Check that it doesn't start with a 0\n if ($password[0] == '0') {\n $errors[] = 'leadingzero';\n $result = false;\n }\n \n return $result;\n }", "function checkPasswordComplexity( $password ) {\n\n $this->load->library( \"Passwordvalidator\" );\n\n/* ... check the complexity of the password */\n $this->passwordvalidator->setPassword( $password );\n if ($this->passwordvalidator->validate_non_numeric( 1 )) { //Password must have 1 non-alpha character in it.\n $this->passwordvalidator->validate_whitespace(); //No whitespace please\n }\n\n/* ... if we didn't pass, set an appropriate error message */\n if ($this->passwordvalidator->getValid() == 0) {\n $this->form_validation->set_message('checkPasswordComplexity', 'The %s field must contain a string with no spaces and at least 1 non-alpha character');\n }\n\n/* ... time to go */\n return( $this->passwordvalidator->getValid() == 1 ? TRUE : FALSE );\n }", "public function pw_test($password) {\r\n\r\n $errors = 0;\r\n $error_msg = \"\";\r\n\r\n $password = trim($password);\r\n\r\n\r\n if($password == \"\") {\r\n $error_msg .= \"Vous devez spécifier un mot de passe. <br />\";\r\n $errors++;\r\n } elseif(strlen($password) < 4) {\r\n $error_msg .= \"Votre mot de passe est trop court<br />\";\r\n $errors++;\r\n } elseif(strlen($password) > 50) {\r\n $error_msg .= \"Votre mot de passe est trop long<br />\";\r\n $errors++;\r\n }\r\n\r\n return array(\r\n \"value\" => $password,\r\n \"error_msg\" => $error_msg,\r\n \"errors\" => $errors\r\n );\r\n\r\n }", "function validatePassword() : bool\n {\n if($this->Password && preg_match('/^[[:alnum:]]{6,20}$/', $this->Password)) // solo numeri-lettere da 6 a 20\n {\n return true;\n }\n else\n return false;\n }", "function error_password($pass, $pass_bis)\n{\n $error = array();\n if (strlen($pass) < 8 || strlen($pass) >= 255)\n array_push($error, \"error password must be longer than 8 and shorter than 255 \");\n if ($pass !== $pass_bis)\n array_push($error, \"password do not match\");\n if (!preg_match(\"/.*[0-9].*/\", $pass))\n array_push($error, \"password must have at least a number in it\");\n return ($error);\n}", "public function providerForValidPassword()\n {\n return [\n ['password1'],\n ['pass-word1'],\n ['Pass word'],\n ['Password1'],\n ['Pass1'],\n ['Pass1#!']\n ];\n }", "function generatePassword($l = 8, $c = 0, $n = 0, $s = 0) {\n $count = $c + $n + $s;\n\n // sanitize inputs; should be self-explanatory\n if (!is_int($l) || !is_int($c) || !is_int($n) || !is_int($s)) {\n trigger_error('Argument(s) not an integer', E_USER_WARNING);\n return false;\n } elseif ($l < 0 || $l > 20 || $c < 0 || $n < 0 || $s < 0) {\n trigger_error('Argument(s) out of range', E_USER_WARNING);\n return false;\n } elseif ($c > $l) {\n trigger_error('Number of password capitals required exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($n > $l) {\n trigger_error('Number of password numerals exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($s > $l) {\n trigger_error('Number of password capitals exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($count > $l) {\n trigger_error('Number of password special characters exceeds specified password length', E_USER_WARNING);\n return false;\n }\n\n // all inputs clean, proceed to build password\n // change these strings if you want to include or exclude possible password characters\n $chars = \"abcdefghijklmnopqrstuvwxyz\";\n $caps = strtoupper($chars);\n $nums = \"0123456789\";\n $syms = \"!@#$%^&*()-+?\";\n\n // build the base password of all lower-case letters\n for ($i = 0; $i < $l; $i++) {\n $out .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);\n }\n\n // create arrays if special character(s) required\n if ($count) {\n // split base password to array; create special chars array\n $tmp1 = str_split($out);\n $tmp2 = array();\n\n // add required special character(s) to second array\n for ($i = 0; $i < $c; $i++) {\n array_push($tmp2, substr($caps, mt_rand(0, strlen($caps) - 1), 1));\n }\n for ($i = 0; $i < $n; $i++) {\n array_push($tmp2, substr($nums, mt_rand(0, strlen($nums) - 1), 1));\n }\n for ($i = 0; $i < $s; $i++) {\n array_push($tmp2, substr($syms, mt_rand(0, strlen($syms) - 1), 1));\n }\n\n // hack off a chunk of the base password array that's as big as the special chars array\n $tmp1 = array_slice($tmp1, 0, $l - $count);\n // merge special character(s) array with base password array\n $tmp1 = array_merge($tmp1, $tmp2);\n // mix the characters up\n shuffle($tmp1);\n // convert to string for output\n $out = implode('', $tmp1);\n }\n\n return $out;\n}", "function validatePassword($pwd) {\r\n\t\treturn (strlen($pwd) >= 6 && preg_match_all(\"/[0-9]/\", $pwd) >= 2);\r\n\t}", "protected function rules()\n {\n return [\n 'password' => ['required', 'string', 'min:8', 'confirmed','regex:/^(?=.*?[a-z])(?=.*?[#?!@$%^&*-_]).{8,}$/']\n ];\n }", "function passwordGood($pass) {\n\t// default encoding/encoding specified in php.ini for nginx's php fpm module\n\t// is 'UTF-8'\n\t$len = mb_strlen($pass);\n\t//$len = strlen($pass);\n\t// original code of ($len >= 8 && $len <= 24) doesn't seem to work since I think\n\t// when true these return 1, when false they seem to return nothing, when printed empty string\n\t// be careful, these seem to return nothing or they don't print properly\n\t// this does work though :P\n\tif ( ( $len < 8 ) || ( $len > 24 ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function rules()\n {\n return [\n 'current_password' => [\n 'required',\n function ($attribute, $value, $fail) {\n if (!password_verify ($value, auth()->user()->password)) {\n $fail(\"$attribute không đúng\");\n }\n },\n ],\n 'password' => [\n 'required',\n 'max:128',\n 'regex:/^(?=.*[a-z])+(?=.*[A-Z])+(?=.*\\d)+(?=.*[$~!#^()@$!%*?&])[A-Za-z\\d$~!#^()@$!%*?&]{8,}/',\n ],\n ];\n }", "public function setPasswordStrength($num) {\n if((is_numeric($num)) && (($num>=0) && ($num<=4))) {\n $this->password_strength = $num;\n return $this->password_strength;\n }\n return false;\n }", "public function test($password) {\n $error = array();\n if($password == trim($password) && strpos($password, ' ') !== false) {\n $error[] = \"Password can not contain spaces!\";\n }\n \n if(($this->password_lenghtMin!=null) && (strlen($password) < $this->password_lenghtMin)) {\n $error[] = \"Password too short! Minimum \".$this->password_lenghtMin.\" characters.\";\n }\n if(($this->password_lenghtMax!=null) && (strlen($password) > $this->password_lenghtMax)) {\n $error[] = \"Password too long! Maximum \".$this->password_lenghtMax.\" characters.\";\n }\n \n if(($this->password_number!=null) && (!preg_match(\"#[0-9]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_number.\" number(s)!\";\n } elseif($this->password_number>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_number) {\n $error[] = \"Password must include at least \".$this->password_number.\" number(s)!\";\n }\n }\n\n if(($this->password_letter!=null) && (!preg_match(\"#[a-z]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_letter.\" letter(s)! \";\n } elseif($this->password_letter>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_letter) {\n $error[] = \"Password must include at least \".$this->password_letter.\" letter(s)! \";\n }\n }\n\n if(($this->password_capital!=null) && (!preg_match(\"#[A-Z]+#\", $password, $output))) {\n $error[] = \"Password must include at least \".$this->password_capital.\" capital letter(s)! \";\n } elseif($this->password_capital>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_capital) {\n $error[] = \"Password must include at least \".$this->password_capital.\" capital letter(s)! \";\n }\n }\n \n \n if(($this->password_symbol!=null) && (!preg_match(\"/\\W+/\", $password))) {\n $error[] = \"Password must include at least \".$this->password_symbol.\" symbol(s)!\";\n } elseif($this->password_symbol>1) {\n preg_match_all(\"/\\W+/\", $password, $output);\n $output = $output[0];\n $c = 0;\n foreach($output as $out) {\n $c = $c + strlen($out);\n }\n if($c<$this->password_symbol) {\n $error[] = \"Password must include at least \".$this->password_symbol.\" symbol(s)!\";\n }\n }\n \n if(($this->password_strength!=null) && (($this->strength($password)!==false) && ($this->strength($password)['score']<$this->password_strength))) {\n $error[] = \"Password too weak! \".$this->strength($password)['score'].'/4 minimum '.$this->password_strength;\n }\n\n if(!empty($error)){\n return $error;\n } else {\n return true;\n }\n }", "public function testManyLowercaseCharacter ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 1,\n 'digit' => 1,\n 'upper' => 1,\n 'lower' => 5\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^a-z]*[a-z]){5})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){1})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function provideCheckGroupMatchingDigits()\n {\n return [\n [123444, false],\n [123445, 123445],\n [111222, false],\n [111122, 111122]\n ];\n }", "function testPasswordErr($password) {\n if (empty($password)) {\n $passwordErr = 'Password required';\n } else {\n $password = test_input($password);\n //VALIDATE PASSWORD\n if (!filter_var($password, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,10})\")))) {\n //da 4 a 10 caratteri, deve contenere maiuscole, minuscole e numeri\n $passwordErr = \"Invalid Password format\";\n } else\n $passwordErr = \"*\";\n }\n return $passwordErr;\n }", "public function retrievePasswordValidationRules()\n {\n return $this->startAnonymous()->uri(\"/api/tenant/password-validation-rules\")\n ->get()\n ->go();\n }", "function PWValidation($x){\n\t$x = str_split($x, 1);\n\t$faultyCheck = TRUE;\n\twhile($faultyCheck) {\n\t\tforeach($x as $eachOne) {\n\t\t\tif((ctype_alpha($eachOne) OR (is_numeric($eachOne)))) {\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$errorMessage = 'Your password must contain only alphanumeric characters';\n\t\t\t\treturn $errorMessage;\n\t\t\t}\n\t\t}\n\t\t$faultyCheck = FALSE;\n\t}\n}", "function validatePassword($value){\n if (is_int($value)) throw new Exception (\"Password must consist of letters and, if needed, numbers\"); #PASS (Check the string to int if all are numbers)\n $passwordMinLength=7;\n $passwordMaxLength=18;\n if (strlen($value)<=$passwordMinLength || strlen($value)>=$passwordMaxLength){\n throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n //return;\n } else{\n //throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n }\n //return;\n}", "public function parameterRules()\n\t{\n\t\treturn [\n\t\t\t[['account','password'],'required'],\n\t\t\t['account','inlineAccountExists'],\n\t\t\t['remember','default','value'=>0],\n\t\t\t['remember','in','range'=>[0,1]]\n\t\t];\n\t}", "protected function rules()\n {\n return [\n 'token' => 'required',\n 'email' => 'required|email',\n 'password' => 'required|confirmed|min:'.config('db_limits.users.minPasswordLength'),\n ];\n }", "public function rules()\n {\n $maxChars = config('tweetRules.maxCharCount');\n $minChars = config('tweetRules.minCharCount');\n\n return [\n 'message' => \"min:$minChars|max:$maxChars\",\n ];\n }", "protected function rulesChange()\n {\n return [\n 'password' => 'required|confirmed|min:'.config('db_limits.users.minPasswordLength'),\n ];\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "function passwordLength($wachtwoordbevestiging) {\n\t$count = 0;\n\n\tfor($i = 0; $i < strlen($wachtwoordbevestiging); $i++) { \n\t\tif($wachtwoordbevestiging[$i] != ' ') \n\t\t\t$count++; \n\t}\n\n\tif ($count < 6) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "public function passwordIsValid($password)\n {\n $config = $this->getPasswordConfig();\n\n /**\n * Count lowercase characters, including multibyte characters.\n *\n * @param string $string\n */\n $countLowercase = function ($string) {\n $stringUppercase = mb_strtoupper($string);\n $similar = similar_text($string, $stringUppercase);\n return strlen($string) - $similar;\n };\n /**\n * Count uppercase characters, including multibyte characters.\n *\n * @param string $string\n */\n $countUppercase = function ($string) {\n $stringLowercase = mb_strtolower($string);\n $similar = similar_text($string, $stringLowercase);\n return strlen($string) - $similar;\n };\n\n // Validate minimum password length.\n if (isset($config['min_length']) && is_numeric($config['min_length'])) {\n if (strlen($password) < $config['min_length']) {\n return false;\n }\n }\n // Validate minimum lowercase character count.\n if (isset($config['min_lowercase']) && is_numeric($config['min_lowercase'])) {\n if ($countLowercase($password) < $config['min_lowercase']) {\n return false;\n }\n }\n // Validate minimum uppercase character count.\n if (isset($config['min_uppercase']) && is_numeric($config['min_uppercase'])) {\n if ($countUppercase($password) < $config['min_uppercase']) {\n return false;\n }\n }\n // Validate minimum number character count.\n if (isset($config['min_number']) && is_numeric($config['min_number'])) {\n if (preg_match_all('/[0-9]/', $password) < $config['min_number']) {\n return false;\n }\n }\n // Validate minimum symbol character count.\n if (isset($config['min_symbol']) && is_numeric($config['min_symbol'])\n && isset($config['symbol_list']) && is_string($config['symbol_list'])\n && strlen($config['symbol_list'])\n ) {\n $symbolCount = 0;\n foreach (str_split($config['symbol_list']) as $symbol) {\n $symbolCount += substr_count($password, $symbol);\n }\n if ($symbolCount < $config['min_symbol']) {\n return false;\n }\n }\n\n // The password is valid.\n return true;\n }", "function __construct ($params=array())\n {\n /**\n * Define Rules\n * Key is rule identifier\n * Value is rule parameter\n * false is disabled (default)\n * Type is type of parameter data\n * permitted values are 'integer' or 'boolean'\n * Test is php code condition returning true if rule is passed\n * password string is $p\n * rule value is $v\n * Error is rule string definition\n * use #VALUE# to insert value\n */\n $this->rules['min_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return strlen($p)>=$v;',\n 'error' => 'Password must be more than #VALUE# characters long');\n\n $this->rules['max_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return (strlen($p)<=$v);',\n 'error' => 'Password must be less than #VALUE# characters long');\n\n $this->rules['min_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# lowercase characters');\n\n $this->rules['max_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# lowercase characters');\n\n $this->rules['min_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# uppercase characters');\n\n $this->rules['max_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# uppercase characters');\n\n $this->rules['disallow_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)==0;',\n 'error' => 'Password may not contain numbers');\n\n $this->rules['disallow_numeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[0-9]/\",$p,$x)==0;',\n 'error' => 'First character cannot be numeric');\n\n $this->rules['disallow_numeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be numeric');\n\n $this->rules['min_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# numbers');\n\n $this->rules['max_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# numbers');\n\n $this->rules['disallow_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)==0;',\n 'error' => 'Password may not contain non-alphanumeric characters');\n\n $this->rules['disallow_nonalphanumeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[\\W]/\",$p,$x)==0;',\n 'error' => 'First character cannot be non-alphanumeric');\n\n $this->rules['disallow_nonalphanumeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be non-alphanumeric');\n\n $this->rules['min_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# non-aplhanumeric characters');\n\n $this->rules['max_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# non-alphanumeric characters');\n\n // Apply params from constructor array\n foreach( $params as $k=>$v ) { $this->$k = $v; }\n\n // Errors defaults empty\n $this->errors = array();\n\n return 1;\n }", "public static function getPasswordCriteria(){\n $config = Configuration::where('id', 1)->first();\n\n $regex = \"/^\";\n\n if($config->password_lower_case_required == 1){\n $regex.=\"(?=.*[a-z])\";\n }\n\n if($config->password_upper_case_required == 1){\n $regex.=\"(?=.*[A-Z])\";\n }\n\n if($config->password_special_characters_required == 1){\n $regex.=\"(?=.*[!$#@%*&])\";\n }\n\n if($config->password_number_required == 1){\n $regex.=\"(?=.*[0-9])\";\n }\n\n if($config->password_min_length > 6){\n $regex.=\".{\".$config->password_min_length.\",}$\";\n }\n else{\n $regex.=\".{6,}$\";\n }\n\n return $regex.\"/m\";\n }", "public function rules()\n {\n $rules = [\n 'password' => [\n 'required',\n 'min:8',\n 'confirmed'\n ]\n ];\n if ($this->user()->password != 'not_set') {\n $rules['current_password'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n /* @var SystemSetting $systemSetting */\n $systemSetting = Loader::singleton(SystemSetting::class);\n $setting = $systemSetting->getSetting();\n $return = [];\n if($setting['isCaptcha'] == 1) {\n $return = [\n 'account'=>'required',\n 'password'=>'required',\n 'captcha'=>'required|captcha'\n ];\n }else {\n $return = [\n 'account'=>'required',\n 'password'=>'required',\n ];\n }\n return $return;\n }", "public function rules()\n {\n return [\n 'password' => 'max:30|min:3',\n ];\n }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "public function getMinimumPasswordLength()\n {\n return $this->_scopeConfig->getValue(AccountManagement::XML_PATH_MINIMUM_PASSWORD_LENGTH);\n }", "function checkPasswordForPolicy($password, $handle = '') {\n $minLength = $this->getProperty('PASSWORD_MIN_LENGTH', 0);\n $compareToHandle = $this->getProperty('PASSWORD_NOT_EQUALS_HANDLE', 0);\n $checkAgainstBlacklist = $this->getProperty('PASSWORD_BLACKLIST_CHECK', 0);\n $result = 0;\n if ($minLength > 0 && strlen($password) < $minLength) {\n $result -= 1;\n }\n if ($compareToHandle && $handle != '' && strtolower($password) == strtolower($handle)) {\n $result -= 2;\n }\n if ($checkAgainstBlacklist && $this->checkPasswordAgainstBlacklist($password) === FALSE) {\n $result -= 4;\n }\n return $result;\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function isValid($password)\n {\n if ($this->_minLength) {\n $len = strlen($password);\n if ($len < $this->_minLength) {\n return $this->_setInvalidReason(self::REASON_TOO_SHORT, array(\n 'minimum length' => $this->_minLength,\n 'password length' => $len,\n ));\n }\n }\n if ($this->_minStrength) {\n $strength = $this->calculateStrength($password);\n if ($strength < $this->_minStrength) {\n return $this->_setInvalidReason(self::REASON_TOO_WEAK, array(\n 'minimum strength' => $this->_minStrength,\n 'password strength' => $strength,\n ));\n }\n }\n if ($this->_minEntropy) {\n $entropy = $this->calculateEntropy($password);\n if ($entropy < $this->_minEntropy) {\n return $this->_setInvalidReason(self::REASON_INSUFFICIENT_ENTROPY, array(\n 'minimum entropy' => $this->_minEntropy,\n 'password entropy' => $entropy,\n ));\n }\n }\n foreach ($this->_requiredCharValidators as $validator) {\n list ($chars, $numRequired) = $validator;\n // http://www.php.net/manual/en/function.mb-split.php#99851\n $charArr = preg_split('/(?<!^)(?!$)/u', $chars);\n str_replace($charArr, ' ', $password, $count);\n if ($count < $numRequired) {\n return $this->_setInvalidReason(self::REASON_MISSING_REQUIRED_CHARS, array(\n 'required chars' => $chars,\n 'num required' => $numRequired,\n 'num found' => $count,\n ));\n }\n }\n foreach ($this->_validators as $validator) {\n list($type, $thing) = $validator;\n if ($type === 'callable') {\n $func = $thing;\n } else {\n $func = array($thing, 'isValid');\n }\n $result = call_user_func($func, $password);\n if (! $result) {\n return $this->_setInvalidReason(self::REASON_FAILED_VALIDATOR, array(\n 'validator' => $thing,\n ));\n }\n }\n if ($this->_passwordLists) {\n $file = $this->findPassword($password);\n if ($file) {\n return $this->_setInvalidReason(self::REASON_FOUND_IN_LIST, array(\n 'list file' => $file,\n ));\n }\n }\n return true;\n }", "public function rules()\n {\n $id = Auth::user()->id;\n\n $rules = [\n 'username' => 'required|string',\n 'phone' => 'required|digits:9|starts_with:5|unique:users,phone,'.$id,\n 'email' => 'required|email|unique:users,email,'.$id,\n ];\n\n if($this->password){\n $rules['password'] = 'required|string|min:8';\n }\n\n return $rules;\n\n }", "public function rules()\n {\n return [\n 'phone' => 'required|exists:users,phone|digits:11|regex:/(01)[0-9]{9}/',\n 'code' => 'required|digits:4',\n 'password' => ['required','string','max:32','confirmed',\n Password::min(8)\n ->mixedCase()\n ->letters()\n ->numbers()\n ->symbols()\n// ->uncompromised()\n ,]\n ];\n }", "function validatePassword($pass) {\n\t\t$l = getOption('min_password_lenght');\n\t\tif ($l > 0) {\n\t\t\tif (strlen($pass) < $l) return sprintf(gettext('Password must be at least %u characters'), $l);\n\t\t}\n\t\t$p = getOption('password_pattern');\n\t\tif (!empty($p)) {\n\t\t\t$strong = false;\n\t\t\t$p = str_replace('\\|', \"\\t\", $p);\n\t\t\t$patterns = explode('|', $p);\n\t\t\t$p2 = '';\n\t\t\tforeach ($patterns as $pat) {\n\t\t\t\t$pat = trim(str_replace(\"\\t\", '|', $pat));\n\t\t\t\tif (!empty($pat)) {\n\t\t\t\t\t$p2 .= '{<em>'.$pat.'</em>}, ';\n\n\t\t\t\t\t$patrn = '';\n\t\t\t\t\tforeach (array('0-9','a-z','A-Z') as $try) {\n\t\t\t\t\t\tif (preg_match('/['.$try.']-['.$try.']/', $pat, $r)) {\n\t\t\t\t\t\t\t$patrn .= $r[0];\n\t\t\t\t\t\t\t$pat = str_replace($r[0],'',$pat);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$patrn .= addcslashes($pat,'\\\\/.()[]^-');\n\t\t\t\t\tif (preg_match('/(['.$patrn.'])/', $pass)) {\n\t\t\t\t\t\t$strong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$strong)\treturn sprintf(gettext('Password must contain at least one of %s'), substr($p2,0,-2));\n\t\t}\n\t\treturn false;\n\t}", "public function rules()\n {\n return [\n 'password' => 'required|min:4|max:20|regex:/^([a-zA-Z0-9\\.\\-_\\/\\+=\\.\\~\\!@#\\$\\%\\^\\&\\*\\(\\)\\[\\]\\{\\}]){4,20}$/',\n ];\n }", "public function passwordstrengthTask()\n\t{\n\t\t// Incoming\n\t\t$no_html = Request::getInt('no_html', 0);\n\t\t$password = Request::getString('pass', '', 'post');\n\t\t$username = Request::getString('user', '', 'post');\n\n\t\t// Instantiate a new registration object\n\t\t$xregistration = new \\Components\\Members\\Models\\Registration();\n\n\t\t// Score the password\n\t\t$score = $xregistration->scorePassword($password, $username);\n\n\t\t// Determine strength\n\t\tif ($score < PASS_SCORE_MEDIOCRE)\n\t\t{\n\t\t\t$cls = 'bad';\n\t\t\t$txt = Lang::txt('COM_MEMBERS_REGISTER_PASS_BAD');\n\t\t}\n\t\telse if ($score >= PASS_SCORE_MEDIOCRE && $score < PASS_SCORE_GOOD)\n\t\t{\n\t\t\t$cls = 'mediocre';\n\t\t\t$txt = Lang::txt('COM_MEMBERS_REGISTER_PASS_MEDIOCRE');\n\t\t}\n\t\telse if ($score >= PASS_SCORE_GOOD && $score < PASS_SCORE_STRONG)\n\t\t{\n\t\t\t$cls = 'good';\n\t\t\t$txt = Lang::txt('COM_MEMBERS_REGISTER_PASS_GOOD');\n\t\t}\n\t\telse if ($score >= PASS_SCORE_STRONG)\n\t\t{\n\t\t\t$cls = 'strong';\n\t\t\t$txt = Lang::txt('COM_MEMBERS_REGISTER_PASS_STRONG');\n\t\t}\n\n\t\t// Build the HTML\n\t\t$html = '<span id=\"passwd-meter\" style=\"width:' . $score . '%;\" class=\"' . $cls . '\"><span>' . Lang::txt($txt) . '</span></span>';\n\n\t\t// Return the HTML\n\t\tif ($no_html)\n\t\t{\n\t\t\techo $html;\n\t\t}\n\n\t\treturn $html;\n\t}", "public function rules()\n {\n $rules = [\n 'password' => 'required|min:6|max:60',\n 'password_confirmation' => 'same:password',\n ];\n\n if (Auth::user()->isSuperUser()) {\n return $rules;\n }\n\n return ['old_password' => 'required|min:6|max:60'] + $rules;\n }", "function validate_password($field) {\n\t\tif ($field == \"\") return \"No Password was entered.<br>\";\n\t\telse if (strlen($field) < 6)\n\t\t\treturn \"Password must be at least 6 characters.<br>\";\n\t\telse if (!preg_match(\"/[a-z]/\",$field) || !preg_match(\"/[A-Z]/\",$field) || !preg_match(\"/[0-9]/\",$field) )\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.<br>\";\n\t\treturn \"\";\n\t}", "public function rules()\n {\n $rules = [];\n\n foreach ($this->request->get('barcode') as $key => $value) {\n $rules['barcode.' . $key] = 'bail|required|min:15|max:15';\n $rules['jumlah.' . $key] = 'bail|required|numeric';\n }\n\n return $rules;\n }", "function vPassword2() \r\n\t\t{\r\n\t\t\t# Check password strength\r\n\t\t\t$p = $p1;\r\n\t\t\t\r\n\t\t\tif( strlen($p) < 8 ) $reg_errors[] = \"Password too short!\";\r\n\t\t\t\r\n\t\t\tif( strlen($p) > 20 ) $reg_errors[] = \"Password too long!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[0-9]+#\", $p) ) $reg_errors[] = \"Password must include at least one number!\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[a-z]+#\", $p) ) $reg_errors[] = \"Password must include at least one letter!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[A-Z]+#\", $p) ) $reg_errors[] = \"Password must include at least one CAPS!\";\r\n\t\t\t\r\n\t\t\t/* if( !preg_match(\"#\\W+#\", $p) ) $errors[] = \"Password must include at least one symbol!\"; */\t\r\n\t\t\t\r\n\t\t}", "function minimum_password_limit( & $errors ) {\r\n\t$min_length = 12;\r\n\tif ( !empty( $_POST['pass1'] ) && $_POST['pass1'] === $_POST['pass2'] && !preg_match('/^.*(?=.{12,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', $_POST['pass1']) ) {\r\n\t\t$errors->add( 'min_pass_length', sprintf( __( '<strong>Security advice</strong>: Your password must be at least %d characters long and have at least one capital letter and one number in it.' ), $min_length ), array( 'form-field' => 'pass1' ) );\r\n\t}\r\n}", "function pwdLongEnough($password) {\n $result=true;\n if(strlen($password) < 8){\n $result =false;\n } \n else {\n $result = true;\n }\n return $result;\n}", "public function rules()\n {\n $req = (request::input('chg_password.current') != '') ? 'required|' : '';\n\n return [\n 'chg_password.current' => $req.'min:6',\n 'chg_password.new' => $req.'min:6|different:chg_password.current|same:chg_password.repeat',\n 'chg_password.repeat' => $req.'min:6',\n ];\n }", "function checkpw($pw){\r\n\t\t\t\t\tfor($i = 0; $i <= 9; $i++)\r\n\t\t\t\t\t\tif(strchr($pw, (string)$i ))\r\n\t\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}", "public function passwordStrength($password, array $userInputs = [])\n {\n $timeStart = microtime(true);\n if ('' === $password) {\n $timeStop = microtime(true) - $timeStart;\n\n return $this->result($password, 0, [], 0, ['calc_time' => $timeStop]);\n }\n\n // Get matches for $password.\n $matches = $this->matcher->getMatches($password, $userInputs, $this->params);\n\n // Calcuate minimum entropy and get best match sequence.\n $entropy = $this->searcher->getMinimumEntropy($password, $matches);\n $bestMatches = $this->searcher->matchSequence;\n\n // Calculate score and get crack time.\n $score = $this->scorer->score($entropy);\n $metrics = $this->scorer->getMetrics();\n\n $timeStop = microtime(true) - $timeStart;\n // Include metrics and calculation time.\n $params = array_merge($metrics, ['calc_time' => $timeStop]);\n\n return $this->result($password, $entropy, $bestMatches, $score, $params);\n }", "function checkPassword($clientPassword)\n{\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\n return preg_match($pattern, $clientPassword);\n}", "function verify_creditcard_mod10($strccno = '')\n {\n if (empty($strccno))\n {\n return false;\n }\n $len = mb_strlen($strccno);\n if ($len < 13 OR $len > 16)\n {\n return false;\n }\n $checkdig = (int)$strccno[--$len];\n for ($i=--$len, $sum = 0, $dou = true; $i >= 0; $i--, $dou =! $dou)\n {\n $curdig = (int)$strccno[$i];\n if ($dou)\n {\n $curdig *= 2;\n if ($curdig > 9) $curdig-=9;\n }\n $sum += $curdig;\n }\n if (($checkdig + $sum) % 10 == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function rules()\n {\n $validasi = [ \n 'email' => 'required|email|unique:users,email,'.auth()->user()->id,\n 'phone' => 'required|unique:users,phone,'.auth()->user()->id, \n 'password_confirm' => 'required|min:8'\n ];\n\n if(request()->filled(\"password\")){\n $validasi = array_merge($validasi,[\n \"password\" => \"min:8\"\n ]);\n }\n\n return $validasi;\n }", "protected function rules()\n {\n return [\n 'token' => 'required',\n 'email' => 'required|email',\n 'password' => 'required|min:8|confirmed|regex:\"^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{8,}$\"',\n ];\n }", "public function getMaskingStringLength(): PositiveInteger;", "public function rules()\n {\n\t\t$id = $this->route('admin_user');\n\t\t$rules = [\n\t\t\t'password' => 'nullable|between:6,20',\n\t\t\t'name' => 'required|between:2,20|allow_letter|unique:admin_users,name,'.$id\n\t\t];\n\n\t\tif (!$id) {\n\t\t\t$rules['password'] = 'required';\n\t\t}\n\t\treturn $rules;\n }" ]
[ "0.6221264", "0.6148037", "0.60621935", "0.6033135", "0.60245085", "0.6005632", "0.59476495", "0.58565587", "0.57886267", "0.5783336", "0.577515", "0.57163537", "0.5690557", "0.5668192", "0.5641812", "0.56082016", "0.5590052", "0.5581374", "0.5553084", "0.5505471", "0.550343", "0.5483973", "0.5482553", "0.5480901", "0.5456961", "0.5456961", "0.5456961", "0.541267", "0.54057485", "0.53466773", "0.53351295", "0.5309787", "0.5301736", "0.52779496", "0.525633", "0.5244404", "0.52413213", "0.5227471", "0.5201314", "0.51934975", "0.5190952", "0.5182761", "0.5172339", "0.51663417", "0.5149636", "0.51480526", "0.5147437", "0.514629", "0.5145636", "0.51443565", "0.5129969", "0.51279485", "0.5097491", "0.5093269", "0.5079624", "0.50621563", "0.50610375", "0.5058639", "0.5049426", "0.5039152", "0.5018678", "0.5009704", "0.50051063", "0.5003657", "0.50018597", "0.5000749", "0.49991184", "0.49950576", "0.49934408", "0.49916607", "0.49829963", "0.4970945", "0.4951596", "0.49439996", "0.49409705", "0.49328637", "0.49328536", "0.49328536", "0.49281433", "0.49191308", "0.4919006", "0.49146998", "0.49116978", "0.49089065", "0.4903159", "0.48873237", "0.48831335", "0.4862997", "0.48623767", "0.48551106", "0.4845899", "0.48377547", "0.48344472", "0.48273483", "0.4825004", "0.48234376", "0.48156407", "0.4812903", "0.48118523", "0.48024794", "0.48022515" ]
0.0
-1
Set password strength rule to have any digit presented in password. Default value is `TRUE` to must have digit characters in password. Digit (arabian) characters from arabian alphabet: 0123456789. Function has second argument to set minimum digit characters in password. Default value is at least one digit character in password.
public function SetMustHaveDigits ($mustHaveDigits = TRUE, $minCount = self::MIN_DIGIT_CHARS_COUNT) { /** @var \MvcCore\Ext\Forms\Validator $this */ $this->mustHaveDigits = $mustHaveDigits; $this->mustHaveDigitsCount = $minCount; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPasswordStrength($num) {\n if((is_numeric($num)) && (($num>=0) && ($num<=4))) {\n $this->password_strength = $num;\n return $this->password_strength;\n }\n return false;\n }", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "function reduce_min_strength_password_requirement( $strength ) {\n return 2; \n}", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK)\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n elseif ($params['strength'] === self::STRONG)\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n\n if (!preg_match($pattern, $this->$attribute) || strlen($this->$attribute) < 8)\n $this->addError($attribute, 'New password is not strong enough!' . \" \\n\" . \" Minimal length 8 digit and \" . \" \\n includes alphanumeric string\");\n }", "public function testUpdatePasswordOnlyNumbers(): void { }", "public function setPasswordMinimumLength(?int $value): void {\n $this->getBackingStore()->set('passwordMinimumLength', $value);\n }", "public function passwordStrength($attribute, $params) {\n if ($params['strength'] === self::WEAK) {\n $pattern = '/^(?=.*[a-zA-Z0-9]).{5,}$/';\n } elseif ($params['strength'] === self::STRONG) {\n $pattern = '/^(?=.*\\d(?=.*\\d))(?=.*[a-zA-Z](?=.*[a-zA-Z])).{5,}$/';\n }\n if (!preg_match($pattern, $this->$attribute)) {\n $this->addError($attribute, 'your password is not strong enough!');\n }\n }", "public function password_strength_check($str)\n\t{\n\t\tif (preg_match('#[0-9]#', $str) && preg_match('#[a-zA-Z]#', $str)) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\t$this->form_validation->set_message('password_strength_check', 'Your password must be at least 6-19 characters in length and contain a number and both uppercase and lowercase letters');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\n\t}", "function minimum_password_limit( & $errors ) {\r\n\t$min_length = 12;\r\n\tif ( !empty( $_POST['pass1'] ) && $_POST['pass1'] === $_POST['pass2'] && !preg_match('/^.*(?=.{12,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', $_POST['pass1']) ) {\r\n\t\t$errors->add( 'min_pass_length', sprintf( __( '<strong>Security advice</strong>: Your password must be at least %d characters long and have at least one capital letter and one number in it.' ), $min_length ), array( 'form-field' => 'pass1' ) );\r\n\t}\r\n}", "function check_strength($user_password) {\n $characters = 0;\n $capitalletters = 0;\n $loweletters = 0;\n $number = 0;\n\n if (strlen ($user_password) > 11) {\n $characters = 1;\n } else {\n $characters = 0;\n };\n if (preg_match('/[A-Z]/', $user_password)) {\n $capitalletters = 1;\n } else {\n $capitalletters = 0;\n };\n if (preg_match('/[a-z]/', $user_password)) {\n $loweletters = 1;\n } else {\n $loweletters = 0;\n };\n if (preg_match('/[0-9]/', $user_password)) {\n $number = 1;\n } else {\n $number = 0;\n };\n\n $total = $characters + $capitalletters + $loweletters + $number;\n\n return GetPercentage(4, $total);\n}", "function CheckStrength($attribute, $params) {\n if (isset($this->$attribute)) { // Edit 2013-06-01\n $password = $this->$attribute;\n if (strlen($password) == 0)\n $strength = -10;\n else\n $strength = 0;\n /* * * get the length of the password ** */\n $length = strlen($password);\n /* * * check if password is not all lower case ** */\n if (strtolower($password) != $password) {\n $strength += 1;\n }\n /* * * check if password is not all upper case ** */\n if (strtoupper($password) == $password) {\n $strength += 1;\n }\n /* * * check string length is 8 -15 chars ** */\n if ($length >= 8 && $length <= 15) {\n $strength += 2;\n }\n /* * * check if lenth is 16 - 35 chars ** */\n if ($length >= 16 && $length <= 35) {\n $strength += 2;\n }\n /* * * check if length greater than 35 chars ** */\n if ($length > 35) {\n $strength += 3;\n }\n /* * * get the numbers in the password ** */\n preg_match_all('/[0-9]/', $password, $numbers);\n $strength += count($numbers[0]);\n /* * * check for special chars ** */\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^\\\\\\]/', $password, $specialchars);\n $strength += sizeof($specialchars[0]);\n /* * * get the number of unique chars ** */\n $chars = str_split($password);\n $num_unique_chars = sizeof(array_unique($chars));\n $strength += $num_unique_chars * 2;\n /* * * strength is a number 1-100; ** */\n $strength = $strength > 99 ? 99 : $strength;\n //$strength = floor($strength / 10 + 1);\n if ($strength < $params['score'])\n $this->addError($attribute, \"Password is too weak - try using CAPITALS, Num8er5, AND sp€c!al characters. Your score was \" . $strength . \"/\" . $params['score']);\n else\n return true;\n }\n }", "public function getPasswordStrength(string $password): int;", "function testPass($pass){\n$level=0;\nif(eight($pass)){$level+=1;}\nif(upper($pass)){$level+=1;}\nif(lower($pass)){$level+=1;}\nif(hasDigit($pass)){$level+=1;}\nif(hasSpecial($pass)){$level+=1;}\n\nswitch($level){\ncase 1: echo 'Password strength : <b><font color=red\">Very weak.</font></b>';return false; break;\ncase 2: echo 'Password strength : <b><font color=\"orange\">Weak.</font></b>';return true; break;\ncase 3: echo 'Password strength : <b><font color=\"grey\">Medium</font></b>';return true; break;\ncase 4: echo 'Password strength : <b><font color=\"blue\">Good</font></b>';return true; break;\ncase 5: echo 'Password strength : <b><font color=\"green\">Strong.</font></b>';return true; break;\ndefault : echo 'Password strength : <b><font color=\"red\">Very weak.</font></b>'; break;}\n}", "public function passStrength($str){\n $error = FALSE;\n // make sure it is long enough\n if(strlen($str) < 8){\n $error['length'] = 'must be 8 characters minimum.';\n }\n // must contain letters & numbers and must have 1 upper case letter!\n if( ! preg_match('/[A-Za-z]/', $str) && preg_match('/[0-9]/', $str)){\n $error['alphanum'] = 'Must be alphanumeric and contain capitals and lower case.';\n }\n return $error;\n }", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "public static function setPasswordMinLength($length){\n Configuration::where('id', 1)\n ->update(['password_min_length' => $length]);\n }", "public function setPasswordLenghtMin($num) {\n if((is_numeric($num)) && (($this->password_lenghtMax==null) || ($this->password_lenghtMax>$num))) {\n $this->password_lenghtMin = $num;\n return $this->password_lenghtMin;\n }\n return false;\n }", "function validatePassword($value){\n if (is_int($value)) throw new Exception (\"Password must consist of letters and, if needed, numbers\"); #PASS (Check the string to int if all are numbers)\n $passwordMinLength=7;\n $passwordMaxLength=18;\n if (strlen($value)<=$passwordMinLength || strlen($value)>=$passwordMaxLength){\n throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n //return;\n } else{\n //throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n }\n //return;\n}", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "public function setPasswordLetter($num) {\n if(is_numeric($num)) {\n $this->password_letter = $num;\n return $this->password_letter;\n }\n return false;\n }", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function getStrength($password, $username = null)\n {\n if (!empty($username)) {\n $password = str_replace($username, '', $password);\n }\n\n $password_length = strlen($password);\n\n $strength = $password_length * 4;\n\n for ($i = 2; $i <= 4; $i++) {\n $temp = str_split($password, $i);\n\n $strength -= (ceil($password_length / $i) - count(array_unique($temp)));\n }\n\n preg_match_all('/[0-9]/', $password, $numbers);\n\n if (!empty($numbers)) {\n $numbers = count($numbers[0]);\n\n if ($numbers >= 3) {\n $strength += 5;\n }\n } else {\n $numbers = 0;\n }\n\n preg_match_all('/[|!@#$%&*\\/=?,;.:\\-_+~^¨\\\\\\]/', $password, $symbols);\n\n if (!empty($symbols)) {\n $symbols = count($symbols[0]);\n\n if ($symbols >= 2) {\n $strength += 5;\n }\n } else {\n $symbols = 0;\n }\n\n preg_match_all('/[a-z]/', $password, $lowercase_characters);\n preg_match_all('/[A-Z]/', $password, $uppercase_characters);\n\n if (!empty($lowercase_characters)) {\n $lowercase_characters = count($lowercase_characters[0]);\n } else {\n $lowercase_characters = 0;\n }\n\n if (!empty($uppercase_characters)) {\n $uppercase_characters = count($uppercase_characters[0]);\n } else {\n $uppercase_characters = 0;\n }\n\n if (($lowercase_characters > 0) && ($uppercase_characters > 0)) {\n $strength += 10;\n }\n\n $characters = $lowercase_characters + $uppercase_characters;\n\n if (($numbers > 0) && ($symbols > 0)) {\n $strength += 15;\n }\n\n if (($numbers > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($symbols > 0) && ($characters > 0)) {\n $strength += 15;\n }\n\n if (($numbers == 0) && ($symbols == 0)) {\n $strength -= 10;\n }\n\n if (($symbols == 0) && ($characters == 0)) {\n $strength -= 10;\n }\n\n if ($strength < 0) {\n $strength = 0;\n }\n\n if ($strength > 100) {\n $strength = 100;\n }\n\n return $strength;\n }", "public function setPasswordNumber($num) {\n if(is_numeric($num)) {\n $this->password_number = $num;\n return $this->password_number;\n }\n return false;\n }", "function validatePassword() : bool\n {\n if($this->Password && preg_match('/^[[:alnum:]]{6,20}$/', $this->Password)) // solo numeri-lettere da 6 a 20\n {\n return true;\n }\n else\n return false;\n }", "protected function password_strength($password)\n\t{\n\t\t$strength = 0;\n\t\t$patterns = array('/[a-z]/','/[A-Z]/','/\\d/','/\\W/','/.{12,}/');\n\t\tforeach($patterns as $pattern)\n\t\t{\n\t\t\t$strength += (int) preg_match($pattern,$password);\n\t\t}\n\t\treturn $strength;\n\t\t// 1 - weak\n\t\t// 2 - not weak\n\t\t// 3 - acceptable\n\t\t// 4 - strong\n\t}", "function validate_password($candidate) \n{\n if (!empty($candidate))\n {\n // Declare and Initialize Local Variables\n $CritCount = 0; //Tabulator for keeping track of number of criteria matched\n\n /*\n Regular Expression Example $\\S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S*$\n $ = beginning of string\n \\S* = any set of characters\n (?=\\S{8,}) = of at least length 8\n (?=\\S*[a-z]) = containing at least one lowercase letter\n (?=\\S*[A-Z]) = and at least one uppercase letter\n (?=\\S*[\\d]) = and at least one number\n (?=\\S*[\\W]) = and at least a special character (non-word characters)\n $ = end of the string\n\n */\n // Test for each requirement \n if (strlen($candidate) >= 8) $CritCount = $CritCount + 10; // Value of 10 for minimum length\n if (preg_match('/[a-z]/', $candidate)) $CritCount = $CritCount + 1; //Contains lower case a-z\n if (preg_match('/[A-Z]/', $candidate)) $CritCount = $CritCount + 1; //Contains UPPER case A-Z\n if (preg_match('/[\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one numeric digit\n if (preg_match('/[^a-zA-Z\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one special Character (!@#$%^&*()-_, etc.)\n \n if ($CritCount > 12) //Meets minimum length, plus 3 additional criteria\n {\n return TRUE;\n }\n else \n {\n return FALSE;\n }\n }\n else\n return false;\n}", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "public function testRandomRequirements ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 4,\n 'digit' => 3,\n 'upper' => 2,\n 'lower' => 1\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){3})(?=(?:[^a-z]*[a-z]){1})(?=(?:[^A-Z]*[A-Z]){2})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){4})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "public function setPassword($value);", "function minimumNumber($n, $password) {\n $res = 0;\n $check = 0;\n\t$free = 0;\n\n if ($n < 6) {\n $free = 6 - $n;\n }\n\t\n\t$uppercase = preg_match('@[A-Z]@', $password);\n\tif (!$uppercase) {\n\t\t$check++;\n\t}\n\t$lowercase = preg_match('@[a-z]@', $password);\n\tif (!$lowercase) {\n\t\t$check++;\n\t}\n\t$number = preg_match('@[0-9]@', $password);\n\tif (!$number) {\n\t\t$check++;\n\t}\n\t$speciaux = preg_match('#^(?=.*\\W)#', $password);\n\tif (!$speciaux) {\n\t\t$check++;\n\t}\n\t\n\t$res = $free + $check;\n\tif ($n < 6) {\n\t\t$res = ($free <= $check) ? $check : $free;\n\t}\n \n return $res;\n}", "public function checkPassword($value);", "function makePassword() {\n $alphaNum = array(2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, g, h, i, j, k, m, n, p, q, r, s, t, u, v, w, x, y, z);\n srand ((double) microtime() * 1000000);\n $pwLength = \"7\"; // this sets the limit on how long the password is.\n for($i = 1; $i <=$pwLength; $i++) {\n $newPass .= $alphaNum[(rand(0,31))];\n }\n return ($newPass);\n}", "function generatePassword($l = 8, $c = 0, $n = 0, $s = 0) {\n $count = $c + $n + $s;\n\n // sanitize inputs; should be self-explanatory\n if (!is_int($l) || !is_int($c) || !is_int($n) || !is_int($s)) {\n trigger_error('Argument(s) not an integer', E_USER_WARNING);\n return false;\n } elseif ($l < 0 || $l > 20 || $c < 0 || $n < 0 || $s < 0) {\n trigger_error('Argument(s) out of range', E_USER_WARNING);\n return false;\n } elseif ($c > $l) {\n trigger_error('Number of password capitals required exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($n > $l) {\n trigger_error('Number of password numerals exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($s > $l) {\n trigger_error('Number of password capitals exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($count > $l) {\n trigger_error('Number of password special characters exceeds specified password length', E_USER_WARNING);\n return false;\n }\n\n // all inputs clean, proceed to build password\n // change these strings if you want to include or exclude possible password characters\n $chars = \"abcdefghijklmnopqrstuvwxyz\";\n $caps = strtoupper($chars);\n $nums = \"0123456789\";\n $syms = \"!@#$%^&*()-+?\";\n\n // build the base password of all lower-case letters\n for ($i = 0; $i < $l; $i++) {\n $out .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);\n }\n\n // create arrays if special character(s) required\n if ($count) {\n // split base password to array; create special chars array\n $tmp1 = str_split($out);\n $tmp2 = array();\n\n // add required special character(s) to second array\n for ($i = 0; $i < $c; $i++) {\n array_push($tmp2, substr($caps, mt_rand(0, strlen($caps) - 1), 1));\n }\n for ($i = 0; $i < $n; $i++) {\n array_push($tmp2, substr($nums, mt_rand(0, strlen($nums) - 1), 1));\n }\n for ($i = 0; $i < $s; $i++) {\n array_push($tmp2, substr($syms, mt_rand(0, strlen($syms) - 1), 1));\n }\n\n // hack off a chunk of the base password array that's as big as the special chars array\n $tmp1 = array_slice($tmp1, 0, $l - $count);\n // merge special character(s) array with base password array\n $tmp1 = array_merge($tmp1, $tmp2);\n // mix the characters up\n shuffle($tmp1);\n // convert to string for output\n $out = implode('', $tmp1);\n }\n\n return $out;\n}", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "public function testManyLowercaseCharacter ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 1,\n 'digit' => 1,\n 'upper' => 1,\n 'lower' => 5\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^a-z]*[a-z]){5})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){1})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "public function genaratepassword() {\r\r\n $length = 10;\r\r\n $alphabets = range('A', 'Z');\r\r\n $numbers = range('0', '9');\r\r\n $additional_characters = array('1', '3');\r\r\n $final_array = array_merge($alphabets, $numbers, $additional_characters);\r\r\n $password = '';\r\r\n while ($length--) {\r\r\n $key = array_rand($final_array);\r\r\n $password .= $final_array[$key];\r\r\n }\r\r\n return $password;\r\r\n }", "public function setPasswordLenghtMax($num) {\n if((is_numeric($num)) && (($this->password_lenghtMin==null) || ($this->password_lenghtMin<$num))) {\n $this->password_lenghtMax = $num;\n return $this->password_lenghtMax;\n }\n return false;\n }", "public static function setPasswordNumberRequired($isRequired){\n Configuration::where('id', 1)\n ->update(['password_number_required' => $isRequired]);\n }", "public static function setPasswordSpecialCharactersRequired($isRequired){\n Configuration::where('id', 1)\n ->update(['password_special_characters_required' => $isRequired]);\n }", "function vPassword2() \r\n\t\t{\r\n\t\t\t# Check password strength\r\n\t\t\t$p = $p1;\r\n\t\t\t\r\n\t\t\tif( strlen($p) < 8 ) $reg_errors[] = \"Password too short!\";\r\n\t\t\t\r\n\t\t\tif( strlen($p) > 20 ) $reg_errors[] = \"Password too long!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[0-9]+#\", $p) ) $reg_errors[] = \"Password must include at least one number!\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[a-z]+#\", $p) ) $reg_errors[] = \"Password must include at least one letter!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[A-Z]+#\", $p) ) $reg_errors[] = \"Password must include at least one CAPS!\";\r\n\t\t\t\r\n\t\t\t/* if( !preg_match(\"#\\W+#\", $p) ) $errors[] = \"Password must include at least one symbol!\"; */\t\r\n\t\t\t\r\n\t\t}", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "public function testManySpecialCharacter ()\n {\n // Function parameters\n $length = 10;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 6,\n 'digit' => 1,\n 'upper' => 1,\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){6})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function generate_random_password($len = 8)\n {\n }", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "public function increaseLength($minLength = 100) {}", "function valid_pass($password)\n {\n $r2 = '/[A-z]/'; //lowercase\n $r3 = '/[0-9]/'; //numbers\n $r4 = '/[~!@#$%^&*()\\-_=+{};:<,.>?]/'; // special char\n\n /*if (preg_match_all($r1, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个大写字母,请返回修改!\";\n return FALSE;\n }*/\n if (preg_match_all($r2, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个字母,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n if (preg_match_all($r3, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个数字,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n /*if (preg_match_all($r4, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个特殊符号:[~!@#$%^&*()\\-_=+{};:<,.>?],请返回修改!\";\n return FALSE;\n }*/\n if (strlen($password) < 8) {\n $msg = \"密码必须包含至少含有8个字符,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n return ['code' => 0, 'msg' => 'success'];\n }", "public function increaseLength($minLength = 100) {}", "public function testPasswordLengthManagement() {\n // Create a policy and add minimum and maximum \"length\" constraints.\n $this->drupalPostForm('admin/config/security/password-policy/add', ['label' => 'Test policy', 'id' => 'test_policy'], 'Next');\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->assertText('Number of characters');\n $this->assertText('Operation');\n\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => 1], 'Save');\n $this->assertText('Password character length of at least 1');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'maximum', 'character_length' => 6], 'Save');\n $this->assertText('Password character length of at most 6');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => ''], 'Save');\n $this->assertText('The character length must be a positive number.');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => -1], 'Save');\n $this->assertText('The character length must be a positive number.');\n\n $this->drupalGet('admin/config/system/password_policy/constraint/add/test_policy/password_length');\n $this->drupalPostForm(NULL, ['character_operation' => 'minimum', 'character_length' => $this->randomMachineName()], 'Save');\n $this->assertText('The character length must be a positive number.');\n }", "function checkPasswordPolicy( $password, $admin=\"y\" ) {\n\t\n\tglobal $CONF;\n\t\n\t$smallLetters\t\t= preg_match( '/[a-z]/', $password );\n\t$capitalLetters\t\t= preg_match( '/[A-Z]/', $password );\n\t$numbers\t\t\t= preg_match( '/[0-9]/', $password );\n\tif( isset( $CONF['passwordSpecialChars'] ) ) {\n\t\t$pattern\t\t= '/'.$CONF['passwordSpecialChars'].'/';\n\t} else {\n\t\t$pattern\t\t= '/'.'[\\!\\\"\\§\\$\\%\\/\\(\\)=\\?\\*\\+\\#\\-\\_\\.\\:\\,\\;\\<\\>\\|\\@]'.'/';\n\t}\n\t$specialChars\t\t= preg_match( $pattern, $password );\n\t$passwordLength\t\t= strlen( $password );\n\t$groups\t\t\t\t= 0;\n\t\n\tif( $smallLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $capitalLetters != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $numbers != 0 ) {\n\t\t$groups++;\n\t}\n\t\n\tif( $specialChars != 0 ) {\t\t\n\t\t$groups++;\n\t}\n\t\n\tif( $admin == \"y\" ) {\n\t\t\n\t\tif( isset($CONF['minPasswordlength']) ) {\n\t\t\t$minPasswordLength\t= $CONF['minPasswordlength'];\n\t\t} else {\n\t\t\t$minPasswordLength\t= 14;\n\t\t}\n\t\tif( $passwordLength < $minPasswordLength ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset( $CONF['minPasswordGroups'] ) ) {\n\t\t\t\t$minPasswordGroups\t= $CONF['minPasswordGroups'];\n\t\t\t} else {\n\t\t\t\t$minPasswordGroups\t= 4;\n\t\t\t}\n\t\t\tif( isset( $minPasswordGroups ) ) {\n\t\t\t\n\t\t\t\tif( ($minPasswordGroups < 1) or ($minPasswordGroups > 4) ) {\n\t\t\t\t\t$minGroups\t= 4;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroups\t= $minPasswordGroups;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroups\t\t= 4;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroups ) {\n\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\n\t} else {\n\t\t\n\t\tif( isset( $CONF['minPasswordlengthUser'] ) ) {\n\t\t\t$minPasswordlengthUser\t\t= $CONF['minPasswordlengthUser'];\n\t\t} else {\n\t\t\t$minPasswordLengthUser\t\t= 8;\n\t\t}\n\t\tif( $passwordLength < $CONF['minPasswordlengthUser'] ) {\n\t\t\t\n\t\t\t$retval\t\t\t= 0;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif( isset($CONF['minPasswordGroupsUser']) ) {\n\t\t\t\t\n\t\t\t\tif( ($CONF['minPasswordGroupsUser'] < 1) or ($CONF['minPasswordGroupsUser'] > 4 ) ) {\n\t\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t\t} else {\n\t\t\t\t\t$minGroupsUser\t= $CONF['minPasswordGroupsUser'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$minGroupsUser\t= 3;\n\t\t\t}\n\t\t\t\n\t\t\tif( $groups < $minGroupsUser ) {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 0;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$retval\t\t\t= 1;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\treturn $retval;\n}", "public function increaseLength($minLength = 100);", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function testLongPassword ()\n {\n // Function parameters\n $length = 20;\n $minPasswordRequirements = [];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{20,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function sloodle_validate_prim_password($password)\n {\n // Check that it's a string\n if (!is_string($password)) return false;\n // Check the length\n $len = strlen($password);\n if ($len < 5 || $len > 9) return false;\n // Check that it's all numbers\n if (!ctype_digit($password)) return false;\n // Check that it doesn't start with a 0\n if ($password[0] == '0') return false;\n \n // It all seems fine\n return true;\n }", "public function validatePassword($attribute, $params)\n\t{\n\t\tif ($this->password !== $this->repeatePassword) {\n\t\t\t$this->addError($attribute, 'Пароль не совпадает.');\n\t\t}\n\t}", "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "function generate_password($length=8, $strength=9) {\n $vowels = 'aeuy';\n $consonants = 'bdghjmnpqrstvz';\n\n if ($strength & 1) {\n $consonants .= 'BDGHJLMNPQRSTVWXZ';\n }\n if ($strength & 2) {\n $vowels .= \"AEUY\";\n }\n if ($strength & 4) {\n $consonants .= '23456789';\n }\n if ($strength & 8) {\n $consonants .= '@#$%';\n }\n\n $password = '';\n $alt = time() % 2;\n for ($i = 0; $i < $length; $i++) {\n if ($alt == 1) {\n $password .= $consonants[(rand() % strlen($consonants))];\n $alt = 0;\n } else {\n $password .= $vowels[(rand() % strlen($vowels))];\n $alt = 1;\n }\n }\n // add a number, there has to be a number\n $password .= rand(1, 9);\n\n return $password;\n}", "public function setPassword($newPassword);", "function pwdLongEnough($password) {\n $result=true;\n if(strlen($password) < 8){\n $result =false;\n } \n else {\n $result = true;\n }\n return $result;\n}", "public function testUpdatePasswordOnlyLowerCase(): void { }", "public function includeNumber() {\n\n for ($i=0; $i <$this->numPortion ; $i++) {\n $this->password = $this->password.substr($this->num, rand(0, strlen($this->num) - 1), 1);\n }\n }", "static function RandomPassword($length = 10){\n\t\tsettype($length,\"integer\");\n\t\t$numeric_versus_alpha_total = 10;\n\t\t$numeric_versus_alpha_numeric = 2;\n\t\t$piece_min_length = 2;\n\t\t$piece_max_length = 3;\n\t\t$numeric_piece_min_length = 1;\n\t\t$numeric_piece_max_length = 2;\n\t\t$s1 = \"aeuyr\";\n\t\t$s2 = \"bcdfghjkmnpqrstuvwxz\";\n\t\t$password = \"\";\n\t\t$last_s1 = rand(0,1);\n\t\twhile(strlen($password)<=$length){\n\t\t\t$numeric = rand(0,$numeric_versus_alpha_total);\n\t\t\tif($numeric<=$numeric_versus_alpha_numeric){\n\t\t\t\t$numeric = 1;\n\t\t\t}else{\n\t\t\t\t$numeric = 0;\n\t\t\t}\n\t\t\tif($numeric==1){\n\t\t\t\t$piece_lenght = rand($numeric_piece_min_length,$numeric_piece_max_length);\n\t\t\t\twhile($piece_lenght>0){\n\t\t\t\t\t$password .= rand(2,9);\n\t\t\t\t\t$piece_lenght--;\n\t\t\t\t} \n\t\t\t}else{ \n\t\t\t\t$uppercase = rand(0,1);\n\t\t\t\t$piece_lenght = rand($piece_min_length,$piece_max_length);\n\t\t\t\twhile($piece_lenght>0){\n\t\t\t\t\tif($last_s1==0){\n\t\t\t\t\t\tif($uppercase==1){\n\t\t\t\t\t\t\t$password .= strtoupper($s1[rand(0,strlen($s1)-1)]);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$password .= $s1[rand(0,strlen($s1)-1)];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$last_s1 = 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif($uppercase==1){\n\t\t\t\t\t\t\t$password .= strtoupper($s2[rand(0,strlen($s2)-1)]);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$password .= $s2[rand(0,strlen($s2)-1)];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$last_s1 = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$piece_lenght--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(strlen($password)>$length){\n\t\t\t$password = substr($password,0,$length);\n\t\t}\n\t\treturn new self($password);\n\t}", "public function setPassword(){\n\t}", "function randomPassword()\n{\n\n$digit = 6;\n$karakter = \"ABCDEFGHJKLMNPQRSTUVWXYZ23456789\";\n\nsrand((double)microtime()*1000000);\n$i = 0;\n$pass = \"\";\nwhile ($i <= $digit-1)\n{\n$num = rand() % 32;\n$tmp = substr($karakter,$num,1);\n$pass = $pass.$tmp;\n$i++;\n}\nreturn $pass;\n}", "public function passwordstrengthTask()\n\t{\n\t\t// Incoming\n\t\t$no_html = Request::getInt('no_html', 0);\n\t\t$password = Request::getString('pass', '', 'post');\n\t\t$username = Request::getString('user', '', 'post');\n\n\t\t// Instantiate a new registration object\n\t\t$xregistration = new \\Components\\Members\\Models\\Registration();\n\n\t\t// Score the password\n\t\t$score = $xregistration->scorePassword($password, $username);\n\n\t\t// Determine strength\n\t\tif ($score < PASS_SCORE_MEDIOCRE)\n\t\t{\n\t\t\t$cls = 'bad';\n\t\t\t$txt = Lang::txt('COM_MEMBERS_REGISTER_PASS_BAD');\n\t\t}\n\t\telse if ($score >= PASS_SCORE_MEDIOCRE && $score < PASS_SCORE_GOOD)\n\t\t{\n\t\t\t$cls = 'mediocre';\n\t\t\t$txt = Lang::txt('COM_MEMBERS_REGISTER_PASS_MEDIOCRE');\n\t\t}\n\t\telse if ($score >= PASS_SCORE_GOOD && $score < PASS_SCORE_STRONG)\n\t\t{\n\t\t\t$cls = 'good';\n\t\t\t$txt = Lang::txt('COM_MEMBERS_REGISTER_PASS_GOOD');\n\t\t}\n\t\telse if ($score >= PASS_SCORE_STRONG)\n\t\t{\n\t\t\t$cls = 'strong';\n\t\t\t$txt = Lang::txt('COM_MEMBERS_REGISTER_PASS_STRONG');\n\t\t}\n\n\t\t// Build the HTML\n\t\t$html = '<span id=\"passwd-meter\" style=\"width:' . $score . '%;\" class=\"' . $cls . '\"><span>' . Lang::txt($txt) . '</span></span>';\n\n\t\t// Return the HTML\n\t\tif ($no_html)\n\t\t{\n\t\t\techo $html;\n\t\t}\n\n\t\treturn $html;\n\t}", "public function enablePasswordStringLength()\n {\n // Add validator\n return $this->attachPasswordValidator('Zend\\Validator\\StringLength', array(\n 'min' => 8,\n 'max' => 64,\n ));\n }", "function testPasswordErr($password) {\n if (empty($password)) {\n $passwordErr = 'Password required';\n } else {\n $password = test_input($password);\n //VALIDATE PASSWORD\n if (!filter_var($password, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,10})\")))) {\n //da 4 a 10 caratteri, deve contenere maiuscole, minuscole e numeri\n $passwordErr = \"Invalid Password format\";\n } else\n $passwordErr = \"*\";\n }\n return $passwordErr;\n }", "protected function changePassword() {}", "public function encryptPassword($pass){\r\n\t\t$this->string = array(\r\n\t\t\t\"string\" => $pass,\r\n\t\t\t\"count\" => strlen($pass)\r\n\t\t);\r\n\t\t//the function setCharacters() is executed to get all the initial characters to use for password encryption.\r\n\t\t$characters = $this->setCharacters();\r\n\t\t/* \r\n\t\t\tIn order to encrypt this password with a unique pattern I took the password and found the position\r\n\t\t\ton my character table. I took all positions that are found on my character table and use those numbers like patters\r\n\t\t\tI set the characters location as ranges in my $start_range variable.\r\n\t\t*/\r\n\t\t$start_range = array();\r\n\t\tfor($x=0; $x<$this->string['count']; $x++){\r\n\t\t\t$start_range[$x] = array_search($this->string['string'][$x], $characters);\r\n\t\t}\r\n\t\tforeach ($start_range as $key => $value) {\r\n\t\t\tif($value == null){\r\n\t\t\t\t$start_range[$key] = $this->string['count'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//doubles the range to make the password more complex base on mathematical additions; submitted on the 1.2 update\r\n\t\t$a = 0;\r\n\t\tfor ($i=0; $i < $this->string['count']; $i++) {\r\n\t\t\t$start_range[$this->string['count'] + $a] = round(($start_range[$i] * ($this->string['count'] + $a))); \r\n\t\t\t$a++;\r\n\t\t}\r\n\t\t/*\r\n\t\t\tUnique matrix is created depending on number of characters and the location of the characters\r\n\t\t\tI set for what i call my matrix to be 5000 characters to make the mattern more complex. you can set that to your liking i dont recommend going lower than 1000 characters.\r\n\t\t*/\r\n\t\t$matrix = $this->generateMatrix($characters, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\t@param array will make sure the matrix is as complex as possible.\r\n\t\t*/\r\n\t\t$matrix_final = $this->generateMatrix($matrix, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\tI have tested with 128 characters, havent test for less or more yet.\r\n\t\t\tthis is where the magic happens and i use the same consept of creating a matrix to create the final encryption.\r\n\t\t*/\r\n\t\t$final_password = $this->generateMatrix($matrix_final, $start_range, $this->passwordEncryptionLenght);\r\n\t\t$this->encPassword = implode('',$final_password);\r\n\t}", "function checkPasswordErrors($password, $username = false) {\n $returns = array(\n 'strength' => 0,\n 'error' => 0,\n 'text' => ''\n );\n\n $length = strlen($password);\n\n if ($length < 8) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is not long enough';\n } elseif ($length > 32) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is too long';\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n $returns['error'] = 4;\n $returns['text'] = 'Password cannot be the same as your Username';\n } elseif (strtolower($password) == 'password') {\n $returns['error'] = 3;\n $returns['text'] = 'Password is too common';\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n $returns['error'] = 2;\n $returns['text'] = 'Too many consecutive characters';\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n $returns['strength'] = 5;\n $returns['text'] = 'Virtually Bulletproof';\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n $returns['strength'] = 4;\n $returns['text'] = 'Very Strong';\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n $returns['strength'] = 3;\n $returns['text'] = 'Strong';\n } else if ($numbers > 1) {\n//fair\n $returns['strength'] = 2;\n $returns['text'] = 'Fair';\n } else {\n//weak\n $returns['strength'] = 1;\n $returns['text'] = 'Weak';\n }\n }\n }\n return $returns;\n}", "public function addLetters() {\n\n for ($i=0; $i <$this->letterPorsion ; $i++) {\n $this->password = $this->password.substr($this->str, rand(0, strlen($this->str) - 1), 1);\n }\n }", "function setPassword($password){\n\t\t$password = base64_encode($password);\n\t\t$salt5 = mt_rand(10000,99999);\t\t\n\t\t$salt3 = mt_rand(100,999);\t\t\n\t\t$salt1 = mt_rand(0,25);\n\t\t$letter1 = range(\"a\",\"z\");\n\t\t$salt2 = mt_rand(0,25);\n\t\t$letter2 = range(\"A\",\"Z\");\n\t\t$password = base64_encode($letter2[$salt2].$salt5.$letter1[$salt1].$password.$letter1[$salt2].$salt3.$letter2[$salt1]);\n\t\treturn str_replace(\"=\", \"#\", $password);\n\t}", "function wp_generate_password($length = 12, $special_chars = \\true, $extra_special_chars = \\false)\n {\n }", "public function valida_password($password){\n\t\tif (preg_match(\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/\", $password)) \n\t\t\techo \"Su password es seguro.\"; \n\t\telse echo \"Su password no es seguro.\";\n\n\t}", "public function validatePassword()\n {\n $result = false;\n if (strlen($this->password) >= 5) {\n $result = true;\n }\n return $result;\n }", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "function createPwd($characters) {\n $possible = '23456789bcdfghjkmnpqrstvwxyz';\n $code = '';\n $i = 0;\n while ($i < $characters) {\n $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);\n $i++;\n }\n return $code;\n}", "function checkPasswordComplexity( $password ) {\n\n $this->load->library( \"Passwordvalidator\" );\n\n/* ... check the complexity of the password */\n $this->passwordvalidator->setPassword( $password );\n if ($this->passwordvalidator->validate_non_numeric( 1 )) { //Password must have 1 non-alpha character in it.\n $this->passwordvalidator->validate_whitespace(); //No whitespace please\n }\n\n/* ... if we didn't pass, set an appropriate error message */\n if ($this->passwordvalidator->getValid() == 0) {\n $this->form_validation->set_message('checkPasswordComplexity', 'The %s field must contain a string with no spaces and at least 1 non-alpha character');\n }\n\n/* ... time to go */\n return( $this->passwordvalidator->getValid() == 1 ? TRUE : FALSE );\n }", "function randomPassword()\r\n{\r\n\r\n$digit = 6;\r\n$karakter = \"ABCDEFGHJKLMNPQRSTUVWXYZ23456789\";\r\n\r\nsrand((double)microtime()*1000000);\r\n$i = 0;\r\n$pass = \"\";\r\nwhile ($i <= $digit-1)\r\n{\r\n$num = rand() % 32;\r\n$tmp = substr($karakter,$num,1);\r\n$pass = $pass.$tmp;\r\n$i++;\r\n}\r\nreturn $pass;\r\n}", "function genPassword($length=7){\n $newPass = \"\";\n for ($i = 0; $i < $length; $i++) {\n if (rand(0,1)){\n if (rand(0,1)){\n $newPass .= chr(rand(97,122));\n }else{\n $newPass .= chr(rand(65,90));\n }\n }else{\n $newPass .= chr(rand(48,57));\n }\n }\n return $newPass;\n}", "function do_change_password($puuid, &$error, $set_force_reset=false) {\n global $_min_passwd_len;\n global $_passwd_numbers;\n global $_passwd_uperlower;\n global $_passwd_chars;\n\n if($puuid === '') {\n $error = \"No PUUID given\";\n return false;\n }\n\n if($_REQUEST['p1'] === $_REQUEST['p2']) {\n $temparr = array();\n $p = $_REQUEST['p1'];\n\n // do strength test here\n if(strlen($p) < $_min_passwd_len) {\n $error = \"Password too short\";\n return false;\n }\n if($_passwd_numbers && !preg_match('/[0-9]/', $p)) {\n $error = \"Password must contain one or more numbers\";\n return false;\n }\n if($_passwd_uperlower && \n \t(!preg_match('/[A-Z]/', $p) || !preg_match('/[a-z]/', $p))) {\n $error = \"Password must contain both upper case and lower case\";\n return false;\n }\n if($_passwd_chars && \n \t(preg_match_all('/[A-Za-z0-9]/', $p, &$temparr) == strlen($p))) {\n $error = \"Password must contain non-alphanumeric characters\";\n return false;\n }\n\n // we got here, so update password\n $s = \"SELECT distinct passwordtype from password_types\";\n $res = pg_query($s);\n if (!$res) {\n $error = \"DB Error\";\n return false;\n }\n $hashes = pg_fetch_all($res);\n pg_free_result($res);\n\n hpcman_log(\"Updating \".count($hashes).\" password hashes for puuid \".$puuid);\n\n if (!pg_query(\"BEGIN\")) {\n $error = \"Could not begin transaction\";\n return false;\n }\n\n foreach($hashes as $hash) {\n $s = \"UPDATE passwords SET password=$1 \n\tWHERE puuid=$2 AND passwordtype=$3\";\n $passwd = hpcman_hash($hash['passwordtype'], $p);\n $result = pg_query_params($s, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"DB Error\";\n return false;\n }\n\n $acount = pg_affected_rows($result);\n\n if ($acount > 1) {\n $error = \"Error: Too many rows\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n } else if ($acount < 1) {\n hpcman_log(\"Adding new password hash {$hash['passwordtype']} for $puuid\");\n $sql = \"INSERT INTO passwords (password, puuid, passwordtype) VALUES ($1,$2,$3)\";\n $result = pg_query_params($sql, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"Error: Not enough rows; insert failed\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n }\n }\n }\n\n if (!pg_query(\"COMMIT\")) {\n $error = \"DB Error: Commit failed\";\n return false;\n }\n\n if($set_force_reset) {\n $sql = \"UPDATE authenticators SET mustchange='t' \n\tWHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n\t$error = \"DB Error\";\n return false;\n }\n } else {\n $sql = \"UPDATE authenticators SET mustchange='f'\n WHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n $error = \"DB Error\";\n return false;\n }\n }\n } else {\n $error = \"Passwords do not match\";\n return false;\n }\n return true;\n}", "private function genPass() {\r\n $random = 0;\r\n $rand78 = \"\";\r\n $randpass = \"\";\r\n $pass = \"\";\r\n $maxcount = rand( 4, 9 );\r\n // The rand() limits (min 4, max 9) don't actually limit the number\r\n // returned by rand, so keep looping until we have a password that's\r\n // more than 4 characters and less than 9.\r\n if ( ($maxcount > 8) or ( $maxcount < 5) ) {\r\n do {\r\n $maxcount = rand( 4, 9 );\r\n } while ( ($maxcount > 8) or ( $maxcount < 5) );\r\n }\r\n $rand78 = \"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-=_+abcdefghijklmnopqrstuvwxyz\";\r\n for ( $count = 0; $count <= $maxcount; $count++ ) {\r\n $random = rand( 0, 77 );\r\n $randpass = substr( $rand78, $random, 1 );\r\n $pass = $pass . $randpass;\r\n }\r\n $pass = substr( $pass, 0, 8 ); // Just in case\r\n return($pass);\r\n }", "function check_password($password)\n{\n if (strlen($password) < 8) {\n throw new Exception(\"password_short.\", 1);\n return false;\n }\n if (!preg_match(\"/[0-9]{1,}/\", $password) || !preg_match(\"/[A-Z]{1,}/\", $password)) {\n throw new Exception(\"password_bad\", 1);\n return false;\n }\n return true;\n}", "public static function validPassword ($length = 6)\r\n\t{\r\n\t\t# Check that the URL contains an activation key string of exactly 6 lowercase letters/numbers\r\n\t\treturn (preg_match ('/^[a-z0-9]{' . $length . '}$/D', (trim ($_SERVER['QUERY_STRING']))));\r\n\t}", "function generatePassword() {\n // 57 prefixes\n $aPrefix = array('aero', 'anti', 'ante', 'ande', 'auto', \n 'ba', 'be', 'bi', 'bio', 'bo', 'bu', 'by', \n 'ca', 'ce', 'ci', 'cou', 'co', 'cu', 'cy', \n 'da', 'de', 'di', 'duo', 'dy', \n 'eco', 'ergo', 'exa', \n 'geo', 'gyno', \n 'he', 'hy', 'ki',\n 'intra', \n 'ma', 'mi', 'me', 'mo', 'my', \n 'na', 'ni', 'ne', 'no', 'ny', \n 'omni', \n 'pre', 'pro', 'per', \n 'sa', 'se', 'si', 'su', 'so', 'sy', \n 'ta', 'te', 'tri',\n 'uni');\n\n // 30 suffices\n $aSuffix = array('acy', 'al', 'ance', 'ate', 'able', 'an', \n 'dom', \n 'ence', 'er', 'en',\n 'fy', 'ful', \n 'ment', 'ness',\n 'ist', 'ity', 'ify', 'ize', 'ise', 'ible', 'ic', 'ical', 'ous', 'ish', 'ive', \n 'less', \n 'sion',\n 'tion', 'ty', \n 'or');\n\n // 8 vowel sounds \n $aVowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo'); \n\n // 20 random consonants \n $aConsonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j', \n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n // Some consonants can be doubled\n $aDoubles = array('n', 'm', 't', 's');\n\n // \"Salt\"\n $aSalt = array('!', '#', '%', '?');\n\n $pwd = $aPrefix[array_rand($aPrefix)];\n\n // add random consonant(s)\n $c = $aConsonants[array_rand($aConsonants)];\n if ( in_array( $c, $aDoubles ) ) {\n // 33% chance of doubling it\n if (rand(0, 2) == 1) { \n $c .= $c;\n }\n }\n $pwd .= $c;\n\n // add random vowel\n $pwd .= $aVowels[array_rand($aVowels)];\n\n $pwdSuffix = $aSuffix[array_rand($aSuffix)];\n // If the suffix begins with a vovel, add one or more consonants\n if ( in_array( $pwdSuffix[0], $aVowels ) ) {\n $pwd .= $aConsonants[array_rand($aConsonants)];\n }\n $pwd .= $pwdSuffix;\n\n $pwd .= rand(2, 999);\n # $pwd .= $aSalt[array_rand($aSalt)];\n\n // 50% chance of capitalizing the first letter\n if (rand(0, 1) == 1) {\n $pwd = ucfirst($pwd);\n }\n return $pwd;\n }", "public function isValid($password)\n {\n if ($this->_minLength) {\n $len = strlen($password);\n if ($len < $this->_minLength) {\n return $this->_setInvalidReason(self::REASON_TOO_SHORT, array(\n 'minimum length' => $this->_minLength,\n 'password length' => $len,\n ));\n }\n }\n if ($this->_minStrength) {\n $strength = $this->calculateStrength($password);\n if ($strength < $this->_minStrength) {\n return $this->_setInvalidReason(self::REASON_TOO_WEAK, array(\n 'minimum strength' => $this->_minStrength,\n 'password strength' => $strength,\n ));\n }\n }\n if ($this->_minEntropy) {\n $entropy = $this->calculateEntropy($password);\n if ($entropy < $this->_minEntropy) {\n return $this->_setInvalidReason(self::REASON_INSUFFICIENT_ENTROPY, array(\n 'minimum entropy' => $this->_minEntropy,\n 'password entropy' => $entropy,\n ));\n }\n }\n foreach ($this->_requiredCharValidators as $validator) {\n list ($chars, $numRequired) = $validator;\n // http://www.php.net/manual/en/function.mb-split.php#99851\n $charArr = preg_split('/(?<!^)(?!$)/u', $chars);\n str_replace($charArr, ' ', $password, $count);\n if ($count < $numRequired) {\n return $this->_setInvalidReason(self::REASON_MISSING_REQUIRED_CHARS, array(\n 'required chars' => $chars,\n 'num required' => $numRequired,\n 'num found' => $count,\n ));\n }\n }\n foreach ($this->_validators as $validator) {\n list($type, $thing) = $validator;\n if ($type === 'callable') {\n $func = $thing;\n } else {\n $func = array($thing, 'isValid');\n }\n $result = call_user_func($func, $password);\n if (! $result) {\n return $this->_setInvalidReason(self::REASON_FAILED_VALIDATOR, array(\n 'validator' => $thing,\n ));\n }\n }\n if ($this->_passwordLists) {\n $file = $this->findPassword($password);\n if ($file) {\n return $this->_setInvalidReason(self::REASON_FOUND_IN_LIST, array(\n 'list file' => $file,\n ));\n }\n }\n return true;\n }", "function cjpopups_is_password_strong($pass_string, $compare = 1) {\n $r1='/[A-Z]/'; //Uppercase\n $r2='/[a-z]/'; //lowercase\n $r3='/[!@#$%^&*()\\-_=+{};:,<.>]/'; // whatever you mean by 'special char'\n $r4='/[0-9]/'; //numbers\n if(preg_match_all($r1,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r2,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r3,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r4,$pass_string, $o) < $compare) return FALSE;\n if(strlen($pass_string) < 8) return FALSE;\n return TRUE;\n}", "function generatePassword ($length = 8)\n{\n $string = implode(\"\", range(\"a\", \"z\")) . implode(\"\", range(0, 9));\n $max = strlen($string) - 1;\n $pwd = \"\";\n\n while ($length--)\n {\n $pwd .= $string[ mt_rand(0, $max) ];\n }\n\n\n return $pwd;\n}", "function random_pass($len)\r\n{\r\n\t$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n\r\n\t$password = '';\r\n\tfor ($i = 0; $i < $len; ++$i)\r\n\t\t$password .= substr($chars, (mt_rand() % strlen($chars)), 1);\r\n\r\n\treturn $password;\r\n}", "function passwordGood($pass) {\n\t// default encoding/encoding specified in php.ini for nginx's php fpm module\n\t// is 'UTF-8'\n\t$len = mb_strlen($pass);\n\t//$len = strlen($pass);\n\t// original code of ($len >= 8 && $len <= 24) doesn't seem to work since I think\n\t// when true these return 1, when false they seem to return nothing, when printed empty string\n\t// be careful, these seem to return nothing or they don't print properly\n\t// this does work though :P\n\tif ( ( $len < 8 ) || ( $len > 24 ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public static function generatePassword() {\r\n return StringGenerator::generateRandomAlphaAndNumbersAndSpecial(12);\r\n }" ]
[ "0.6863631", "0.6692743", "0.6692743", "0.6692743", "0.6679495", "0.6615836", "0.64371425", "0.63698125", "0.63653034", "0.63569635", "0.6305209", "0.62923574", "0.6275585", "0.61276156", "0.6093317", "0.60760653", "0.6044233", "0.60335964", "0.60149646", "0.5992642", "0.5989906", "0.59768546", "0.5945049", "0.5945049", "0.5945049", "0.59116703", "0.5866114", "0.58621544", "0.58568174", "0.58487636", "0.5809474", "0.5791902", "0.5789534", "0.5731445", "0.57292056", "0.56936896", "0.5688908", "0.56792456", "0.56441325", "0.56390965", "0.56076515", "0.56050235", "0.560092", "0.5595546", "0.55949366", "0.5585146", "0.5581579", "0.5570098", "0.5559466", "0.5550469", "0.55504125", "0.55497724", "0.5514122", "0.55104434", "0.5498861", "0.54912394", "0.54912394", "0.54912394", "0.5487046", "0.5485068", "0.54660714", "0.54616416", "0.54547477", "0.5449093", "0.5424222", "0.54223555", "0.5422324", "0.5417429", "0.5407634", "0.54068106", "0.5398434", "0.53979355", "0.5396009", "0.5394628", "0.5378456", "0.537718", "0.53756", "0.5372073", "0.53675485", "0.53643084", "0.5358597", "0.5354406", "0.53433084", "0.5329933", "0.5329375", "0.5325048", "0.5320569", "0.53118956", "0.53007245", "0.5298355", "0.5297654", "0.52864426", "0.5283533", "0.52824485", "0.5273992", "0.5258815", "0.52577007", "0.5256738", "0.5256738", "0.5256738", "0.5253213" ]
0.0
-1
Validate raw user password by configured rules. Password still could contain very dangerous characters for XSS, SQL or any other attacks. Be careful!!!
public function Validate ($rawSubmittedValue) { $password = trim((string) $rawSubmittedValue); $passwordLength = mb_strlen($password); if ($passwordLength === 0) return NULL; // check password global minimum and maximum length: if ($passwordLength < $this->mustHaveMinLength) $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_MIN_LENGTH), [$this->mustHaveMinLength] ); if ($passwordLength > $this->mustHaveMaxLength) { $password = mb_substr($password, 0, $this->mustHaveMaxLength); $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_MAX_LENGTH), [$this->mustHaveMaxLength] ); } // check password lower case characters and minimum lower case characters count if necessary: if ($this->mustHaveLowerCaseChars) { $lowerCaseChars = preg_replace('#[^a-z]#', '', $password); $lowerCaseCharsCount = strlen($lowerCaseChars); if ($this->mustHaveLowerCaseCharsCount > 1 && $lowerCaseCharsCount < $this->mustHaveLowerCaseCharsCount) { $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_LOWERCASE_CHARS_MIN), [$this->mustHaveLowerCaseCharsCount, '[a-z]'] ); } else if ($lowerCaseCharsCount === 0) { $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_LOWERCASE_CHARS), ['[a-z]'] ); } } // check password upper case characters and minimum upper case characters count if necessary: if ($this->mustHaveUpperCaseChars) { $upperCaseChars = preg_replace('#[^A-Z]#', '', $password); $upperCaseCharsCount = strlen($upperCaseChars); if ($this->mustHaveUpperCaseCharsCount > 1 && $upperCaseCharsCount < $this->mustHaveUpperCaseCharsCount) { $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_UPPERCASE_CHARS_MIN), [$this->mustHaveUpperCaseCharsCount, '[A-Z]'] ); } else if ($upperCaseCharsCount === 0) { $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_UPPERCASE_CHARS), ['[A-Z]'] ); } } // check password digit characters and minimum digit characters count if necessary: if ($this->mustHaveDigits) { $digitChars = preg_replace('#[^0-9]#', '', $password); $digitCharsCount = strlen($digitChars); if ($this->mustHaveDigitsCount > 1 && $digitCharsCount < $this->mustHaveDigitsCount) { $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_DIGIT_CHARS_MIN), [$this->mustHaveDigitsCount, '[0-9]'] ); } else if ($digitCharsCount === 0) { $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_DIGIT_CHARS), ['[0-9]'] ); } } // check password special characters and minimum special characters count if necessary: if ($this->mustHaveSpecialChars) { $specialCharsArr = str_split($this->specialChars); $passwordCharsArr = str_split($password); $specialChars = array_intersect($passwordCharsArr, $specialCharsArr); $specialCharsCount = count($specialChars); if ($this->mustHaveSpecialCharsCount > 1 && $specialCharsCount < $this->mustHaveSpecialCharsCount) { $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_SPECIAL_CHARS_MIN), [$this->mustHaveSpecialCharsCount, htmlspecialchars($this->specialChars, ENT_QUOTES)] ); } else if ($specialCharsCount === 0) { $this->field->AddValidationError( static::GetErrorMessage(static::ERROR_SPECIAL_CHARS), [htmlspecialchars($this->specialChars, ENT_QUOTES)] ); } } return $password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isPasswordValid(string $encoded, string $raw);", "function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function is_valid_password($password)\n{\n if (is_null($password) || strlen($password) < 6 || strlen($password) > 40)\n {\n return false;\n }\n $pattern = \"/^[a-z0-9~`!@#\\$%\\^&\\*\\-_\\+=\\(\\)\\{\\}\\[\\]\\|:;\\\"\\'\\<\\>\\.,\\?\\/]{6,40}$/i\";\n\n return (preg_match($pattern, $password) == 1);\n}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "function sanitize_password(string $text = '')\n{\n return filter_var($text, FILTER_SANITIZE_STRING);\n}", "function validatePassword() : bool\n {\n if($this->Password && preg_match('/^[[:alnum:]]{6,20}$/', $this->Password)) // solo numeri-lettere da 6 a 20\n {\n return true;\n }\n else\n return false;\n }", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "function isValidPassword2($password)\n{\n return checkLength($password) && specialChar($password) && containsUpperAndLower($password);\n}", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "public function isPasswordValid($encoded, $raw, $salt)\n {\n\n }", "function check_password($password)\n{\n if (strlen($password) < 8) {\n throw new Exception(\"password_short.\", 1);\n return false;\n }\n if (!preg_match(\"/[0-9]{1,}/\", $password) || !preg_match(\"/[A-Z]{1,}/\", $password)) {\n throw new Exception(\"password_bad\", 1);\n return false;\n }\n return true;\n}", "function passwordValid($password) {\n\treturn true;\n}", "public function validatePassword(User $user, $password);", "function checkPassword($clientPassword)\n{\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\n return preg_match($pattern, $clientPassword);\n}", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', 'Incorrect password.');\n }\n }", "public function validate_password($password){\nif(!preg_match('%\\A(?=[-_a-zA-Z0-9]*?[A-Z)(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])\\S{6,}\\z%', $password)){\n\treturn false;\n\t}else{\n\t\treturn true;\n\t\t}\n}", "public function isValidPassword($uid, $password);", "function checkPassword($clientPassword){\r\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\r\n return preg_match($pattern, $clientPassword);\r\n }", "function is_secured_password($password)\n{\n if (is_null($password) || strlen($password) < 6 || strlen($password) > 40)\n {\n return false;\n }\n $pattern = \"/^[a-z0-9~`!@#\\$%\\^&\\*\\-_\\+=\\(\\)\\{\\}\\[\\]\\|:;\\\"\\'\\<\\>\\.,\\?\\/]{6,40}$/i\";\n $pattern1 = \"/[A-Z]/\";\n $pattern2 = \"/[a-z]/\";\n $pattern3 = \"/[0-9]/\";\n $pattern4 = \"/[~`!@#\\$%\\^&\\*\\-_\\+=\\(\\)\\{\\}\\[\\]\\|:;\\\"\\'\\<\\>\\.,\\?\\/]/\";\n\n return (preg_match($pattern, $password) == 1) && (preg_match($pattern1, $password) == 1) && (preg_match($pattern2, $password) == 1) && (preg_match($pattern3, $password) == 1) && (preg_match($pattern4, $password) == 1);\n}", "function validate_password($password)\n {\n $reg1='/[A-Z]/'; //Upper case Check\n $reg2='/[a-z]/'; //Lower case Check\n $reg3='/[^a-zA-Z\\d\\s]/'; // Special Character Check\n $reg4='/[0-9]/'; // Number Digit Check\n $reg5='/[\\s]/'; // Number Digit Check\n\n if(preg_match_all($reg1,$password, $out)<1) \n return \"There should be atleast one Upper Case Letter...\";\n\n if(preg_match_all($reg2,$password, $out)<1) \n return \"There should be atleast one Lower Case Letter...\";\n\n if(preg_match_all($reg3,$password, $out)<1) \n return \"There should be atleast one Special Character...\";\n\n if(preg_match_all($reg4,$password, $out)<1) \n return \"There should be atleast one numeric digit...\";\n \n if(preg_match_all($reg5,$password, $out)>=1) \n return \"Spaces are not allowed...\";\n\n if(strlen($password) <= 8 || strlen($password) >= 16 ) \n return \"Password Length should be between 8 and 16\";\n\n return \"OK\";\n }", "function wp_validate_application_password($input_user)\n {\n }", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "private function valid_password() {\n return (strlen($this->password) == 6);\n }", "public function validatePassword()\n {\n $result = false;\n if (strlen($this->password) >= 5) {\n $result = true;\n }\n return $result;\n }", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', Yii::t('app','Falscher Benutzername oder falsches Passwort.'));\n }\n }\n }", "function valid_password($pwd) {\n\t\tif (!$pwd)\n\t\t\treturn FALSE;\n\t\tif (strlen($pwd) < 6)\n\t\t\treturn FALSE;\n\t\tif (!preg_match('/[a-zA-Z]+/', $pwd) || !preg_match('/[0-9]+/', $pwd))\n\t\t\treturn FALSE;\n\t\treturn TRUE;\n\t}", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->oldPassword)) {\n $this->addError('oldPassword', 'Incorrect old password.');\n }\n }", "public function checkPassword($value);", "public function validate_password()\n\t{\n\t\t//Load language from user component\n\t\t$lang = JFactory::getLanguage();\n\t\t$tag = $lang->getTag();\n\n\t\tif (!$tag)\n\t\t{\n\t\t\t$tag = 'en-GB';\n\t\t}\n\n\t\t$lang->load('com_users', JPATH_ROOT, $tag);\n\t\t$value = $this->input->get('fieldValue', '', 'none');\n\t\t$validateId = $this->input->get('fieldId', '', 'none');\n\t\t$params = JComponentHelper::getParams('com_users');\n\t\t$minimumIntegers = $params->get('minimum_integers');\n\t\t$minimumSymbols = $params->get('minimum_symbols');\n\t\t$minimumUppercase = $params->get('minimum_uppercase');\n\t\t$validPassword = true;\n\t\t$errorMessage = '';\n\n\t\tif (!empty($minimumIntegers))\n\t\t{\n\t\t\t$nInts = preg_match_all('/[0-9]/', $value, $imatch);\n\n\t\t\tif ($nInts < $minimumIntegers)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($validPassword && !empty($minimumSymbols))\n\t\t{\n\t\t\t$nsymbols = preg_match_all('[\\W]', $value, $smatch);\n\n\t\t\tif ($nsymbols < $minimumSymbols)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($validPassword && !empty($minimumUppercase))\n\t\t{\n\t\t\t$nUppercase = preg_match_all(\"/[A-Z]/\", $value, $umatch);\n\n\t\t\tif ($nUppercase < $minimumUppercase)\n\t\t\t{\n\t\t\t\t$errorMessage = JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase);\n\t\t\t\t$validPassword = false;\n\t\t\t}\n\t\t}\n\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$validPassword)\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t\t$arrayToJs[2] = $errorMessage;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "function valid_pass($password)\n {\n $r2 = '/[A-z]/'; //lowercase\n $r3 = '/[0-9]/'; //numbers\n $r4 = '/[~!@#$%^&*()\\-_=+{};:<,.>?]/'; // special char\n\n /*if (preg_match_all($r1, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个大写字母,请返回修改!\";\n return FALSE;\n }*/\n if (preg_match_all($r2, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个字母,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n if (preg_match_all($r3, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个数字,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n /*if (preg_match_all($r4, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个特殊符号:[~!@#$%^&*()\\-_=+{};:<,.>?],请返回修改!\";\n return FALSE;\n }*/\n if (strlen($password) < 8) {\n $msg = \"密码必须包含至少含有8个字符,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n return ['code' => 0, 'msg' => 'success'];\n }", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "function testPasswordErr($password) {\n if (empty($password)) {\n $passwordErr = 'Password required';\n } else {\n $password = test_input($password);\n //VALIDATE PASSWORD\n if (!filter_var($password, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,10})\")))) {\n //da 4 a 10 caratteri, deve contenere maiuscole, minuscole e numeri\n $passwordErr = \"Invalid Password format\";\n } else\n $passwordErr = \"*\";\n }\n return $passwordErr;\n }", "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "function is_password_valid ($password, $user_data) {\n // the one in the user records.\n $is_valid = $password == $user_data['password'];\n return $is_valid;\n}", "protected function is_password_valid($not_strict = true , String $password = '') : bool\n {\n\n $password = $password ? $password : @$_POST['password'];\n\n if(!$password and $not_strict) return true;\n\n return preg_match(\"/([A-Z])+([a-z])+([0-9])/\",$password);\n\n }", "public function verifyAndReEncode($raw_password, $encoded_password);", "function validate_password($field) {\n\t\tif ($field == \"\") return \"No Password was entered.<br>\";\n\t\telse if (strlen($field) < 6)\n\t\t\treturn \"Password must be at least 6 characters.<br>\";\n\t\telse if (!preg_match(\"/[a-z]/\",$field) || !preg_match(\"/[A-Z]/\",$field) || !preg_match(\"/[0-9]/\",$field) )\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.<br>\";\n\t\treturn \"\";\n\t}", "function validate_password($password)\r\n\t{\r\n\t\tif($this->dont_allow_3_in_a_row($password) === FALSE)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tif(preg_match(REGEX_PASSWORD, $password) !== 1)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "function validPassword($password){\t\r\n \tglobal $API;\r\n return $API->userValidatePassword($this->username,$password); \r\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "private function validate_password($password){\n\t\treturn TRUE;\n\t}", "public function validatePassword()\n {\n $validator = new Validator(array(\n 'password' => $this->password,\n 'password2' => $this->password2,\n self::$primaryKey => $this->id(),\n ));\n\n $validator\n ->required()\n ->set('password2', 'Confirm password');\n\n $validator\n ->required()\n ->minLength(6)\n ->callback(function ($password, $password2) {\n return $password === $password2;\n }, 'Password is not matching confirm password', array($this->password2))\n ->set('password', 'Password');\n\n return $validator->validate();\n }", "public static function renderPassword();", "public function isPassword($password);", "public function validatePassword() {\n if (!$this->hasErrors()) {\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password_old)) {\n // $this->addError('password_old', 'Incorrect current password.');\n }\n }\n }", "function validate_password($hashed_password, $cleartext_password) {\n if (!is_string($hashed_password) || !is_string($cleartext_password))\n return false;\n if (config\\HASHING_ALGORITHM == \"crypt\") {\n $salt_end = strrpos($hashed_password, \"$\");\n if ($salt_end === false) {\n // DES, first two charachers is salt.\n $salt = substr($hashed_password, 0, 2);\n } else {\n // Salt before $.\n $salt_end++;\n $salt = substr($hashed_password, 0, $salt_end);\n }\n return crypt($cleartext_password, $salt) == $hashed_password;\n } else if (config\\HASHING_ALGORITHM == \"sha1\") {\n if (strlen($hashed_password) != 80)\n return false;\n $salt = substr($hashed_password, 0, 40);\n $hash = substr($hashed_password, 40);\n return $hash == sha1($salt . $cleartext_password, false);\n } else if (config\\HASHING_ALGORITHM == \"md5\") {\n if (strlen($hashed_password) != 64)\n return false;\n $salt = substr($hashed_password, 0, 32);\n $hash = substr($hashed_password, 32);\n return $hash == sha1($salt . $cleartext_password, false);\n } else\n trigger_error(\"The configured hashing algorithm '\" . config\\HASHING_ALGORITHM . \"' is not supported.\", \\E_USER_ERROR);\n}", "function validatePassword($pwd) {\r\n\t\treturn (strlen($pwd) >= 6 && preg_match_all(\"/[0-9]/\", $pwd) >= 2);\r\n\t}", "public function testValidationRules() {\n\t\t// fake the submision\n\t\t$this->data['User']['password'] = 'cd4f70413dececd8b813e1d5c56c6421e1a35018';\n\t\t$this->data['User']['email'] = 'test@example.com';\n\t\t$this->Model->set($this->data['User']);\n\n\t\t// pw regex simple\n\t\tConfigure::write('Website.password_regex', '[a-z]');\n\t\t$field['confirm_password'] = 'simplepw';\n\t\t$result = $this->Model->validatePassword($field);\n\t\t$this->assertTrue($result);\n\n\t\t$field['confirm_password'] = '�^%&^%*^&�$%�';\n\t\t$result = $this->Model->validatePassword($field);\n\t\t$this->assertFalse($result);\n\n\t\t// pw regex advanced\n\t\tConfigure::write('Website.password_regex', '^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\\s).{4,8}$');\n\t\t$field['confirm_password'] = 'aBcD123';\n\t\t$result = $this->Model->validatePassword($field);\n\t\t$this->assertTrue($result);\n\n\t\t$field['confirm_password'] = 'something';\n\t\t$result = $this->Model->validatePassword($field);\n\t\t$this->assertFalse($result);\n\t}", "static function checkPasswords($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d!@#$%][\\W\\w\\d!@#$%]{8,20}$/', $input)) {\r\n return true;//Illegal Character found\r\n } else{\r\n echo PageBuilder::printError(\"Password should be between 8 to 20 characters long with alphabets, at the least one number and at the least one special characters from ! @ # $ %.\");\r\n return false;\r\n }\r\n }", "static function checkPasswords($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d!@#$%][\\W\\w\\d!@#$%]{8,20}$/', $input)) {\r\n return true;//Illegal Character found\r\n } else{\r\n echo PageBuilder::printError(\"Password should be between 8 to 20 characters long with alphabets, at the least one number and at the least one special characters from ! @ # $ %.\");\r\n return false;\r\n }\r\n }", "function validatePassword($pass) {\n\t\t$l = getOption('min_password_lenght');\n\t\tif ($l > 0) {\n\t\t\tif (strlen($pass) < $l) return sprintf(gettext('Password must be at least %u characters'), $l);\n\t\t}\n\t\t$p = getOption('password_pattern');\n\t\tif (!empty($p)) {\n\t\t\t$strong = false;\n\t\t\t$p = str_replace('\\|', \"\\t\", $p);\n\t\t\t$patterns = explode('|', $p);\n\t\t\t$p2 = '';\n\t\t\tforeach ($patterns as $pat) {\n\t\t\t\t$pat = trim(str_replace(\"\\t\", '|', $pat));\n\t\t\t\tif (!empty($pat)) {\n\t\t\t\t\t$p2 .= '{<em>'.$pat.'</em>}, ';\n\n\t\t\t\t\t$patrn = '';\n\t\t\t\t\tforeach (array('0-9','a-z','A-Z') as $try) {\n\t\t\t\t\t\tif (preg_match('/['.$try.']-['.$try.']/', $pat, $r)) {\n\t\t\t\t\t\t\t$patrn .= $r[0];\n\t\t\t\t\t\t\t$pat = str_replace($r[0],'',$pat);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$patrn .= addcslashes($pat,'\\\\/.()[]^-');\n\t\t\t\t\tif (preg_match('/(['.$patrn.'])/', $pass)) {\n\t\t\t\t\t\t$strong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$strong)\treturn sprintf(gettext('Password must contain at least one of %s'), substr($p2,0,-2));\n\t\t}\n\t\treturn false;\n\t}", "function nrua_check_password($pwd) {\n\t$errors = [];\n\t\n\tif (strlen($pwd) < 8) {\n\t$errors[] = \"Password too short!\";\n\t}\n\t\n\tif (!preg_match(\"#[0-9]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one number!\";\n\t}\n\t\n\tif (!preg_match(\"#[a-zA-Z]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one letter!\";\n\t}\n\t\n\treturn $errors;\n}", "function validate_password($candidate) \n{\n if (!empty($candidate))\n {\n // Declare and Initialize Local Variables\n $CritCount = 0; //Tabulator for keeping track of number of criteria matched\n\n /*\n Regular Expression Example $\\S*(?=\\S{8,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S*$\n $ = beginning of string\n \\S* = any set of characters\n (?=\\S{8,}) = of at least length 8\n (?=\\S*[a-z]) = containing at least one lowercase letter\n (?=\\S*[A-Z]) = and at least one uppercase letter\n (?=\\S*[\\d]) = and at least one number\n (?=\\S*[\\W]) = and at least a special character (non-word characters)\n $ = end of the string\n\n */\n // Test for each requirement \n if (strlen($candidate) >= 8) $CritCount = $CritCount + 10; // Value of 10 for minimum length\n if (preg_match('/[a-z]/', $candidate)) $CritCount = $CritCount + 1; //Contains lower case a-z\n if (preg_match('/[A-Z]/', $candidate)) $CritCount = $CritCount + 1; //Contains UPPER case A-Z\n if (preg_match('/[\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one numeric digit\n if (preg_match('/[^a-zA-Z\\d]/', $candidate)) $CritCount = $CritCount + 1; //Contains at least one special Character (!@#$%^&*()-_, etc.)\n \n if ($CritCount > 12) //Meets minimum length, plus 3 additional criteria\n {\n return TRUE;\n }\n else \n {\n return FALSE;\n }\n }\n else\n return false;\n}", "function validate_password($plain, $encrypted) {\n if ($plain != \"\" && $encrypted != \"\") {\n// split apart the hash / salt\n $stack = explode(':', $encrypted);\n\n if (sizeof($stack) != 2) return false;\n\n if (md5($stack[1] . $plain) == $stack[0]) {\n return true;\n }\n }\n\n return false;\n }", "public function testPasswordIsValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "public static function validatePassword($password) {\n if (\n (strlen($password) > 8 || strlen($password) < 4) || // Check Length\n (!preg_match(\"#[0-9]+#\", $password)) || // Contains a number.\n (!preg_match(\"#[a-zA-Z]+#\", $password)) || // Contains a letter.\n (!preg_match(\"/^[a-z0-9]+$/i\",$password))) // No special characters.\n {\n // Password did not meet one of the requirements.\n return false; \n } else {\n // Password meets all requirements.\n return true;\n }\n }", "public function validatePassword($passPassword) \n {\n\n if(preg_match('/^[a-zA-Z0-9\\s]+$/',$passPassword)) \n {\n\n return true;\n }\n else \n {\n return false;\n }\n }", "public static function chunk_password($raw_password)\n {\n }", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "public function encodePassword(string $raw): string;", "public function valida_password($password){\n\t\tif (preg_match(\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/\", $password)) \n\t\t\techo \"Su password es seguro.\"; \n\t\telse echo \"Su password no es seguro.\";\n\n\t}", "function vPassword( $password )\r\n\t\t{\r\n\t\t\t\treturn preg_match( '/^(?=^.{8,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$/', $password );\r\n\t\t\t\t\r\n\t\t}", "public function check_password($password)\n {\n }", "public function getSecuredPassword();", "function passwordGood($pass) {\n\t// default encoding/encoding specified in php.ini for nginx's php fpm module\n\t// is 'UTF-8'\n\t$len = mb_strlen($pass);\n\t//$len = strlen($pass);\n\t// original code of ($len >= 8 && $len <= 24) doesn't seem to work since I think\n\t// when true these return 1, when false they seem to return nothing, when printed empty string\n\t// be careful, these seem to return nothing or they don't print properly\n\t// this does work though :P\n\tif ( ( $len < 8 ) || ( $len > 24 ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function validatePasswordSpecialChar(&$Model, $data, $compare) {\r\n\t\tif (in_array($this->settings[$Model->alias]['passwordPolicy'], array('weak', 'normal', 'medium'))) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$compare[0]];\r\n\t\tif (!(preg_match('/.*[^\\w].*/', $compare))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n if (!$this->user->validatePassword($this->old_password)) {\n $this->addError('old_password', 'Incorrect email or password.');\n }\n }\n }", "function isPassCorrect($psw, $psw_repeat){\r\n\t$regex = '/(?:[^`!@#$%^&*\\-_=+\\'\\/.,]*[`!@#$%^&*\\-_=+\\'\\/.,]){2}/';\r\n\tif (strlen($psw) >= 2 && strlen($psw_repeat) <= 255 && $psw == $psw_repeat) {\r\n\t\tif (preg_match($regex, $psw)) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t}\r\n\treturn 0;\r\n}", "abstract protected function is_valid($username, $password);", "function checkPasswordErrors($password, $username = false) {\n $returns = array(\n 'strength' => 0,\n 'error' => 0,\n 'text' => ''\n );\n\n $length = strlen($password);\n\n if ($length < 8) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is not long enough';\n } elseif ($length > 32) {\n $returns['error'] = 1;\n $returns['text'] = 'The password is too long';\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n $returns['error'] = 4;\n $returns['text'] = 'Password cannot be the same as your Username';\n } elseif (strtolower($password) == 'password') {\n $returns['error'] = 3;\n $returns['text'] = 'Password is too common';\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n $returns['error'] = 2;\n $returns['text'] = 'Too many consecutive characters';\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n $returns['strength'] = 5;\n $returns['text'] = 'Virtually Bulletproof';\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n $returns['strength'] = 4;\n $returns['text'] = 'Very Strong';\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n $returns['strength'] = 3;\n $returns['text'] = 'Strong';\n } else if ($numbers > 1) {\n//fair\n $returns['strength'] = 2;\n $returns['text'] = 'Fair';\n } else {\n//weak\n $returns['strength'] = 1;\n $returns['text'] = 'Weak';\n }\n }\n }\n return $returns;\n}", "public static function checkPassword( $rawPassword , $encPassword )\n {\n\n $parts = explode( '$' , $encPassword );\n if ( count( $parts ) != 3 )\n {\n return false;\n }\n\n $algo = strtolower( $parts[0] );\n $salt = $parts[1];\n $encPass = $parts[2];\n\n $credentialEnc = '';\n if ( $algo == 'sha1' )\n {\n $credentialEnc = sha1( $salt . $rawPassword , false );\n }\n else\n {\n $credentialEnc = md5( $salt . $rawPassword , false );\n }\n\n return $credentialEnc == $encPass;\n }", "function validatePassword($password, $retypedPassword)\n\t\t{\n\t\t\t// include the Password Validator Class and create a validator with 5-15 characters long\n\t\t\tinclude(\"class_libraries/PasswordValidator.php\");\n\t\t\t$passwordValidator = new PasswordValidator(5, 15);\n\t\t\t\n\t\t\t// validate the password\n\t\t\t$result = $passwordValidator -> validatePassword($password, $retypedPassword);\n\t\t\t\n\t\t\t// check the result\n\t\t\tif($result == false)\n\t\t\t{\n\t\t\t\t// get the error and return the result\n\t\t\t\treturn $passwordValidator -> getErrors();\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}", "public function verifyPassword (string $hash, string $password): bool;", "public function testPlainPassword()\n {\n $user = new User();\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n $user->setPlainPassword('dd');\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n\n $user->setPlainPassword($this->createString(128));\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n }", "function cleanup($user, $pass)\r\n {\r\n\r\n //$combo = array($user, $pass);\r\n\r\n\r\n /*-+=+-*-+=+-*-+=+-*-+=+-*-+=+-*-+=+-*-+=+-*-+=+-+-*-+=+-+-*-+\r\n * Validity Checks, entropy check, blacklists\r\n */\r\n\r\n\r\n // Trim\r\n $user = trim($user);\r\n $pass = trim($pass);\r\n\r\n // Remove line numbers from usernames\r\n $pattern = '/^\\d{1,4}[\\s\\.\\:\\-]{0,2}/';\r\n $user = preg_replace($pattern, '', $user);\r\n\r\n if (strstr($user,'&')) {\r\n $user = preg_replace_callback(\"/(&#[0-9]+;)/\", function($m) { return mb_convert_encoding($m[1], \"UTF-8\", \"HTML-ENTITIES\"); }, $user);\r\n $user = html_entity_decode($user);\r\n }\r\n\r\n if (strstr($pass,'&')) {\r\n $pass = preg_replace_callback(\"/(&#[0-9]+;)/\", function($m) { return mb_convert_encoding($m[1], \"UTF-8\", \"HTML-ENTITIES\"); }, $pass);\r\n $pass = html_entity_decode($pass);\r\n }\r\n\r\n // Min and max lengths\r\n if ($this->mStrLen($user) > 60) {\r\n $this->skipped['Username too long']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Username too long: $user\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n if ($this->mStrLen($user) < 3) {\r\n $this->skipped['Username too short']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Username too short: $user\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n if ($this->mStrLen($pass) > 40) {\r\n $this->skipped['Password too long']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Password too long: $user\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n if ($this->mStrLen($pass) < 3) {\r\n $this->skipped['Password too short']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Password too short: $user\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Entropy checks\r\n if ($this->doEntropyCheck) {\r\n $x = $this->checkEntropy($user);\r\n $y = $this->checkEntropy($pass);\r\n\r\n // High entropy or (medium entropy and both username and password are the same length)\r\n if (($x > .8 && $y > .8) || ($x > .5 && $y > .5 && strlen($user) == strlen($pass))) {\r\n $this->skipped['Entropy too high']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (High entropy)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Is hash and medium entropy\r\n if ($this->isHash($pass) && $y > .5) {\r\n $this->skipped['Password is a hash']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Hash)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Numeric username and high entropy pass\r\n if (is_numeric($user) && $y > .8) {\r\n $this->skipped['Entropy too high']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Numeric user, high entropy pass)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n }\r\n\r\n // Discard usernames or passwords that contain linefeeds or carriage returns\r\n if (strstr($user, \"\\r\") || strstr($pass, \"\\n\") || strstr($pass, \"\\r\") || strstr($pass, \"\\n\")) {\r\n $this->skipped['Invalid characters']++;\r\n if (PARSER_DEBUG) {\r\n echo ' Invalid characters - User: ' . $user . ' Pass: ' . $pass . \"\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n // Remove quotes and commas\r\n //list($user, $pass) = str_replace(array(\"'\", '\"', ','), '', $combo);\r\n $user = str_replace(array(\"'\", '\"', ','), '', $user);\r\n $pass = str_replace(array(\"'\", '\"', ','), '', $pass);\r\n\r\n\r\n // Strip out email addresses\r\n //$data = preg_replace('/\\b([A-Z0-9._%+-]+)@[A-Z0-9.-]+\\.[A-Z]{2,6}\\b/', '$1', $data);\r\n\r\n // Convert e notation to numbers\r\n if (preg_match('/\\d\\.\\d+E\\+\\d+/i', $pass)) {\r\n $pass = (float)$pass;\r\n $pass = (string)$pass;\r\n }\r\n\r\n\r\n // TEMP HACK Todo: Fix this\r\n if (strstr($pass, ':')) {\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping password $pass (Contains a colon)\\n\";\r\n }\r\n return null;\r\n }\r\n\r\n\r\n // For now just reject combos that looks like &#9679;\r\n If ((preg_match('/&#\\d{3,4};/i', $user) || (preg_match('/&#\\d\\d\\d\\d;/i', $pass)))) {\r\n return null;\r\n }\r\n\r\n\r\n // remove stuff that looks like a url (=)\r\n if (preg_match('#:\\/\\/|@[^\\.]*\\.\\.#', $user, $matches) || preg_match('#:\\/\\/|@[^\\.]*\\.\\.#', $pass, $matches)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping (URI)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Catch member URLs\r\n // Is this a duplicate of the previous check?\r\n if ((preg_match('~h?..p~i', $user) && substr($pass, 0, 2) == '//')\r\n || (preg_match('~.*(?:/?member|/login|/premium)|/.*/[^\\s]*\\s|\\.[a-z][a-z]+[\\/|:]~im', $user . ' ' . $pass))\r\n || (preg_match('~(?:www\\.|members\\.)[-A-Z0-9+&@#/%=_|$?!:,.]*[A-Z0-9+&@#/%=_|$]~im', $user . ' ' . $pass))\r\n ) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (URL)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Data is an IP address\r\n if (preg_match('#(?:[0-9]{1,3}\\.){3}[0-9]{1,3}#', $user) || preg_match(\r\n '#(?:[0-9]{1,3}\\.){3}[0-9]{1,3}#',\r\n $pass\r\n )\r\n ) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (IP Address)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Password is an email address\r\n // This will have false positives because the password really could be an email address\r\n // but it will eliminate tens of thousands of parsing errors.\r\n\r\n if (preg_match(\"/[a-z0-9!#$%&\\'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\\'*+\\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/im\", $pass)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping $pass (Email Address)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n // Username is truncated email address\r\n if (preg_match(\"/^.?@[^\\.]*\\./im\", $user)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping $user (Truncated Email Address)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Username or password starts with \"(\" or ends with \")\"\r\n // Discard them for now but these may be able to be stripped out\r\n\r\n if ($user[0] == '(' || $pass[0] == '(' ||\r\n $pass[strlen($pass) - 1] == ')' || $pass[strlen($pass) - 1] == ')'\r\n ) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Parenthesis)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Both username and password contain a space\r\n if (strstr($user, ' ') && strstr($pass, ' ')) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Spaces)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n // Kill usernames like \"Database\" or \"Table\r\n if (preg_match('/^database|table|system|server|hostname|target$/smi', $user)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Reserved word)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Catch ellipses\r\n if (strstr($user, '...') || strstr($pass, '...')) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Elipses)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n // Catch html tags in username or password\r\n if (preg_match(\r\n '~</?\\s?(?:s(?:t(?:r(?:ike|ong)|yle)|(?:crip|elec|qr)t|pa(?:cer|n)|u[bp]|mall|ound|amp)?|b(?:l(?:ockquote|ink)|ase(?:font)?|o(?:dy|x)|gsound|utton|do|ig|r)?|t(?:[dr]|ext(?:area)?|(?:ab|it)le|(?:foo)?t|h(?:ead)?|body)|a(?:b(?:ove|br)|r(?:ray|ea)|cronym|ddress|pplet)?|c(?:o(?:l(?:group)?|mment|de)|aption|enter|ite)|n(?:o(?:(?:laye|b)r|frames|script|te)|extid)|f(?:i(?:eldset|g)|rame(?:set)?|o(?:nt|rm))|i(?:n(?:put|s)|sindex|frame|layer|mg)?|l(?:i(?:sting|nk)?|a(?:bel|yer)|egend)|m(?:a(?:rquee|p)|e(?:nu|ta)|ulticol)|o(?:pt(?:group|ion)|bject|l)|d(?:[dt]|i[rv]|e?l|fn)|h(?:[123456r]|ead|tml)|p(?:aram|re)?|r(?:ange|oot)|(?:va|wb)r|em(?:bed)?|q(?:uote)?|kbd|ul?|xmp)|color|clear|font-.*|list-.*|margin-.*|float|vertical-.*|padding-.*~im',\r\n $pass . ' ' . $user\r\n )\r\n ) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (HTML tag)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // More HTML/CSS stuff\r\n if (preg_match('~.*transition|return|(?:.*background.*)|#\\d+|(?:\\d+(em|px|pt|%))|(?:left|right|top|bottom|middle|normal|italic|bold|none|both);|-(?:style|size|align|weight|width|height|spacing|color)~im',\r\n $pass . ' ' . $user\r\n )\r\n ) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (HTML/CSS tag)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /* Get rid of stuff that looks like code\r\n * define(\"DB_PREFETCH_ALL\",0);\r\n * define(\"FROMEMAILNAME\",'RPPC');\r\n */\r\n\r\n if (preg_match('/\\([\\'\"]|[\"\\',\\s]{3,6}|define\\(/im', $pass . ' ' . $user)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Source code)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // OS and file system stuff\r\n if (preg_match('/\\.\\.\\/|;echo|;ls/im', $pass . ' ' . $user)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Source code)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n // Kill all usernames that start with 3 or more symbols, may kill a few legit usernames but most are bad\r\n if (preg_match('/^[^a-zA-Z0-9\\s]{3,}/m', $user)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Source code)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Blacklists\r\n if ($this->useBlacklist) {\r\n\r\n // Known hackers\r\n $blacklist = 'x{1,3}.*pass.*|premium|2sexy2hot|4zima|arangarang|azzbite|babemagnet|c0ldsore|candoit0|capthowdy|cr3at0r|dabest|dawggyloves|ddenys|denyde|dreamv|drhacker|forxhq|xxxhq|forzima|fromajaxxx|frompwbb|gigacrap|h4x0r3d|h4x0r3d|hackedit|hackerz|hacksquat|hax411|heka6w2|hunterdivx|hxpduck|iownbuz|ischrome|ishere|jules\\d\\d|justone|lawina|mp3fanis|myownpass|neohack|niprip|onmeed|opsrule|ownzyou|ownzyou|pass4life|passbots|passfan|pr0t3st|pro@long|probot|prolong|realxxx|reduser\\d\\d|regradz|ripnip|rulzgz|strosek|surgict|suzeadmin|tama|tawnyluvs|valentijn|vbhacker|verygoodbot|wapbbs|washere|wazhere|webcracker|webcrackers|xcarmex2|xxxcrack|xxxhack|xxxpass|zcoolx|zealots|zolushka|ccbill|4xhq|\\$andman|\\[hide\\]|ranger67|xv16n35h';\r\n if (preg_match('~' . $blacklist . '~', $user, $matches)) {\r\n $this->skipped['Blacklisted username']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Known hackers blacklist)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Known hacker passwords\r\n $blacklist = '.*pas.*bot|forx.*|(?:is|w[u|a][z|s]|iz|)_?(?:here|back|numberone|thebest|dabest)|(?:greet[s|z]|l[0|o]ves|[0|o]wn[s|z])you.*';\r\n if (preg_match('~' . $blacklist . '~', $pass, $matches)) {\r\n $this->skipped['Blacklisted username']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Known hackers blacklist)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n // Usernames blacklist\r\n // Discards these: user, username, pass, password, email, login\r\n if (preg_match('#^(pass(word)?|user(name)?|email|login|from|Computer|Program):?$#i', $user, $matches)) {\r\n $this->skipped['Blacklisted username']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Username blacklist)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Passwords blacklist\r\n // Discards these: user, username, email, login\r\n if (preg_match('#^(user(name)?|email|login):?$#i', $pass, $matches)) {\r\n $this->skipped['Blacklisted password']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (password blacklist)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n\r\n // Misc stuff\r\n $blacklist = '\\*\\.\\*|76n74link|-box|Computername|text\\/javascript|\\(?null\\)?|\\#NAME|\\d\\d\\d\\d-\\d\\d-\\d\\d.*\\d\\d:\\d\\d:\\d\\d|&nbsp;|\\{float|\\{text-align|\\{height|\\{display|function\\(|height=|\\(HIT|(em|p[xt]);?\\s*\\}|this\\.|^link|&raquo|^http';\r\n\r\n if (preg_match('~' . $blacklist . '~i', $user, $matches)) {\r\n $this->skipped['Blacklisted username']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping user $user (Blacklisted username)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n if (preg_match('~' . $blacklist . '~i', $pass, $matches)) {\r\n $this->skipped['Blacklisted password']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping password $pass (Blacklisted password)\\n\";\r\n }\r\n\r\n return null;\r\n };\r\n\r\n // CSS stuff\r\n\r\n // Start with a quick check on obvious matches to avoid a regex on every combo\r\n //if (substr($user, 5) == '-moz-' || substr($user, 8) == '-webkit-') {\r\n if (stristr($user, '-moz-') || stristr($user, '-webkit-') || stristr($user, '-ms-')) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping $user (Username contains CSS)\\n\";\r\n }\r\n return null;\r\n }\r\n\r\n $blacklist = '(?:t(?:r(?:ee(?:header(?:sortarrow|cell)|twisty(?:open)?|item|view)|a(?:ns(?:ition|form)|d)|im)|o(?:ol(?:b(?:ar(?:button)?|ox)|tip))?|a(?:b(?:panels|le)?|rget|mil)|i(?:gr(?:inya|e)|betan)|e(?:xt(?:field)?|lugu)|hai|b)|s(?:t(?:r(?:i(?:ct|ng)|ength|ong)|a(?:rt[xy]|tusbar)|yle|em)|p(?:ac(?:es?|ing)|eek)|cr(?:oll(?:bar)?|ipt)|i(?:d(?:ama|e)|mp|ze)|e(?:parator|lf|t)|a(?:turation|me)|o(?:mali|urce)|li[cd]e|hifts?|yriac|mall|RGB)|c(?:o(?:n(?:t(?:e[nx]t|ainer)|s(?:onant|ider))|l(?:or(?:imetric)?|lapse|umns?)?|unter|py)|h(?:eck(?:box)?|a(?:nge|r)|inese)|a(?:p(?:tion|s)|mbodian)|e(?:ntral|lls?)|l(?:ear|ip)|ro(?:ss|p)|ircled|ursor|jk)|p(?:r(?:o(?:g(?:ressbar|id)|file)|e(?:se(?:ntation|rve))?)|er(?:s(?:pective|ian)|ceptual)|o(?:s(?:iti(?:on|ve))?|int)|h(?:onemes|ase)|a(?:dding|ge)|unctuation|itch)|d(?:i(?:s(?:(?:(?:reg|c)ar|able)d|pla(?:ce|y)|tribute)|a(?:mond|log)|rection|gits)|o(?:(?:cume|mina)nt|t(?:ted)?|uble|wn)|e(?:vanagari|cimal)|ash|rop)|a(?:l(?:i(?:gn(?:ment)?|as)|l(?:owed)?|phabetic)|(?:ppearanc|beged)e|r(?:menian|abic)|f(?:te|a)r|nimation|sterisks|mharic|djust|head|uto)|b(?:a(?:ck(?:ground|wards|face)|seline)|o(?:okmark|unding|rder|x)|e(?:havior|ngali|fore)|r(?:eaks?|anch)|in(?:ding|ary)|utton|lock|t)|m(?:a(?:(?:thematic|nu)al|r(?:quee|gin|k)|layalam|x)|e(?:n(?:u(?:popup|item|list)?|t)|et)|o(?:de(?:rate|l)?|ngolian|ve|z)|yanmar|in)|i(?:n(?:d(?:e(?:nt|x)|ic)|c(?:rement|lude)|(?:activ|lin)e|(?:form|iti)al|(?:ten|se)t|k)|m(?:ages?|e)|deograph)|f(?:i(?:nish(?:(?:opacit)?y|x)|l(?:l(?:ed)?|ter)|t)|o(?:r(?:ma[lt]|wards)|otnotes|nt)|loat|req)|r(?:e(?:s(?:olution|izer?|e?t)|(?:lativ|plac)e|ndering|duced|ct)|o(?:tation|ws?|le)|adio|uby|l)|e(?:n(?:(?:able)?d|grave)|(?:xclud|dg)e|a(?:rthly|ch)|m(?:boss|pty)|thiopic|pub|w)|l(?:i(?:ghtstrength|n[ek]|teral|st)|a(?:(?:you|s)t|o)|o(?:ose|wer)|e(?:vel|ft)|r)|o(?:r(?:i(?:(?:entatio|gi)n|ya)|omo)|ff(?:[xy]|set)|verflow|pacity|utline|ctal)?|n(?:e(?:w(?:spaper)?|ver|sw)|o(?:rwegian|t)?|a(?:me|v)|umeral|wse|s)|h(?:e(?:xadecimal|avenly|ight|re)|an(?:g(?:ing|ul)|d)|yphen)|v(?:(?:o(?:lum|ic)|alu)e|isibility|ertical)|w(?:r(?:iting|ap)|hite|idth|eak|ord)|g(?:u(?:jarat|rmukh)i|r(?:eek|id))|D(?:XImageTransform|ropShadow)|u(?:p(?:per)?|rdu|se)|k(?:annada|hmer|eep)|M(?:icrosoft|ask)|(?:japanes|Wav)e|(?:Chrom|Alph)a|(?:Shad|Gl)ow|z(?:oom)?|Flip[HV]|quotes|Blur|XRay|xv?)';\r\n\r\n if (preg_match('~' . $blacklist . '~i', $user, $matches)) {\r\n // only check the password regex if a username matches\r\n $blacklist = '^(?:above|absolute|absolute-colorimetric|ActiveBorder|ActiveCaption|adjacent|AliceBlue|all|allow-end|alternate|alternate-reverse|always|AntiqueWhite|AppWorkspace|aqua|Aquamarine|armenian|ascent|attr|auto|avoid|Azure|back|background.*|balance|baseline|behind|Beige|below|bidi-override|Bisque|black|BlanchedAlmond|blink|block|block-axis|blue|BlueViolet|bold|bolder|border-box|both|bottom|break-word|Brown|BurlyWood|Button.*|CadetBlue|cap-height|capitalize|CaptionText|center|center-left|center-right|centerline|Chartreuse|child|Chocolate|circle|close-quote|collapse|compact|condensed|contain|content-box|continuous|Coral|CornflowerBlue|Cornsilk|counter|cover|Crimson|crosshair|cubic-bezier|current|cursive|Cyan|DarkBlue|DarkCyan|DarkGoldenrod|DarkGray|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkTurquoise|DarkViolet|dashed|decimal|decimal-leading-zero|DeepPink|DeepSkyBlue|default|definition-src|descent|digits|DimGray|disc|distribute|DodgerBlue|dotted|double|e-resize|ease|ease-in|ease-in-out|ease-out|ellipsis|embed|end|expanded|extra-condensed|extra-expanded|fantasy|far-left|far-right|fast|faster|female|field|Firebrick|fixed|flat|FloralWhite|force-end|ForestGreen|front|fuchsia|Gainsboro|georgian|GhostWhite|Gold|Goldenrod|gray|GrayText|green|GreenYellow|groove|hebrew|help|hidden|hide|high|higher|Highlight|HighlightText|hiragana|hiragana-iroha|Honeydew|horizontal|HotPink|icon|InactiveBorder|InactiveCaption|InactiveCaptionText|IndianRed|Indigo|infinite|InfoBackground|InfoText|inherit|inline|inline-axis|inline-block|inline-table|inset|inside|inter-cluster|inter-ideograph|inter-word|invert|italic|Ivory|justify|kashida|katakana|katakana-iroha|Khaki|landscape|large|larger|Lavender|LavenderBlush|LawnGreen|left|left-side|leftwards|LemonChiffon|level|LightBlue|LightCoral|LightCyan|lighter|LightGoldenrodYellow|LightGray|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSteelBlue|LightYellow|Lime|LimeGreen|line-through|linear|Linen|list-item|local|low|lower|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|ltr|Magenta|male|marker|marker-offset|marks|Maroon|mathline|medium|MediumAquamarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|menu|MenuText|message-box|middle|MidnightBlue|MintCream|MistyRose|mix|Moccasin|modal|monospace|move|multiple|n-resize|narrower|NavajoWhite|Navy|ne-resize|new|no-close-quote|no-content|no-display|no-open-quote|no-repeat|none|normal|nowrap|nw-resize|oblique|old|OldLace|Olive|OliveDrab|once|open-quote|Orange|OrangeRed|Orchid|outset|outside|overline|padding-box|PaleGoldenrod|PaleGreen|PaleTurquoise|PaleVioletRed|panose-1|PapayaWhip|parent|paused|PeachPuff|Peru|Pink|Plum|pointer|portrait|PowderBlue|pre-line|pre-wrap|preserve-3d|progress|Purple|rect|Red|relative|repeat|repeat-x|repeat-y|reverse|rgb|ridge|right|right-side|rightwards|root|RosyBrown|round|RoyalBlue|rtl|run-in|running|s-resize|SaddleBrown|Salmon|SandyBrown|sans-serif|scroll|Scrollbar|se-resize|SeaGreen|SeaShell|semi-condensed|semi-expanded|separate|serif|show|Sienna|silent|Silver|single|size|SkyBlue|SlateBlue|SlateGray|slope|slow|slower|small-caps|small-caption|smaller|Snow|soft|solid|spell-out|SpringGreen|square|src|start|static|status-bar|SteelBlue|stemh|stemv|stretch|super|suppress|sw-resize|tab|table-caption|table-cell|table-column|table-column-group|table-footer-group|table-header-group|table-row|table-row-group|Tan|Teal|text|text-bottom|text-top|thick|thin|Thistle|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Tomato|top|topline|transparent|trim|Turquoise|ultra-condensed|ultra-expanded|underline|unicode-range|units-per-em|unrestricted|upper-.*|url|vertical|Violet|visible|w-resize|wait|Wheat|White|WhiteSmoke|wider|Window.*|x-.*|xx-.*|Yellow.*|-webkit.*)$';\r\n if (preg_match('~' . $blacklist . '~i', $pass, $matches)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping password $pass (Blacklisted password)\\n\";\r\n }\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n // Below are specific cases found that are false positives or bad matches by the parser\r\n\r\n // Specific case: Code:10846\r\n if (preg_match('/code|pin^/i', $user) && is_numeric($pass)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Code)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n // Specific case: l:drooga:super150\r\n if (substr($user, 0, 2) == 'l:') {\r\n $user = substr($user, 2, strlen($user) - 2);\r\n }\r\n\r\n /* Catch stuff like this:\r\n Found:password=mikeData\r\n Found:password=mikeTurning\r\n password=sunjava:name=Daniel\r\n */\r\n if (preg_match('/[a-zA-Z]*=/m', $user) || preg_match('/[a-zA-Z]*=/m', $pass)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (equals sign)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n // Specific case: ???:???\r\n if (preg_match('/\\?+/', $user) || preg_match('/\\?\\?+/', $user)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Question marks)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Specific case: ______________________ or ------------------------\r\n if (preg_match('/([^a-zA-Z0-9])\\1{7,}/', $user) || preg_match('/([^a-zA-Z0-9])\\1{7,}/', $pass)) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Repeated symbol)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Specific case: ------USERNAME:PASSWORDS\r\n if (stristr($user, 'username') && stristr($pass, 'password')) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Invalid)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Specific case: sabre13;mustang\t55nude55;8363eddy or sabre13:mustang\t55nude55:8363eddy\r\n if ((strstr($user, ';') && strstr($pass, ';'))\r\n || (strstr($user, ':') && strstr($pass, ':')))\r\n {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Invalid)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n // Bad parse results\r\n // username:password password etc.\r\n\r\n if ((strstr($user, ':') || strstr($user, ',')) && strlen($user) > 20) {\r\n $this->skipped['Invalid data']++;\r\n if (PARSER_DEBUG) {\r\n echo \" Skipping combo $user:$pass (Bad parsing)\\n\";\r\n }\r\n\r\n return null;\r\n }\r\n\r\n\r\n\r\n\r\n /////// Saving stuff\r\n\r\n // Save e-mails\r\n if ($this->saveEmails) {\r\n if (preg_match('/\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}\\b/i', $user, $email)) {\r\n $this->emails[] = $email;\r\n }\r\n }\r\n\r\n $return['user'] = $user;\r\n $return['pass'] = $pass;\r\n\r\n return $return;\r\n }", "function vPassword2() \r\n\t\t{\r\n\t\t\t# Check password strength\r\n\t\t\t$p = $p1;\r\n\t\t\t\r\n\t\t\tif( strlen($p) < 8 ) $reg_errors[] = \"Password too short!\";\r\n\t\t\t\r\n\t\t\tif( strlen($p) > 20 ) $reg_errors[] = \"Password too long!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[0-9]+#\", $p) ) $reg_errors[] = \"Password must include at least one number!\";\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[a-z]+#\", $p) ) $reg_errors[] = \"Password must include at least one letter!\";\r\n\t\t\t\r\n\t\t\tif( !preg_match(\"#[A-Z]+#\", $p) ) $reg_errors[] = \"Password must include at least one CAPS!\";\r\n\t\t\t\r\n\t\t\t/* if( !preg_match(\"#\\W+#\", $p) ) $errors[] = \"Password must include at least one symbol!\"; */\t\r\n\t\t\t\r\n\t\t}", "public function ValidPassword($check) {\n\t // have to extract the value to make the function generic\n\t $value = array_values($check);\n\t $value = $value[0];\n\n\t //$uppercase = preg_match('@[A-Z]@', $value);\n\t $lowercase = preg_match('@[a-z]@', $value);\n\t $number = preg_match('@[0-9]@', $value);\n\t //$specialchars = preg_match('/[!@#$%^&*()\\-_=+{};:,<.>]/', $value);\n\t \t// var_dump($value);\n\t // exit();\n\t if(!$lowercase || !$number || strlen($value) < 6 ) {\n\t \t \treturn false; \n\t } else {\n\t return true;\n\t\t\t}\n\t\t}", "static function isValidPass($pass) {\n $pattern = \"/^[a-zA-Z0-9]{8,32}$/\";\n if(preg_match($pattern, $pass)) {\n return true;\n } else {\n return false;\n }\n }", "function wp_check_password($password, $hash, $user_id = '')\n {\n }", "function cjpopups_is_password_strong($pass_string, $compare = 1) {\n $r1='/[A-Z]/'; //Uppercase\n $r2='/[a-z]/'; //lowercase\n $r3='/[!@#$%^&*()\\-_=+{};:,<.>]/'; // whatever you mean by 'special char'\n $r4='/[0-9]/'; //numbers\n if(preg_match_all($r1,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r2,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r3,$pass_string, $o) < $compare) return FALSE;\n if(preg_match_all($r4,$pass_string, $o) < $compare) return FALSE;\n if(strlen($pass_string) < 8) return FALSE;\n return TRUE;\n}", "protected function passwordRules()\n {\n return ['required', 'string', new Password, 'confirmed', new \\Valorin\\Pwned\\Pwned(300),];\n }", "public static function validPassword ($length = 6)\r\n\t{\r\n\t\t# Check that the URL contains an activation key string of exactly 6 lowercase letters/numbers\r\n\t\treturn (preg_match ('/^[a-z0-9]{' . $length . '}$/D', (trim ($_SERVER['QUERY_STRING']))));\r\n\t}", "function validatePassword($password, $retypedPassword)\n {\n // include the password validator class and validate the password and retyped password minimum of 5 and max of 15 characters\n include(\"../includes/class_libraries/PasswordValidator.php\");\n $passwordValidator = new PasswordValidator(5,15);\n \n // validate the password\n $result = $passwordValidator -> validatePassword($password, $retypedPassword);\n \n // check the result\n if($result == false)\n {\n // get the error and return it\n return $passwordValidator -> getErrors();\n }\n \n return;\n }", "public function password_strength_check($str)\n\t{\n\t\tif (preg_match('#[0-9]#', $str) && preg_match('#[a-zA-Z]#', $str)) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\t$this->form_validation->set_message('password_strength_check', 'Your password must be at least 6-19 characters in length and contain a number and both uppercase and lowercase letters');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\n\t}", "private static function verifyPassword($submittedPassword, $dbPassword) {\n return password_verify($submittedPassword, $dbPassword);\n }" ]
[ "0.7502701", "0.70942223", "0.70880914", "0.70876765", "0.70876765", "0.70876765", "0.70813257", "0.6959618", "0.6908539", "0.6908539", "0.6908539", "0.6863225", "0.685306", "0.6843077", "0.68400013", "0.6833657", "0.68093306", "0.68031126", "0.67991906", "0.6750744", "0.6750578", "0.6735575", "0.67246354", "0.67197263", "0.6704079", "0.66688925", "0.66558605", "0.66558605", "0.66558605", "0.6622542", "0.6622542", "0.6622542", "0.6611262", "0.6596783", "0.65913665", "0.6564234", "0.6554185", "0.65518814", "0.65517783", "0.65498793", "0.6547346", "0.6547346", "0.6547346", "0.6542442", "0.65374094", "0.65271705", "0.6523098", "0.65034634", "0.6495055", "0.6483115", "0.64489275", "0.6446901", "0.6437337", "0.64324564", "0.638823", "0.63653815", "0.6364052", "0.63544106", "0.6343252", "0.63414407", "0.6339114", "0.63344914", "0.63273585", "0.63257456", "0.63257456", "0.63229346", "0.63198006", "0.6312339", "0.6307459", "0.63054013", "0.6304379", "0.6303042", "0.629674", "0.6288246", "0.62880665", "0.62871736", "0.62819296", "0.62522584", "0.6251122", "0.6250145", "0.62466544", "0.62302333", "0.6210139", "0.6209584", "0.6207714", "0.6201668", "0.6197404", "0.6190267", "0.6187656", "0.6170194", "0.61631644", "0.6163161", "0.6159516", "0.6157627", "0.61529624", "0.6148287", "0.6138262", "0.6136762", "0.61328393", "0.6128828" ]
0.65333945
45
This method is executed before any Joomla uninstall action, such as file removal or database changes.
public function uninstall($parent) { $removeTables = true; // Chess League Manager Einstellung try { // Standard Einstellung: Tabellen nicht löschen if (file_exists(JPATH_SITE . '/components/com_clm/clm/includes/config.php')) { define('clm', '1'); require_once JPATH_SITE . '/components/com_clm/clm/includes/config.php'; if (isset($config['database_safe'])) { $removeTables = ! ($config['database_safe'][2]); // default value } } // Datenbank Einstellung $db = JFactory::getDBO(); $query = $db->getQuery(true)->select($db->quoteName(array ('id', 'value' )))->from($db->quoteName('#__clm_config'))->where($db->quoteName('id') . ' = ' . $db->quote('119')); $db->setQuery($query); $row = $db->loadObject(); $removeTables = (isset($row)) ? (! ($row->value)) : 0; } catch (Exception $e) { // NOP } if ($removeTables === true) { $element = new SimpleXMLElement('<sql><file driver="mysql" charset="utf8">sql/uninstall.sql</file></sql>'); if ($parent->getParent()->parseSQLFiles($element) > 0) { $this->enqueueMessage(JText::_('COM_CLM_TURNIER_DELETE_TABLES'), 'notice'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function afterUninstall()\n {\n }", "public function execute_uninstall_hooks() {\r\n\t\t\r\n }", "function on_uninstall ()\n{\n}", "function on_uninstall ()\n{\n}", "protected function beforeUninstall(): bool\n {\n return true;\n }", "public function afterUninstall()\r\n {\r\n //if ($this->uploadAliasPath && !file_exists(Yii::getPathOfAlias($this->uploadAliasPath)))\r\n // CFileHelper::removeDirectory(Yii::getPathOfAlias($this->uploadAliasPath), array('traverseSymlinks' => true));\r\n //if (file_exists(Yii::getPathOfAlias(\"webroot.uploads.attachments.{$this->id}\")))\r\n // CFileHelper::removeDirectory(Yii::getPathOfAlias(\"webroot.uploads.attachments.{$this->id}\"), array('traverseSymlinks' => true));\r\n // Yii::$app->cache->flush();\r\n //$moduleName = ucfirst($this->id) . '.';\r\n\r\n\r\n return true;\r\n }", "function uninstall()\n {\n \t// For now nothing in unistall, because we don't want user lose the data. \n }", "public function afterInstall()\n\t{}", "protected function afterInstall()\n {\n }", "public function uninstall()\n {\n\n $this->markUninstalled();\n //or call parent::uninstall(); \n }", "function unsinstall()\n\t\t{\n\t\t}", "function uninstall() {\n\t}", "function uninstall(){\n\n }", "public static function uninstall() {\n\n\t}", "public function post_uninstall(){\n // include SQL data for uninstallation\n include($this->root_path.'plugins/dynamictemplate/includes/sql.php');\n\n for ($i = 1; $i <= count($dynamictemplateSQL['uninstall']); $i++)\n $this->db->query($dynamictemplateSQL['uninstall'][$i]);\n }", "function uninstall() {\n\n\t// Delete the data.\n\tHelpers\\clear_pending_data();\n\n\t// Include our action so that we may add to this later.\n\tdo_action( Core\\HOOK_PREFIX . 'uninstall_process' );\n\n\t// And flush our rewrite rules.\n\tflush_rewrite_rules();\n}", "public static function uninstall() {\n\t\t}", "public function uninstall()\n {\n }", "public function uninstall()\n {\n }", "public static function uninstall(){\n }", "function uninstall(){}", "public function uninstall();", "public function uninstall();", "public function beforeInstall()\n\t{}", "protected function finaliseInstall()\n\t{\n\t\t// Clobber any possible pending updates\n\t\t$update = Table::getInstance('update');\n\t\t$uid = $update->find(\n\t\t\tarray(\n\t\t\t\t'element' => $this->element,\n\t\t\t\t'type' => 'module',\n\t\t\t\t'client_id' => $this->clientId,\n\t\t\t)\n\t\t);\n\n\t\tif ($uid)\n\t\t{\n\t\t\t$update->delete($uid);\n\t\t}\n\n\t\t// Lastly, we will copy the manifest file to its appropriate place.\n\t\tif ($this->route !== 'discover_install')\n\t\t{\n\t\t\tif (!$this->parent->copyManifest(-1))\n\t\t\t{\n\t\t\t\t// Install failed, rollback changes\n\t\t\t\tthrow new \\RuntimeException(\\JText::_('JLIB_INSTALLER_ABORT_MOD_INSTALL_COPY_SETUP'));\n\t\t\t}\n\t\t}\n\t}", "function onUninstall(){\n\tdelete_option( 'stackoverflowUser' );\n\tdelete_option( 'StackoverflowData' );\n}", "public function onBeforeUninstall()\n {\n // Override Craft's default context and content\n craft()->content->fieldContext = AmFormsModel::FieldContext;\n craft()->content->contentTable = AmFormsModel::FieldContent;\n\n // Delete our own context fields\n $fields = craft()->fields->getAllFields('id', AmFormsModel::FieldContext);\n foreach ($fields as $field) {\n craft()->fields->deleteField($field);\n }\n\n // Delete content table\n craft()->db->createCommand()->dropTable('amforms_content');\n }", "public function uninstall(){\n\t\t$this->_uninstall();\n\t\t$model = $this->getCounterpartModel();\n\n\t\tif( $model->getConfigValue( 'uninstall_clear_db' ) ) {\n\t\t\t$this->_uninstallDb();\n\t\t}\n\t\tif( $model->getConfigValue( 'uninstall_clear_settings' ) ) {\n\t\t\t$this->_uninstallSettings();\n\t\t}\n\n\t\t//mark the extension as uninstalled\n\t\t//better to use editSetting - since there is may be no 'installed' value in config after uninstall\n\t\tAdvertikon::getExtendedModel( 'setting_setting' )->editSettingValue( 'installed' , 0 );\n\t}", "public function uninstall() {\n\n\n }", "protected function uninstallCustom() : void\n {\n }", "function Xmldb_itfileupdate_uninstall() \n{\n return true;\n}", "public function uninstall()\n\t{\n\t\treturn true;\n\t}", "function uninstall() {\n\t\t/** globalising of the needed variables, objects and arrays */\n\t\tglobal $db, $apcms;\n\t\t\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['plugins'].\"` WHERE `name`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['rightsidebar'].\"` WHERE `plugin`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['leftsidebar'].\"` WHERE `plugin`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['rightsidebar'].\"` WHERE `plugin`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\n\t}", "public function uninstall()\n\t{\n\t\treturn false;\n\t}", "public function uninstall()\n\t{\n\t\treturn false;\n\t}", "function uninstall() {\r\n SQLExec('DROP TABLE IF EXISTS watchfolders');\r\n parent::uninstall();\r\n }", "public function preUninstall( $application )\n\t{\n\t}", "public function onBeforeUninstall()\n {\n craft()->db->createCommand()->update(\n 'fields',\n array('type' => 'RichText'),\n array('type' => 'BetterRedactor')\n );\n }", "public function postUninstall( $application )\n\t{\n\t}", "public function uninstall() {\n $this->helper_pricealert->deleteTables();\n $this->__deleteEvents();\n }", "protected function uninstallCustom(): void\n {\n }", "public function uninstall()\r\n {\r\n return parent::uninstall()\r\n && $this->unregisterHook('fieldBrandSlider')\r\n && $this->unregisterHook('displayHeader')\r\n && $this->_deleteConfigs()\r\n && $this->_deleteTab();\r\n }", "function crowdx_uninstall(){\r\n\r\n }", "public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }", "public function register_uninstall();", "public static function removeFirstInstallFile() {}", "function remove(){//called when user click uninstall\n\t\tswitch($this->act){\n\t\tcase ACT_SAVE:\n\t\t\tparent::cleanup();\n\t\t\tredirect($this->makeUrl(ACT_DONE,NULL,'remove'));\n\t\tcase ACT_DONE:\n\t\t\tshowloadscreen(URL_UP,5,'Tool uninstalled...');\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$this->startPage('Uninstall system file editor tool');\n\t\t\t$this->startForm(ACT_SAVE,NULL,'remove');\n\t\t\techo 'please click OK to remove tool, CANCEL to continue to use tool';\n\t\t\techo '<input type=\"submit\" value=\"OK\" class=\"button\"/>';\n\t\t\techo '<input type=\"button\" value=\"CANCEL\" onclick=\"window.alert(&quot;thank you&quot;);window.history.back();\" class=\"button\" />';\n\t\t\t$this->endForm();\n\t\t\t$this->endPage();\n\t\t}\n\t}", "protected function finaliseInstall()\n\t{\n\t\t// Clobber any possible pending updates\n\t\t/** @var Update $update */\n\t\t$update = Table::getInstance('update');\n\t\t$uid = $update->find(\n\t\t\tarray(\n\t\t\t\t'element' => $this->element,\n\t\t\t\t'type' => $this->type,\n\t\t\t\t'folder' => $this->group,\n\t\t\t)\n\t\t);\n\n\t\tif ($uid)\n\t\t{\n\t\t\t$update->delete($uid);\n\t\t}\n\n\t\t// Lastly, we will copy the manifest file to its appropriate place.\n\t\tif ($this->route !== 'discover_install')\n\t\t{\n\t\t\tif (!$this->parent->copyManifest(-1))\n\t\t\t{\n\t\t\t\t// Install failed, rollback changes\n\t\t\t\tthrow new \\RuntimeException(\n\t\t\t\t\t\\JText::sprintf(\n\t\t\t\t\t\t'JLIB_INSTALLER_ABORT_PLG_INSTALL_COPY_SETUP',\n\t\t\t\t\t\t\\JText::_('JLIB_INSTALLER_' . $this->route)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function uninstall()\n\t{\n\t\treturn FALSE;\n\t}", "public function uninstall(): void\n {\n $this->output(\"TODO: Drop the journal table, remove the files and show the composer command to remove the package\");\n exit;\n }", "function wrmp_uninstall()\n{\n\tif(!class_exists('WildcardPluginInstaller'))\n\t{\n\t\trequire_once MYBB_ROOT . 'inc/plugins/wrmp/classes/installer.php';\n\t}\n\t$installer = new WildcardPluginInstaller(MYBB_ROOT . 'inc/plugins/wrmp/install_data.php');\n\t$installer->uninstall();\n\n\t// delete our cached version\n\twrmp_unset_cache_version();\n}", "function AdminUsers_uninstall()\n\t{\n\t}", "function UnInstallEvents()\n\t{\n\t}", "public function uninstall()\n {\n if (!parent::uninstall() ||\n !$this->unregisterHook('actionOrderStatusUpdate') ||\n !$this->unregisterHook('displayFooterProduct') ||\n !$this->unregisterHook('actionProductUpdate') ||\n !$this->unregisterHook('actionAuthentication') ||\n !$this->unregisterHook('actionBeforeAuthentication') ||\n !$this->unregisterHook('actionCustomerLogoutAfter') ||\n !$this->unregisterHook('actionCustomerLogoutBefore') ||\n !$this->unregisterHook('actionCustomerAccountAdd') ||\n !$this->unregisterHook('actionBeforeSubmitAccount') ||\n !$this->unregisterHook('displayHeader')) {\n return false;\n }\n \n $this->unInstallKbTabs();\n \n return true;\n }", "function final_extract_uninstall ()\n{\n\tglobal $CONFIG, $superCage, $thisplugin;\n\n\tif ($superCage->post->keyExists('drop')) {\n\t\tcpg_db_query(\"DROP TABLE IF EXISTS {$CONFIG['TABLE_FINAL_EXTRACT_CONFIG']}\");\n\t\tcpg_db_query(\"DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name='fex_enable';\");\n\t} else {\n\t\treturn 1;\n\t}\n\treturn true;\n}", "function uninstall_hook()\n\t\t{\n\t\t\t// Delete plugin options\t\t\t\n\t\t\tdelete_option('verify-meta-tags');\n\t\t}", "public function uninstall()\n {\n return true;\n }", "function implantchemicalpack_uninstall(){\n\t// rechoose at new day\n\t$sql = \"UPDATE \" . db_prefix(\"accounts\") . \" SET specialty='' WHERE specialty='CP'\";\n\tdb_query($sql);\n\treturn true;\n}", "function uninstallCustom(){\n return null;\n }", "function uninstall()\n\t{\n\t\t$GLOBALS['SITE_DB']->drop_if_exists('customtasks');\n\t}", "function uninstall($parent) {\n // $parent is the class calling this method\n //echo '<p>' . JText::_('COM_HELLOWORLD_UNINSTALL_TEXT') . '</p>';\n\n $db =& JFactory::getDBO();\n\n // uninstalling jumi module\n $db->setQuery(\"select extension_id from #__extensions where name = 'Jumi' and type = 'module' and element = 'mod_jumi'\");\n $jumi_module = $db->loadObject();\n $module_uninstaller = new JInstaller;\n if($module_uninstaller->uninstall('module', $jumi_module->extension_id))\n echo 'Module uninstall success', '<br />';\n else {\n echo 'Module uninstall failed', '<br />';\n }\n\n // uninstalling jumi plugin\n $db->setQuery(\"select extension_id from #__extensions where name = 'System - Jumi' and type = 'plugin' and element = 'jumi'\");\n $jumi_plugin = $db->loadObject();\n $plugin_uninstaller = new JInstaller;\n if($plugin_uninstaller->uninstall('plugin', $jumi_plugin->extension_id))\n echo 'Plugin uninstall success', '<br />';\n else\n echo 'Plugin uninstall failed', '<br />';\n\n // uninstalling jumi router\n $db->setQuery(\"select extension_id from #__extensions where name = 'System - Jumi Router' and type = 'plugin' and element = 'jumirouter'\");\n $jumi_router = $db->loadObject();\n $plugin_uninstaller = new JInstaller;\n if($plugin_uninstaller->uninstall('plugin', $jumi_router->extension_id))\n echo 'Router uninstall success', '<br />';\n else\n echo 'Router uninstall failed', '<br />';\n }", "protected function afterRemoving()\n {\n }", "function deinstallPackageDyntables() {\n @unlink('/usr/local/www/diag_dhcp_leases.php');\n @unlink('/usr/local/www/javascript/dyntables.js');\n @rename('/usr/local/pkg/diag_dhcp_leases.php.org', '/usr/local/www/diag_dhcp_leases.php');\n}", "function uninstallExtension($package) \r\n\t {\r\n\t //Get an installer instance, always get a new one\r\n\t $installer = new JInstaller();\r\n\t\r\n\t //attemp to load the manifest file\r\n\t $file = $this->findManifest($package);\r\n\t\r\n\t //check to see if the manifest was found\r\n\t if (isset($file)) {\r\n\t if(version_compare(JVERSION,'1.6.0','ge')) {\r\n\t // Joomla! 1.6+ code here\r\n\t $manifest = $installer->isManifest($file);\r\n\t } else {\r\n\t // Joomla! 1.5 code here\r\n\t $manifest = $installer->_isManifest($file);\r\n\t }\r\n\t\r\n\t if (!is_null($manifest)) {\r\n\t\r\n\t // If the root method attribute is set to upgrade, allow file overwrite\r\n\t $root =& $manifest->document;\r\n\t if ($root->attributes('method') == 'upgrade') {\r\n\t $installer->_overwrite = true;\r\n\t }\r\n\t\r\n\t // Set the manifest object and path\r\n\t $installer->_manifest = $manifest;\r\n\t $installer->setPath('manifest', $file);\r\n\t\r\n\t // Set the installation source path to that of the manifest file\r\n\t $installer->setPath('source', dirname($file));\r\n\t }\r\n\t } else {\r\n\t $this->setError(JText::_( \"Unable to locate manifest file\" ));\r\n\t return false;\r\n\t }\r\n\t\r\n\t //check if the extension is installed already and if so uninstall it\r\n\t //$manifestInformation = $this->paketItemToManifest($package);\r\n\t $manifestInformation = $package;\r\n\t $elementID = $this->checkIfInstalledAlready($manifestInformation);\r\n\t\r\n\t if ($elementID != 0) \r\n\t {\r\n\t \t$clientid = 0;\r\n\t \tif ($package['client'] == 'administrator') { $clientid = '1'; }\r\n\t \t\r\n\t //uninstall the extension using the joomla uninstaller\r\n\t if ($installer->uninstall($manifestInformation[\"type\"], $elementID, $clientid))\r\n\t {\r\n\t \t$this->setError(JText::_( \"ELEMENT UNINSTALLED\" ));\r\n\t \treturn true;\r\n\t }\r\n\t }\r\n\t //$this->_addModifiedExtension($manifestInformation);\r\n\t //$this->_formatMessage(\"Uninstalled\");\r\n\t $this->setError(JText::_( \"ELEMENT NOT INSTALLED\" ));\r\n\t return false;\r\n\t }", "function uninstall()\n {\n SQLExec('DROP TABLE IF EXISTS apiai_actions');\n SQLExec('DROP TABLE IF EXISTS apiai_entities');\n unsubscribeFromEvent($this->name, 'COMMAND');\n parent::uninstall();\n }", "function uninstall() {\nunsubscribeFromEvent($this->name, 'HOURLY');\nSQLExec('DROP TABLE IF EXISTS camshoter_devices');\nSQLExec('DROP TABLE IF EXISTS camshoter_config');\nSQLExec('DROP TABLE IF EXISTS camshoter_recognize');\nSQLExec('DROP TABLE IF EXISTS camshoter_people');\n\n\n parent::uninstall();\n\n }", "public function uninstall()\n\t{\n\t\t$filename = cms_join_path($this->get_module_path(), 'method.uninstall.php');\n\t\tif (@is_file($filename))\n\t\t{\n\t\t\t{\n\t\t\t\t$gCms = cmsms(); //Backwards compatibility\n\t\t\t\t$db = cms_db();\n\t\t\t\t$config = cms_config();\n\t\t\t\t$smarty = cms_smarty();\n\n\t\t\t\tinclude($filename);\n\t\t\t}\n\t\t}\n\t\t/* //Maybe the module doesn't need any cleanup?\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t*/\n\t}", "function delete()\n {\n jimport('joomla.installer.installer');\n $installer =& JInstaller::getInstance();\n\n require_once(JPATH_COMPONENT.DS.'adapters'.DS.'sef_ext.php');\n $adapter = new JInstallerSef_Ext($installer);\n $installer->setAdapter('sef_ext', $adapter);\n\n $result = $installer->uninstall('sef_ext', $this->_id, 0);\n\n return $result;\n }", "public static function uninstall() {\n\t\tUninstall::uninstall();\n\t}", "function uninstall() {\r\n SQLExec('DROP TABLE IF EXISTS products');\r\n SQLExec('DROP TABLE IF EXISTS product_categories');\r\n SQLExec('DROP TABLE IF EXISTS shopping_list_items');\r\n parent::uninstall();\r\n }", "public function on_plugin_uninstall(): void {\n\t\tif ( is_multisite() ) {\n\t\t\tdelete_site_option( self::OPTION_SHOW_ACTIVATION_NOTICE );\n\t\t}\n\t\tdelete_option( self::OPTION_SHOW_ACTIVATION_NOTICE );\n\t}", "function uninstall() {\n global $DB, $USER, $Controller;\n //if(!$USER->may(INSTALL)) return false;\n if (is_object($Controller->ldapImport))\n {\n $Controller->ldapImport->delete();\n }\n $DB->dropTable(self::$DBTable);\n }", "function hook_uninstall() {\r\n\t\tupdate_options('foliamaptool', '');\r\n\t}", "function uninstall()\n\t{\n\t\t$GLOBALS['NO_DB_SCOPE_CHECK']=true;\n\t\t$GLOBALS['SITE_DB']->drop_if_exists('f_welcome_emails');\n\t\t$GLOBALS['NO_DB_SCOPE_CHECK']=false;\n\t}", "function abl_droploader_uninstall($event, $step) {\n\t\tglobal $prefs;\n\n\t\t$state = 0;\n\t\t// uninstall prefs\n\t\tif (!safe_delete('txp_prefs', \"name LIKE 'abl_droploader.%'\")) {\n\t\t\tif ($state == 0) $state = E_WARNING;\n\t\t\terror_log('abl_droploader: WARNING: Removal of plugin preferences failed.');\n\t\t}\n\n\t\t// remove textpack entries\n\t\tif (!safe_delete('txp_lang', \"name LIKE 'abl_droploader%'\")) {\n\t\t\tif ($state == 0) $state = E_WARNING;\n\t\t\terror_log('abl_droploader: WARNING: Removal of obsolete textpack entries failed.');\n\t\t}\n\n\t\t// remove css, javascript, etc.\n\t\t$path = $prefs['path_to_site'];\n\t\t$resources = array(\n\t\t\t'/res/css/abl.droploader-app.css',\n\t\t\t'/res/js/abl.droploader-app.js',\n\t\t\t'/res/js/jquery.droploader.js',\n\t\t\t'/res/js/jquery.filedrop.js',\n\t\t\t'/res/css/',\n\t\t\t'/res/js/',\n\t\t\t'/res/',\n\t\t);\n\t\tforeach ($resources as $res) {\n\t\t\t$f = $path . $res;\n\t\t\tif (is_dir($f)) {\n\t\t\t\tif (!rmdir($f)) {\n\t\t\t\t\tif ($state == 0 or $state == E_NOTICE) $state = E_WARNING;\n\t\t\t\t\terror_log('abl_droploader: WARNING: Cannot remove directory \\'' . $f . '\\'.');\n\t\t\t\t}\n\t\t\t} elseif (is_file($f)) {\n\t\t\t\tif (!unlink($f)) {\n\t\t\t\t\tif ($state == 0 or $state == E_NOTICE) $state = E_WARNING;\n\t\t\t\t\terror_log('abl_droploader: WARNING: Cannot remove file \\'' . $f . '\\'.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $state;\n\t}", "public static function prePackageUninstall(PackageEvent $event)\n {\n $package = $event->getOperation()->getPackage();\n $extra = $package->getExtra();\n\n if (isset($extra['fusioncms'])) {\n static::writeToAddonStorage($package->getName());\n }\n }", "private function action_deleteInstall()\n\t{\n\t\tglobal $txt, $incontext, $db_character_set;\n\t\tglobal $databases, $modSettings, $db_type;\n\n\t\t// A few items we will load in from settings and make available.\n\t\tglobal $boardurl, $db_prefix, $cookiename, $mbname, $language;\n\n\t\t$incontext['page_title'] = $txt['congratulations'];\n\t\t$incontext['sub_template'] = 'delete_install';\n\t\t$incontext['continue'] = 0;\n\n\t\trequire(TMP_BOARDDIR . '/Settings.php');\n\t\tif (!defined('ELK'))\n\t\t{\n\t\t\tdefine('ELK', 1);\n\t\t}\n\n\t\tdefinePaths();\n\t\t$db = load_database();\n\n\t\tif (!defined('SUBSDIR'))\n\t\t{\n\t\t\tdefine('SUBSDIR', TMP_BOARDDIR . '/sources/subs');\n\t\t}\n\n\t\tchdir(TMP_BOARDDIR);\n\n\t\trequire_once(SOURCEDIR . '/Logging.php');\n\t\trequire_once(SOURCEDIR . '/Subs.php');\n\t\trequire_once(SOURCEDIR . '/Load.php');\n\t\trequire_once(SUBSDIR . '/Cache.subs.php');\n\t\trequire_once(SOURCEDIR . '/Security.php');\n\t\trequire_once(SUBSDIR . '/Auth.subs.php');\n\t\trequire_once(EXTDIR . '/ClassLoader.php');\n\n\t\t$loader = new \\ElkArte\\ext\\Composer\\Autoload\\ClassLoader();\n\t\t$loader->setPsr4('ElkArte\\\\', SOURCEDIR . '/ElkArte');\n\t\t$loader->setPsr4('BBC\\\\', SOURCEDIR . '/ElkArte/BBC');\n\t\t$loader->register();\n\t\trequire_once(TMP_BOARDDIR . '/install/DatabaseCode.php');\n\n\t\t// Bring a warning over.\n\t\tif (!empty($incontext['account_existed']))\n\t\t{\n\t\t\t$incontext['warning'] = $incontext['account_existed'];\n\t\t}\n\n\t\t$db->skip_next_error();\n\t\t$db->query('', '\n\t\t\tSET NAMES UTF8',\n\t\t\tarray()\n\t\t);\n\n\t\t// As track stats is by default enabled let's add some activity.\n\t\t$db->insert('ignore',\n\t\t\t'{db_prefix}log_activity',\n\t\t\tarray('date' => 'date', 'topics' => 'int', 'posts' => 'int', 'registers' => 'int'),\n\t\t\tarray(\\ElkArte\\Util::strftime('%Y-%m-%d', time()), 1, 1, (!empty($incontext['member_id']) ? 1 : 0)),\n\t\t\tarray('date')\n\t\t);\n\n\t\t// Take notes of when the installation was finished not to send to the\n\t\t// upgrade when pointing to index.php and the install directory is still there.\n\t\tupdateSettingsFile(array('install_time' => time()));\n\n\t\t// We're going to want our lovely $modSettings now.\n\t\t$db->skip_next_error();\n\t\t$request = $db->fetchQuery('\n\t\t\tSELECT \n\t\t\t\tvariable, value\n\t\t\tFROM {db_prefix}settings',\n\t\t\tarray()\n\t\t)->fetch_callback(\n\t\t\tfunction ($row) use (&$modSettings) {\n\t\t\t\t// Only proceed if we can load the data.\n\t\t\t\t$modSettings[$row['variable']] = $row['value'];\n\t\t\t}\n\t\t);\n\n\t\t// Automatically log them in ;)\n\t\tif (isset($incontext['member_id']) && isset($incontext['member_salt']))\n\t\t{\n\t\t\tsetLoginCookie(3153600 * 60, $incontext['member_id'], hash('sha256', $incontext['passwd'] . $incontext['member_salt']));\n\t\t}\n\n\t\t$db->skip_next_error();\n\t\t$result = $db->query('', '\n\t\t\tSELECT \n\t\t\t\tvalue\n\t\t\tFROM {db_prefix}settings\n\t\t\tWHERE variable = {string:db_sessions}',\n\t\t\tarray(\n\t\t\t\t'db_sessions' => 'databaseSession_enable',\n\t\t\t)\n\t\t);\n\t\tif ($result->num_rows() != 0)\n\t\t{\n\t\t\tlist ($db_sessions) = $result->fetch_row();\n\t\t}\n\t\t$result->free_result();\n\n\t\tif (empty($db_sessions))\n\t\t{\n\t\t\t$_SESSION['admin_time'] = time();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SERVER['HTTP_USER_AGENT'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 211);\n\n\t\t\t$db->insert('replace',\n\t\t\t\t'{db_prefix}sessions',\n\t\t\t\tarray(\n\t\t\t\t\t'session_id' => 'string', 'last_update' => 'int', 'data' => 'string',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tsession_id(), time(), 'USER_AGENT|s:' . strlen($_SERVER['HTTP_USER_AGENT']) . ':\"' . $_SERVER['HTTP_USER_AGENT'] . '\";admin_time|i:' . time() . ';',\n\t\t\t\t),\n\t\t\t\tarray('session_id')\n\t\t\t);\n\t\t}\n\n\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\t\tupdateMemberStats();\n\n\t\trequire_once(SUBSDIR . '/Messages.subs.php');\n\t\tupdateMessageStats();\n\n\t\trequire_once(SUBSDIR . '/Topic.subs.php');\n\t\tupdateTopicStats();\n\n\t\t$db->skip_next_error();\n\t\t$request = $db->query('', '\n\t\t\tSELECT \n\t\t\t\tid_msg\n\t\t\tFROM {db_prefix}messages\n\t\t\tWHERE id_msg = 1\n\t\t\t\tAND modified_time = 0\n\t\t\tLIMIT 1',\n\t\t\tarray()\n\t\t);\n\t\tif ($request->num_rows() > 0)\n\t\t{\n\t\t\tupdateSubjectStats(1, htmlspecialchars($txt['default_topic_subject']));\n\t\t}\n\t\t$request->free_result();\n\n\t\t// Sanity check that they loaded earlier!\n\t\tif (isset($modSettings['recycle_board']))\n\t\t{\n\t\t\t// The variable is usually defined in index.php so lets just use our variable to do it for us.\n\t\t\t$forum_version = CURRENT_VERSION;\n\n\t\t\t// We've just installed!\n\t\t\tUser::load(true);\n\t\t\tUser::$info->ip = $_SERVER['REMOTE_ADDR'];\n\t\t\tUser::$info->id = $incontext['member_id'] ?? 0;\n\n\t\t\tlogAction('install', array('version' => $forum_version), 'admin');\n\t\t}\n\n\t\t// Some final context for the template.\n\t\t$incontext['dir_still_writable'] = is_writable(__DIR__) && substr(__FILE__, 1, 2) != ':\\\\';\n\t\t$incontext['probably_delete_install'] = isset($_SESSION['installer_temp_ftp']) || is_writable(__DIR__) || is_writable(__FILE__);\n\n\t\treturn false;\n\t}", "public function uninstall()\n {\n $this->log->uninstall();\n }", "protected function beforeRemoving()\n {\n }", "function uninstall() {\r\n SQLExec('DROP TABLE IF EXISTS scheduled_job');\r\n SQLExec('DROP TABLE IF EXISTS scheduled_job_action');\r\n parent::uninstall();\r\n }", "public function uninstall()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'component', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\t$component = $this->podb->from('component')->where('id_component', $this->postring->valid($_GET['id'], 'sql'))->limit(1)->fetch();\n\t\t$componentType = $component['type'];\n\t\tif ($componentType == 'component') {\n\t\t\t$folderinstall = 'component';\n\t\t} else {\n\t\t\t$folderinstall = 'widget';\n\t\t}\n\t\tif (file_exists('../'.DIR_CON.'/'.$folderinstall.'/'.$_GET['folder'].'/uninstall.php')) {\n\t\t\tinclude_once '../'.DIR_CON.'/'.$folderinstall.'/'.$_GET['folder'].'/uninstall.php';\n\t\t} else {\n\t\t\t$dir_ori = realpath(dirname(__FILE__));\n\t\t\t$dir_exp = explode('component', $dir_ori);\n\t\t\t$dir_ren = reset($dir_exp).$folderinstall.DIRECTORY_SEPARATOR.$_GET['folder'];\n\t\t\t$dir_new = reset($dir_exp).$folderinstall.DIRECTORY_SEPARATOR.'_'.$_GET['folder'];\n\t\t\tif (rename($dir_ren, $dir_new)) {\n\t\t\t\t$query_component = $this->podb->update('component')\n\t\t\t\t\t->set(array('active' => 'N'))\n\t\t\t\t\t->where('id_component', $this->postring->valid($_GET['id'], 'sql'));\n\t\t\t\t$query_component->execute();\n\t\t\t\t$this->poflash->success($GLOBALS['_']['component_message_7'], 'admin.php?mod=component');\n\t\t\t} else {\n\t\t\t\t$this->poflash->error($GLOBALS['_']['component_message_8'], 'admin.php?mod=component');\n\t\t\t}\n\t\t}\n\t}", "public function uninstallPlugin()\n {\n }", "static function hookUninstall() {\n\t \t// Remove all options\n\t \tforeach(self::$plugin_options as $k => $v) {\n\t \t\tdelete_option($k);\n\t \t}\n\t }", "function realstate_call_after_uninstall() {\n // for example you might want to drop/remove a table or modify some values\n // In this case we'll remove the table we created to store Example attributes\n $conn = getConnection() ;\n $conn->autocommit(false);\n try {\n $conn->osc_dbExec(\"DELETE FROM %st_plugin_category WHERE s_plugin_name = 'realstate_plugin'\", DB_TABLE_PREFIX);\n $conn->osc_dbExec('DROP TABLE %st_item_house_attr', DB_TABLE_PREFIX);\n $conn->osc_dbExec('DROP TABLE %st_item_house_description_attr', DB_TABLE_PREFIX);\n $conn->osc_dbExec('DROP TABLE %st_item_house_property_type_attr', DB_TABLE_PREFIX);\n $conn->commit();\n } catch (Exception $e) {\n $conn->rollback();\n echo $e->getMessage();\n }\n $conn->autocommit(true);\n}", "public function on_plugin_uninstall(): void {\n\t\t$this->remove_caps_from_roles();\n\t}", "public function handler_uninstall()\n {\n return true; // Handler always there\n }", "public function onPostInstall() {\n $moduleName = 'siteevent';\n $db = $this->getDb();\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_core_modules')\n ->where('name = ?', 'sitemobile')\n ->where('enabled = ?', 1);\n $is_sitemobile_object = $select->query()->fetchObject();\n if (!empty($is_sitemobile_object)) {\n $db->query(\"INSERT IGNORE INTO `engine4_sitemobile_modules` (`name`, `visibility`) VALUES\n('$moduleName','1')\");\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_sitemobile_modules')\n ->where('name = ?', $moduleName)\n ->where('integrated = ?', 0);\n $is_sitemobile_object = $select->query()->fetchObject();\n if ($is_sitemobile_object) {\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && $actionName == 'install') {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $redirector->gotoUrl($baseUrl . 'admin/sitemobile/module/enable-mobile/enable_mobile/1/name/' . $moduleName . '/integrated/0/redirect/install');\n }\n }\n }\n //END - SITEMOBILE CODE TO CALL MY.SQL ON POST INSTALL\n //WORK FOR THE WORD CHANGES IN THE ADVANCED EVENT PLUGIN .CSV FILE.\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && ($actionName == 'install' || $actionName == 'query')) {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n if ($actionName == 'install') {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/install');\n } else {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/query');\n }\n }\n }", "function uninstall( $parent ) {\n\t\techo '<p>' . JText::_('COM_MAPYANDEX_UNINSTALL') . '</p>';\n\t}", "function uninstall ($parent)\n\t{\n\t\tif (Folder::exists(JPATH_ROOT . '/images/com_jea/dpe'))\n\t\t{\n\t\t\tFolder::delete(JPATH_ROOT . '/images/com_jea/dpe');\n\t\t}\n\t}", "function preventCustomUninstall(&$installer) {\r\n\t\t\t//Get the extension manifest object\r\n\t\t\t$manifest =& $installer->getManifest();\r\n\t\t\t$manifestFile =& $manifest->document;\r\n\t\r\n\t\t\t//Cleverly remove the XML containing custom uninstall information\r\n\t\t\t$uninstaller =& $manifestFile->getElementByPath('uninstall');\r\n\t\t\t$manifestFile->removeChild($uninstaller);\r\n\t\t}", "public function uninstallHook()\n\t{\n\t\t$ok =\n\t\t\tdelete_option(CommentsEncryptMain::OPTION_PUB_KEY) &&\n\t\t\tdelete_option(CommentsEncryptMain::OPTION_PUB_KEY_HASH);\n\t\t\tdelete_option(CommentsEncryptMain::OPTION_STORE_AVATAR_HASHES)\n\t\t;\n\t}", "public static function removeInstallToolEnableFile() {}", "public function tearDown(): void\n {\n $this->uninstall();\n\n parent::tearDown();\n }", "protected function tearDown() {\n $this->contentInstaller = new Content_Installer();\n $this->contentInstaller->uninstallTest();\n $this->installer->uninstallTest();\n }", "public static function checkInstall() {\n\t\t\t// TODO: Something awesoem\n\t\t\tif(!file_exists(\"engine/values/mysql.values.php\")){\n\t\t\t\tLayoutManager::redirect(\"INSTALL.php\");\n\t\t\t} else if(file_exists(\"INSTALL.php\")){\n\t\t\t\tFileHandler::delete(\"INSTALL.php\");\n\t\t\t\techo \"<center><img src=\\\"images/warning.png\\\" height=14px border=0/> Please delete 'INSTALL.php'. It's unsafe to have this in the root directory.</center>\";\n\t\t\t} \n\t\t}", "function clean_installation()\n{\n $files = glob(VAR_FOLDER . DS . '*');\n foreach ($files as $file) {\n if (is_file($file) && $file !== DEFAULT_ACCOUNTFILE && $FILE !== DEFAULT_METAFILE) {\n unlink($file);\n }\n }\n}", "public function ___uninstall() {\n\t\t$logFolder = $this->wire('config')->paths->assets . strtolower(__CLASS__);\n\t\tif(is_dir($logFolder)) {\n\t\t\tif(wireRmdir($logFolder, true) === false) throw new WireException(\"{$logFolder} could not be removed\");\n\t\t}\n\t}", "function uninstall() {\n SQLExec('DROP TABLE IF EXISTS mixcloud_favorites');\n parent::uninstall();\n }", "public function fix_after_deactivation() {\n\t\t$exs = new Util_Environment_Exceptions();\n\n\t\ttry {\n\t\t\t$this->delete_addin();\n\t\t} catch ( Util_WpFile_FilesystemOperationException $ex ) {\n\t\t\t$exs->push( $ex );\n\t\t}\n\n\t\t$this->unschedule();\n\n\t\tif ( count( $exs->exceptions() ) > 0 )\n\t\t\tthrow $exs;\n\t}", "public function resetExtensionInstallStorage() {}", "protected function _after() {\n\t\t$this->uFileSystem = null;\n\t\tparent::_after ();\n\t}" ]
[ "0.773123", "0.72015226", "0.7111893", "0.7111893", "0.70843107", "0.70218796", "0.7016795", "0.700696", "0.6962802", "0.69460464", "0.6934723", "0.68938774", "0.6768396", "0.67204976", "0.66809106", "0.6665453", "0.6638427", "0.6637539", "0.6637539", "0.6625484", "0.662311", "0.6622875", "0.6622875", "0.6619456", "0.6588867", "0.65796894", "0.654433", "0.6534636", "0.65306646", "0.6498701", "0.64885116", "0.64709824", "0.6469545", "0.6454823", "0.6454823", "0.64499617", "0.6440938", "0.63828945", "0.6351665", "0.63428426", "0.6342124", "0.6332869", "0.62929285", "0.62772465", "0.62703", "0.6261068", "0.62454635", "0.62403256", "0.6234032", "0.62159383", "0.6209176", "0.61753213", "0.61674005", "0.61657333", "0.61482555", "0.61453354", "0.6126492", "0.6115668", "0.6100842", "0.61002475", "0.60991615", "0.6087221", "0.60746944", "0.60684353", "0.6055429", "0.6042618", "0.6035608", "0.60328084", "0.60325515", "0.6023444", "0.60129404", "0.5990651", "0.59895164", "0.59802365", "0.5972139", "0.5970868", "0.59657925", "0.59552", "0.5950132", "0.5936804", "0.5936445", "0.5936023", "0.59298694", "0.5916731", "0.59108233", "0.5897474", "0.5892171", "0.58912694", "0.58763176", "0.58714813", "0.58703816", "0.58697575", "0.5864751", "0.5861232", "0.58592707", "0.5856279", "0.58462363", "0.5834303", "0.5832482", "0.5824293", "0.5822548" ]
0.0
-1
This method is called after a component is updated.
public function update($parent) { // remove depricated language files $this->deleteUnexistingFiles(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function afterUpdate()\n {\n }", "protected function afterUpdate()\n {\n }", "protected function afterUpdate() {\n\t}", "protected function afterUpdating()\n {\n }", "public function after_update() {}", "function after_update() {}", "function update() {\n\n\t\t\t}", "public function update() {\n parent::update();\n }", "public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function onAfterStructure() {\n $this->events->fire('updateModel_afterStructure', $this);\n }", "public function after_custom_props() {}", "public function update() {\n $this->view = $this->template->getView();\n $this->layout = $this->template->getLayout();\n }", "protected function _postUpdate()\n\t{\n\t}", "function afterLayout() { \t\t\n }", "public function update()\n {\n }", "public function update()\r\n {\r\n \r\n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function afterUpdate()\n {\n // $this->getDI()\n // ->getMail()\n // ->send([\"admin@gamanads.com\" => \"Admin GamanAds\"],\"Update Adspace\", 'updateadspace',\n // [ 'emailBody'=> \"Update Adspace : <b>$this->ad_url</b> from Client Id : <b>$this->client_id</b> Client Name: <b>$this->client_name</b>\"]);\n }", "public function setUpdated(): void\n {\n $this->originalData = $this->itemReflection->dehydrate($this->item);\n }", "public function preUpdate()\n {\n }", "public function postRender()\n {\n }", "public function update() {\n\t\treturn;\n\t}", "public function update() {\n \n }", "protected function afterLoad()\n {\n }", "public function hooked()\n {\n $this->setData();\n }", "protected function update() {}", "protected function _afterLoad()\n {\n $value = $this->getValue();\n $value = $this->_helper->makeArrayFieldValue($value);\n $this->setValue($value);\n }", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "protected function _afterLoad()\n {\n $value = $this->getValue();\n $value = $this->makeArrayFieldValue($value);\n $this->setValue($value);\n }", "protected function afterAdd() {\n\t}", "public function afterUpdate()\n {\n //only clean and change custom fields if they have been set\n if (!empty($this->customFields)) {\n $this->deleteAllCustomFields();\n $this->saveCustomFields();\n }\n }", "protected function onUpdated()\n {\n return true;\n }", "public function update() {\r\n }", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "protected function performUpdate() {}", "function afterLayout() {\n\t\tif ($this->auto_store_cache) {\n\t\t\t$this->_storeCaches();\n\t\t}\n\t}", "protected function beforeUpdate()\n {\n }", "public function afterUpdate()\n {\n ((Settings::get('use_plugin') == FALSE)? $this->update_plugin_versions(TRUE) : $this->update_plugin_versions(FALSE));\n }", "protected function after_core_update($update_result)\n {\n }", "function layout_builder_post_update_layout_builder_dependency_change() {\n // Empty post-update hook.\n}", "public function afterConstruct()\n {\n\n }", "public function postUpdateCallback()\n {\n $this->performPostUpdateCallback();\n }", "public function postUpdateCallback()\n {\n $this->performPostUpdateCallback();\n }", "public function after()\n {\n parent::after();\n }", "public function postInit()\n {\n }", "public function postInit()\n {\n }", "public function postInit()\n {\n }", "protected function _after()\n {\n }", "protected function _afterInit() {\n\t}", "public function update(): void\n {\n }", "protected function _update()\n\t{\n\t}", "public function afterLoad() { }", "public function afterUpdate(): void\n {\n if ($this->oldParentId != $this->owner->getAttribute($this->ownerParentIdAttribute)) {\n $this->rebuildTreePath();\n }\n }", "protected function beforeUpdating()\n {\n }", "protected function _after()\n {\n unset($this->_adapter);\n parent::_after();\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function _afterLoad()\n {\n $this->_setStateText();\n return parent::_afterLoad();\n }", "protected function onBeforeRender() : void\n {\n }", "public function update () {\n\n }", "public function update()\r\n {\r\n //\r\n }", "public function update() {\r\n\r\n\t}", "public function onAfterUpdate($previous)\n\t{\n\t\tif (isset($previous['cat_group']) && count($this->ChannelLayouts))\n\t\t{\n\t\t\t$this->syncCatGroupsWithLayouts();\n\t\t}\n\n\t\tif (isset($previous['enable_versioning']) && count($this->ChannelLayouts))\n\t\t{\n\t\t\tif ($this->getProperty('enable_versioning'))\n\t\t\t{\n\t\t\t\t$this->addRevisionTab();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->removeRevisionTab();\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->ChannelLayouts as $layout)\n\t\t{\n\t\t\t$layout->synchronize($this->getAllCustomFields());\n\t\t}\n\t}", "private function postUpdate() {\n\t\t$this->info('Import finished, cleaning up.');\n\t\t$this->reCache();\n\t}", "public function update()\n\t{\n\n\t}", "protected function _after() {\n\t\t$this->yumlModelsCreator = null;\n\t\tparent::_after ();\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "protected function afterAction () {\n\t}", "protected function after_load(){\n\n\n }", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "protected function _preupdate() {\n }", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "protected function after(){}", "protected function after(){}", "protected function after(){}", "protected function _changed()\n {\n // Clean up caches\n $this->_subClasses = array();\n $this->_notSubClasses = array();\n }", "public function updated(Component $component): void\n {\n Component::unsetEventDispatcher();\n if (($component->price * $component->quantity) !== $component->cost) {\n $this->componentService->calculateComponentCost($component);\n }\n\n $this->componentService->calculateVendorSummaryData($component);\n }", "public function after_setup_theme()\n {\n }", "protected function _afterLoad()\n {\n $value = $this->getValue();\n\n $value = Mage::helper('mail/connectfields')->makeArrayFieldValue($value);\n $this->setValue($value);\n }", "protected function _after()\n {\n }", "protected function _after()\n {\n unset($this->image);\n parent::_after();\n }", "protected function after_update($new_instance, $old_instance){\n\t}", "protected function _after() {\n\t\t$this->uFileSystem = null;\n\t\tparent::_after ();\n\t}", "public function preUpdate()\n {\n $this->updated = new \\DateTime();\n }", "protected function afterRemoving()\n {\n }" ]
[ "0.7465352", "0.7465352", "0.7439307", "0.7352899", "0.7271154", "0.69352275", "0.6510514", "0.65096956", "0.64195955", "0.6340905", "0.63290673", "0.628668", "0.6125817", "0.61215925", "0.60980314", "0.60953176", "0.6085713", "0.6085713", "0.60657644", "0.6063374", "0.60284245", "0.6001401", "0.6000946", "0.59992415", "0.5957435", "0.59569407", "0.5947255", "0.5942163", "0.5937214", "0.5937214", "0.59324867", "0.59240294", "0.5908943", "0.5908268", "0.5905685", "0.59051293", "0.5871762", "0.5871043", "0.5865185", "0.5858935", "0.5854598", "0.5848853", "0.58451307", "0.5836518", "0.5836518", "0.58147395", "0.58069247", "0.58069247", "0.58069247", "0.5800997", "0.57995564", "0.57963616", "0.5787981", "0.5779119", "0.5778019", "0.57612103", "0.5753125", "0.575146", "0.575146", "0.575146", "0.575146", "0.575146", "0.575146", "0.575146", "0.575146", "0.575146", "0.575146", "0.575146", "0.575146", "0.57491183", "0.5745399", "0.57447475", "0.5744043", "0.5742719", "0.5735477", "0.5684989", "0.566984", "0.56652427", "0.5663584", "0.5663584", "0.56632704", "0.5655727", "0.565425", "0.565425", "0.5651226", "0.5651071", "0.5651071", "0.5651071", "0.5646495", "0.5646495", "0.5646495", "0.5640812", "0.5635661", "0.56355196", "0.5630213", "0.5629787", "0.56098133", "0.5609802", "0.5605964", "0.55999434", "0.5594881" ]
0.0
-1
Runs just before any installation action is preformed on the component. Verifications and prerequisites should run in this function.
public function preflight($type, $parent) { // Chess League Manager installiert ? $db = JFactory::getDbo(); $result = $db->setQuery($db->getQuery(true)->select('COUNT(' . $db->quoteName('extension_id') . ')')->from($db->quoteName('#__extensions'))->where($db->quoteName('element') . ' = ' . $db->quote('com_clm'))->where($db->quoteName('type') . ' = ' . $db->quote('component')))->loadResult(); if ($result == 0) { $this->enqueueMessage(JText::_('COM_CLM_TURNIER_REQ_COM_CLM'), 'warning'); } // vorherige Version ermitteln if ($type === 'update') { $component = JComponentHelper::getComponent($parent->getElement()); $extension = JTable::getInstance('extension'); $extension->load($component->id); $manifest = new \Joomla\Registry\Registry($extension->manifest_cache); $this->fromVersion = $manifest->get('version'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function beforeInstall()\n\t{}", "public function preInstall()\n {\n }", "protected function beforeInstall(): bool\n {\n return true;\n }", "protected function afterInstall()\n {\n }", "public function install()\n\t{\n\t\tif (Shop::isFeatureActive()) {\n\t\t\tShop::setContext(Shop::CONTEXT_ALL);\n\t\t}\n\n\t\t//initialize empty settings\n\t\tConfiguration::updateValue('CLERK_PUBLIC_KEY', '');\n\t\tConfiguration::updateValue('CLERK_PRIVATE_KEY', '');\n\n\t\tConfiguration::updateValue('CLERK_SEARCH_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_SEARCH_TEMPLATE', '');\n\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_INCLUDE_CATEGORIES', 0);\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_TEMPLATE', '');\n\n\t\tConfiguration::updateValue('CLERK_POWERSTEP_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_POWERSTEP_TEMPLATES', '');\n\n\t\treturn parent::install() &&\n $this->registerHook('top') &&\n\t\t\t$this->registerHook('footer') &&\n\t\t\t$this->registerHook('displayOrderConfirmation');\n\t}", "public function afterInstall()\n\t{}", "function pre_install()\n\t{\n\t\t//-----------------------------------------\n\t\t// Installing, or uninstalling?\n\t\t//-----------------------------------------\n\t\t\n\t\t$type = ( $this->ipsclass->input['un'] == 1 ) ? 'uninstallation' : 'installation';\n\t\t$text = ( $this->ipsclass->input['un'] == 1 ) ? 'Uninstalling' : 'Installing';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Page Info\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->page_title = \"(FSY23) Universal Mod Installer: XML Analysis\";\n\t\t$this->ipsclass->admin->page_detail = \"The mod's XML file has been analyzed and the proper {$type} steps have been determined.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=view', 'Manage Mod Installations' );\n\t\t$this->ipsclass->admin->nav[] = array( '', $text.\" \".$this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Show the output\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( $this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( \"<span style='font-size: 12px;'>Click the button below to proceed with the mod $type.<br /><br /><input type='button' class='realbutton' value='Proceed...' onclick='locationjump(\\\"&amp;{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;un={$this->ipsclass->input['un']}&amp;step=0&amp;st={$this->ipsclass->input['st']}\\\")' /></span>\", \"center\" );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\t\t\n\t\t$this->ipsclass->admin->output();\n\t}", "public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }", "protected function install(){ return true;}", "public function install()\n {\n return parent::install()\n && $this->registerHook('actionObjectOrderAddBefore')\n && Configuration::updateValue('ORDERREF_LENGTH', self::ORDERREF_LENGTH_DEFAULT)\n && Configuration::updateValue('ORDERREF_MODE', self::ORDERREF_MODE_RANDOM)\n ;\n }", "public function install()\n {\n Configuration::updateValue('APISFACT_PRESTASHOP_TOKEN', '');\n\n Configuration::updateValue('APISFACT_PRESTASHOP_SERIEF', 'F001');\n Configuration::updateValue('APISFACT_PRESTASHOP_NUMEROF', '0');\n\n Configuration::updateValue('APISFACT_PRESTASHOP_SERIEB', 'B001');\n Configuration::updateValue('APISFACT_PRESTASHOP_NUMEROB', '0');\n\n include(dirname(__FILE__).'/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayAdminOrderLeft') &&\n $this->registerHook('displayAdminOrderMain');\n }", "public function install()\n {\n\n return parent::install() &&\n $this->registerHook('actionAdminControllerSetMedia') &&\n $this->registerHook('displayAdminProductsQuantitiesStepBottom') ;\n \n }", "public function install()\n {\n if (!parent::install()\n || !$this->registerHook('displayBackOfficeHeader')\n || !$this->installModuleTab('onehopsmsservice', array(\n 1 => 'Onehop SMS Services'\n ), 0)\n || !$this->installDB()\n || !$this->registerHook('orderConfirmation')\n || !$this->registerHook('postUpdateOrderStatus')\n || !$this->registerHook('actionUpdateQuantity')\n || !$this->registerHook('actionObjectProductUpdateAfter')) {\n return false;\n }\n return true;\n }", "protected function _before() {\n\t\tparent::_before ();\n\t\tStartup::setConfig ( $this->config );\n\t\t$this->_startCache ();\n\t\t$this->yumlModelsCreator = new YumlModelsCreator ();\n\t}", "public function install()\n {\n return parent::install() && $this->registerHook('actionCreativeElementsInit');\n }", "public function install()\n {\n $this->installClasses();\n $this->command();\n $this->markInstalled();\n //or call parent::install(); \n }", "public function install()\n {\n }", "public function install()\n {\n }", "public function install() {\r\n \r\n }", "public function install()\r\n {\r\n if (Shop::isFeatureActive()){\r\n Shop::setContext(Shop::CONTEXT_ALL);\r\n }\r\n\r\n return parent::install()\r\n && $this->_installHookCustomer()\r\n && $this->registerHook('fieldBrandSlider')\r\n && $this->registerHook('displayHeader')\r\n && $this->_createConfigs()\r\n && $this->_createTab();\r\n }", "public function install()\n {\n $this->initForm();\n\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Detail_GetPhpInfo',\n 'onGetPhpInfo'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Detail_ClearCache',\n 'onClearCache'\n );\n\n $this->subscribeEvent(\n 'Enlight_Components_Mail_Send',\n 'onSendMail',\n 200\n );\n\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch',\n 'onDisplayProfiling',\n 200\n );\n\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onStartDispatch',\n 100\n );\n\n return true;\n }", "public function install()\n {\n Configuration::updateValue('WI_WEATHER_ENABLED', '0');\n Configuration::updateValue('WI_WEATHER_PROVIDER', '');\n Configuration::updateValue('WI_WEATHER_KEY', '');\n Configuration::updateValue('WI_WEATHER_CITY', '');\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayNav') &&\n $this->registerHook('displayNav1');\n }", "public function onInstall() {\n\t\tglobal $conf;\n\n\t\treturn true;\n\n\t}", "function install() {\n /*\n * do some stuff at install db table creation/modification, email template creation etc.\n * \n * \n */\n return parent::install();\n }", "public function install() {\n include(dirname(__FILE__) . '/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('actionProductUpdate') &&\n $this->registerHook('displayAdminProductsExtra');\n }", "public function install(){\r\n\t\t\r\n\t}", "public function install()\n {\n if (Shop::isFeatureActive())\n Shop::setContext(Shop::CONTEXT_ALL);\n\n\n if (!parent::install() ||\n !$this->registerHook('productfooter') ||\n !$this->registerHook('header') ||\n !Configuration::updateValue('BLOCKPRODUCTMANUFACTURER_NAME', 'Block Product Manufacturer')\n )\n return false;\n\n return true;\n }", "public function hookInstall(): void\n {\n $this->say(\"Executing the Plugin's install hook...\");\n $this->_exec(\"php ./src/hook_install.php\");\n }", "public function onAfterInstall()\n {\n craft()->amForms_install->install();\n }", "protected function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t$this->object = new JInstaller;\n\t}", "public function preExec()\n {\n }", "public function install() {\n\n\n }", "public function beforeSetup()\n {\n }", "public function set_up_dependencies () {\n\t\tif (!Upfront_Permissions::current(Upfront_Permissions::BOOT)) wp_die(\"Nope.\");\n\t\tadd_action('admin_enqueue_scripts', array($this, 'enqueue_dependencies'));\n\t}", "protected function _before()\n {\n parent::_before();\n\n $this->setUpEnvironment();\n }", "protected function doSetup(): void\n {\n }", "public function preDispatch()\n {\n $config = Mage::getModel('emailchef/config');\n /* @var $config EMailChef_EMailChefSync_Model_Config */\n\n if (!$config->isTestMode()) {\n die('Access Denied.');\n }\n\n return parent::preDispatch();\n }", "public function preExecute() {\n if ($this->get_option('geocluster_enabled')) {\n if ($algorithm = geocluster_init_algorithm($this->config)) {\n $algorithm->before_pre_execute();\n }\n }\n }", "public function install()\n {\n // Save the new component\n $this->component = $this->createComponent();\n\n // Create the necessary fields for the component\n $this->createComponentFields();\n\n // Register all necessary events to handle the data.\n $this->registerEvents();\n\n return true;\n }", "public function install()\n {\n // initialisation successful\n return true;\n }", "public function install()\n {\n include dirname(__FILE__) . '/sql/install.php';\n Configuration::updateValue('WI_SPENT_ENABLED', '0');\n Configuration::updateValue('WI_SPENT_AMOUNT', '');\n Configuration::updateValue('WI_SPENT_COUPON', '');\n Configuration::updateValue('WI_SPENT_DAYS', '30');\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('actionValidateOrder') &&\n $this->registerHook('postUpdateOrderStatus') &&\n $this->registerHook('actionOrderStatusPostUpdate') &&\n $this->registerHook('displayOrderConfirmation');\n }", "protected function preRun()\n {\n if (@class_exists('Plugin_PreRun') &&\n in_array('Iface_PreRun', class_implements('Plugin_PreRun'))) {\n $preRun = new Plugin_PreRun();\n $preRun->process();\n }\n }", "function pre_init() {\n /* Add capability */\n add_filter( 'wpp_capabilities', array( &$this, \"add_capability\" ) );\n }", "function __construct() {\n\t\t$this->__checkInstall();\n\t\tparent::__construct();\n\t}", "public function preExecute() {\n }", "protected function _beforeInit() {\n\t}", "public function install()\n {\n Configuration::updateValue('MF_TITLE', 'Our Favourite Brands');\n Configuration::updateValue('MF_DESCRIPTION', 'Browse our favourite brands');\n Configuration::updateValue('MF_MAN_NUMBER', 0);\n Configuration::updateValue('MF_PER_ROW_DESKTOP', 4);\n Configuration::updateValue('MF_PER_ROW_TABLET', 3);\n Configuration::updateValue('MF_PER_ROW_MOBILE', 1);\n Configuration::updateValue('MF_MAN_ORDER', 'name_asc');\n Configuration::updateValue('MF_SHOW_MAN_NAME', 0);\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('displayHome');\n }", "public function install()\n {\n include(__DIR__ . '/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('actionAdminControllerSetMedia') &&\n $this->registerHook('displayAdminOrderTabLink') &&\n $this->registerHook('displayAdminOrderTabContent') &&\n $this->registerHook('actionOrderGridDefinitionModifier') &&\n $this->registerHook('actionOrderGridPresenterModifier');\n }", "public function install()\n\t{\n\t\tConfiguration::updateValue('ORDERLIST_LIVE_MODE', false);\n\n\t\tinclude(dirname(__FILE__).'/sql/install.php');\n\n\t\treturn parent::install() &&\n\t\t\t$this->registerHook('header') &&\n\t\t\t$this->registerHook('backOfficeHeader') &&\n\t\t\t$this->registerHook('displayCustomerAccount') &&\n\t\t\t$this->registerHook('displayProductAdditionalInfo');\n\t}", "public function _postSetup()\n {\n }", "protected function preProcess() {}", "protected function beforeProcess() {\n }", "public function hookActionDispatcherBefore()\n {\n AlternativeDescription::addToProductDefinition();\n }", "public function install()\n\t{\n\t\treturn true;\n\t}", "public function preExecute()\n {\n $this->getContext()->getConfiguration()->loadHelpers(array('Url', 'sfsCurrency'));\n \n if ($this->getActionName() == 'index') {\n $this->checkOrderStatus();\n }\n }", "function install() {}", "protected function setUp(): void\n {\n DummyHookPlugin::$beforeHookCalled = 0;\n DummyHookPlugin::$beforeActionCalled = 0;\n DummyHookPlugin::$afterActionCalled = 0;\n DummyHookPlugin::$afterHookCalled = 0;\n DummyHookPluginSkipsActions::$skipStartIn = 'beforeHook';\n DummyHookPluginSkipsActions::$skipStartAt = 1;\n DummyConstrainedHookPlugin::$restriction = null;\n DummyConstrainedHookPluginAlt::$restriction = null;\n DummyConstrainedPlugin::$restriction = null;\n }", "public function setUpBeforeTests()\n {\n $initialProductCount = $this->_getProductCount();\n if ($initialProductCount < self::MINIMUM_PRODUCT_COUNT) {\n $this->loginAdminUser();\n// var_dump(\"createProducts()\");\n// $this->_createProducts(10 - $initialProductCount);\n for($i = $initialProductCount; $i < self::MINIMUM_PRODUCT_COUNT; $i++) {\n $this->_createSimpleProduct();\n }\n $initialProductCount = $i;\n }\n }", "public function install()\n {\n if (!parent::install()) {\n $this->_errors[] = 'Unable to install module';\n\n return false;\n }\n\n foreach ($this->hooks as $hook) {\n $this->registerHook($hook);\n }\n\n if (!$this->pendingOrderState()) {\n $this->_errors[] = 'Unable to install Mollie pending order state';\n\n return false;\n }\n\n $this->initConfig();\n\n include(dirname(__FILE__).'/sql/install.php');\n\n return true;\n }", "protected function _preExec()\n {\n }", "public function preAction()\n {\n // Nothing to do\n }", "public function pre_action()\n\t{\n\t\tparent::pre_action();\n\t}", "public function install () {\n\t\t$this->_log_version_number();\n\t}", "public function install(){\n\n return true;\n\n }", "public static function install(){\n\t}", "public function setup(){\n\t\tparent::setup();\n\t\t//Do stuff...\n\t}", "function install(){}", "protected function preCommitSetup() :void\n {\n $url = \"https://raw.githubusercontent.com/EngagePHP/pre-commit/master/setup.sh\";\n $content = file_get_contents($url);\n $path = app_path('setup.sh');\n\n Storage::put($path, $content);\n\n chmod($path, 0751); //rwxr-x--x\n }", "protected function _initInstallChecker()\r\n\t{\r\n\t\t$config = Tomato_Core_Config::getConfig();\r\n\t\tif (null == $config->install || null == $config->install->date) {\r\n\t\t\theader('Location: install.php');\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "function install()\n {\n }", "public function install(){\n if (!parent::install() ||\n !$this->registerHook('displayHeader') ||\n !$this->registerHook('displayRightColumn') )\n return false;\n \n $this->initConfiguration(); // set default values for settings\n \n return true;\n }", "public function onBeforeRun()\n\t{\n\t\t$this->raiseEvent('onBeforeRun', new TestRunnerEvent($this, $this->collection));\n\t}", "public function install()\n {\n include(dirname(__FILE__).'/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayHome');\n }", "public function install()\n {\n return parent::install()\n && $this->registerHook('payment')\n && $this->registerHook('paymentReturn')\n && $this->defaultConfiguration()\n && $this->createDatabaseTables();\n }", "public function prepareDiscoverInstall()\n\t{\n\t\t$client = ApplicationHelper::getClientInfo($this->parent->extension->client_id);\n\t\t$manifestPath = $client->path . '/modules/' . $this->parent->extension->element . '/' . $this->parent->extension->element . '.xml';\n\t\t$this->parent->manifest = $this->parent->isManifest($manifestPath);\n\t\t$this->parent->setPath('manifest', $manifestPath);\n\t\t$this->setManifest($this->parent->getManifest());\n\t}", "public function preExecuteCheck()\n {\n return true;\n }", "public function preExecute(){\n\n\t\n\t}", "protected function beforeActivation() {\n if (!self::checkPreconditions()) {\n ilUtil::sendFailure(\"Cannot activate plugin: Make sure that you have installed the CtrlMainMenu plugin and RouterGUI. Please read the documentation: http://www.ilias.de/docu/goto_docu_wiki_1357_Reporting_Plugin.html\", true);\n //throw new ilPluginException(\"Cannot activate plugin: Make sure that you have installed the CtrlMainMenu plugin and RouterGUI. Please read the documentation: http://www.ilias.de/docu/goto_docu_wiki_1357_Reporting_Plugin.html\");\n return false;\n }\n return true;\n }", "protected function _before() : void {\n require_once '../../public/wp-content/plugins/kc/Data/Database/DatabaseManager.php';\n }", "public function install();", "public function install();", "public function Init()\n {\n $basket = $this->getShopService()->getActiveBasket();\n $basket->aCompletedOrderStepList[$this->fieldSystemname] = false;\n $this->CheckBasketContents();\n\n if (false === $this->AllowAccessToStep(true)) {\n $this->JumpToStep($this->GetPreviousStep());\n }\n if ('basket' !== $this->fieldSystemname && 'thankyou' !== $this->fieldSystemname) {\n $basket->CommitCopyToDatabase(false, $this->fieldSystemname);\n } // commit basket to database...\n }", "public function before_run(){}", "protected function onFinishSetup()\n {\n }", "public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n }\n }", "public function eXpOnInit()\n {\n $this->addDependency(\n new \\ManiaLive\\PluginHandler\\Dependency(\"\\\\ManiaLivePlugins\\\\eXpansion\\\\Database\\\\Database\")\n );\n }", "function bootstrap() {\n\tif ( is_initial_install() ) {\n\t\tdefine( 'WP_INITIAL_INSTALL', true );\n\t\terror_reporting( E_ALL & ~E_STRICT & ~E_DEPRECATED & ~E_USER_WARNING );\n\t}\n}", "protected function _preupdate() {\n }", "public function before_run() {}", "public function initialInstall()\n\t\t{\n\t\t\t$installer = $this->getInstaller();\n\t\t\t$installer->newTable($installer->getResourceTable('core/extension'))\n\t\t\t->addColumn('code', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t'primary' => TRUE,\n\t\t\t\t),'Extension identifier')\n\t\t\t->addColumn('version', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t),'The currently installed version of this extension')\n\t\t\t->setComment('List of ZeroG installed extensions and their version number');\n\t\t\t$installer->run();\n\t\t}", "public function testFaqInstall()\r\n {\r\n\t\t$this->faqClass->moduleInstall();\r\n\t\t$needUpdate = $this->faqClass->checkUpdate();\r\n\t\tif($needUpdate)\r\n\t\t\t$this->faqClass->moduleUpdate();\r\n\t}", "protected function isInitialInstallationInProgress() {}", "public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n } \n }", "public function install () {\n $this->_log_version_number();\n }", "private function maybe_install() {\n\t\tglobal $woocommerce;\n\n\t\t$installed_version = get_option( 'wc_pre_orders_version' );\n\n\t\t// install\n\t\tif ( ! $installed_version ) {\n\n\t\t\t// add 'pre-order' shop order status term\n\t\t\t$woocommerce->init_taxonomy();\n\t\t\tif ( ! get_term_by( 'slug', 'pre-ordered', 'shop_order_status' ) )\n\t\t\t\twp_insert_term( 'pre-ordered', 'shop_order_status' );\n\n\t\t\t// install default settings\n\t\t\tforeach ( $this->get_settings() as $setting ) {\n\n\t\t\t\tif ( isset( $setting['default'] ) )\n\t\t\t\t\tupdate_option( $setting['id'], $setting['default'] );\n\t\t\t}\n\t\t}\n\n\t\t// upgrade - installed version lower than plugin version?\n\t\tif ( -1 === version_compare( $installed_version, WC_Pre_Orders::VERSION ) ) {\n\n\t\t\t$this->upgrade( $installed_version );\n\n\t\t\t// new version number\n\t\t\tupdate_option( 'wc_pre_orders_version', WC_Pre_Orders::VERSION );\n\t\t}\n\t}", "public function preTesting() {}", "public function install() {\n\n if (!parent::install()\n || !$this->registerHook('payment')\n || !$this->config->install()\n ) {\n return false;\n }\n return true;\n }", "protected function _onStart()\n {\n $this->_raise(self::E_LOAD);\n }", "protected function beforeUninstall(): bool\n {\n return true;\n }", "public function init() {\n // Check if Elementor installed and activated\n if ( ! did_action( 'elementor/loaded' ) ) {\n add_action( 'admin_notices', array( $this, 'admin_notice_missing_main_plugin' ) );\n return;\n }\n\n // Check for required Elementor version\n if ( ! version_compare( ELEMENTOR_VERSION, MINIMUM_ELEMENTOR_VERSION, '>=' ) ) {\n add_action( 'admin_notices', array( $this, 'admin_notice_minimum_elementor_version' ) );\n return;\n }\n\n // Check for required PHP version\n if ( version_compare( PHP_VERSION, MINIMUM_PHP_VERSION, '<' ) ) {\n add_action( 'admin_notices', array( $this, 'admin_notice_minimum_php_version' ) );\n return;\n }\n\n // Once we get here, We have passed all validation checks so we can safely include our plugin\n require_once( 'plugin.php' );\n }", "public function install()\n {\n\n Configuration::updateValue('KKIAPAY_LIVE_MODE', false);\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('paymentOptions');\n }" ]
[ "0.8143597", "0.7941518", "0.71152365", "0.6925626", "0.6903909", "0.6789204", "0.67859584", "0.66364795", "0.6625032", "0.65948415", "0.65809506", "0.6566539", "0.6466661", "0.64643115", "0.6463094", "0.63410586", "0.6338126", "0.6338126", "0.63345146", "0.63132924", "0.629786", "0.6266173", "0.6265535", "0.62652606", "0.62652427", "0.6259269", "0.6256694", "0.6252659", "0.62445766", "0.6228014", "0.6224233", "0.6216705", "0.6216222", "0.6211131", "0.6203484", "0.61799103", "0.61713105", "0.6165059", "0.6159277", "0.61581856", "0.61559296", "0.61553174", "0.6154802", "0.61541545", "0.6153741", "0.61465657", "0.61343634", "0.61230797", "0.61157966", "0.61147386", "0.61079895", "0.61064136", "0.6101265", "0.61012006", "0.6096354", "0.6094413", "0.60927176", "0.60925084", "0.60919464", "0.6086276", "0.6083195", "0.60807675", "0.6066543", "0.60615826", "0.6048093", "0.60395503", "0.6033173", "0.602979", "0.60008574", "0.60004264", "0.599583", "0.5995248", "0.59872574", "0.5987103", "0.5985772", "0.59787714", "0.5967996", "0.5965672", "0.5962441", "0.59600365", "0.59600365", "0.59582883", "0.5957457", "0.5957358", "0.5956222", "0.5941691", "0.5935338", "0.59346795", "0.59316427", "0.5930108", "0.5926805", "0.59230447", "0.5918165", "0.5908742", "0.5906186", "0.59045297", "0.59045273", "0.5904409", "0.58840406", "0.5870391", "0.5860928" ]
0.0
-1
Runs right after any installation action is preformed on the component.
public function postflight($type, $parent) { $this->loadConfigXml($parent); $this->loadSamples($parent); if ($type === 'update' && version_compare($this->fromVersion, $parent->getManifest()->version, '<')) { $this->enqueueMessage($this->getChangelog($parent)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function afterInstall()\n\t{}", "protected function afterInstall()\n {\n }", "public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }", "protected function afterUninstall()\n {\n }", "public function beforeInstall()\n\t{}", "public function onAfterInstall()\n {\n craft()->amForms_install->install();\n }", "public function execute_uninstall_hooks() {\r\n\t\t\r\n }", "protected function onFinishSetup()\n {\n }", "protected function finaliseInstall()\n\t{\n\t\t// Clobber any possible pending updates\n\t\t$update = Table::getInstance('update');\n\t\t$uid = $update->find(\n\t\t\tarray(\n\t\t\t\t'element' => $this->element,\n\t\t\t\t'type' => 'module',\n\t\t\t\t'client_id' => $this->clientId,\n\t\t\t)\n\t\t);\n\n\t\tif ($uid)\n\t\t{\n\t\t\t$update->delete($uid);\n\t\t}\n\n\t\t// Lastly, we will copy the manifest file to its appropriate place.\n\t\tif ($this->route !== 'discover_install')\n\t\t{\n\t\t\tif (!$this->parent->copyManifest(-1))\n\t\t\t{\n\t\t\t\t// Install failed, rollback changes\n\t\t\t\tthrow new \\RuntimeException(\\JText::_('JLIB_INSTALLER_ABORT_MOD_INSTALL_COPY_SETUP'));\n\t\t\t}\n\t\t}\n\t}", "protected function finaliseInstall()\n\t{\n\t\t// Clobber any possible pending updates\n\t\t/** @var Update $update */\n\t\t$update = Table::getInstance('update');\n\t\t$uid = $update->find(\n\t\t\tarray(\n\t\t\t\t'element' => $this->element,\n\t\t\t\t'type' => $this->type,\n\t\t\t\t'folder' => $this->group,\n\t\t\t)\n\t\t);\n\n\t\tif ($uid)\n\t\t{\n\t\t\t$update->delete($uid);\n\t\t}\n\n\t\t// Lastly, we will copy the manifest file to its appropriate place.\n\t\tif ($this->route !== 'discover_install')\n\t\t{\n\t\t\tif (!$this->parent->copyManifest(-1))\n\t\t\t{\n\t\t\t\t// Install failed, rollback changes\n\t\t\t\tthrow new \\RuntimeException(\n\t\t\t\t\t\\JText::sprintf(\n\t\t\t\t\t\t'JLIB_INSTALLER_ABORT_PLG_INSTALL_COPY_SETUP',\n\t\t\t\t\t\t\\JText::_('JLIB_INSTALLER_' . $this->route)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "private function _post()\n\t{\n\t\t$sCacheModules = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS . 'installer_modules.php';\n\t\tif (!file_exists($sCacheModules))\n\t\t{\n\t\t\t// Something went wrong...\n\t\t}\t\t\n\t\trequire_once($sCacheModules);\t\t\n\t\t\n\t\t$oModuleProcess = Phpfox::getService('admincp.module.process');\t\t\n\t\tforeach ($aModules as $sModule)\n\t\t{\t\t\n\t\t\t$oModuleProcess->install($sModule, array('post_install' => true));\t\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->_pass();\n\t\t$this->_oTpl->assign(array(\n\t\t\t\t'sMessage' => 'Post install completed...',\n\t\t\t\t'sNext' => $this->_step('final')\n\t\t\t)\n\t\t);\n\t}", "public function onPostInstall(Event $event): void\n {\n $this->onPostUpdate($event);\n }", "public function _postSetup()\n {\n }", "public function preInstall()\n {\n }", "public function testComposerPostPackageInstallEventHandlerDoesRun(): void {\n // Clean up must run when \"lemberg/draft-environment\" is being uninstalled.\n $package = new Package(App::PACKAGE_NAME, '1.0.0.0', '^1.0');\n $operation = new InstallOperation($package);\n $event = new PackageEvent(PackageEvents::POST_PACKAGE_INSTALL, $this->composer, $this->io, FALSE, $this->installedRepo, [$operation], $operation);\n $this->configInstallManager\n ->expects(self::once())\n ->method('install');\n $this->app->handleEvent($event);\n }", "public function hookInstall(): void\n {\n $this->say(\"Executing the Plugin's install hook...\");\n $this->_exec(\"php ./src/hook_install.php\");\n }", "protected function markModuleAsInstalled()\n {\n Mongez::updateStorageFile();\n }", "public function onInstall() {\n\t\tglobal $conf;\n\n\t\treturn true;\n\n\t}", "function custom_config_postinstall_callback() {\n // Call function to run post install routines.\n custom_config_run_postinstall_hooks();\n}", "public function finish() {\n\t\t$this->_check();\n\t\t$d['title_for_layout'] = __(\"Installation complete\");\n\t\t$path = PLUGIN_CONFIG.'bootstrap.php';\n\t\tif(!$this->Install->changeConfiguration('Database.installed', 'true', $path)){\n\t\t\t$this->Session->setFlash(__(\"Cannot modify Database.installed variable in app/Plugin/Install/Config/bootstrap.php\"), 'Install.alert');\n\t\t}\n\t\t\n\t\tif($this->request->is('post')) {\n\t\t\tCakeSession::delete('Install.create');\n\t\t\tCakeSession::delete('Install.salt');\n\t\t\tCakeSession::delete('Install.seed');\n\t\t\t\n\t\t\t$this->redirect('/');\n\t\t}\n\t\n\t\t$this->set($d);\n\t}", "public function onAfterInitialise()\n\t{\n\t\t$this->call(array('System\\\\Command', 'execute'));\n\n\t\tif ($this->params->get('tranAlias', 1))\n\t\t{\n\t\t\t$this->call(array('Article\\\\Translate', 'translateAlias'), $this);\n\t\t}\n\n\t\tif ($this->params->get('languageOrphan', 0))\n\t\t{\n\t\t\t$this->call(array('System\\\\Language', 'orphan'));\n\t\t}\n\n\t\t@include $this->includeEvent(__FUNCTION__);\n\t}", "protected function beforeUninstall(): bool\n {\n return true;\n }", "public static function activation() {\n\t\tregister_uninstall_hook(__FILE__, array(__CLASS__, 'uninstall'));\n\t}", "public function afterSetup()\n {\n }", "public function after_custom_props() {}", "protected function afterAction () {\n\t}", "public function after_setup_theme()\n {\n }", "public function onPostPackageInstall(PackageEvent $event) {\n $this->runPackageOperation($event);\n }", "public function afterInstall()\r\n {\r\n\r\n // $test = $this::getInstance();\r\n//print_r(Yii::getAlias('@'.($this->id)));\r\n\r\n\r\n // $fileName2 = (new \\ReflectionClass(new \\panix\\engine\\WebModule($this->id)))->getFileName();\r\n\r\n // $fileName = (new \\ReflectionClass(get_called_class()))->getFileName();\r\n // print_r($fileName2);\r\n\r\n\r\n /// print_r($reflectionClass->getNamespaceName());\r\n //die;\r\n\r\n // if ($this->uploadAliasPath && !file_exists(Yii::getPathOfAlias($this->uploadAliasPath)))\r\n // CFileHelper::createDirectory(Yii::getPathOfAlias($this->uploadAliasPath), 0777);\r\n //Yii::$app->cache->flush();\r\n // Yii::app()->widgets->clear();\r\n return true;\r\n }", "function on_uninstall ()\n{\n}", "function on_uninstall ()\n{\n}", "function power_up_setup_callback ( )\n\t{\n\t\t$this->admin->power_up_setup_callback();\n\t}", "function hookInstall() {\n// $db = get_db()cou;\n//die(\"got to the installer method...\");\n $this->_saveVocabularies();\n }", "public function after_run() {}", "function unsinstall()\n\t\t{\n\t\t}", "protected function _afterInit() {\n\t}", "public static function execute() {\n if ( defined( 'DPC_EXECUTED' ) ) {\n return false;\n } else {\n define( 'DPC_EXECUTED', true );\n }\n load_textdomain( 'dustpress-components', dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' );\n add_action( 'init', __NAMESPACE__ . '\\Components::add_options_page', 1, 1 );\n add_action( 'init', __NAMESPACE__ . '\\Components::hook', 20, 1 );\n add_action( 'dustpress/partials', __NAMESPACE__ . '\\Components::add_partial_path', 1, 1 );\n add_action( 'activated_plugin', __NAMESPACE__ . '\\Components::load_first', 1, 1 );\n add_filter( 'acf/format_value/type=group', __NAMESPACE__ . '\\Components::add_layout_static', 150, 3 );\n add_filter( 'acf/format_value/type=group', __NAMESPACE__ . '\\Data::component_handle', 200, 3 );\n add_filter( 'acf/format_value/type=flexible_content', __NAMESPACE__ . '\\Data::component_handle', 200, 3 );\n }", "private function _postInit()\n {\n // Register all the listeners for config items\n $this->_registerConfigListeners();\n\n // Register all the listeners for invalidating GraphQL Cache.\n $this->_registerGraphQlListeners();\n\n // Load the plugins\n $this->getPlugins()->loadPlugins();\n\n $this->_isInitialized = true;\n\n // Fire an 'init' event\n if ($this->hasEventHandlers(WebApplication::EVENT_INIT)) {\n $this->trigger(WebApplication::EVENT_INIT);\n }\n\n if (!$this->getUpdates()->getIsCraftDbMigrationNeeded()) {\n // Possibly run garbage collection\n $this->getGc()->run();\n }\n }", "public function onAfterInstall()\n {\n craft()->db->createCommand()->update(\n 'fields',\n array('type' => 'BetterRedactor'),\n array('type' => 'RichText')\n );\n\n $publicDirectory = craft()->path->appPath . '../../public/redactor_plugins';\n\n if (!IOHelper::folderExists($publicDirectory)) {\n $initialDirectory = craft()->path->getPluginsPath()\n . '/betterredactor/redactor_plugins';\n\n $files = array_filter(\n scandir($initialDirectory),\n function($file) use ($initialDirectory) {\n return is_file(\"$initialDirectory/$file\");\n }\n );\n\n foreach ($files as $file) {\n if (preg_match('((.js|.css)$)i', $file)) {\n IOHelper::copyFile(\n \"$initialDirectory/$file\",\n \"$publicDirectory/$file\"\n );\n }\n }\n }\n }", "public function onPostInstall() {\n $moduleName = 'siteevent';\n $db = $this->getDb();\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_core_modules')\n ->where('name = ?', 'sitemobile')\n ->where('enabled = ?', 1);\n $is_sitemobile_object = $select->query()->fetchObject();\n if (!empty($is_sitemobile_object)) {\n $db->query(\"INSERT IGNORE INTO `engine4_sitemobile_modules` (`name`, `visibility`) VALUES\n('$moduleName','1')\");\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_sitemobile_modules')\n ->where('name = ?', $moduleName)\n ->where('integrated = ?', 0);\n $is_sitemobile_object = $select->query()->fetchObject();\n if ($is_sitemobile_object) {\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && $actionName == 'install') {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $redirector->gotoUrl($baseUrl . 'admin/sitemobile/module/enable-mobile/enable_mobile/1/name/' . $moduleName . '/integrated/0/redirect/install');\n }\n }\n }\n //END - SITEMOBILE CODE TO CALL MY.SQL ON POST INSTALL\n //WORK FOR THE WORD CHANGES IN THE ADVANCED EVENT PLUGIN .CSV FILE.\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && ($actionName == 'install' || $actionName == 'query')) {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n if ($actionName == 'install') {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/install');\n } else {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/query');\n }\n }\n }", "public function onAfterInstall()\n {\n $ingredients = array(\n array('name' => 'Gin'),\n array('name' => 'Tonic'),\n array('name' => 'Lime'),\n array('name' => 'Soda'),\n array('name' => 'Vodka'),\n );\n\n foreach ($ingredients as $ingredient) {\n craft()->db->createCommand()->insert('cocktailrecipes_ingredients', $ingredient);\n }\n }", "public function after_update() {}", "public function install()\n\t{\n\t\tif (Shop::isFeatureActive()) {\n\t\t\tShop::setContext(Shop::CONTEXT_ALL);\n\t\t}\n\n\t\t//initialize empty settings\n\t\tConfiguration::updateValue('CLERK_PUBLIC_KEY', '');\n\t\tConfiguration::updateValue('CLERK_PRIVATE_KEY', '');\n\n\t\tConfiguration::updateValue('CLERK_SEARCH_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_SEARCH_TEMPLATE', '');\n\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_INCLUDE_CATEGORIES', 0);\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_TEMPLATE', '');\n\n\t\tConfiguration::updateValue('CLERK_POWERSTEP_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_POWERSTEP_TEMPLATES', '');\n\n\t\treturn parent::install() &&\n $this->registerHook('top') &&\n\t\t\t$this->registerHook('footer') &&\n\t\t\t$this->registerHook('displayOrderConfirmation');\n\t}", "protected function install(){ return true;}", "protected function afterAction() {\n\n }", "public function clickInstallNow()\n {\n $this->_rootElement->find($this->installNow, Locator::SELECTOR_XPATH)->click();\n $this->waitSuccessInstall();\n }", "public function afterUpdate()\n {\n ((Settings::get('use_plugin') == FALSE)? $this->update_plugin_versions(TRUE) : $this->update_plugin_versions(FALSE));\n }", "protected function beforeInstall(): bool\n {\n return true;\n }", "public function uninstall()\n {\n\n $this->markUninstalled();\n //or call parent::uninstall(); \n }", "public function postUninstall( $application )\n\t{\n\t}", "protected function after_execute() {\n // Add iadlearning related files, no need to match by itemname (just internally handled context).\n $this->add_related_files('mod_iadlearning', 'intro', null);\n }", "public function fireUp() {\n\t\t// We will not fire up the component if the theme doesn't explicitly declare support for it.\n\t\tif ( ! current_theme_supports( $this->getThemeSupportsKey() ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Load and instantiate various classes\n\t\t */\n\n\t\t// The class that handles the metaboxes\n\t\tpixelgrade_load_component_file( self::COMPONENT_SLUG, 'inc/class-FeaturedImage-Metaboxes' );\n\t\tPixelgrade_FeaturedImage_Metaboxes::instance( $this );\n\n\t\t// Let parent's fire up as well - One big happy family!\n\t\tparent::fireUp();\n\t}", "function after_update() {}", "public function after_run(){}", "function pre_install()\n\t{\n\t\t//-----------------------------------------\n\t\t// Installing, or uninstalling?\n\t\t//-----------------------------------------\n\t\t\n\t\t$type = ( $this->ipsclass->input['un'] == 1 ) ? 'uninstallation' : 'installation';\n\t\t$text = ( $this->ipsclass->input['un'] == 1 ) ? 'Uninstalling' : 'Installing';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Page Info\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->page_title = \"(FSY23) Universal Mod Installer: XML Analysis\";\n\t\t$this->ipsclass->admin->page_detail = \"The mod's XML file has been analyzed and the proper {$type} steps have been determined.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=view', 'Manage Mod Installations' );\n\t\t$this->ipsclass->admin->nav[] = array( '', $text.\" \".$this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Show the output\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( $this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( \"<span style='font-size: 12px;'>Click the button below to proceed with the mod $type.<br /><br /><input type='button' class='realbutton' value='Proceed...' onclick='locationjump(\\\"&amp;{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;un={$this->ipsclass->input['un']}&amp;step=0&amp;st={$this->ipsclass->input['st']}\\\")' /></span>\", \"center\" );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\t\t\n\t\t$this->ipsclass->admin->output();\n\t}", "public function after_setup_theme() {\n\t\t\t// check to see if acf5 is installed\n\t\t\t// if not then do not run anything else in this plugin\n\t\t\t// move all other actions to this function except text domain since this is too late\n\t\t\tif (!class_exists('acf') ||\n\t\t\t\t\t!function_exists('acf_get_setting') ||\n\t\t\t\t\tintval(acf_get_setting('version')) < 5 ||\n\t\t\t\t\t!class_exists('acf_pro')) {\n\t\t\t\t$this->active = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tadd_action('init', array($this, 'init'), 0);\n\t\t\tadd_action('admin_menu', array($this, 'build_admin_menu_list'), 999);\n\t\t\tadd_filter('acf/load_field/name=_acfop_parent', array($this, 'acf_load_parent_menu_field'));\n\t\t\tadd_filter('acf/load_field/name=_acfop_capability', array($this, 'acf_load_capabilities_field'));\n\t\t\tadd_filter('manage_edit-'.$this->post_type.'_columns', array($this, 'admin_columns'));\n\t\t\tadd_action('manage_'.$this->post_type.'_posts_custom_column', array($this, 'admin_columns_content'), 10, 2);\n\t\t\tadd_action('acf/include_fields', array($this, 'acf_include_fields'));\n\t\t\tadd_filter('acf_options_page/post_type', array($this, 'get_post_type'));\n\t\t\tadd_filter('acf_options_page/text_domain', array($this, 'get_text_domain'));\n\t\t}", "public function runInstallTasks();", "public static function PostInit(){\r\n\t\tself::CallHook('PostInitHook');\r\n\t\t// Autorun\r\n\t\tglobal $PhpWsdlAutoRun;\r\n\t\tif(self::$AutoRun||$PhpWsdlAutoRun)\r\n\t\t\tself::RunQuickMode();\r\n\t}", "public function postPackageInstall ( Event $event ) {\n//\n// if( !file_exists( $config_file ) ){\n//\n// copy( './config/build-tool.php', base_path() . '/config/build-tool.php' );\n// }\n $event->getIO()->write( \"postPackageInstall\" );\n\n }", "protected function afterActivation() {\n self::createReportMainMenuEntries();\n }", "function instant_ide_manager_activate_post() {\n\n\tif ( ! get_option( 'instant_ide_manager_version_number' ) )\n\t\tupdate_option( 'instant_ide_manager_version_number', IIDEM_VERSION );\n\t\t\n\tinstant_ide_manager_dir_check( instant_ide_manager_get_uploads_path() );\n\n}", "public function postInstall()\n {\n include_once BASE_PATH.'/modules/api/models/AppModel.php';\n $modelLoader = new MIDAS_ModelLoader();\n $userModel = $modelLoader->loadModel('User');\n $userapiModel = $modelLoader->loadModel('Userapi', 'api');\n\n //limit this to 100 users; there shouldn't be very many when api is installed\n $users = $userModel->getAll(false, 100, 'admin');\n foreach($users as $user)\n {\n $userapiModel->createDefaultApiKey($user);\n }\n }", "protected function after(){}", "protected function after(){}", "protected function after(){}", "public function install()\n {\n $this->installClasses();\n $this->command();\n $this->markInstalled();\n //or call parent::install(); \n }", "public function install(){\r\n\t\t\r\n\t}", "protected function _after() {\n\t\t$this->startup = null;\n\t}", "public function finalize() {\n\t\t$ini = sprintf(\"; Forum installed on %s\", date('Y-m-d H:i:s')) . PHP_EOL;\n\n\t\tforeach (array('prefix', 'database', 'table') as $key) {\n\t\t\t$ini .= $key . ' = \"' . $this->install[$key] . '\"' . PHP_EOL;\n\t\t}\n\n\t\tfile_put_contents(FORUM_PLUGIN . 'Config/install.ini', $ini);\n\n\t\t$this->hr(1);\n\t\t$this->out('Forum installation complete! Your admin credentials:');\n\t\t$this->out();\n\t\t$this->out(sprintf('Username: %s', $this->install['username']));\n\t\t$this->out(sprintf('Email: %s', $this->install['email']));\n\t\t$this->out();\n\t\t$this->out('Please read the documentation for further configuration instructions.');\n\t\t$this->hr(1);\n\t}", "private function _after_install() {\n global $COURSE, $DB;\n \n if(!$this->_found) { // if the block's instance hasn't been cached\n // lookup the DB to check if this block instance already exists\n $result = $DB->get_record('block_group_choice', array('course_id' => $COURSE->id, 'instance_id' => $this->instance->id));\n if($result) { // if the block's instance already exist in the DB\n $this->_found = true;\n }\n else { // if this block instance doesn't exist we insert a first set of preferences\n $entries = new stdClass();\n $entries->instance_id = $this->instance->id;\n $entries->course_id = $COURSE->id;\n $entries->showgroups = 1;\n $entries->maxmembers = 2;\n $entries->allowchangegroups = 0;\n $entries->allowstudentteams = 1;\n $entries->allowmultipleteams = 0;\n $DB->insert_record('block_group_choice', $entries);\n }\n }\n }", "public function hookActionDispatcherBefore()\n {\n AlternativeDescription::addToProductDefinition();\n }", "public function install_post_message()\n\t{\n\t\treturn FALSE;\n\t}", "function finish()\n\t{\n\t\t$type = ( $this->ipsclass->input['un'] == 1 ) ? 'uninstallation' : 'installation';\n\t\t\n\t\tif ( $type == 'installation' )\n\t\t{\n\t\t\t$this->ipsclass->DB->do_update( 'installed_mods', array( 'm_version' => $this->xml_array['mod_info']['version']['VALUE'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'm_author' => $this->xml_array['mod_info']['author']['VALUE'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'm_website' => $this->xml_array['mod_info']['website']['VALUE'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'm_finished' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ), \"m_name='\".$this->xml_array['mod_info']['title']['VALUE'].\"'\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ipsclass->DB->do_delete( 'installed_mods', \"m_name='\".$this->xml_array['mod_info']['title']['VALUE'].\"'\" );\n\t\t\t\n\t\t\t$this->ipsclass->DB->sql_optimize_table( 'installed_mods' );\n\t\t}\n\t\t\n\t\t$this->ipsclass->main_msg = 'Modification '.$type.' complete...';\n\t\t\n\t\t$this->view_mods();\n\t}", "protected function after_execute() {\n// \t$this->add_related_files('mod_vcubeseminar', 'intro', null);\n// \t$this->add_related_files('mod_vcubeseminar', 'vcubeseminar', null);\n }", "public function postApplyTheme()\n {\n //...\n }", "public function install()\n {\n\n return parent::install() &&\n $this->registerHook('actionAdminControllerSetMedia') &&\n $this->registerHook('displayAdminProductsQuantitiesStepBottom') ;\n \n }", "public function action_admin_init() {\n\t\t$this->maybe_upgrade();\n\t}", "function afterAction()\n {\n }", "function activate() {\n\t\tregister_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) );\n\t}", "public function install()\n {\n }", "public function install()\n {\n }", "protected function afterProcess() {\n }", "private function hooks() {\n\t\t\t// check for EDD when plugin is activated\n\t\t\tadd_action( 'admin_init', array( $this, 'activation' ), 1 );\n\t\t\t\n\t\t\t// plugin meta\n\t\t\tadd_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 );\n\n\t\t\t// settings link on plugin page\n\t\t\tadd_filter( 'plugin_action_links_' . $this->basename, array( $this, 'settings_link' ), 10, 2 );\n\t\t\t\n\t\t\t// insert actions\n\t\t\tdo_action( 'edd_sd_setup_actions' );\n\t\t}", "function realstate_call_after_uninstall() {\n // for example you might want to drop/remove a table or modify some values\n // In this case we'll remove the table we created to store Example attributes\n $conn = getConnection() ;\n $conn->autocommit(false);\n try {\n $conn->osc_dbExec(\"DELETE FROM %st_plugin_category WHERE s_plugin_name = 'realstate_plugin'\", DB_TABLE_PREFIX);\n $conn->osc_dbExec('DROP TABLE %st_item_house_attr', DB_TABLE_PREFIX);\n $conn->osc_dbExec('DROP TABLE %st_item_house_description_attr', DB_TABLE_PREFIX);\n $conn->osc_dbExec('DROP TABLE %st_item_house_property_type_attr', DB_TABLE_PREFIX);\n $conn->commit();\n } catch (Exception $e) {\n $conn->rollback();\n echo $e->getMessage();\n }\n $conn->autocommit(true);\n}", "protected function finishCoreBootstrap() {}", "public function init() {\n\t\t\tglobal $prefix;\n\t\t\t$WPFC_active = $this->checkForManager();\n\n\t\t\t// if not already done\n\t\t\tif ( ! get_option( $prefix . 'manager_done', '0' ) ) {\n\t\t\t\t// if the plugin is already there, show a notice that it should be activated\n\t\t\t\tif ( $WPFC_active === true ) {\n\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t\t\t\tactivate_plugin( $this->wpfcm_path . '/wpfc-manager.php' );\n\t\t\t\t} else if ( $WPFC_active === false ) {\n\t\t\t\t\t$this->downloadWPFCM();\n\t\t\t\t}\n\n\t\t\t\tupdate_option( $prefix . 'manager_done', '1', true );\n\t\t\t} else {\n\t\t\t\tif ( $WPFC_active === true ) {\n\t\t\t\t\t$this->noticeWPFCMNotActive();\n\t\t\t\t} else if ( $WPFC_active === false ) {\n\t\t\t\t\t$this->noticeWPFCMNotInstalled();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function install() {\r\n \r\n }", "public static function setup_actions() {\n\t\tadd_action( 'after_switch_theme', array( __CLASS__, 'after_switch_theme' ), 10, 2 );\n\t}", "public function install()\n {\n return parent::install() && $this->registerHook('actionCreativeElementsInit');\n }", "public function after_install( $response, $hook_extra, $result ) {\n global $wp_filesystem;\n $install_directory = SALESFORCE__PLUGIN_DIR;\n $wp_filesystem->move( $result['destination'], $install_directory );\n $result['destination'] = $install_directory;\n if ( $this->active ) {\n activate_plugin( $this->basename );\n }\n return $result;\n }", "private function init_hooks() {\n\n register_activation_hook( __FILE__, array( 'IWJ_Install', 'install' ) );\n register_deactivation_hook( __FILE__, array('IWJ_Install', 'deactive') );\n\n add_action('plugins_loaded', array('IWJ_Install', 'update'));\n add_action('wp_loaded', array('IWJ_Install', 'update2'));\n\n add_action( 'wpmu_new_blog', array( 'IWJ_Install', 'new_blog' ), 10, 6 );\n add_action( 'delete_blog', array( 'IWJ_Install', 'delete_blog' ), 10, 2 );\n\n add_action( 'after_setup_theme', array( $this, 'setup_environment' ) );\n add_action( 'init', array( $this, 'init' ), 0 );\n\n add_action('wp_logout', array($this, 'end_session'));\n add_action('wp_login', array($this, 'end_session'));\n\n //add_action('activated_plugin',array($this, 'active_plugin_error'));\n }", "public function install()\n {\n if (!$this->installModel()) {\n $this->custom_errors[] = $this->l('Error occurred while installing/upgrading modal.');\n return false;\n }\n\n /*\n * Register various hook functions\n */\n if (!parent::install() ||\n !$this->registerHook('displayHeader') ||\n !$this->registerHook('actionOrderStatusUpdate') ||\n !$this->registerHook('displayFooterProduct') ||\n !$this->registerHook('actionProductUpdate') ||\n !$this->registerHook('actionBeforeAuthentication') ||\n !$this->registerHook('actionAuthentication') ||\n !$this->registerHook('actionBeforeSubmitAccount') ||\n !$this->registerHook('actionCustomerAccountAdd') ||\n !$this->registerHook('actionCustomerLogoutBefore') ||\n !$this->registerHook('actionCustomerLogoutAfter') ||\n !$this->registerHook('displayBackOfficeHeader')) {\n return false;\n }\n \n //Create Admin tabs\n $this->installKbTabs();\n \n //FCM key update\n $setting = array(\n 'apiKey' => \"AIzaSyA750xlMtIuePD6SsGx7FDlihk55qIkQhw\",\n 'authDomain' => \"propane-fusion-156206.firebaseapp.com\",\n 'databaseURL' => \"https://propane-fusion-156206.firebaseio.com\",\n 'projectId' => \"propane-fusion-156206\",\n 'storageBucket' => \"propane-fusion-156206.appspot.com\",\n 'messagingSenderId' => \"310977195083\",\n 'server_key' => \"AAAASGevbEs:APA91bHydR2XnMLZFkrQhQU33Vp3N_koFmjikYlP9AATJ4L3RIsX73m6AZwzZeJVLQVuor-yY13EJ1j6-H8-qPA2hireV6-Ti4N0tZ8LY1jabx_E7pchXhxoH0TWQc7-xQYZhNbf1qjVZIy2DMD5I6gqS8U1XXrnCQ\",\n\n );\n Configuration::updateValue('KB_PUSH_FCM_SERVER_SETTING', Tools::jsonEncode($setting));\n\n if (!Configuration::get('KB_WEB_PUSH_CRON_1')) {\n Configuration::updateValue('KB_WEB_PUSH_CRON_1', $this->kbKeyGenerator());\n }\n if (!Configuration::get('KB_WEB_PUSH_CRON_2')) {\n Configuration::updateValue('KB_WEB_PUSH_CRON_2', $this->kbKeyGenerator());\n }\n \n $existing_notification = KbPushTemplates::getNotificationTemplates();\n if (empty($existing_notification) && count($existing_notification) <= 0) {\n //for order update\n $this->createUpdateStatus();\n $this->createAbandandAlert();\n $this->createPriceAlertUpdate();\n $this->createBackStockAlertUpdate();\n }\n \n return true;\n }", "function postflight( $type, $parent )\n\t{\n\n\t\t// Install subextensions\n\t\t$status = $this->_installSubextensions($parent);\n\t\t// Install FOF\n\t\t$fofStatus = $this->_installFOF($parent);\n\n\t\t// Install Techjoomla Straper\n\t\t$straperStatus = $this->_installStraper($parent);\n\t\t//$fofStatus=$straperStatus='';\n\n\t\t$document = JFactory::getDocument();\n\t\t$document->addStyleSheet(JURI::root().'/media/techjoomla_strapper/css/bootstrap.min.css' );\n\t\t// Do all releated Tag line/ logo etc\n\t\t$this->taglinMsg();\n\t\t// Show the post-installation page\n\t\t$this->_renderPostInstallation($status, $fofStatus, $straperStatus, $parent);\n\t\t//Remove non required files and folders\n\t\t$removeFilesAndFolders = $this->removeFilesAndFolders;\n\t\t$this->_removeObsoleteFilesAndFolders($removeFilesAndFolders);\n\n\n\t}", "public function afterRegistry()\n {\n // parent::afterRegistry();\n }", "protected function afterUpdate() {\n\t}", "public function testComposerPrePackageUninstallEventHandlerDoesRun(): void {\n // Clean up must run when \"lemberg/draft-environment\" is being uninstalled.\n $package = new Package(App::PACKAGE_NAME, '1.0.0.0', '^1.0');\n $operation = new UninstallOperation($package);\n $event = new PackageEvent(PackageEvents::PRE_PACKAGE_UNINSTALL, $this->composer, $this->io, FALSE, $this->installedRepo, [$operation], $operation);\n $this->configInstallManager\n ->expects(self::once())\n ->method('uninstall');\n $this->app->handleEvent($event);\n }", "public abstract function afterExec();", "function ois_activation() {\r\n\t// Create the database table for statistics.\r\n ois_install_database();\r\n update_option('ois_table_created', 'yes');\r\n //update_option('ois-valid', 'no'); // Must validate after every install.\r\n \r\n // Check if old version has been installed.\r\n if (get_option('ois_installed') != 'yes') \r\n {\r\n\t // Reset any old variables that might conflict with new version (from 3.1).\r\n\t\t update_option('ois_skins', array()); // Delete any old settings\r\n\t\t update_option('ois_custom_designs', array()); // Custom designs.\r\n\t\t update_option('ois_installed', 'yes'); // Set to installed.\r\n } // if\r\n}", "public static function postInstall(Event $event)\n {\n\n // Check environment type\n if (self::getEnvironmentType() !== 'dev') {\n exit;\n }\n\n $io = $event->getIO();\n $basePath = self::getBasepath();\n\n // If the theme has already been renamed, assume this setup is complete\n if (file_exists($basePath.'/themes/default')) {\n\n // Only try to rename things if the user actually provides some info\n if ($theme = $io->ask('Please specify the theme name: ')) {\n $config = array(\n 'theme' => $theme,\n // 'sql-host' => $io->ask('Please specify the database host: '),\n 'sql-name' => $io->ask('Please specify the database name: '),\n );\n self::applyConfiguration($config);\n\n $io->write('New configuration settings have been applied.');\n $io->write('Foundation will now be installed...');\n\n // install foundation\n self::installFoundation($config['theme']);\n\n // settings have been updated so it's time to tidy up what was downloaded from Foundation.\n self::cleanUpFoundation($config['theme']);\n $io->write('Foundation has been installed and the contents have been organised.');\n $io->write('Bundle will now be run and then compass will compile the stylesheets...');\n\n // run bundle and compass compile\n self::compileSass($config['theme']);\n\n $io->write('Installation complete!!!');\n\n }\n\n }\n\n }", "function plugins_loaded(){\r\n // $current_time = current_time('timestamp');\r\n // $this->logger->debug( 'plugins_loaded ' . $current_time );\r\n \r\n // perform recover from member mail\r\n add_action( 'wp_loaded', array( &$this->cartController, 'restore_abandon_cart' ) );\r\n }", "public function onAfterInitialise()\n\t{\n\t\t// Get the application.\n\t\t$app = JFactory::getApplication();\n\n\t\t// Only in Admin.\n\t\tif ($app->isSite())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Detecting Active Variables.\n\t\t$option = $app->input->getCmd('option', '');\n\t\t$view = $app->input->getCmd('view', '');\n\t\t$layout = $app->input->getCmd('layout', 'default');\n\n\t\tif ($option == 'com_installer' && $view == 'manage' && $layout == 'default')\n\t\t{\n\t\t\t// Get the input.\n\t\t\t$cid = $app->input->post->get('cid', array(), 'array');\n\n\t\t\tforeach ($cid as $id)\n\t\t\t{\n\t\t\t\t// Get an instance of the extension table.\n\t\t\t\t$extension = JTable::getInstance('Extension');\n\t\t\t\t$extension->load($id);\n\n\t\t\t\t$this->loadExtensionLanguage($extension);\n\n\t\t\t\tswitch ($extension->type)\n\t\t\t\t{\n\t\t\t\t\tcase 'component':\n\t\t\t\t\t\t$this->exportComponent($extension);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t// $this->exportFile($extension);\n\t\t\t\t\t\t// break;\n\t\t\t\t\tcase 'language':\n\t\t\t\t\t\t// $this->exportLanguage($extension);\n\t\t\t\t\t\t// break;\n\t\t\t\t\tcase 'library':\n\t\t\t\t\t\t// $this->exportLibrary($extension);\n\t\t\t\t\t\t// break;\n\t\t\t\t\tcase 'module':\n\t\t\t\t\t\t// $this->exportModule($extension);\n\t\t\t\t\t\t// break;\n\t\t\t\t\tcase 'package':\n\t\t\t\t\t\t// $this->exportPackage($extension);\n\t\t\t\t\t\t// break;\n\t\t\t\t\tcase 'plugin':\n\t\t\t\t\t\t// $this->exportPlugin($extension);\n\t\t\t\t\t\t// break;\n\t\t\t\t\tcase 'template':\n\t\t\t\t\t\t$this->underConstruction($extension);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.8425329", "0.82395136", "0.7559028", "0.72642064", "0.722887", "0.7134401", "0.70190644", "0.6894788", "0.68835986", "0.66755086", "0.66699874", "0.6640504", "0.662751", "0.66223156", "0.6552223", "0.6431351", "0.6392818", "0.6365143", "0.63484025", "0.6332495", "0.6330982", "0.6329466", "0.6273956", "0.6267854", "0.62513995", "0.6247287", "0.6246588", "0.62369514", "0.62358904", "0.6230124", "0.6230124", "0.6222353", "0.62147796", "0.6187649", "0.6182489", "0.61757815", "0.61640066", "0.616146", "0.6160952", "0.6154052", "0.61420846", "0.6119178", "0.6119049", "0.61066675", "0.60981774", "0.6097971", "0.60941905", "0.6088578", "0.6080825", "0.60807025", "0.6075433", "0.6046721", "0.60374844", "0.60359573", "0.60341537", "0.60204256", "0.59970367", "0.5982715", "0.59738344", "0.5973831", "0.59587485", "0.5946108", "0.5931772", "0.5931772", "0.5931772", "0.5931389", "0.59265476", "0.591937", "0.5919061", "0.59145474", "0.5914446", "0.5904533", "0.5903524", "0.59025097", "0.5894099", "0.5883931", "0.58812267", "0.5879169", "0.58746624", "0.5869326", "0.5869326", "0.5866986", "0.58604515", "0.5856989", "0.5856858", "0.58566576", "0.5852725", "0.58498526", "0.584954", "0.5845979", "0.58440596", "0.58307743", "0.5828764", "0.58266616", "0.58114576", "0.5804329", "0.5790653", "0.5790566", "0.57861394", "0.5778225", "0.5768963" ]
0.0
-1
Enqueue a system message.
private function enqueueMessage($msg, $type = 'message') { // Don't add empty messages. if (! strlen(trim($msg))) { return; } // Enqueue the message if (! preg_match('#^<pre|^<div#i', $msg)) { $msg = '<pre style="line-height: 1.6em;">' . $msg . '</pre>'; } JFactory::getApplication()->enqueueMessage('<h3>' . JText::_('COM_CLM_TURNIER_DESC') . '</h3>' . $msg, $type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function enqueue($message = array()) {\n $this->_events->enqueue($message);\n }", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue() {\n\t}", "public function enqueue(array $messages);", "function send_message ($message)\t\t\t\t\n\t{\n\t\t$con = new Stomp('tcp://'.ACTIVEMQ_SERVER.':61613');\n\t\t$con->connect();\n\t\t$con->send(\"/queue/s3backup\", $message);\n\t\n\t}", "public function push($message);", "public function enqueueMessage($msg, $type = 'message')\n\t{\n\t\tif ($this->messageStatus) {\n\t\t\t$event = new Event('onApplicationEnqueueMessage');\n\t\t\t$event->addArgument('message', $msg);\n\t\t\t$event->addArgument('type', $type);\n\t\t\tFactory::getDispatcher()->triggerEvent($event);\n\t\t}\n\t}", "public static function enqueue();", "function enqueue(){\n\t\t}", "public function enqueue($item)\n {\n array_push($this->array, $item);\n }", "public function enqueueMessage($msg, $type = self::MSG_INFO)\n\t{\n\t\tif (!key_exists($type, $this->messages))\n\t\t{\n\t\t\t$this->messages[$type] = [];\n\t\t}\n\n\t\t$this->messages[$type][] = $msg;\n\t}", "public function addMessage($message);", "public function enqueue($item)\n {\n $this->items[] = $item;\n }", "public function publish($message, AbstractQueue $queue) \n {\n $queue->addMessage($message);\n }", "public function message($message): void\n {\n $this->messages[] = $message;\n }", "public function dispatchToQueue($command)\n\t{\n\t\t$queue = call_user_func($this->queueResolver);\n\n\t\tif ( ! $queue instanceof Queue)\n\t\t{\n\t\t\tthrow new \\RuntimeException(\"Queue resolver did not return a Queue implementation.\");\n\t\t}\n\n\t\t$queue->push($command);\n\t}", "function enqueue ($entry) {\n\n}", "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "function PutMessage($user_id, $message, $message_params = null, $service_command = null) \n\t{\n\t\t/*// add direct message\n\t\tif ($user_key === null) {\n\t\t\t$sid = $item_id;\n\t\t\t$user_id = 0;\n\t\t}\n\t\t// user messge post\n\t\telse {\n\t\t\t$sid = $this->db->getOne(\"SELECT sid FROM #_PREF_lc_users\", array('user_id' => $item_id, 'user_key' => $user_key));\n\t\t}*/\n\t\t\n\t\t$this->db->qI(\"#_PREF_lc_messages\", \n\t\t\tarray (\n\t\t\t\t'user_id' => $user_id,\n\t\t\t\t'sid' => $this->sid,\n\t\t\t\t'message' => $message,\n\t\t\t\t'message_params' => serialize($message_params),\n\t\t\t\t'service_command' => $service_command,\n\t\t\t\t'rec_time' => 'NOW()'\n\t\t\t)\n\t\t);\n\t\treturn true;\n\t}", "public function ackQueueMessagesExtern($params = null);", "function syncServiceWithQueue($params)\n {\n dispatch(new SyncService($params));\n }", "public function addMessage($message)\n {\n $this->storage[] = $message;\n }", "function sendMessageToQueue($messageObj){\n\tglobal $LAS_CFG;\n\t\n\t$daemon_host = $LAS_CFG->las_daemon_server['host'];\n\t$daemon_port = $LAS_CFG->las_daemon_server['port'];\n\t$daemon_url = 'tcp://'.$daemon_host.':'.$daemon_port;\n\t\n\t$client_timeout = $LAS_CFG->las_daemon_server['timeout'];\n\t\n\t$exchange_name = $LAS_CFG->message_server['taskQueue'];\n\t$new_routing_key = $exchange_name . $messageObj->routing_key;\n\t$messageObj->routing_key = $new_routing_key;\n\t\n\t// Convert JSON message to String\n\t$message = json_encode($messageObj);\n\t\n\t$server = new LasManager($daemon_url);\n\treturn $server->clientSendMessage($message, $client_timeout);\n}", "public function actionWriteMessage() {\n\t\ttry {\n\t\t\treturn $this->getService('SupportMessage')->add();\n\t\t} catch (Exception $e) {\n\t\t\treturn $this->sendError('You reached some error');\n\t\t}\n\t}", "public function enqueue($value) {\n $this->add($value);\n }", "private function performQueueOperations()\n\t{\n\t\t//$this->queue_manager = high_risk\n\t\t$application_id = $this->application->getModel()->application_id;\n\t\t$qi = $this->queue_manager->getQueue(\"high_risk\")->getNewQueueItem($application_id);\n\t\t$this->queue_manager->moveToQueue($qi, \"high_risk\");\t\t\n\t}", "public function enqueue(\\System\\Module $module)\n\t\t{\n\t\t\t$this->queue[] = $module;\n\t\t}", "public function queueOn($queue, $numbers = null, $message = null, $type = null);", "function tn_add_message( $type, $message ) {\n\t$m = TN_Messages::get_instance();\n\t$m->add_message( array( $type => $message ) );\n}", "public function enqueue($element) {\n $this->queue[] = $element;\n }", "public function queue($numbers = null, $message = null, $type = null, $queue = null);", "public static function queue($command, $parameters = array()){\n //Method inherited from \\Illuminate\\Foundation\\Console\\Kernel \n \\App\\Console\\Kernel::queue($command, $parameters);\n }", "public function send($message);", "public function send($message);", "public function send($message);", "public function send($message);", "public function add($item)\n {\n $this->queueItems[] = $item;\n }", "public function declareSimpleQueue($queueName = '', $type = self::QUEUE_DURABLE);", "public function queue($command, array $parameters = [])\n {\n // TODO: Implement queue() method.\n }", "function system_message($message) {\n\treturn system_messages($message, \"messages\");\n}", "private function send_msg() {\r\n }", "public function createQueue() {\n // Drupal is first installed) so there is nothing we need to do to create\n // a new queue.\n }", "public function pushToQueue($queue, $message) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('pushToQueue', func_get_args()));\n }", "public function pushToQueue($queue, $message) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('pushToQueue', func_get_args()));\n }", "public function add_message($message){\n $this->messages[] = $message;\n }", "public function Queues();", "function addNewMyQueue($myqueueName)\r\n {\r\n $time = time(); \r\n $q = \"INSERT INTO \".TBL_MYQUEUE.\" VALUES (NULL, '$myqueueName', $time )\";\r\n return mysql_query($q, $this->connection);\r\n }", "public function sendMessage($queueId, $message, $options = null);", "public function queue($recepient, $message, $queue = null)\n {\n $callback = [\n 'recepient' => $recepient,\n 'message' => $message,\n 'sender' => isset($sender) ? $sender : null,\n 'message_type' => isset($message_type) ? $message_type : 0\n ];\n \n return $this->queue->push('sms@handleQueuedMessage', $callback, $queue);\n }", "function EnqueueEmail( $to, $subject, $message )\r\n\t\t{\r\n\t\t\t# Store the email in a new emails table in the db, send it later\r\n\t\t\t$this->CI->load->model('email');\r\n\t\t\t$this->CI->email->Create( $to, $subject, $message );\r\n\t\t}", "public function queue(Queue $queue, self $messageJob): void\n {\n $queue->pushOn($this->queue, $messageJob);\n }", "public static function push($message) : void\n {\n array_push(static::$stack, (string)$message);\n \n }", "protected function queue($title, $output)\r\n {\r\n self::getInstance();\r\n self::$instance->_queue[] = array('title' => $title, 'output' => $output);\r\n }", "public function _DO_push()\n {\n// $res = $this->tim->group_send_group_msg('admin', 'L5900888378d29-T', 'hello');\n// $res = servTIM::sole(null)->systemMessage('L591a745be656f-T', 'hint', '老师暂时离开');\n $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-D', 'hint', '老师暂时离开');\n print_r($res);\n// $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-T', 'hint', '老师暂时离开');\n// print_r($res);\n }", "public function write($message);", "public function queue($name = null);", "public function writeMessage($message);", "public function displaySystemMessages() {\n\t\t\n\t\t\t$systemMessage = DMInput::getString('systemMessage', '');\n\t\t\t$systemMessageType = DMInput::getString('systemMessageType', 'MESSAGE');\n\t\t\t\n\t\t\tif ($systemMessage != '') {\n\t\t\t\tif ($systemMessageType === 'ERROR') {\n\t\t\t\t\t$alertClass = 'alert-error';\n\t\t\t\t} else if ($systemMessageType === 'WARNING') {\n\t\t\t\t\t$alertClass = '';\n\t\t\t\t} else if ($systemMessageType === 'SUCCESS') {\n\t\t\t\t\t$alertClass = 'alert-success';\n\t\t\t\t} else {\n\t\t\t\t\t$alertClass = 'alert-info';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$alertHtml = '<div class=\"alert ' . $alertClass . '\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button><strong>' . DMLang::_($systemMessageType) . '</strong> ' . DMLang::_($systemMessage) . '</div>';\n\t\t\t\t\n\t\t\t\t$this->outputLine($alertHtml);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "public function addMessageToQueue($message, $queue)\n {\n $this->queue->putInTube($queue, $message);\n }", "public function add($message, $messageType = false) {\n if ( empty($this->_queue) ) {\n return false;\n }\n\n\t\tif(false === $messageType)\n\t\t{\n\t\t\t$crcMessageType = $this->_msgType;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$crcMessageType = sprintf(\"%u\", crc32($messageType));\n\t\t}\n\n\t\tif ( false === msg_send($this->_queue, $crcMessageType , $message, $this->_serialize, $this->_blockSend, $err) ) {\n $this->_lastError = $err;\n return false;\n }\n return true;\n }", "public function message(string $msg, array $params = []): void\r\n {\r\n $sendMessage = new AMQPMessage($msg, $params);\r\n $this->channel->basic_publish($sendMessage, '', $this->queue);\r\n }", "public function write(string $message);", "function addMessage($txt = \"\"){\t$this->mMessages\t.= $txt;\t}", "public function pushOn($queue, $job, $data = '');", "public function admin_enqueue()\r\n {\r\n if (isset($_GET['page']) && $_GET['page'] === 'notifications') {\r\n wp_localize_script('giga-messenger-bots', 'messages', $this->messages);\r\n wp_localize_script('giga-messenger-bots', 'answers', $this->message->content);\r\n }\r\n }", "public function testQueue() {\n $node = $this->node;\n $message = Message::create([\n 'template' => 'foo',\n ]);\n\n $subscribe_options = [];\n $subscribe_options['save message'] = FALSE;\n\n try {\n $this->messageSubscribers->sendMessage($node, $message, [], $subscribe_options);\n $this->fail('Can add a non-saved message to the queue.');\n }\n catch (MessageSubscribeException $e) {\n $this->assertTrue(TRUE, 'Cannot add a non-saved message to the queue.');\n }\n\n // Assert message was saved and added to queue.\n $uids = array_fill(1, 10, new DeliveryCandidate([], [], 1));\n foreach ($uids as $uid => $candidate) {\n $candidate->setAccountId($uid);\n }\n $subscribe_options = [\n 'uids' => $uids,\n 'skip context' => TRUE,\n 'range' => 3,\n ];\n $queue = \\Drupal::queue('message_subscribe');\n $this->assertEquals($queue->numberOfItems(), 0, 'Queue is empty');\n $this->messageSubscribers->sendMessage($node, $message, [], $subscribe_options);\n $this->assertTrue((bool) $message->id(), 'Message was saved');\n $this->assertEquals($queue->numberOfItems(), 1, 'Message added to queue.');\n\n // Assert queue-item is processed and updated. We mock subscription\n // of users to the message. It will not be sent, as the default\n // notifier is disabled.\n $item = $queue->claimItem();\n $item_id = $item->item_id;\n\n // Add the queue information, and the user IDs to process.\n $subscribe_options['queue'] = [\n 'uids' => $uids,\n 'item' => $item,\n 'end time' => FALSE,\n ];\n\n $this->messageSubscribers->sendMessage($node, $message, [], $subscribe_options);\n\n // Reclaim the new item, and assert the \"last UID\" was updated.\n $item = $queue->claimItem();\n $this->assertNotEquals($item_id, $item->item_id, 'Queue item was updated.');\n $this->assertEquals($item->data['subscribe_options']['last uid'], 3, 'Last processed user ID was updated.');\n }", "public function addQueue($strName, $iOpen = 0, $bText = false)\n {\n if($bText && !$this->isAllowed('moderator')) return $this->returnText(self::ERR_NO_MOD);\n if(trim($strName) == \"\") return $this->returnText('No queue name specified to add');\n\n $oQueue = Queue::where([\n ['channel_id', '=', $this->c->id],\n ['name', '=', $strName]\n ])->first();\n\n if(!$oQueue)\n {\n $oQueue = Queue::create([\n 'channel_id' => $this->c->id,\n 'name' => $strName,\n 'is_open' => ($iOpen == 0 ? 0 : 1)\n ]);\n }\n elseif($bText) return $this->returnText('Queue \"'. $strName .'\" already exists');\n\n if($bText === false)\n {\n if($oQueue) return $oQueue;\n return false;\n }\n elseif($oQueue)\n {\n return $this->returnText('Successfully added queue \"'. $strName .'\"');\n }\n }", "private function send_system()\n\t{\n\t\t$to = $this->mail_to_name.' <'.$this->mail_to_email.'>';\n\n\t\t$headers = $this->getHeaders();\n\t\tmail($to, $this->mail_subject, $this->mail_message, $headers);\n\t}", "protected function registerSystem() { }", "function syncAddonWithQueue($params)\n {\n dispatch(new SyncAddons($params));\n }", "function add($message) { return; }", "protected function addMessage($message, $title = '', $severity = FlashMessage::OK)\n {\n /** @var $flashMessage FlashMessage */\n $flashMessage = GeneralUtility::makeInstance(\n FlashMessage::class,\n $message,\n $title,\n $severity\n );\n $defaultFlashMessageQueue = $this->flashMessageService->getMessageQueueByIdentifier();\n $defaultFlashMessageQueue->enqueue($flashMessage);\n }", "public function send($message)\n {\n }", "public function create(string $message = ''): BusMessageInterface;", "public function testEnqueueWithSynchronousTopic()\n {\n $topicName = 'topic.name';\n $response = 'responseBody';\n $topicData = [\n \\Magento\\Framework\\Communication\\ConfigInterface::TOPIC_IS_SYNCHRONOUS => true\n ];\n $this->communicationConfig->expects($this->once())\n ->method('getTopic')->with($topicName)->willReturn($topicData);\n $envelope = $this\n ->getMockBuilder(\\Magento\\Framework\\MessageQueue\\EnvelopeInterface::class)\n ->disableOriginalConstructor()->getMock();\n $this->exchange->expects($this->once())->method('enqueue')->with($topicName, $envelope)->willReturn($response);\n $this->assertEquals([$response], $this->bulkExchange->enqueue($topicName, [$envelope]));\n }", "public function addMessage($message)\n\t{\n\t\t$this->messages[] = $message;\n\t}", "public function add(Message $flash);", "public function addMessage($message) {\n $this->messages[] = $message;\n }", "public function addMessage($message)\n {\n $this->messages[] = $message;\n }", "public function createQueue();", "public static function push()\n {\n return <<<'LUA'\n-- Push the job onto the queue...\nredis.call('zadd', KEYS[1], 'NX', ARGV[1], ARGV[2])\n-- Push a notification onto the \"notify\" queue...\nredis.call('rpush', KEYS[2], 1)\nLUA;\n }", "public function pushToQueue($queue, $message)\n {\n $message = $message instanceof AMQPMessage\n ? $message\n : new AMQPMessage($message);\n\n $this->getChannel()->queue_declare($queue);\n $this->getChannel()->basic_publish($message, '', $queue);\n }", "abstract public function enqueue($Job, $priority = null);", "public function enqueue($task);", "public function queue(Command $command, $handler = null);", "private function declareQueue($name)\n {\n\n $this->connection->channel()->queue_declare(\n $this->config['exchange'],\n $this->config['passive'] ?? false,\n $this->config['durable'] ?? false,\n $this->config['exclusive'] ?? false,\n $this->config['nowait'] ?? false\n );\n }", "public function addMsgFtok(string $msg_queue_name, string $path_name, string $project)\n {\n if (!extension_loaded('sysvmsg')) {\n throw new \\Exception(sprintf(\"【Warning】%s::%s missing sysvmsg extension\",\n __CLASS__,\n __FUNCTION__\n ));\n }\n\n if (strlen($project) != 1) {\n throw new \\Exception(sprintf(\"【Warning】%s::%s. the params of project require only one string charset\",\n __CLASS__,\n __FUNCTION__\n ));\n }\n\n $pathNameKey = md5($path_name);\n $msgQueueNameKey = md5($msg_queue_name);\n\n if (isset($this->msgProject[$pathNameKey][$project])) {\n throw new \\Exception(sprintf(\"【Warning】%s::%s. the params of project is had setting\",\n __CLASS__,\n __FUNCTION__\n ));\n }\n\n $this->msgProject[$pathNameKey][$project] = $project;\n\n $msgKey = ftok($path_name, $project);\n if ($msgKey < 0) {\n throw new SystemException(sprintf(\"【Warning】%s::%s create msg_key failed\",\n __CLASS__,\n __FUNCTION__\n ));\n }\n\n $msgQueue = msg_get_queue($msgKey, 0666);\n $this->msgNameMapQueue[$msgQueueNameKey] = $msg_queue_name;\n\n if (is_resource($msgQueue) && msg_queue_exists($msgKey)) {\n $this->msgQueues[$msgQueueNameKey] = $msgQueue;\n defined('ENABLE_WORKERFY_SYSVMSG_MSG') or define('ENABLE_WORKERFY_SYSVMSG_MSG', 1);\n }\n\n return true;\n }", "protected function addMessage($type,$message) \n { \n $this->flashMessenger()->setNamespace($type)->addMessage(array($type => $message));\n }", "public function addQueue(QueueInterface $queue);", "private function setQueue() {\n if (count($this->request->q) > 0) {\n try {\n $this->client->setQueue(array($this->request->q));\n $this->view->addParameter(\"result\", \"success\");\n } catch(Exception $e) {\n $this->view->addParameter(\"result\", \"failure\");\n $this->view->addParameter(\"data\", \"Failed to execute '{$this->request->action}' action\");\n }\n } else {\n $this->view->addParameter(\"result\", \"invalid\");\n $this->view->addParameter(\"data\", \"Query array must not be empty\");\n }\n }", "public function add($id) \n {\n $log = FezLog::get();\n if (!array_key_exists($id,$this->_ids) || !$this->_ids[$id]) {\n $this->_ids[$id] = self::ACTION_ADD;\n $log->debug(\"Added $id to queue\");\n }\n }", "public function add() {\n $this->out('CakePHP Queue Example task.');\n $this->hr();\n $this->out('This is a very simple example of a QueueTask.');\n $this->out('I will now add an example Job into the Queue.');\n $this->out('This job will only produce some console output on the worker that it runs on.');\n $this->out(' ');\n $this->out('To run a Worker use:');\n $this->out('\tbin/cake queue runworker');\n $this->out(' ');\n $this->out('You can find the sourcecode of this task in: ');\n $this->out(__FILE__);\n $this->out(' ');\n\n //$options = getopt('',['id:']);\n /*\n * Adding a task of type 'example' with no additionally passed data\n */\n //if ($this->QueuedJobs->createJob('RemittanceApi', ['id'=>4033, 'batch_id'=>'58e44de0f33a7'])) {\n if ($this->QueuedJobs->createJob('RemittanceApi', null)) {\n $this->out('OK, job created, now run the worker');\n } else {\n $this->err('Could not create Job');\n }\n }", "public function enqueue($handles)\n {\n }", "protected function addMessage(string $message, $type = self::MESSAGE_INFO) {\n\t\t$this->messages[$type][] = $message;\n\t}" ]
[ "0.644728", "0.64358544", "0.62235796", "0.62235796", "0.62235796", "0.62235796", "0.62235796", "0.62235796", "0.61118054", "0.592221", "0.5922043", "0.5882807", "0.5859655", "0.58204246", "0.5792052", "0.5739909", "0.5644332", "0.5568418", "0.5539051", "0.5389984", "0.5380677", "0.53308755", "0.53102416", "0.5308768", "0.5308522", "0.5277079", "0.52720904", "0.52581847", "0.52429897", "0.5241001", "0.5230767", "0.5217237", "0.51968306", "0.5193136", "0.5187983", "0.5155632", "0.51456887", "0.5134221", "0.5126239", "0.5126239", "0.5126239", "0.5126239", "0.5111664", "0.5106345", "0.50891125", "0.50883806", "0.5085156", "0.50850487", "0.5084815", "0.5084815", "0.508481", "0.5078865", "0.50769013", "0.50761914", "0.5060834", "0.5060579", "0.50599736", "0.50570863", "0.5056584", "0.50543475", "0.5038937", "0.5038406", "0.5032639", "0.5025703", "0.5014613", "0.5014144", "0.5004053", "0.49739444", "0.49694613", "0.49662983", "0.49560556", "0.4954288", "0.49428904", "0.4935984", "0.49276587", "0.4922748", "0.49102986", "0.48969626", "0.4892418", "0.4882371", "0.4874456", "0.48671493", "0.4866716", "0.48659962", "0.48603255", "0.48528162", "0.48523393", "0.48518404", "0.48349607", "0.48335075", "0.4815199", "0.48138836", "0.47992373", "0.47953227", "0.4794442", "0.4785969", "0.4768328", "0.47647178", "0.47604924", "0.475561" ]
0.5401502
19
Delete files that should not exist
private function deleteUnexistingFiles() { $files = array ( // Release 2.0 '/administrator/language/de-DE/de-DE.com_clm_turnier.sys.ini', '/administrator/language/en-GB/en-GB.com_clm_turnier.sys.ini', // Release 3.2.0 '/administrator/components/com_clm_turnier/layouts/form/fields/sonderranglisten-j4.php', '/components/com_clm_turnier/helpers/html/clm_turnier.php', // Release 3.2.1 '/media/com_clm_turnier/js/sonderranglisten-j4.php' ); $folders = array ( // Release 3.0 '/components/com_clm_turnier/includes', // Release 3.2.0 '/administrator/components/com_clm_turnier/helpers/html', '/administrator/components/com_clm_turnier/helpers', // Release 3.2.1 '/components/com_clm_turnier/classes/' ); jimport('joomla.filesystem.file'); foreach ($files as $file) { if (JFile::exists(JPATH_ROOT . $file) && ! JFile::delete(JPATH_ROOT . $file)) { $this->enqueueMessage(JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $file), 'warning'); } } jimport('joomla.filesystem.folder'); foreach ($folders as $folder) { if (JFolder::exists(JPATH_ROOT . $folder) && ! JFolder::delete(JPATH_ROOT . $folder)) { $this->enqueueMessage(JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $folder), 'warning'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteUnexistingFiles()\n\t{\n\t\tinclude JPATH_ADMINISTRATOR . '/components/com_hierarchy/deletelist.php';\n\n\t\tjimport('joomla.filesystem.file');\n\n\t\tforeach ($files as $file)\n\t\t{\n\t\t\tif (JFile::exists(JPATH_ROOT . $file) && !JFile::delete(JPATH_ROOT . $file))\n\t\t\t{\n\t\t\t\t$app->enqueueMessage(JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $file));\n\t\t\t}\n\t\t}\n\n\t\tjimport('joomla.filesystem.folder');\n\n\t\tforeach ($folders as $folder)\n\t\t{\n\t\t\tif (JFolder::exists(JPATH_ROOT . $folder) && !JFolder::delete(JPATH_ROOT . $folder))\n\t\t\t{\n\t\t\t\t$app->enqueueMessage(JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $folder));\n\t\t\t}\n\t\t}\n\t}", "protected function removeFiles() {}", "public static function deleteFiles() : void{\n $files = glob(self::DIRECTORY . '/*');\n foreach($files as $file){\n if(is_file($file))\n unlink($file);\n }\n }", "public function deleteUnusedFiles(){\n \n }", "private function cleanFiles($files) {\n foreach ($files as $v) {\n $file = $this->tmpFolder . '/' . $v;\n if(file_exists($file)) {\n unlink($file);\n }\n }\n }", "function cleanup_files() {\n\t$files = glob(\"./*.{mp4,mp3,zip}\", GLOB_BRACE);\n\tforeach ($files as $file) {\n\t\tunlink($file);\n\t}\n}", "private function cleanupFiles() {\n\t\t$this -> loadModel('Archivo');\n\t\t$items = $this -> Archivo -> find('all');\n\t\t$db_files = array();\n\t\tforeach ($items as $key => $item) {\n\t\t\t$db_files[] = $item['Archivo']['ruta'];\n\t\t}\n\t\t$dir_files = array();\n\t\t$dir_path = APP . 'webroot/files/uploads/solicitudesTitulacion';\n\t\tif ($handle = opendir($dir_path)) {\n\t\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\t\tif ($entry != 'empty' && is_file($dir_path . DS . $entry))\n\t\t\t\t\t$dir_files[] = 'files/uploads/solicitudesTitulacion/' . $entry;\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\tforeach ($dir_files as $file) {\n\t\t\tif (!in_array($file, $db_files)) {\n\t\t\t\t$file = explode('/', $file);\n\t\t\t\t$file = $file[count($file) - 1];\n\t\t\t\t$tmp_file_path = $dir_path . DS . $file;\n\t\t\t\tunlink($tmp_file_path);\n\t\t\t}\n\t\t}\n\t}", "public function maybe_delete_files() {\n\n\t\t// If there are files to delete, delete them.\n\t\tif ( ! empty( gf_dropbox()->files_to_delete ) ) {\n\n\t\t\t// Log files being deleted.\n\t\t\t$this->log_debug( __METHOD__ . '(): Deleting local files => ' . print_r( gf_dropbox()->files_to_delete, 1 ) );\n\n\t\t\t// Delete files.\n\t\t\tarray_map( 'unlink', gf_dropbox()->files_to_delete );\n\n\t\t}\n\n\t}", "private function clean() {\n foreach (glob($this->dir . '/*') as $file) {\n $name = basename($file);\n if (!preg_match('/^\\d{10}/', $name))\n throw new \\Exception('Unexpected filename. Make sure \"' . $this->dir . '\" contains only build artefacts (and is thus safe to clean) and try again.');\n $deleted = unlink($file);\n if (!$deleted)\n throw new \\Exception('Failed to delete \"' . $file . '\". Make sure target directory is writable to allow delete of other users files.');\n }\n }", "function cleanUpTmpFiles($target){\n if (is_dir($target)) {\n $files = glob($target . '*', GLOB_MARK); //GLOB_MARK adds a slash to directories returned\n\n foreach ($files as $file) {\n cleanUpTmpFiles($file);\n }\n\n // Checks if dir is empty\n if (!(new FilesystemIterator($target))->valid()) {\n rmdir($target);\n }\n } elseif (is_file($target)) {\n unlink($target);\n }\n}", "function remove_temp_files() {\n\t\n\tif(!class_exists(FilterIterator) && !class_exists(RecursiveDirectoryIterator)) return;\n\tclass TempFilesFilterIterator extends FilterIterator {\n\t\tpublic function accept() {\n\t\t\t$fileinfo = $this->getInnerIterator()->current();\n\t\t\tif(preg_match('/temp_.*/', $fileinfo)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\t$iterator = new RecursiveDirectoryIterator(__CHV_FOLDER_IMAGES__); // PHP > 5.3 flag: FilesystemIterator::SKIP_DOTS\n\t$iterator = new TempFilesFilterIterator($iterator);\n\tforeach ($iterator as $file) {\n\t\tunlink($file->getPathname());\n\t}\n}", "private function deleteTemporaryFiles()\n {\n foreach ($this->temp as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n\n $this->temp = [];\n }", "public function cleanCompilationFolder($files_to_delete)\n {\n foreach ($files_to_delete as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n }", "function delete_files($target) { \n if(is_dir($target)){\n $files = glob( $target . '*', GLOB_MARK ); //GLOB_MARK adds a slash to directories returned\n \n foreach( $files as $file )\n {\n delete_files( $file ); \n }\n \n rmdir( $target );\n } elseif(is_file($target)) {\n unlink( $target ); \n }\n}", "public function removeRegisteredFiles() {}", "public function cleanupFiles()\n {\n\n echo 'Cleaning ' . $this->accountID . ' - ' . $this->accountName . ' File Directories' . PHP_EOL;\n\n foreach (glob(\"{$this->commissionsOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('1 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(\"{$this->dailyFileOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('1 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(\"{$this->monthlyFileOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('2 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(\"{$this->metaFileOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('1 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(self::EXPORT_TMP_DIR . \"/*.txt\") as $filename) {\n unlink($filename);\n }\n\n echo 'Finished cleaning ' . $this->accountName . ' File Directories' . PHP_EOL;\n }", "protected function tidyUpFiles() {\n\t\t/* load valid ids */\n\t\t$validIds = array();\n\t\t$result = $this->db->query('SELECT id FROM image');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_NUM)) {\n\t\t\t\t$validIds[] = $entry[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* remove entries with missing file */\n\t\tforeach ($validIds as $id) {\n\t\t\tif (!is_file(self::getPath($id))) {\n\t\t\t\t$this->delete($id);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* delete from list what is not in the database */\n\t\tif ($dh = opendir(self::FILES_DIR)) {\n\t\t\twhile (($id = readdir($dh)) !== false) {\n\t\t\t\tif (preg_match('#^[0-9a-zA-Z]+$#', $id) && !in_array($id, $validIds) && $id != self::DATABASE_FILE) {\n\t\t\t\t\t$this->delete($id);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t}\n\t}", "public static function _removeTmpFiles()\n {\n if (count($GLOBALS['_System_temp_files'])) {\n $delete = $GLOBALS['_System_temp_files'];\n array_unshift($delete, '-r');\n System::rm($delete);\n $GLOBALS['_System_temp_files'] = array();\n }\n }", "private function cleanTmp()\n {\n // cleanup files in tmp\n $dir = ELAB_ROOT . '/uploads/tmp';\n $di = new \\RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);\n $ri = new \\RecursiveIteratorIterator($di, \\RecursiveIteratorIterator::CHILD_FIRST);\n foreach ($ri as $file) {\n $file->isDir() ? rmdir($file) : unlink($file);\n }\n }", "public function cleanUpFolder()\r\n {\r\n $fs = new Filesystem();\r\n\r\n foreach($this->file_list as $file) :\r\n if ( preg_match('#^'.$this->destination_dir.'/#', $file))\r\n $fs->remove($file);\r\n endforeach;\r\n }", "public function cleanTmpFolder() {\n\t\tarray_map('unlink', glob($this->settings->tmp_path . '/*'));\n\t}", "public function cleanFiles()\n { \n $this->zip();\n // $this->unzip();\n\n if (!empty($this->files)) {\n foreach ($files as $file) {\n $this->clean($file);\n }\n }\n }", "public function unlinkTempFiles() {}", "public function unlinkTempFiles() {}", "public function removeTemporaryFiles()\n {\n foreach ($this->temporaryFiles as $file) {\n $this->unlink($file);\n }\n }", "public function wp_clean_files()\n\t{\n\n\t\tforeach ($this->_fileswp as $key => $file) {\n\t\t\tif(is_dir($file)) {\n\t\t\t\t$this->rrmdir($file);\n\t\t\t} else {\n\t\t\t\t@unlink($file);\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function remove_files() {\n\t\t$rm = escapeshellarg( self::RM );\n\t\t$files = escapeshellarg( $this->tmp_dir );\n\n\t\t$this->exec_with_notify( escapeshellcmd( \"{$rm} -rf {$files}\" ) );\n\t}", "function delete_files($target) {\r\n\t\t\t\tif(is_dir($target)){\r\n\t\t\t\t\t//GLOB_MARK adds a slash to directories returned\r\n\t\t\t\t\t$files = glob( $target . '*', GLOB_MARK ); \r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach( $files as $file )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdelete_files( $file ); \r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\trmdir( $target );\r\n\t\t\t\t} elseif(is_file($target)) {\r\n\t\t\t\t\tunlink( $target ); \r\n\t\t\t\t}\r\n\t\t\t}", "public function tearDown()\n {\n foreach ($this->files as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n }", "function delete_files($target) {\n if(is_dir($target)){\n $files = glob( $target . '*', GLOB_MARK ); //GLOB_MARK adds a slash to directories returned\n\n foreach( $files as $file ){\n delete_files( $file ); \n }\n\n rmdir( $target );\n } elseif(is_file($target)) {\n unlink( $target ); \n }\n}", "function files_delete()\n{\n // remove module vars and masks\n xarModDelAllVars('files');\n xarRemoveMasks('files');\n\n // Deletion successful\n return true;\n}", "private function clean() {\n\t\t$types = ['.aux', '.fdb_latexmk', '.fls', '.log', '.out', '.tex', '.toc'];\n\t\t$s = '';\n\t\tforeach (scandir($this -> directory) as $file) {\n\t\t\tif ($file === '.' || $file === '..') continue;\n\t\t\tforeach ($types as $t) {\n\t\t\t\t$extension = substr($file, 0-strlen($t));\n\t\t\t\tif (in_array($extension, $types) && file_exists($this -> directory . '/' . $file)) {\n\t\t\t\t\tunlink($this -> directory . '/' . basename($file));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function clean()\n {\n if ( is_dir( $this->_strDirectory ) ) {\n $h = opendir($this->_strDirectory);\n while ($h && $f = readdir($h)) { \n if ( $f != '.' && $f != '..') {\n $fn = $this->_strDirectory . '/' . $f;\n if ( is_dir($fn) ) {\n $dir = new Sys_Dir($fn);\n $dir->delete();\n } else {\n $file = new Sys_File( $fn );\n $file->delete();\n }\n }\n }\n\t if ( $h ) { closedir( $h ); }\n \n }\n }", "private function deleteOldTempdirs(){\n $dirname = FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH;\n $dircontents = scandir($dirname);\n foreach($dircontents as $file){\n if ( substr($file, 0,5) == 'temp_' &&\n is_dir($dirname.$file) &&\n filemtime( $dirname.$file ) < strtotime('now -2 days')) {\n $this->destroyDir($dirname.$file);\n }\n }\n }", "public function deleteAllFiles(): bool {\n return $this->fileService->deleteDirectory('public/products');\n }", "function deleteTemp () : void {\n\tforeach(glob(_ROOT_PATH.'temp/*') as $file){\n\t\tunlink($file);\n\t}\n}", "public function clean() {\n // Clean Temporary Files\n if (is_dir($this->tmpPath)) {\n $objects = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->tmpPath), \\RecursiveIteratorIterator::SELF_FIRST\n );\n foreach ($objects as $name => $object) {\n if (!$object->isDir()) {\n @unlink($name);\n }\n }\n }\n\n // Clean Cache Files\n if (is_dir($this->cachePath)) {\n $objects = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->cachePath), \\RecursiveIteratorIterator::SELF_FIRST\n );\n foreach ($objects as $name => $object) {\n if (!$object->isDir()) {\n @unlink($name);\n }\n }\n }\n }", "public static function cleanupTempFolder(){\r\n\t\t$files = glob($_SERVER[\"DOCUMENT_ROOT\"] . \"/tmp/*\");\r\n\t\t$now = time();\r\n\r\n\t\tforeach($files as $file){\r\n\t\t\tif(is_file($file) && basename($file) != \".keep\"){\r\n\t\t\t\tif($now - filemtime($file) >= 60*60*24){\r\n\t\t\t\t\tunlink($file);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function unlinkTempFiles()\n {\n $typo3temp = PATH_site . 'typo3temp/';\n foreach (glob($typo3temp . $this->tempFilePrefix . '*') as $tempFile) {\n @unlink($tempFile);\n }\n }", "public function cleanZipFolder()\r\n {\r\n foreach(glob(\"{$this->destination_dir}/*\") as $file)\r\n {\r\n if (is_file($file)) {\r\n unlink($file);\r\n }\r\n }\r\n }", "public function cleanUploadedFiles(): void\n {\n foreach ($this->uploadedFiles as $file) {\n @unlink($file['tmp_name']);\n }\n }", "function clean_installation()\n{\n $files = glob(VAR_FOLDER . DS . '*');\n foreach ($files as $file) {\n if (is_file($file) && $file !== DEFAULT_ACCOUNTFILE && $FILE !== DEFAULT_METAFILE) {\n unlink($file);\n }\n }\n}", "function purge_files(){\n\t//echo \"<pre>purge_files: To limit disk space, everytime you create an effect all previous files are removed</pre>\\n\";\n\t//echo \"<pre>purge_files: Removing *.png, *.dat,*.vir,*.txt,*.hls,*.gp,*.srt,.*.lms</pre>\\n\";\n\t$directory=getcwd();\n}", "public function removeTempFiles()\n {\n $this->removeDir($this->context['temp_dir']);\n }", "public static function invalidate() {\n if (is_dir(self::$fileBased))\n {\n $dir = opendir(self::$fileBased);\n while ($file = readdir($dir)) {\n @unlink(YPFramework::getFileName(self::$fileBased, $file));\n }\n }\n }", "private function removeOldFiles()\n {\n if ($handle = opendir($this->uploadDir)) {\n\n while (false !== ($file = readdir($handle))) {\n if (is_file($file)) {\n if (filectime($this->uploadDir . $file) < (time() - $this->fileHandleTime)) {\n unlink($this->uploadDir . $file);\n }\n }\n }\n }\n }", "function scorm_delete_files($directory) {\n if (is_dir($directory)) {\n $files=scorm_scandir($directory);\n set_time_limit(0);\n foreach($files as $file) {\n if (($file != '.') && ($file != '..')) {\n if (!is_dir($directory.'/'.$file)) {\n unlink($directory.'/'.$file);\n } else {\n scorm_delete_files($directory.'/'.$file);\n }\n }\n }\n rmdir($directory);\n return true;\n }\n return false;\n}", "public function cleanTempFiles()\n\t{\n\t\t$manifestData = $this->_getManifestData();\n\n\t\tforeach ($manifestData as $row)\n\t\t{\n\t\t\tif (UpdateHelper::isManifestVersionInfoLine($row))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$rowData = explode(';', $row);\n\n\t\t\t// Delete any files we backed up.\n\t\t\t$backupFilePath = IOHelper::normalizePathSeparators(blx()->path->getAppPath().$rowData[0].'.bak');\n\n\t\t\tif (($file = IOHelper::getFile($backupFilePath)) !== false)\n\t\t\t{\n\t\t\t\tBlocks::log('Deleting backup file: '.$file->getRealPath(), \\CLogger::LEVEL_INFO);\n\t\t\t\t$file->delete();\n\t\t\t}\n\t\t}\n\n\t\t// Delete the temp patch folder\n\t\tIOHelper::deleteFolder($this->_unzipFolder);\n\n\t\t// Delete the downloaded patch file.\n\t\tIOHelper::deleteFile($this->_downloadFilePath);\n\t}", "protected function doCleanup() {\n $base = $this->tempPath();\n $dirs = array($base);\n\n if (is_dir($base)) {\n foreach ($this->recurse($base) as $file) {\n if (is_dir($file)) {\n $dirs[] = $file;\n } else {\n unlink($file);\n }\n }\n\n foreach (array_reverse($dirs) as $path) {\n rmdir($path);\n }\n }\n\n foreach (array(self::LOGFILE_STUB, self::STATEFILE_STUB, self::ZIPTEMP_STUB, self::ZIPCOMP_STUB) as $extra_file) {\n if (is_file($base.$extra_file)) {\n unlink($base.$extra_file);\n }\n }\n }", "function delete_tmp_folder_content()\n{\n\t$baseDir = '../backups/tmp/';\n\t$files = scandir($baseDir);\n\tforeach ($files as $file) \n\t{\n\t\tif ( ($file != '.') && ($file != '..') && ($file != '.htaccess') ) \n\t\t{\n\t\t\tif ( is_dir($baseDir . $file) ) recursive_deletion($baseDir.$file.'/');\n\t\t\telse unlink('../backups/tmp/' . $file);\n\t\t}\n\t}\n}", "public function invalidateAll() : void\n {\n $files = glob($this->path . \"/*\"); // get all file names\n foreach ($files as $file) { // iterate files\n if (is_file($file)) {\n unlink($file); // delete file\n }\n }\n }", "protected function utilPurgeOrphans()\n {\n if (!$this->confirmToProceed('This will PERMANENTLY DELETE files in \"system_files\" that do not belong to any other model.')) {\n return;\n }\n\n $orphanedFiles = 0;\n\n // Locate orphans\n $files = FileModel::whereNull('attachment_id')->get();\n\n foreach ($files as $file) {\n $file->delete();\n $orphanedFiles += 1;\n }\n\n if ($orphanedFiles > 0) {\n $this->comment(sprintf('Successfully deleted %d orphaned record(s).', $orphanedFiles));\n }\n else {\n $this->comment('No records to purge.');\n }\n }", "function delete_dir_with_file($target)\n{\n if (is_dir($target)) {\n $files = glob($target . '*', GLOB_MARK); //GLOB_MARK adds a slash to directories returned\n\n foreach ($files as $file) {\n delete_dir_with_file($file);\n }\n\n if (file_exists($target)) {\n rmdir($target);\n }\n } elseif (is_file($target)) {\n unlink($target);\n }\n}", "function borrarCarpeta($carpeta) {\r\n foreach(glob($carpeta . \"/*\") as $archivos_carpeta){ \r\n if (is_dir($archivos_carpeta)){\r\n if($archivos_carpeta != \".\" && $archivos_carpeta != \"..\") {\r\n borrarCarpeta($archivos_carpeta);\r\n }\r\n } else {\r\n unlink($archivos_carpeta);\r\n }\r\n }\r\n rmdir($carpeta);\r\n}", "protected function cleanupTestDirectory() {\n\t\tforeach ($this->filesToRemove as $file) {\n\t\t\tif (file_exists($this->testBasePath . $file)) {\n\t\t\t\tunlink($this->testBasePath . $file);\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->directoriesToRemove as $directory) {\n\t\t\tif (file_exists($this->testBasePath . $directory)) {\n\t\t\t\trmdir($this->testBasePath . $directory);\n\t\t\t}\n\t\t}\n\t}", "protected function cleanup() {\n $h = opendir($this->tmpdir);\n while (false !== ($e = readdir($h))) {\n if ($e!='.'&&$e!='..'&&is_file($this->tmpdir.'/'.$e)) unlink ($this->tmpdir.'/'.$e);\n }\n if (is_object($this->history)) $this->history->cleanup();\n closedir($h);\n rmdir($this->tmpdir);\n }", "static function deleteFiles($pool) {\n $path = JPATH_COMPONENT.DS.\"data\".DS.$pool;\n system(\"rm -rf \".$path);\n $path = JPATH_COMPONENT.DS.\"private\".DS.$pool;\n system(\"rm -rf \".$path);\n }", "protected function cleanup()\n {\n foreach ($this->temp_files as $file) {\n $this->filesystem->remove($file);\n }\n $this->temp_files = [];\n }", "function deleteUserImageFiles($username) {\n $target_dir = \"uploads/\" . $username . \"/\";\n\n $files = glob(\"$target_dir/*.*\");\n foreach ($files as $file) {\n unlink($file);\n }\n if (is_dir($target_dir)) {\n rmdir($target_dir);\n }\n}", "function _clear_cache_files () {\n\t\t// Memcached code\n\t\tif ($this->USE_MEMCACHED) {\n// TODO\n\t\t// Common (files-based) cache code\n\t\t} else {\n\t\t\t$dh = @opendir($this->CACHE_DIR);\n\t\t\tif (!$dh) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\twhile (($f = readdir($dh)) !== false) {\n\t\t\t\tif ($f == \".\" || $f == \"..\" || !is_file($this->CACHE_DIR.$f)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (common()->get_file_ext($f) != \"php\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (substr($f, 0, strlen($this->_file_prefix)) != $this->_file_prefix) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Do delete cache file\n\t\t\t\tif (file_exists($this->CACHE_DIR.$f)) {\n\t\t\t\t\tunlink($this->CACHE_DIR.$f);\n\t\t\t\t}\n\t\t\t}\n\t\t\t@closedir($dh);\n\t\t}\n\t}", "public function cleanAll()\n {\n $this->filesystem->remove(self::getFilesList());\n }", "public function clear(): bool\n {\n $result = [];\n $files = array_diff(scandir($this->config['path']), ['..', '.']);\n $prefixLength = strlen($this->config['prefix']);\n foreach ($files as $file) {\n if (substr($file, 0, $prefixLength) === $this->config['prefix']) {\n $result[] = unlink($this->config['path'] . '/' . $file) === true;\n }\n }\n\n return ! in_array(false, $result);\n }", "protected function removeFiles()\n {\n assert(valid_num_args());\n\n $remove = new RemoveProcess($this->config, $this->env, $this->output);\n $remove->execute();\n }", "public function clean() {\n $this->logger->debug('Deleting of all cache files');\n $list = glob($this->cacheFilePath . '*.cache');\n if (!$list) {\n $this->logger->info('No cache files were found skipping');\n return;\n }\n $this->logger->info('Found [' . count($list) . '] cache files to remove');\n foreach ($list as $file) {\n $this->logger->debug('Processing the cache file [' . $file . ']');\n unlink($file);\n }\n }", "protected function removeFilesAndDirectories()\n {\n parent::removeFilesAndDirectories();\n $this->laravel['files']->delete(base_path('routes/admin.php'));\n }", "public function delete($files);", "public function vaciar_temporales()\n\t{\n\t\t$directorio = $_SERVER['DOCUMENT_ROOT'].Yii::app()->request->baseUrl.\"/images/tmp/\"; \n\t\t/**\n\t\t*\tRecorre el directorio y borra los archivos que contiene\n\t\t*/\n\t\t$handle = opendir($directorio); \n\t\twhile ($file = readdir($handle)) { \n\t\t\tif (is_file($directorio.$file)) { \n\t\t\t\tunlink($directorio.$file); \n\t\t\t}\n\t\t}\n\t}", "function clean_old_files(){\n\t$files = scandir(OUTPUT_FOLDER);\n\tforeach($files as $file){\n\t\tif($file != '.' && $file != '..'){\n\t\t\t$ext = substr($file,-4,4);\n\t\t\tif($ext == 'json'){\n\t\t\t\t$filemtime = filemtime(OUTPUT_FOLDER.'/'.$file);\n\t\t\t\t$diff = time() - $filemtime;\n\t\t\t\tif($diff >= FILE_LIFETIME){\n\t\t\t\t\t@unlink(OUTPUT_FOLDER.'/'.$file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function eliminarDirectorio($directorio){\n foreach(glob($directorio . \"/*\") as $archivos_carpeta){\n if (is_dir($archivos_carpeta)){\n eliminarDirectorio($archivos_carpeta);\n }\n else{\n unlink($archivos_carpeta);\n }\n }\n rmdir($directorio);\n}", "public static function clear(){\n $directory = \"bin\";\n\n if(is_dir($directory)) {\n $scan = scandir($directory);\n unset($scan[0], $scan[1]); //unset . and ..\n foreach($scan as $file) {\n $filename = \"$directory/$file\";\n $filedate = date (\"d/m/Y\", filemtime($filename));\n\n if( $filedate < date(\"d/m/Y\") )\n unlink($filename);\n }\n }\n }", "public function clearCacheFiles()\n {\n if (false === $this->cache) {\n return;\n }\n foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->cache), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {\n if ($file->isFile()) {\n @unlink($file->getPathname());\n }\n }\n }", "function serendipity_removeFiles($files = null) {\n global $serendipity, $errors;\n\n if (!is_array($files)) {\n return;\n }\n\n $backupdir = S9Y_INCLUDE_PATH . 'backup';\n if (!is_dir($backupdir)) {\n @mkdir($backupdir, 0777);\n if (!is_dir($backupdir)) {\n $errors[] = sprintf(DIRECTORY_CREATE_ERROR, $backupdir);\n return false;\n }\n }\n\n if (!is_writable($backupdir)) {\n $errors[] = sprintf(DIRECTORY_WRITE_ERROR, $backupdir);\n return false;\n }\n\n foreach($files AS $file) {\n $source = S9Y_INCLUDE_PATH . $file;\n $sanefile = str_replace('/', '_', $file);\n $target = $backupdir . '/' . $sanefile;\n\n if (!file_exists($source)) {\n continue;\n }\n\n if (file_exists($target)) {\n $target = $backupdir . '/' . time() . '.' . $sanefile; // Backupped file already exists. Append with timestamp as name.\n }\n\n if (!is_writable($source)) {\n $errors[] = sprintf(FILE_WRITE_ERROR, $source) . '<br />';\n } else {\n rename($source, $target);\n }\n }\n}", "protected function cleanupFilesystem() {\n $this->deleteFile($this->_directories[\"communication.log\"]);\n $this->deleteFile($this->_directories[\"communicationDetails\"]);\n $this->deleteFile($this->_directories[\"communityRegistry\"]);\n $this->deleteDirector($this->_directories[\"communityDefinitionsDir\"]);\n $this->deleteDirector($this->_directories[\"nodeListDir\"]);\n }", "public function actionCleartemp()\n {\n $uploadPath = '../web/web_mat/temp/';\n $file = scandir($uploadPath);\n foreach ($file as $key => $value) {\n if ($key >= 2) {\n unlink($uploadPath . $value);\n }\n }\n }", "public function clean()\n {\n $dir = new \\Ninja\\Directory(NINJA_DOCROOT . 'public/');\n /**\n * @var $files \\Ninja\\File[]\n */\n\n $files = $dir->scanRecursive(\"*.css\");\n echo \"\\nDeleting Minified Css Files...\\n\";\n foreach($files as $sourceFile)\n {\n // if does not have a numeric pre-extension-suffix foo.#.js (e.g foo.52.js) which are files from a previous build\n if ( ! is_numeric(substr($sourceFile->getName(true), strrpos($sourceFile->getName(true), '.') + 1)) )\n continue;\n\n echo ' ' . $sourceFile->getPath() . \"\\n\";\n $sourceFile->delete();\n\n unset($sourceFile);\n }\n\n $files = $dir->scanRecursive(\"*.js\");\n echo \"\\nDeleting Minified Js Files...\\n\";\n foreach($files as $sourceFile)\n {\n // if does not have a numeric pre-extension-suffix foo.#.js (e.g foo.52.js) which are files from a previous build\n if ( ! is_numeric(substr($sourceFile->getName(true), strrpos($sourceFile->getName(true), '.') + 1)) )\n continue;\n\n echo ' ' . $sourceFile->getPath() . \"\\n\";\n $sourceFile->delete();\n unset($sourceFile);\n }\n }", "function cleanupTmp() {\n // try to delete all the tmp files we know about.\n foreach($this->tmpFilesCreated as $file) {\n if(file_exists($file)) {\n $status = unlink($file);\n }\n }\n $this->tmpFilesCreated = array();\n // try to completely delete each directory we created.\n $dirs = array_reverse($this->tmpDirsCreated);\n foreach($dirs as $dir) {\n if(file_exists($dir)) {\n $this->recursiveRmdir($dir);\n }\n }\n $this->tmpDirsCreated = array();\n }", "function deleteFiles($dir)\n{\n foreach (glob($dir . '/*') as $file) {\n // check if is a file and not sub-directory\n if (is_file($file)) {\n // delete file\n unlink($file);\n }\n }\n}", "function removePermanentlyDeletedFiles() {\n try {\n DB::beginWork('Start removing permanently deleted files');\n $files_to_delete = array();\n\n defined('STATE_DELETED') or define('STATE_DELETED', 0); // Make sure that we have STATE_DELETED constant defined\n\n if ($this->isModuleInstalled('files')) {\n // find file ids which are deleted\n $file_ids = DB::executeFirstColumn('SELECT id FROM ' . TABLE_PREFIX . 'project_objects WHERE type = ? AND state = ?', 'File', STATE_DELETED);\n // add their locations to cumulative list\n $files_to_delete = array_merge($files_to_delete, (array) DB::executeFirstColumn('SELECT varchar_field_2 FROM ' . TABLE_PREFIX . 'project_objects WHERE type = ? AND id IN (?)', 'File', $file_ids));\n // add file versions locations to the list\n $files_to_delete = array_merge($files_to_delete, (array) DB::executeFirstColumn('SELECT location FROM ' . TABLE_PREFIX . 'file_versions WHERE file_id IN (?)', $file_ids));\n // delete file versions\n DB::execute('DELETE FROM ' . TABLE_PREFIX . 'file_versions WHERE file_id IN (?)', $file_ids);\n } // if\n\n // add attachment locations to the list\n $files_to_delete = array_merge($files_to_delete, (array) DB::executeFirstColumn('SELECT location FROM ' . TABLE_PREFIX . 'attachments WHERE state = ?', STATE_DELETED));\n\n // delete all files related to previously deleted objects\n if (is_foreachable($files_to_delete)) {\n foreach ($files_to_delete as $file_to_delete) {\n $full_path_to_delete = UPLOAD_PATH . '/' . $file_to_delete;\n if (is_file($full_path_to_delete)) {\n @unlink($full_path_to_delete);\n } // if\n } // foreach\n } // if\n\n DB::commit('Successfully removed permanently deleted files');\n } catch (Exception $e) {\n DB::rollback('Failed to remove permanently deleted files');\n return $e->getMessage();\n } // if\n\n return true;\n }", "function deleteTmpFiles()\n{\n global $tmpFiles1;\n global $tmpFiles2;\n\n foreach ($tmpFiles1 as $tmpFile){\n exec(\"rm -f $tmpFile\");\n }\n\n foreach ($tmpFiles2 as $tmpFile){\n exec(\"rm -f $tmpFile\");\n }\n}", "function deleteFile() {\r\n\t\tif (file_exists($this->data[$this->alias]['path'])) {\r\n\t\t\tunlink($this->data[$this->alias]['path']);\r\n\t\t}\r\n\t}", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "public function remove_old_tmp_files() {\n global $wpdb;\n\n $older_than = time() - 86400;\n $num = 0; // Number of files deleted\n\n // Locate files not saved in over a day\n $files = $wpdb->get_results($wpdb->prepare(\n \"SELECT path\n FROM {$wpdb->prefix}h5p_tmpfiles\n WHERE created_at < %d\",\n $older_than)\n );\n\n // Delete files from file system\n foreach ($files as $file) {\n if (@unlink($file->path)) {\n $num++;\n }\n }\n\n // Remove from tmpfiles table\n $wpdb->query($wpdb->prepare(\n \"DELETE FROM {$wpdb->prefix}h5p_tmpfiles\n WHERE created_at < %d\",\n $older_than));\n\n // Old way of cleaning up tmp files. Needed as a transitional fase and it doesn't really harm to have it here any way.\n $h5p_path = $this->get_h5p_path();\n $editor_path = $h5p_path . DIRECTORY_SEPARATOR . 'editor';\n if (is_dir($h5p_path) && is_dir($editor_path)) {\n $dirs = glob($editor_path . DIRECTORY_SEPARATOR . '*');\n if (!empty($dirs)) {\n foreach ($dirs as $dir) {\n if (!is_dir($dir)) {\n continue;\n }\n\n $files = glob($dir . DIRECTORY_SEPARATOR . '*');\n if (empty($files)) {\n continue;\n }\n\n foreach ($files as $file) {\n if (filemtime($file) < $older_than) {\n // Not modified in over a day\n if (unlink($file)) {\n $num++;\n }\n }\n }\n }\n }\n }\n\n if ($num) {\n // Clear cached value for dirsize.\n delete_transient('dirsize_cache');\n }\n }", "private function exportFilesAndClear()\n {\n foreach (File::allFiles(Auth()->user()->getPublicPath()) as $file) {\n if (strpos($file, \".jpg\") !== false || strpos($file, \".png\") !== false) {\n $name = $this->reformatName($file);\n File::move($file, Auth()->user()->getPublicPath() . '/' . $name);\n }\n }\n $files = scandir(Auth()->user()->getPublicPath());\n foreach ($files as $key => $file) {\n if (is_dir(Auth()->user()->getPublicPath() . '/' . $file)) {\n if ($file[0] != '.') {\n File::deleteDirectory(Auth()->user()->getPublicPath() . '/' . $file);\n }\n } else {\n if (strpos($file, \".jpg\") === false && strpos($file, \".png\") === false) {\n File::delete(Auth()->user()->getPublicPath() . '/' . $file);\n }\n }\n }\n return null;\n }", "function emptyDir($dir)\n{\n foreach (scandir($dir) as $basename) {\n $path = $dir . '/' . $basename;\n\n if (is_file($path)) {\n unlink($path);\n }\n }\n}", "protected function deleteFiles($files, $deleteEmptyTargetDir = false, $deleteEmptyDirectories = true) {\n\t\t$targetDir = FileUtil::addTrailingSlash(FileUtil::getRealPath(WCF_DIR.$this->installation->getPackage()->getDir()));\n\t\t\n\t\tif ($ftp = $this->installation->checkSafeMode()) { \n\t\t\trequire_once(WCF_DIR.'lib/system/setup/FTPUninstaller.class.php');\n\t\t\tnew FTPUninstaller($targetDir, $files, $ftp, $deleteEmptyTargetDir, $deleteEmptyDirectories);\n\t\t}\n\t\telse {\n\t\t\trequire_once(WCF_DIR.'lib/system/setup/FileUninstaller.class.php');\n\t\t\tnew FileUninstaller($targetDir, $files, $deleteEmptyTargetDir, $deleteEmptyDirectories);\n\t\t}\n\t}", "function delete_dir($path)\n{\n $file_scan = scandir($path);\n foreach ($file_scan as $filecheck)\n {\n $file_extension = pathinfo($filecheck, PATHINFO_EXTENSION);\n if ($filecheck != '.' && $filecheck != '..')\n {\n if ($file_extension == '')\n {\n delete_dir($path . $filecheck . '/');\n }\n else\n {\n unlink($path . $filecheck);\n }\n }\n }\n rmdir($path);\n}", "public function __destruct()\n {\n $iMax = count($this->aFiles);\n for ($iFor = 0; $iFor < $iMax; $iFor++) {\n\n if (true === file_exists($this->aFiles[$iFor])) {\n\n unlink($this->aFiles[$iFor]);\n }\n\n $sMessage = 'delete: ' . $this->aFiles[$iFor];\n $this->oLog->writeLog(Log::HF_DEBUG, $sMessage);\n }\n }", "public function testDeleteFile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public static function removeTempDir()\n {\n $tmpDir = self::getTempDir();\n\n array_map('unlink', glob(\"$tmpDir/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*/*/*.*\"));\n array_map('unlink', glob(\"$tmpDir/*/*/*/*/*.*\"));\n array_map('rmdir', glob(\"$tmpDir/*/*/*/*\", GLOB_ONLYDIR));\n array_map('rmdir', glob(\"$tmpDir/*/*/*\", GLOB_ONLYDIR));\n array_map('rmdir', glob(\"$tmpDir/*/*\", GLOB_ONLYDIR));\n array_map('rmdir', glob(\"$tmpDir/*\", GLOB_ONLYDIR));\n is_dir($tmpDir) and rmdir($tmpDir);\n }", "public function cleanup() {\n $dirIt = new DirectoryIterator($this->path);\n // Convert days to seconds\n $lifetimeSeconds = self::$lifetime * 3600 * 24;\n /** @var DirectoryIterator $fileInfo */\n foreach ($dirIt as $fileInfo) {\n if ($fileInfo->isDot()) {\n continue;\n }\n $fileAge = time() - $fileInfo->getMTime();\n if ($fileAge > $lifetimeSeconds) {\n $this->deleteFile();\n }\n }\n }", "public static function cleanFiles($basePath)\n {\n if (file_exists($basePath)) {\n foreach (new \\DirectoryIterator($basePath) as $dir) {\n @unlink($dir->getPathname());\n }\n @rmdir($basePath);\n }\n }", "private function clearOldFiles()\r\n {\r\n // Buscando itens na pasta\r\n $files = new \\DirectoryIterator( $this->backupFolder );\r\n\r\n // Passando pelos itens\r\n $sortedFiles = array();\r\n foreach ($files as $file) {\r\n // Se for um arquivo\r\n if ($file->isFile()) {\r\n // Adicionando em um vetor, sendo o índice a data de modificação\r\n // do arquivo, para assim ordenarmos posteriormente\r\n $sortedFiles[$file->getMTime()] = $file->getPathName();\r\n }\r\n }\r\n\r\n // Ordena o vetor em ordem decrescente\r\n arsort( $sortedFiles );\r\n\r\n // Passando pelos arquivos\r\n $numberFiles = 0;\r\n foreach ($sortedFiles as $file) {\r\n $numberFiles++;\r\n // Se a quantidade de arquivo for maior que a quantidade\r\n // máxima definida\r\n if ($numberFiles > $this->maxNumberFiles) {\r\n // Removemos o arquivo da pasta\r\n unlink( $file );\r\n echo \"Apagado backup '{$file}'\" . PHP_EOL;\r\n }\r\n }\r\n\r\n }", "public function deleteFiles($files, $path)\n {\n }", "abstract function delete_dir($filepath);", "protected function cleanDirectories()\n {\n $filesystem = new Filesystem();\n\n $filesystem->cleanDirectory($this->getSeedFilePath());\n\n $filesystem->cleanDirectory(database_path('factories'));\n }", "public function prune()\r\n\t{\r\n\t\tif (file_exists($this->migrationFiles)) {\r\n\t\t\t$this->rmdir_recursive($this->migrationFiles);\r\n\t\t}\r\n\t}", "protected function clearFiles()\n {\n $dir = __DIR__ . '/../lang/i18n';\n FileSystem::clearDirectory($dir);\n }", "public function beforeDelete(){\n $files = $this->getFiles()->all();\n foreach($files as $file)\n $file->delete();\n\n return parent::beforeDelete();\n }", "private function purgefiles()\n\t{\n\t\t$params=JComponentHelper::getParams('com_jbolo');\n\t\t$uploaddir=JPATH_COMPONENT.DS.'uploads';\n\t\t$exp_file_time=3600*24*$params->get('purge_days');\n\t\t$currts=time();\n\t\techo \"<div class='alert alert-success'>\".\n\t\tJText::_('COM_JBOLO_PURGE_OLD_FILES');\n\t\t/*\n\t\t * JFolder::files($path,$filter,$recurse=false,$full=false,$exclude=array('.svn'),$excludefilter=array('^\\..*'))\n\t\t*/\n\t\t$current_files=JFolder::files($uploaddir,'',1,true,array('index.html'));\n\t\t//print_r($current_files);die;\n\t\tforeach($current_files as $file)\n\t\t{\n\t\t\tif( $file != \"..\" && $file != \".\" )\n\t\t\t{\n\t\t\t\t$diffts=$currts-filemtime($file);\n\t\t\t\tif($diffts > $exp_file_time )\n\t\t\t\t{\n\t\t\t\t\techo '<br/>'.JText::_('COM_JBOLO_PURGE_DELETING_FILE').$file;\n\t\t\t\t\tif(!JFile::delete($file)){\n\t\t\t\t\t\techo '<br/>'.JText::_('COM_JBOLO_PURGE_ERROR_DELETING_FILE').'-'.$file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \"</div>\";\n\t}", "function fileError($basePath, $filelist)\n{\n\tforeach($filelist as $kx => $vx)\n\t{\n\t\tif ($vx != NULL)\n\t\t{\n\t\t\tunlink($basePath . '/' . $vx);\n\t\t}\n\t}\n}" ]
[ "0.78326565", "0.78215593", "0.7587197", "0.75118184", "0.7441977", "0.73711056", "0.7308249", "0.72983116", "0.72544867", "0.72209173", "0.72156304", "0.719691", "0.71903753", "0.71337104", "0.71125674", "0.710269", "0.70792174", "0.704123", "0.7034422", "0.7021173", "0.70198834", "0.70131284", "0.70062196", "0.70051855", "0.69973505", "0.6995585", "0.6987983", "0.6985189", "0.69819695", "0.69765824", "0.69764984", "0.6976262", "0.69681174", "0.6951549", "0.69443583", "0.69250053", "0.6913313", "0.6881465", "0.68785363", "0.6871804", "0.6869356", "0.6862909", "0.6824651", "0.6793174", "0.67917836", "0.6779917", "0.67548966", "0.6745803", "0.6738267", "0.6732878", "0.6711977", "0.6694762", "0.66885114", "0.6670823", "0.66505885", "0.66500336", "0.66262406", "0.66098046", "0.6598439", "0.6579267", "0.65767473", "0.6570209", "0.6561136", "0.65543234", "0.65514606", "0.654983", "0.65342176", "0.6533294", "0.6529556", "0.6517753", "0.65122813", "0.649812", "0.6497081", "0.6494561", "0.6484442", "0.64666426", "0.6401064", "0.6384186", "0.6378404", "0.63750714", "0.6373025", "0.6342825", "0.6341898", "0.633051", "0.6328084", "0.6318757", "0.63184994", "0.63132495", "0.6311466", "0.63079435", "0.63045156", "0.6302205", "0.63012254", "0.63005364", "0.6291812", "0.62900424", "0.6284708", "0.6283993", "0.6278026", "0.6274718" ]
0.8077202
0
Method to load and merge the ''config.xml'' file with the extens params.
private function loadConfigXml($parent) { $file = $parent->getParent()->getPath('extension_administrator') . '/config.xml'; $defaults = $this->parseConfigFile($file); if ($defaults === '{}') { return; } $manifest = $parent->getParent()->getManifest(); $type = $manifest->attributes()->type; try { $db = JFactory::getDBO(); $query = $db->getQuery(true)->select($db->quoteName(array ( 'extension_id', 'params' )))->from($db->quoteName('#__extensions'))->where($db->quoteName('type') . ' = ' . $db->quote($type))->where($db->quoteName('element') . ' = ' . $db->quote($parent->getElement()))->where($db->quoteName('name') . ' = ' . $db->quote($parent->getName())); $db->setQuery($query); $row = $db->loadObject(); if (! isset($row)) { $this->enqueueMessage(JText::_('COM_CLM_TURNIER_ERROR_CONFIG_LOAD'), 'warning'); return; } $params = json_decode($row->params, true); if (json_last_error() == JSON_ERROR_NONE && is_array($params)) { $result = array_merge(json_decode($defaults, true), $params); $defaults = json_encode($result); } } catch (Exception $e) { $this->enqueueMessage($e->getMessage(), 'warning'); return; } try { $query = $db->getQuery(true); $query->update($db->quoteName('#__extensions')); $query->set($db->quoteName('params') . ' = ' . $db->quote($defaults)); $query->where($db->quoteName('extension_id') . ' = ' . $db->quote($row->extension_id)); $db->setQuery($query); $db->execute(); } catch (Exception $e) { $this->enqueueMessage($e->getMessage(), 'warning'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getExtensionConfigXml() \n\t{\n\n\t\t// path to the extensions config.xml\n\t\t$extension_config_xml_path = parent::$extension_base_dir . '/etc/config.xml';\n\n\t\tif (!file_exists($extension_config_xml_path)) {\n\t\t\t$this->displayError('Cant find path to extension config xml.');\n\t\t}\n\n\t\t$extension_config_xml = simplexml_load_file($extension_config_xml_path);\n\n\t\tparent::$extension_config_xml = $extension_config_xml;\n\n\t}", "private function mergeConfig() {\n\t\t$this->mergeConfigFrom(\n\t\t\t__DIR__ . '/../config/config.php', 'sl-upload'\n\t\t);\n\t}", "abstract protected function loadConfig();", "private function mergeConfig()\n\t{\n\t\t$this->mergeConfigFrom(\n\t\t\t__DIR__ . '/../config/config.php', 'l5-sms'\n\t\t);\n\t}", "protected function mergeConfig()\n {\n $this->mergeConfigFrom(__DIR__.\"/../config/{$this->name}.php\", $this->name);\n }", "private function loadModuleXml() \n\t{\n\n\t\t// load in config.xml to simplexml parser\n\t\tparent::$base_xml = simplexml_load_file(parent::$app_etc_module_path);\n\n\t}", "public abstract function loadConfig($fileName);", "protected function loadConfigsForRegister(): void\n {\n $shipConfigs = $this->getConfigsFromShip();\n $containersConfigs = $this->getConfigsFromContainers();\n\n $configs = array_merge($shipConfigs, $containersConfigs);\n\n foreach ($configs as $file){\n $filename = pathinfo($file, PATHINFO_FILENAME);\n $this->mergeConfigFrom($file, $filename);\n }\n }", "public function initConfig() {\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t\\app::$config = array_merge(\\app::$config, $config);\r\n }", "function loadXMLParamMulti($config)\r\n {\r\n global $jname;\r\n $option = JRequest::getCmd('option');\r\n //Load current Parameter\r\n $value = JRequest::getVar('params');\r\n if (empty($value)) {\r\n $value = array();\r\n } else if (!is_array($value)) {\r\n $value = base64_decode($value);\r\n $value = unserialize($value);\r\n if (!is_array($value)) {\r\n $value = array();\r\n }\r\n }\r\n $task = JRequest::getVar('jfusion_task');\r\n if ($task == 'add') {\r\n \t$newPlugin = JRequest::getVar('jfusionplugin');\r\n\t\t\tif ($newPlugin) {\r\n\t if (!array_key_exists($newPlugin, $value)) {\r\n\t $value[$newPlugin] = array('jfusionplugin' => $newPlugin);\r\n\t } else {\r\n\t $this->assignRef('error', JText::_('NOT_ADDED_TWICE'));\r\n\t }\r\n } else {\r\n\t\t\t\t$this->assignRef('error', JText::_('MUST_SELLECT_PLUGIN'));\r\n }\r\n } else if ($task == 'remove') {\r\n $rmPlugin = JRequest::getVar('jfusion_value');\r\n if (array_key_exists($rmPlugin, $value)) {\r\n unset($value[$rmPlugin]);\r\n } else {\r\n $this->assignRef('error', JText::_('NOT_PLUGIN_REMOVE'));\r\n }\r\n }\r\n\r\n foreach (array_keys($value) as $key) {\r\n if ($this->isJ16) {\r\n $jname = $value[$key]['jfusionplugin'];\r\n\r\n if (isset($this->configArray[$config]) && !empty($jname)) {\r\n $path = JFUSION_PLUGIN_PATH . DS . $jname . DS . $this->configArray[$config][1];\r\n $defaultPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'views' . DS . 'advancedparam' . DS . 'paramfiles' . DS . $this->configArray[$config][1];\r\n $xml_path = (file_exists($path)) ? $path : $defaultPath;\r\n $xml = JFactory::getXMLParser('Simple');\r\n if ($xml->loadFile($xml_path)) {\r\n if ($fields = $xml->document->getElementByPath('fields')) {\r\n $data = $xml->document->fields[0]->toString();\r\n //make sure it is surround by <form>\r\n if (substr($data, 0, 5) != \"<form>\") {\r\n $data = \"<form>\" . $data . \"</form>\";\r\n }\r\n $form = &JForm::getInstance($jname, $data, array('control' => \"params[$jname]\"));\r\n //add JFusion's fields\r\n $form->addFieldPath(JPATH_COMPONENT.DS.'fields');\r\n //bind values\r\n $form->bind($value[$key]);\r\n $value[$key][\"params\"] = $form;\r\n }\r\n $this->loadLanguage($xml);\r\n }\r\n }\r\n } else {\r\n $params = new JParameter('');\r\n $params->loadArray($value[$key]);\r\n $params->addElementPath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jfusion' . DS . 'elements');\r\n $jname = $params->get('jfusionplugin', '');\r\n if (isset($this->configArray[$config]) && !empty($jname)) {\r\n $path = JFUSION_PLUGIN_PATH . DS . $jname . DS . $this->configArray[$config][1];\r\n $defaultPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'views' . DS . 'advancedparam' . DS . 'paramfiles' . DS . $this->configArray[$config][1];\r\n $xml_path = (file_exists($path)) ? $path : $defaultPath;\r\n $xml = JFactory::getXMLParser('Simple');\r\n if ($xml->loadFile($xml_path)) {\r\n $params->setXML($xml->document->params[0]);\r\n $this->loadLanguage($xml);\r\n }\r\n }\r\n $value[$key][\"params\"] = $params;\r\n }\r\n }\r\n return $value;\r\n }", "function LoadConfiguration()\r\n\t{\r\n\t\t$cinfFilePath = Site::GetConfigFilePath ();\r\n\t\t$config = simplexml_load_file ( $cinfFilePath );\r\n\t\t\r\n\t\t// load languages\r\n\t\tif (isset ( $config->languages ))\r\n\t\t{\r\n\t\t\t$langs = ( array ) $config->languages;\r\n\t\t\t$langsA = $langs ['language'];\r\n\t\t\t\r\n\t\t\tif (! is_array ( $langsA ))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$linkID = ( string ) $langsA->linkID;\r\n\t\t\t\t$linkName = ( string ) $langsA->linkName;\r\n\t\t\t\t$this->m_languages [$linkID] = $linkName;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tforeach ( $langsA as $lang )\r\n\t\t\t\t{\r\n\t\t\t\t\t$linkID = ( string ) $lang->linkID;\r\n\t\t\t\t\t$linkName = ( string ) $lang->linkName;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->m_languages [$linkID] = $linkName;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$langKes = array_keys ( $this->m_languages );\r\n\t\t\t$this->m_languageDefault = $langKes [0];\r\n\t\t}\r\n\t\t\r\n\t\t// load templates\r\n\t\tif (isset ( $config->templates ))\r\n\t\t{\r\n\t\t\t$templates = ( array ) $config->templates;\r\n\t\t\t$langsA = $templates ['template'];\r\n\t\t\t\r\n\t\t\tif (! is_array ( $langsA ))\r\n\t\t\t{\r\n\t\t\t\t$this->m_templates = null;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->m_templates = array ();\r\n\t\t\t\t\r\n\t\t\t\tforeach ( $langsA as $lang )\r\n\t\t\t\t{\r\n\t\t\t\t\t$fileName = ( string ) $lang;\r\n\t\t\t\t\tarray_push ( $this->m_templates, $fileName );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// load siteURL\r\n\t\tif (isset ( $config->url ))\r\n\t\t{\r\n\t\t\t$this->m_URL = ( string ) $config->url;\r\n\t\t\t$this->m_URL = trim ( $this->m_URL );\r\n\t\t}\r\n\t\t\r\n\t\t// load siteURL\r\n\t\tif (isset ( $config->maxImageWidth ))\r\n\t\t{\r\n\t\t\t$this->m_maxImageWidth = ( int ) $config->maxImageWidth;\r\n\t\t}\r\n\t\t\r\n\t\t// secuirity-file root\r\n\t\tif (isset ( $config->securFolder ))\r\n\t\t{\r\n\t\t\t$this->m_sfRoot = ( string ) $config->securFolder;\r\n\t\t\t$this->m_sfRoot = trim ( $this->m_sfRoot );\r\n\t\t}\r\n\t\t\r\n\t\t// boxes\r\n\t\tif (isset ( $config->boxes ))\r\n\t\t{\r\n\t\t\t$boxes = ( array ) $config->boxes;\r\n\t\t\t$boxes = $boxes ['box'];\r\n\t\t\tif (! is_array ( $boxes ))\r\n\t\t\t{\r\n\t\t\t\t$this->m_boxes = array ($boxes );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->m_boxes = $boxes;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// product image root\r\n\t\tif (isset ( $config->productImageRoot ))\r\n\t\t{\r\n\t\t\t$str = ( string ) $config->productImageRoot;\r\n\t\t\t$this->m_prodImagRoot = trim ( $str );\r\n\t\t}\r\n\t\t\r\n\t\t// product image root\r\n\t\tif (isset ( $config->galleryRoot ))\r\n\t\t{\r\n\t\t\t$str = ( string ) $config->galleryRoot;\r\n\t\t\t$this->m_galleryImageRoot = trim ( $str );\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private function mergeConfig()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/config.php', 'routecache'\n );\n }", "private function loadConfig()\n {\n\n $this->config = include(__DIR__ . '/../../config/config.php');\n\n }", "private function loadConfig() {\n $config = array();\n\n $this->config = $config;\n if (file_exists(__DIR__ . '/../config.php')) {\n require_once(__DIR__. '/../config.php');\n $this->config = array_merge($this->config, $config);\n //TODO check for required config entries\n } else {\n //TODO handle this nicer\n $this->fatalErr('NO_CFG', 'Unable to load config file');\n }\n\n if (array_key_exists('THEME', $this->config)) {\n $this->pageLoader->setTheme($this->config['THEME']);\n }\n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "protected function addConfiguration()\n {\n $this['config'] = $this->share(\n function () {\n $user_config_file = (file_exists('phpdoc.xml'))\n ? 'phpdoc.xml'\n : 'phpdoc.dist.xml';\n\n return \\Zend\\Config\\Factory::fromFiles(\n array(\n __DIR__.'/../../data/phpdoc.tpl.xml',\n $user_config_file\n ), true\n );\n }\n );\n }", "protected function registerConfigs()\n {\n // Append or overwrite configs\n #config(['test' => 'hi']);\n\n // Merge configs\n #$this->mergeConfigFrom(__DIR__.'/../Config/parser.php', 'mrcore.parser');\n }", "protected function mergeConfig()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/Config/teamrole.php', 'teamrole'\n );\n }", "private function loadConfigFiles()\n { if (!$this->configFiles) {\n $this->configFiles[] = 'config.neon';\n }\n\n foreach ($this->configFiles as $file) {\n $this->configurator->addConfig($this->paths->getConfigDir().'/'.$file);\n }\n }", "abstract public function loadConfig(array $config);", "public function loadConfig(SimpleXMLElement $config, $metafile, $generate);", "abstract protected function loadConfig(array $config);", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "private function loadConfig()\n {\n $files = scandir($this->configPath());\n $configs = [];\n\n foreach ($files as $file) {\n $filePath = $this->configPath() . DIRECTORY_SEPARATOR . $file;\n\n if (is_file($filePath)) {\n $config = [basename($file, '.php') => include $filePath];\n if (is_array($config)) {\n $configs = array_merge($configs, $config);\n }\n }\n }\n\n $this->config = $configs;\n }", "protected function initConfig()\n {\n $this->di->setShared('config', function () {\n $path = BASE_DIR . 'app/config/';\n\n if (!is_readable($path . 'config.php')) {\n throw new RuntimeException(\n 'Unable to read config from ' . $path . 'config.php'\n );\n }\n\n $config = include $path . 'config.php';\n\n if (is_array($config)) {\n $config = new Config($config);\n }\n\n if (!$config instanceof Config) {\n $type = gettype($config);\n if ($type == 'boolean') {\n $type .= ($type ? ' (true)' : ' (false)');\n } elseif (is_object($type)) {\n $type = get_class($type);\n }\n\n throw new RuntimeException(\n sprintf(\n 'Unable to read config file. Config must be either an array or Phalcon\\Config instance. Got %s',\n $type\n )\n );\n }\n\n if (is_readable($path . APPLICATION_ENV . '.php')) {\n $override = include_once $path . APPLICATION_ENV . '.php';\n\n if (is_array($override)) {\n $override = new Config($override);\n }\n\n if ($override instanceof Config) {\n $config->merge($override);\n }\n }\n\n return $config;\n });\n }", "function loadXMLParamSingle($config)\r\n {\r\n $option = JRequest::getCmd('option');\r\n //Load current Parameter\r\n $value = JRequest::getVar('params');\r\n if (empty($value)) {\r\n $value = array();\r\n } else {\r\n $value = base64_decode($value);\r\n $value = unserialize($value);\r\n if (!is_array($value)) {\r\n $value = array();\r\n }\r\n }\r\n\r\n if ($this->isJ16) {\r\n global $jname;\r\n $jname = (!empty($value['jfusionplugin'])) ? $value['jfusionplugin'] : '';\r\n if (isset($this->configArray[$config]) && !empty($jname)) {\r\n $path = JFUSION_PLUGIN_PATH . DS . $jname . DS . $this->configArray[$config][1];\r\n $defaultPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'views' . DS . 'advancedparam' . DS . 'paramfiles' . DS . $this->configArray[$config][1];\r\n $xml_path = (file_exists($path)) ? $path : $defaultPath;\r\n $xml = JFactory::getXMLParser('Simple');\r\n $form = false;\r\n if ($xml->loadFile($xml_path)) {\r\n if ($fields = $xml->document->getElementByPath('fields')) {\r\n $data = $xml->document->fields[0]->toString();\r\n //make sure it is surround by <form>\r\n if (substr($data, 0, 5) != \"<form>\") {\r\n $data = \"<form>\" . $data . \"</form>\";\r\n }\r\n $form = &JForm::getInstance($jname, $data, array('control' => \"params[$jname]\"));\r\n //add JFusion's fields\r\n $form->addFieldPath(JPATH_COMPONENT.DS.'fields');\r\n\t\t\t\t\t\tif (isset($value[$jname])) {\r\n \t$form->bind($value[$jname]);\r\n }\r\n }\r\n\r\n $this->loadLanguage($xml);\r\n }\r\n $value['params'] = $form;\r\n }\r\n return $value;\r\n } else {\r\n //Load Plugin XML Parameter\r\n $params = new JParameter('');\r\n $params->loadArray($value);\r\n $params->addElementPath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jfusion' . DS . 'elements');\r\n $JPlugin = $params->get('jfusionplugin', '');\r\n if (isset($this->configArray[$config]) && !empty($JPlugin)) {\r\n global $jname;\r\n $jname = $JPlugin;\r\n $path = JFUSION_PLUGIN_PATH . DS . $JPlugin . DS . $this->configArray[$config][1];\r\n $defaultPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'views' . DS . 'advancedparam' . DS . 'paramfiles' . DS . $this->configArray[$config][1];\r\n $xml_path = (file_exists($path)) ? $path : $defaultPath;\r\n $xml = JFactory::getXMLParser('Simple');\r\n if ($xml->loadFile($xml_path)) {\r\n $params->setXML($xml->document->params[0]);\r\n $this->loadLanguage($xml);\r\n }\r\n }\r\n return $params;\r\n }\r\n }", "private function _config()\n\t{\n\t\t// Get the base path for the smarty base directory\n\t\t$basePath\t= $this->getBasePath();\n\t\t$configFile\t= $this->getConfigFile();\n\t\t\n\t\tif (null === $basePath){\n\t\t\tthrow new Exception('No view base path specified');\n\t\t}\n\t\t\n\t\tif (null === $configFile){\n\t\t\tthrow new Exception('No config file specified');\n\t\t}\n\t\t\n\t\t// Generate the path to the view xml config file\n\t\tif ( file_exists(Package::buildPath( $basePath , $configFile)) ) {\n\t\t\t$viewBuildFile = Package::buildPath( $basePath , $configFile);\n\t\t} else {\n\t\t\tthrow new Exception(\"Unable to find config file: \" . $configFile);\n\t\t}\n\t\t \n\t\t// Load the config file\n\t\tif (! $viewXml = Zend_Registry::get('site_config_cache')->load('view_config') ) {\n\t\t\ttry {\n\t\t\t\t$xmlSection = (defined('BUILD_ENVIRONMENT')) ? BUILD_ENVIRONMENT : strtolower($_SERVER['SERVER_NAME']);\n\t\t\t\t$viewXml = new Zend_Config_Xml($viewBuildFile, $xmlSection);\n\t\t\t\tZend_Registry::get('site_config_cache')->save($viewXml, 'view_config');\n\t\t\t} catch (Zend_Exception $e) {\n\t\t\t\tthrow new Exception( 'There was a problem caching the config file: ' . $e->getMessage() );\n\t\t\t}\n\t\t}\n\t\tunset($viewBuildFile, $xmlSection);\n\t\t\n\t\t\n\t\t// Alias' replacements\n\t\t$replacements = array(\n ':baseDir' => $basePath\n ); \n\t\t\n $params = str_replace(array_keys($replacements), array_values($replacements), $viewXml->smarty->params->toArray());\n\n\t\t// Set the base smarty parameters\n\t\t$this->setParams($params);\n\t\t\n\t\t// Register plugins\n\t\t/*\n\t\tif (isset($viewXml->smarty->plugins)){\n\t\t\t$plugins\t= $viewXml->smarty->plugins->toArray();\n\t\t\t\n\t\t\t// Loop each plugin entry\n\t\t\tforeach($plugins as $key => $plugin)\n\t\t\t{\n\t\t\t\t// Check if a plugin type has been specified\n\t\t\t\tif (isset($plugin['type'])){\n\t\t\t\t\tswitch($plugin['type'])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'resource':\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t$methodArgs\t= array(\n\t\t\t\t\t\t\t\t\t$key . '_get_source',\n\t\t\t\t\t\t\t\t\t$key . '_get_timestamp',\n\t\t\t\t\t\t\t\t\t$key . '_get_secure',\n\t\t\t\t\t\t\t\t\t$key . '_get_trusted'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$methodArgs\t= (is_array($plugin['parameters'])) ? $plugin['parameters'] : array();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//$methodName\t= 'register_' . $plugin['type'];\n\t\t\t\t\t//$this->_setSmartyMethod($methodName, array($key, $methodArgs));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t*/\n\t\t\n\t}", "function xf_configLoad()\n{\n global $lang, $XF, $XF_loaded;\n if ($XF_loaded) {\n return $XF;\n }\n if (!($confdir = get_plugcfg_dir('xfields'))) {\n return false;\n }\n if (!file_exists($confdir.'/config.php')) {\n $XF_loaded = 1;\n\n return ['news' => []];\n }\n include $confdir.'/config.php';\n $XF_loaded = 1;\n $XF = is_array($xarray) ? $xarray : ['news' => []];\n\n return $XF;\n}", "private function mergeConfig()\n {\n $countries = $this->countryIso();\n $this->app->configure('priongeography');\n\n $this->mergeConfigFrom(\n __DIR__ . '/config/priongeography.php',\n 'priongeography'\n );\n }", "public function loadConfigs()\n {\n self::$country_configs = self::getCountryConfigs();\n $configs = new parent();\n self::$categories = $configs->getCategories();\n self::$site_data = self::get_site_data();\n self::$payments_name = self::setPaymentGateway();\n }", "public function loadBase()\n {\n $etcDir = $this->getOptions()->getEtcDir();\n $files = glob($etcDir.DS.'*.xml');\n $this->loadFile(current($files));\n\n while ($file = next($files)) {\n $merge = clone $this->_prototype;\n $merge->loadFile($file);\n $this->extend($merge);\n }\n\n if (in_array($etcDir.DS.'local.xml', $files)) {\n $this->_isLocalConfigLoaded = true;\n }\n\n return $this;\n }", "protected function addToConfig()\n {\n $path = $this->getConfigPath();\n $config = require($path);\n if (isset($config[$this->moduleId])) {\n if (\\Yii::$app->controller->confirm('Rewrite exist config?')) {\n $config[$this->moduleId] = $this->getConfigArray();\n echo 'Module config was rewrote' . PHP_EOL;\n }\n } else {\n $config[$this->moduleId] = $this->getConfigArray();\n }\n\n\n $this->writeArrayToFile($this->getConfigPath(), $config);\n }", "private function load_config() {\n $this->config = new Config();\n }", "protected static function loadSingleExtLocalconfFiles() {}", "public function load_config() {\n if (!isset($this->config)) {\n $settingspluginname = 'assessmentsettings';\n $this->config = get_config(\"local_$settingspluginname\");\n }\n }", "protected function mergeConfiguration()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/firefly.php', 'firefly'\n );\n }", "public function loadConfiguration()\n\t{\n\t\t// Set the configuration file path for the application.\n\t\t$file = JPATH_CONFIGURATION . '/configuration.php';\n\n\t\t// Verify the configuration exists and is readable.\n\t\tif (!is_readable($file))\n\t\t{\n\t\t\tthrow new \\RuntimeException('Configuration file does not exist or is unreadable.');\n\t\t}\n\n\t\t// Load the configuration file into an object.\n\t\trequire $file ;\n\t\t$config = new JConfig;\n\n\t\tif ($config === null)\n\t\t{\n\t\t\tthrow new \\RuntimeException(sprintf('Unable to parse the configuration file %s.', $file));\n\t\t}\n\n\t\t// Get the FB config file path\n\t\t$file = JPATH_BASE . '/config_fb.json';\n\n\t\t// Verify the configuration exists and is readable.\n\t\tif (!is_readable($file))\n\t\t{\n\t\t\tthrow new \\RuntimeException('FB-Configuration file does not exist or is unreadable.');\n\t\t}\n\n\t\t// Load the configuration file into an object.\n\t\t$configFb = json_decode(file_get_contents($file));\n\n\t\tif ($configFb === null)\n\t\t{\n\t\t\tthrow new \\RuntimeException(sprintf('Unable to parse the configuration file %s.', $file));\n\t\t}\n\n\t\t// Merge the configuration\n\t\t$config->fb_app_id \t\t= $configFb->app_id;\n\t\t$config->fb_app_secret \t= $configFb->app_secret;\n\n\t\t$this->config->loadObject($config);\n\n\t\treturn $this;\n\t}", "protected function getExtbaseConfiguration() {}", "abstract public function getConfig();", "abstract protected function getConfig();", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "private function getExtensionSystemXml() \n\t{\n\n\t\t// path to the extensions config.xml\n\t\t$extension_system_xml_path = parent::$extension_base_dir . '/etc/system.xml';\n\n\t\tif (!file_exists($extension_system_xml_path)) {\n\t\t\t$this->displayError('Cant find path to extension system xml.');\n\t\t}\n\n\t\t$extension_system_xml = simplexml_load_file($extension_system_xml_path);\n\n\t\tparent::$extension_system_xml = $extension_system_xml;\n\n\t}", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "function loadConfig($config = array())\n {\n // Loading default preferences\n $this->config =& $config;\n }", "static function set_config() {\n\t\tif ( file_exists( self::childpath() . 'config/wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::childpath() . 'config/wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::themepath() . 'config/wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::themepath() . 'config/wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::childpath() . 'wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::childpath() . 'wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::themepath() . 'wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::themepath() . 'wpgrade-config' . EXT;\n\t\t}\n\t}", "public function registerConfig()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/language-switcher.php', 'language-switcher');\n }", "function __loadConfig($plugin,$file) {\n // still support config values of v2.3 elements\n if (count(explode('.', $file)) > 0) {\n $file = str_replace('.', '_', $file);\n }\n \n // load config from app config folder\n if (Configure::load($file) === false) {\n // load config from plugin config folder\n if( $plugin ){\n\t if (Configure::load($plugin.'.'.$file) === false) {\n\t echo '<p>Error: The '.$file.'.php could not be found in your app/config or app/plugins/comment/config folder. Please create it from the default comment/config/default.php.</p>';\n\t }\n\t }else\n\t {\n\t if (Configure::load($file) === false) {\n\t echo '<p>Error: The '.$file.'.php could not be found in your app/config or app/plugins/comment/config folder. Please create it from the default comment/config/default.php.</p>';\n\t }\t \n\t }\n }\n }", "public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }", "protected function _load_config($type) {\r\n\t\t$this->regx_parse = new FileSystem_File(\r\n\t\t\tROOT_BACK.MODELS_DIRECTORY.DS.'Filesystem'.DS.'File'.DS.'settings',\r\n\t\t\t$type.'.xml'\r\n\t\t);\r\n\t\t$this->regx_parse->open('read','settings');\r\n }", "protected function setConfigurations()\n {\n if ($files = $this->getFiles('config'))\n {\n foreach ($files as $key => $filename)\n {\n $this->config->set(basename($filename, '.php'), require path('config').DIRECTORY_SEPARATOR.($filename));\n }\n }\n }", "public function loadConfig($data);", "protected function _initConfig()\n\t{\n\t\t$this->_config = new Zend_Config_Xml($this->_configFile);\n\t\t!empty($this->_config) || trigger_error('Config file not found.', E_USER_ERROR);\n\t\treturn $this->_config;\n\t}", "private function setUpConfig() {\n\n //Get the file where the configs are and process the arrays\n require($this->_data['pathtodata']);\n\n $this->_data = array_merge($this->_data,$acs_confdata);\n\n if (empty($this->_data['indexfile']))\n $this->_data['indexfile'] = 'index';\n\n if (empty($this->_data['common_extension']))\n $this->_data['common_extension'] = COMMON_EXTENSION;\n \n $this->setUriData($this->_data); \n \n //Create the cache file of the config\n if (isset($this->_data['cache_config']) && $this->_data['cache_config'])\n $this->saveConfig();\n else\n if (file_exists($this->_data['cache_config_file']))\n unlink($this->_data['cache_config_file']); \n }", "public function load(array $config, ContainerBuilder $container)\n {\n $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));\n\n $loader->load('event_listeners.xml');\n $loader->load('crawler_clients.xml');\n /*$loader->load('admin.xml');*/\n }", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "function load_config($conf) {\n $this->conf = $conf; // Store configuration\n\n $this->pi_setPiVarDefaults(); // Set default piVars from TS\n $this->pi_initPIflexForm(); // Init FlexForm configuration for plugin\n\n // Read extension configuration\n $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);\n\n if (is_array($extConf)) {\n $conf = t3lib_div::array_merge($extConf, $conf);\n\n }\n\n // Read TYPO3_CONF_VARS configuration\n $varsConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey];\n\n if (is_array($varsConf)) {\n\n $conf = t3lib_div::array_merge($varsConf, $conf);\n\n }\n\n // Read FlexForm configuration\n if ($this->cObj->data['pi_flexform']['data']) {\n\n foreach ($this->cObj->data['pi_flexform']['data'] as $sheetName => $sheet) {\n\n foreach ($sheet as $langName => $lang) {\n foreach(array_keys($lang) as $key) {\n\n $flexFormConf[$key] = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], \n $key, $sheetName, $langName);\n\n if (!$flexFormConf[$key]) {\n unset($flexFormConf[$key]);\n\n }\n }\n }\n }\n }\n\n if (is_array($flexFormConf)) {\n\n $conf = t3lib_div::array_merge($conf, $flexFormConf);\n }\n\n $this->conf = $conf;\n\n }", "abstract protected function loadConfiguration($name);", "public function loadConfiguration()\n {\n // Get bundles paths\n $bundles = $this->kernel->getBundles();\n $paths = array();\n $pathInBundles = 'Resources' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'nekland_admin.yml';\n\n foreach ($bundles as $bundle) {\n $paths[] = $bundle->getPath() . DIRECTORY_SEPARATOR . $pathInBundles;\n }\n $this->configuration->setPaths($paths);\n $this->configuration->loadConfigFiles();\n }", "public function loadConfig()\n {\n $fileName = \"setup.json\";\n\n if (! file_exists(WPADW_DIR . $fileName)) {\n $this->configParams = [];\n return $this;\n }\n\n $data = file_get_contents(WPADW_DIR . $fileName);\n\n $paramsArray = json_decode($data, true);\n\n $this->configParams = $paramsArray;\n\n return $this;\n }", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "protected function getConfigFromFile()\n {\n if (isset($this->config)) {\n return $this->config;\n }\n\n $className = get_class($this);\n $configPath = realpath(dirname(File::fromClass($className)));\n\n if (File::exists($configFile = $configPath.'/extension.json')) {\n $config = json_decode(File::get($configFile), true) ?? [];\n }\n elseif (File::exists($configFile = $configPath.'/composer.json')) {\n $config = ComposerManager::instance()->getConfig($configPath);\n }\n else {\n throw new SystemException(\"The configuration file for extension <b>{$className}</b> does not exist. \".\n 'Create the file or override extensionMeta() method in the extension class.');\n }\n\n foreach (['code', 'name', 'description', 'author', 'icon'] as $item) {\n if (!array_key_exists($item, $config)) {\n throw new SystemException(sprintf(\n Lang::get('system::lang.missing.config_key'),\n $item, File::localToPublic($configFile)\n ));\n }\n }\n\n return $this->config = $config;\n }", "public function getConfig(){\n return include __DIR__ . '/config/module.config.php';\n }", "protected function _getConfig()\n {\n if (Zend_Registry::isRegistered('Zend_Cache_Manager') && Zend_Registry::get('Zend_Cache_Manager')->hasCache('navigation')) {\n $cache = Zend_Registry::get('Zend_Cache_Manager')->getCache('navigation');\n Core_Module_Config_Xml::setCache($cache);\n }\n $moduleConfig = new Core_Module_Config_Xml($this->_options);\n $config = $moduleConfig->readConfigs(true);\n return $config;\n }", "public function getConfig(){\r\n return include __DIR__ . '/config/module.config.php';\r\n }", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "private function loadConfig()\n {\n $base = APP_ROOT.'config/';\n $filename = $base.'app.yml';\n if (!file_exists($filename)) {\n throw new ConfigNotFoundException('The application config file '.$filename.' could not be found');\n }\n\n $config = Yaml::parseFile($filename);\n\n // Populate the environments array\n $hostname = gethostname();\n $environments = Yaml::parseFile($base.'env.yml');\n foreach ($environments as $env => $hosts) {\n foreach ($hosts as $host) {\n if (fnmatch($host, $hostname)) {\n $this->environments[] = $env;\n\n // Merge the app config for the environment\n $filename = $base.$env.'/app.yml';\n if (file_exists($filename)) {\n $envConfig = Yaml::parseFile($filename);\n $config = array_merge($config, $envConfig);\n }\n }\n }\n }\n\n // Loop through each of the config files and add them\n // to the main config array\n foreach (glob(APP_ROOT.'config/*.yml') as $file) {\n $key = str_replace('.yml', '', basename($file));\n $config[$key] = Yaml::parseFile($file);\n\n // Loop through each of the environments and merge their config\n foreach ($this->environments as $env) {\n $filename = $base.$env.'/'.$key.'.yml';\n if (file_exists($filename)) {\n $envConfig = Yaml::parseFile($filename);\n $config[$key] = array_merge($config[$key], $envConfig);\n }\n }\n }\n\n // Create and store the config object\n return $this->config = new Config($config);\n }", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "public function loadApplicationConfigurationFromXml($dom,$configPath)\r\n\t{\r\n\t\t$appConfig=new TApplicationConfiguration;\r\n\t\t$appConfig->loadFromXml($dom,$configPath);\r\n\t\t$this->_appConfigs[]=$appConfig;\r\n\t}", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "private function loadConfig()\n {\n $this->category->config = [];\n $this->loadMeta('admins', 'array');\n $this->loadMeta('members', 'array');\n $this->loadMeta('template');\n $this->loadMeta('category', 'array');\n //$this->loadMetaCategory();\n $this->loadInitScript();\n }", "protected function configure()\n {\n // load config\n $config = new \\Phalcon\\Config(array(\n 'base_url' => '/',\n 'static_base_url' => '/',\n ));\n\n if (file_exists(APPPATH.'config/static.php')) {\n $static = include APPPATH.'config/static.php';\n $config->merge($static);\n }\n\n if (file_exists(APPPATH.'config/setup.php')) {\n $setup = include APPPATH.'config/setup.php';\n $config->merge($setup);\n }\n\n return $config;\n }", "public function getConfig()\n {\n\n $config = [];\n\n $configFiles = [\n __DIR__ . '/config/module.config.php',\n __DIR__ . '/config/module.config.cache.php',\n __DIR__ . '/config/module.config.console.php',\n __DIR__ . '/config/module.config.forms.php',\n __DIR__ . '/config/module.config.imagestorage.php',\n __DIR__ . '/config/module.config.routes.php',\n ];\n\n // Merge all module config options\n foreach($configFiles as $configFile) {\n $config = \\Zend\\Stdlib\\ArrayUtils::merge($config, include $configFile);\n }\n\n return $config;\n }", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::FILE_CONFIG);\n $rawdata = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal, set defaults below\n } catch (Engine_Exception $e) {\n throw new Engine_Exception($e->get_message(), CLEAROS_WARNING);\n }\n\n if (isset($rawdata['allow_shell']) && preg_match(\"/(true|1)/i\", $rawdata['allow_shell']))\n $this->config['allow_shell'] = TRUE;\n else\n $this->config['allow_shell'] = FALSE;\n\n if (isset($rawdata['theme_mode']) && !empty($rawdata['theme_mode']))\n $this->config['theme_mode'] = $rawdata['theme_mode'];\n else\n $this->config['theme_mode'] = 'normal';\n\n if (isset($rawdata['theme']) && !empty($rawdata['theme']))\n $this->config['theme'] = $rawdata['theme'];\n else\n $this->config['theme'] = 'default';\n\n $this->is_loaded = TRUE;\n }", "public function getConfig()\n\t{\n\t\treturn include __DIR__ . '/../../../config/module.config.php';\n\t}", "protected function registerConfig()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/tailwindnotifications.php',\n 'tailwindnotifications'\n );\n }", "private function load()\n {\n if (!file_exists($this->file)) {\n throw new Exception('config file not found');\n }\n // read contents of wordpress config\n // we can not require the configuration because it requires a shit load of other files\n $this->config = file_get_contents($this->file);\n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "public function getConfig() {\r\n\r\n\t}", "public static function load()\n {\n if(!self::$loaded)\n {\n $GLOBALS['_EZMVC_SYS_CONFIG'] = require __DIR__ . '/system.config.php'; //Load config file\n $GLOBALS['_EZMVC_SYS_CONFIG'] = is_array($GLOBALS['_EZMVC_SYS_CONFIG']) ? $GLOBALS['_EZMVC_SYS_CONFIG'] : []; //Make sure its an array\n\n $GLOBALS['_EZMVC_APP_CONFIG'] = require dirname(__DIR__) . '/app/config/app.config.php';\n $GLOBALS['_EZMVC_APP_CONFIG'] = is_array($GLOBALS['_EZMVC_APP_CONFIG']) ? $GLOBALS['_EZMVC_APP_CONFIG'] : [];\n }\n }", "private function initConfig() {\n\t\t$configLoader = new ConfigLoader($this->_env);\n\n /** set config to Di container */\n $this->_di->set('config', $configLoader, TRUE);\n $this->_config = $configLoader;\n\t}", "function plugin_load_configuration_nexcontent($pi_name)\r\n{\r\n global $_CONF;\r\n\r\n $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';\r\n\r\n require_once $_CONF['path_system'] . 'classes/config.class.php';\r\n require_once $base_path . 'install_defaults.php';\r\n\r\n return plugin_initconfig_nexcontent();\r\n}", "protected function load_config() {\n $this->config = Kohana::$config->load('imagecache');\n $this->config_patterns = Kohana::$config->load('imagecache_patterns');\n }", "private function getConfig() {\n // call the GetConfig API\n $args = array('hostname' => $this->hostname);\n $api = new \\xmlAPI('GetConfig', $this->_default_key, 'xml', $args);\n $api->server_url = $this->_default_server;\n $api->send();\n\n // change hostname if found by custom_name\n $this->hostname = $api->hostname;\n \n // save fields in metadata\n $this->key = $api->api_key ? $api->api_key : $this->_default_key;\n $this->server = $api->api_server ? $api->api_server : $this->_default_server;\n $this->controller_path = $api->controller_path;\n $this->controller = $api->controller;\n $this->error_page = $api->error_page ? $api->error_page : '404';\n $this->mode = $api->mode ? $api->mode : 'test';\n $this->site_path = $api->site_path ? $api->site_path : $this->hostname;\n $this->default_site_path = $api->default_site_path;\n $this->secure_domain = $api->secure_domain;\n \n // set the list of controllers this site can use\n $this->setRights($api->row);\n }", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "private function initialiseConfig()\n {\n $this->mergeConfigFrom(__DIR__ . '/..' . Settings::LARAVEL_REAL_CONFIG, Settings::LARAVEL_CONFIG_NAME);\n }", "public function _initConfig() {\r\n $this->config = Yaf\\Application::app()->getConfig();\r\n Yaf\\Registry::set(\"config\", $this->config);\r\n\r\n //申明, 凡是以Foo和Local开头的类, 都是本地类\r\n $this->loader = Yaf\\Loader::getInstance();\r\n $this->loader->registerLocalNamespace([\"fly\"]);\r\n }", "public function loadConfig($file) {\n $config = array();\n if (file_exists(PATH_CONFIGS . $file))\n include(PATH_CONFIGS . $file);\n if (!empty($config)) {\n foreach ($config as $name => $array) {\n $this->configs[$name] = $array;\n }\n }\n }", "protected function mergeWithCurrentConfig($config)\n {\n $currentConfigFilePath = $this->getCurrentConfigFilePath();\n if (File::isFile($currentConfigFilePath)) {\n $currentConfig = include $currentConfigFilePath;\n if (is_array($currentConfig)) {\n foreach ($currentConfig as $key => $value) {\n if (isset($config[$key])) {\n $config[$key]['value'] = $value;\n }\n }\n }\n };\n\n return $config;\n }", "static function merge($config, $newConfigName) \n {\n if (empty($config)) {\n $config = array(); \n }\n\n if ($newConfigName != self::CONFIG_DEFAULT) {\n $newConfig = self::load($newConfigName);\n\n foreach (self::$available_setting as $key => $type) {\n if (isset($newConfig[$key]) && !isset($config[$key])) {\n $config[$key] = $newConfig[$key];\n } else if (isset($newConfig[$key]) && isset($config[$key])) {\n switch ($type) {\n case self::SETTING_TYPE_ARRAY:\n $config[$key] = array_merge($config[$key], $newConfig[$key]);\n break;\n default:\n $config[$key] = $newConfig[$key];\n break;\n } \n }\n } \n\n // Override default setting for some websites that using bad class name\n foreach ($config[self::IGNORED_CLASSES] as $key => $class) {\n if (isset($newConfig[self::OVERRIDE_CLASSES]) && in_array($class, $newConfig[self::OVERRIDE_CLASSES])) {\n unset($config[self::IGNORED_CLASSES][$key]);\n }\n }\n }\n\n return $config;\n }", "public function getConfig() : array {\n return include __DIR__ . '/../config/module.config.php';\n }", "private function readXML() {\n $xmlFile = __DIR__ .\"\\configuracion.xml\";\n if (file_exists($xmlFile)) {\n $xml = simplexml_load_file($xmlFile);\n } else {\n exit('Fallo al abrier el archivo configuraciones.xml');\n }\n $this->host = $xml->mysql[0]->host;\n $this->database = $xml->mysql[0]->database;\n $this->user = $xml->mysql[0]->user;\n $this->password = $xml->mysql[0]->password;\n }" ]
[ "0.7327848", "0.7100023", "0.6876409", "0.6820444", "0.68199956", "0.66956866", "0.6644235", "0.6616868", "0.6595615", "0.6501832", "0.6466532", "0.6459517", "0.6440405", "0.6405277", "0.6371634", "0.63312817", "0.6324032", "0.6303028", "0.6265034", "0.62613964", "0.62613255", "0.6243059", "0.6218573", "0.6195629", "0.61891615", "0.6167874", "0.6166812", "0.61511594", "0.61281735", "0.61232257", "0.61168206", "0.60963714", "0.6060541", "0.60504603", "0.60368276", "0.60308474", "0.6011047", "0.60044223", "0.5991782", "0.59582406", "0.59452206", "0.5927889", "0.59223557", "0.59152704", "0.5912031", "0.5906989", "0.5905296", "0.58960223", "0.5894153", "0.5884707", "0.58777255", "0.58705235", "0.58684015", "0.58641505", "0.58594537", "0.5841587", "0.5833916", "0.5828728", "0.5821304", "0.58080846", "0.57981694", "0.57949996", "0.57844365", "0.5783269", "0.57694805", "0.57648677", "0.5764247", "0.57625926", "0.57625926", "0.57625926", "0.57625926", "0.57625926", "0.57625926", "0.57625926", "0.57625926", "0.576082", "0.5751728", "0.5739428", "0.5736567", "0.5733435", "0.57289076", "0.5720643", "0.57177067", "0.57076854", "0.57051027", "0.5690699", "0.5689302", "0.5684289", "0.5681595", "0.5680901", "0.56637186", "0.56607175", "0.5658227", "0.56406677", "0.5639013", "0.5634712", "0.5630544", "0.56281585", "0.5625363", "0.5624095" ]
0.6721193
5
Method to parse the ''config.xml'' of an extension, build the JSON string for its default parameters, and return the JSON string.
private function parseConfigFile($file) { if (! file_exists($file)) { return '{}'; } $xml = simplexml_load_file($file); if (! ($xml instanceof SimpleXMLElement)) { return '{}'; } if (! isset($xml->fieldset)) { return '{}'; } // Getting the fieldset tags $fieldsets = $xml->fieldset; // Creating the data collection variable: $ini = array (); // Iterating through the fieldsets: foreach ($fieldsets as $fieldset) { if (! count($fieldset->children())) { // Either the tag does not exist or has no children therefore we return zero files processed. return '{}'; } // Iterating through the fields and collecting the name/default values: foreach ($fieldset as $field) { // Check against the null value since otherwise default values like "0" // cause entire parameters to be skipped. if (($name = $field->attributes()->name) === null) { continue; } if (($value = $field->attributes()->default) === null) { continue; } $ini[(string) $name] = (string) $value; } } return json_encode($ini); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getExtensionConfigXml() \n\t{\n\n\t\t// path to the extensions config.xml\n\t\t$extension_config_xml_path = parent::$extension_base_dir . '/etc/config.xml';\n\n\t\tif (!file_exists($extension_config_xml_path)) {\n\t\t\t$this->displayError('Cant find path to extension config xml.');\n\t\t}\n\n\t\t$extension_config_xml = simplexml_load_file($extension_config_xml_path);\n\n\t\tparent::$extension_config_xml = $extension_config_xml;\n\n\t}", "public static function returnExtConfDefaults() {}", "protected function getExtbaseConfiguration() {}", "private function getGiftOptionsConfigJson()\n {\n return $this->configProvider->getConfig();\n }", "private function loadConfigXml($parent) {\n\t\t$file = $parent->getParent()->getPath('extension_administrator') .\n\t\t\t\t'/config.xml';\n\t\t$defaults = $this->parseConfigFile($file);\n\t\tif ($defaults === '{}') {\n\t\t\treturn;\n\t\t}\n\n\t\t$manifest = $parent->getParent()->getManifest();\n\t\t$type = $manifest->attributes()->type;\n\n\t\ttry {\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$query = $db->getQuery(true)->select($db->quoteName(array (\n\t\t\t\t\t'extension_id', 'params' )))->from($db->quoteName('#__extensions'))->where($db->quoteName('type') .\n\t\t\t\t\t' = ' . $db->quote($type))->where($db->quoteName('element') .\n\t\t\t\t\t' = ' . $db->quote($parent->getElement()))->where($db->quoteName('name') .\n\t\t\t\t\t' = ' . $db->quote($parent->getName()));\n\t\t\t$db->setQuery($query);\n\t\t\t$row = $db->loadObject();\n\t\t\tif (! isset($row)) {\n\t\t\t\t$this->enqueueMessage(JText::_('COM_CLM_TURNIER_ERROR_CONFIG_LOAD'), 'warning');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$params = json_decode($row->params, true);\n\t\t\tif (json_last_error() == JSON_ERROR_NONE && is_array($params)) {\n\t\t\t\t$result = array_merge(json_decode($defaults, true), $params);\n\t\t\t\t$defaults = json_encode($result);\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$this->enqueueMessage($e->getMessage(), 'warning');\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->update($db->quoteName('#__extensions'));\n\t\t\t$query->set($db->quoteName('params') . ' = ' . $db->quote($defaults));\n\t\t\t$query->where($db->quoteName('extension_id') . ' = ' .\n\t\t\t\t\t$db->quote($row->extension_id));\n\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\t\t} catch (Exception $e) {\n\t\t\t$this->enqueueMessage($e->getMessage(), 'warning');\n\t\t}\n\t}", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "abstract protected function getConfig();", "abstract public function getConfig();", "private function generateConfig() {\n $config_json = array(\n 'version' => '1.0.0',\n 'name' => $this->gateway_name,\n 'description' => '',\n 'authors' => [],\n 'currencies' => ['USD'],\n 'signup_url' => 'https://google.com'\n );\n\n foreach($config_json as $key => $value) {\n if($key == 'authors' && isset($this->config['authors'])) {\n foreach($this->config[\"authors\"] as $config_author) {\n $config_entry = array(\n \"name\" => \"\",\n \"url\" => \"\"\n );\n \n if(isset($config_author['name'])) {\n $config_entry[\"name\"] = $config_author['name'];\n \n if(isset($config_author[\"url\"])) {\n $config_entry[\"url\"] = $config_author['url'];\n }\n $config_json[\"authors\"][] = $config_entry;\n }\n }\n }\n else {\n if(isset($this->config[$key])) {\n $config_json[$key] = $this->config[$key];\n }\n }\n }\n\n return json_encode($config_json);\n }", "private function getDefaultConfig(){\n\t\t//Pretty simple. Multidimensional array of configuration values gets returned\n\t $defaultConfig = array();\n\t\t$defaultConfig['general'] = array('start_path'=>'.', 'disallowed'=>'php, php4, php5, phps',\n\t\t\t\t\t\t\t\t\t\t 'page_title'=>'OMFG!', 'files_label'=>'', 'folders_label'=>'');\n\t\t$defaultConfig['options'] = array('thumb_height'=>75, 'files_per_page'=>25, 'max_columns'=>3, \n\t\t\t\t\t\t\t\t\t\t 'enable_ajax'=>false, 'memory_limit'=>'256M', 'cache_thumbs'=>false, \n\t\t\t\t\t\t\t\t\t\t\t'thumbs_dir'=>'/.thumbs', 'icons_dir'=>'/.icons');\n\t\treturn $defaultConfig;\n\t}", "private function getConfig() {\r\n\t\techo '<reply action=\"ok\">';\r\n\t\techo $this->data->asXML();\r\n\t\techo '</reply>';\r\n\t}", "public function defaultConfig();", "public function getConfig() {}", "public function getConfig() {\r\n\r\n\t}", "function vxml_get_config($engine) {\n\twriteVxmlConf();\t\n\t\n\t//Call to the function to change the TTS engine\n\tchangeTTSEngine();\n\t\n\t//Call to the function to change the ASR engine\n\tchangeMRCPEngine();\n\t\n\t//We write the dialplan\n\tglobal $ext;\n\t\n\tswitch($engine) {\n\t\tcase \"asterisk\": \n\t\t\t$vxmllist = getVxmlList(\"*\");\n\t\t\tforeach ($vxmllist as $vxml) {\n\t\t\t\t$ename = \"app-vxml-\".$vxml['id'];\n\t\t\t\t$ext->addSectionComment($ename, $vxml['name']);\n\t\t\t\t$ext->add($ename,'s','',new ext_vxml($vxml['name']));\n\t\t\t\t$ext->add($ename,'s','',new ext_goto($vxml['goto']));\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t}\n\treturn;\n\t\n}", "protected function loadConfig() : \\codename\\core\\config {\r\n return new \\codename\\core\\config\\json('config/model/' . $this->schema . '_' . $this->table . '.json', true, true);\r\n }", "public function extensionMeta()\n {\n return $this->getConfigFromFile();\n }", "public function getConfig($name = '', $default = null);", "public static function getConfig()\n {\n }", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "public function getEditorConfigJSON(){\r\n\t\t//load config from default\r\n\t\t$config = Mage::getSingleton('cms/wysiwyg_config')->getConfig(\r\n\t\t\tarray('tab_id' => 'form_section'));\r\n\t\t$config['add_images'] \t\t= true;\r\n\t\t$config['directives_url']\t= Mage::helper('adminhtml')->getUrl('adminhtml/cms_wysiwyg/directive');//replace $this->getUrl = Mage::helper('adminhtml') to generate secret key\r\n\t\t$config['files_browser_window_url']\t= $this->getUrl('adminhtml/cms_wysiwyg_images/index');\r\n\t\t$config['width']\t \t\t= '990px';\r\n\t\t/*Attach CSS file from selected template*/\r\n\t\t$config['content_css']\t= $this->getSkinUrl('ves_advancedpdfprocessor/default.css');\r\n\t\tif($apiKey = Mage::registry('key_data')){\r\n\t\t\t$template = Mage::getModel('advancedpdfprocessor/template')->load($apiKey->getTemplateId());\r\n\t\t\t$config['content_css']\t.= ','.$this->getSkinUrl($template->getData('css_path'));\r\n\t\r\n\t\t\t/*Body class*/\r\n\t\t\t$config['body_class']\t= $template->getSku();\r\n\t\t}\r\n\t\t$config[\"widget_window_url\"] = Mage::getSingleton('adminhtml/url')->getUrl('advancedpdfprocessor/adminhtml_widget/index');\r\n\t\t$plugins = $config->getData('plugins');\r\n\t\t$plugins[0][\"options\"][\"url\"] = '';\r\n\t\t$plugins[0][\"options\"][\"onclick\"][\"subject\"] = \"MagentovariablePlugin.loadChooser('{{html_id}}');\";\r\n\r\n\t\t/*Add Easy PDF plugin*/\r\n/*\t\t$plugins[] = array(\r\n\t\t\t'name'\t\t=> 'easypdf',\r\n\t\t\t'src'\t\t=> $this->getJsUrl('ves_advancedpdfprocessor/tiny_mce/plugins/easypdf/editor_plugin.js'),\r\n\t\t\t'options'\t=> array('logo_url'=>$this->getJsUrl('ves_advancedpdfprocessor/tiny_mce/plugins/easypdf/images/logo_bg.gif')),\r\n\t\t);\r\n*/\r\n\t\t$config->setData('plugins' , $plugins);\r\n\t\treturn Zend_Json::encode($config);\r\n\t}", "function loadXMLParamSingle($config)\r\n {\r\n $option = JRequest::getCmd('option');\r\n //Load current Parameter\r\n $value = JRequest::getVar('params');\r\n if (empty($value)) {\r\n $value = array();\r\n } else {\r\n $value = base64_decode($value);\r\n $value = unserialize($value);\r\n if (!is_array($value)) {\r\n $value = array();\r\n }\r\n }\r\n\r\n if ($this->isJ16) {\r\n global $jname;\r\n $jname = (!empty($value['jfusionplugin'])) ? $value['jfusionplugin'] : '';\r\n if (isset($this->configArray[$config]) && !empty($jname)) {\r\n $path = JFUSION_PLUGIN_PATH . DS . $jname . DS . $this->configArray[$config][1];\r\n $defaultPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'views' . DS . 'advancedparam' . DS . 'paramfiles' . DS . $this->configArray[$config][1];\r\n $xml_path = (file_exists($path)) ? $path : $defaultPath;\r\n $xml = JFactory::getXMLParser('Simple');\r\n $form = false;\r\n if ($xml->loadFile($xml_path)) {\r\n if ($fields = $xml->document->getElementByPath('fields')) {\r\n $data = $xml->document->fields[0]->toString();\r\n //make sure it is surround by <form>\r\n if (substr($data, 0, 5) != \"<form>\") {\r\n $data = \"<form>\" . $data . \"</form>\";\r\n }\r\n $form = &JForm::getInstance($jname, $data, array('control' => \"params[$jname]\"));\r\n //add JFusion's fields\r\n $form->addFieldPath(JPATH_COMPONENT.DS.'fields');\r\n\t\t\t\t\t\tif (isset($value[$jname])) {\r\n \t$form->bind($value[$jname]);\r\n }\r\n }\r\n\r\n $this->loadLanguage($xml);\r\n }\r\n $value['params'] = $form;\r\n }\r\n return $value;\r\n } else {\r\n //Load Plugin XML Parameter\r\n $params = new JParameter('');\r\n $params->loadArray($value);\r\n $params->addElementPath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jfusion' . DS . 'elements');\r\n $JPlugin = $params->get('jfusionplugin', '');\r\n if (isset($this->configArray[$config]) && !empty($JPlugin)) {\r\n global $jname;\r\n $jname = $JPlugin;\r\n $path = JFUSION_PLUGIN_PATH . DS . $JPlugin . DS . $this->configArray[$config][1];\r\n $defaultPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'views' . DS . 'advancedparam' . DS . 'paramfiles' . DS . $this->configArray[$config][1];\r\n $xml_path = (file_exists($path)) ? $path : $defaultPath;\r\n $xml = JFactory::getXMLParser('Simple');\r\n if ($xml->loadFile($xml_path)) {\r\n $params->setXML($xml->document->params[0]);\r\n $this->loadLanguage($xml);\r\n }\r\n }\r\n return $params;\r\n }\r\n }", "abstract protected function getPluginConfiguration($extensionName, $pluginName);", "function getConfig($param, $return = false) {\n\n $json = new JSONParser(D . '/config.json', 'en-en');\n $r = (string) $json->stream->data[0]->{$param};\n\n if ($return) {\n return (isset($r) && !empty($r)) ? $r : false;\n } else {\n echo (isset($r) && !empty($r)) ? $r : '';\n }\n}", "public function getEpicEditorConfig()\n {\n $config = $this->_getJsonConfig('epiceditor');\n $config = false !== $config ? json_decode($config, true) : array();\n $config['basePath'] = Mage::getBaseUrl('skin') . 'adminhtml/default/default/epiceditor/';\n return json_encode($config);\n }", "public function getPhpExtensionsConfig() {\n\t\treturn $this->_getConfigValueArrayMultiple('PHPextensions');\n\t}", "function getConfigObj(){\n $fh = fopen($GLOBALS['configFileName'],'r')\n\t\t\tor die(\"Unable to open file!\");\n\n $configJson = fread($fh, filesize($GLOBALS['configFileName']));\n fclose($fh);\n // print($configJson);\n // $configObj = json_decode($configJson);\n // var_dump($configObj); //->{'devices'}[0]->{'name'};\n return json_decode($configJson);\n }", "private function initConfig()\n {\n return $this->config = [\n 'api' => 'https://api.gfycat.com/v1',\n ];\n }", "protected function defaultRawConfiguration()\n {\n return [\n 'negotiation' => [\n 'enabled' => false,\n ],\n 'serializer' => [\n 'enabled' => true\n ],\n 'normalizer' => [\n 'enabled' => false\n ],\n 'validator' => [\n 'enabled' => false\n ],\n 'types' =>\n [\n [\n 'name' => 'json',\n 'values'=> [\n 'application/json','text/json'\n ],\n 'restrict' => null\n ],\n [\n 'name' => 'xml',\n 'values' => [\n 'application/xml','text/xml'\n ],\n 'restrict' => null\n ]\n ],\n 'headers' =>\n [\n 'content_type' => 'content-type',\n 'accept_type' => 'accept'\n ]\n ];\n }", "private function parseConfig(){\n\t\t\treturn parse_ini_file(BASE_PATH . 'config' . DIRECTORY_SEPARATOR . 'config.ini');\n\t\t}", "public function getDefaultConfig($fileName = null)\n {\n $configHelper = \\Fci_Helper_Config::getInstance();\n if (!$fileName) {\n $configHelper->load('default.xml.dist');\n } else {\n try {\n $configHelper->load($fileName . '.xml');\n } catch (ParserException $e) {\n $configHelper->load('default.xml.dist');\n }\n }\n\n $default = [\n 'file' => [\n 'path' => $configHelper->getFilePath(),\n 'delimiter' => $configHelper->getFileDelimiter(),\n 'enclosure' => $configHelper->getFileEnclosure(),\n 'archive_with_datetime' => (int)$configHelper->getArchiveWithDateTime(),\n ],\n 'general' => [\n 'reload_cache' => (int)$configHelper->getReloadCache(),\n 'disable_products' => (int)$configHelper->getDisableProducts(),\n 'delete_disabled_products' => (int)$configHelper->getDeleteDisabledProducts(),\n 'disable_conditions' => $configHelper->getDisableConditions(),\n 'delete_products_not_in_csv' => (int)$configHelper->getDeleteProductsNotInCsv(),\n 'unset_special_price' => (int)$configHelper->getUnsetSpecialPrice(),\n 'delete_all_special_prices' => (int)$configHelper->getDeleteAllSpecialPrices(),\n 'scripts' => $configHelper->getScripts(),\n ],\n 'dataprocessing' => [\n 'general' => [\n 'mode' => $configHelper->getMode(),\n 'import' => $configHelper->getImportType(),\n 'cache_lines' => $configHelper->getLinesToCache(),\n 'mappings' => $configHelper->getMappingsValue(),\n 'strip_html_tags' => (int)$configHelper->getStripHtmlTags(),\n 'import_globally' => (int)$configHelper->getImportGallery(),\n 'date_time_format' => $configHelper->getDateTimeFormat(),\n ],\n 'images' => [\n 'image_prefix' => $configHelper->getImagePrefix(),\n 'image_split' => $configHelper->getImageSeparator(),\n 'sku_fallback' => (int)$configHelper->getUseSkuImageFallback(),\n 'import_gallery' => (int)$configHelper->getImportGallery(),\n ],\n 'mandatory' => $configHelper->getMandatoryFields(),\n 'products' => [\n 'identifier' => $configHelper->getProductIdentifier(),\n 'clear_existing_websites' => (int)$configHelper->getClearExistingWebsites(),\n ],\n ],\n 'general_defaults' => [\n 'websites' => $configHelper->getWebsitesValue(),\n 'store' => $configHelper->getStoreValue(),\n ],\n 'product_defaults' => $configHelper->getProductDefaults(),\n 'category_defaults' => $configHelper->getCategoryDefaults(),\n 'category_settings' => [\n 'root_category' => $configHelper->getRootCategory(),\n 'category_separate' => $configHelper->getCategorySeparate(),\n 'sub_category_separate' => $configHelper->getSubCategorySeparate(),\n 'create_categories' => (int)$configHelper->createCategories(),\n 'default_product_position' => $configHelper->getDefaultProductPosition(),\n ],\n ];\n\n return $default;\n }", "protected function declareConfig(){\n\n $output = '';\n \n foreach( $this->getConfig() as $key => $value ){\n \n $output .= $key . '=' . json_encode( $value ) . ';';\n \n }\n \n return $output;\n\n }", "protected function getConfigFromFile()\n {\n if (isset($this->config)) {\n return $this->config;\n }\n\n $className = get_class($this);\n $configPath = realpath(dirname(File::fromClass($className)));\n\n if (File::exists($configFile = $configPath.'/extension.json')) {\n $config = json_decode(File::get($configFile), true) ?? [];\n }\n elseif (File::exists($configFile = $configPath.'/composer.json')) {\n $config = ComposerManager::instance()->getConfig($configPath);\n }\n else {\n throw new SystemException(\"The configuration file for extension <b>{$className}</b> does not exist. \".\n 'Create the file or override extensionMeta() method in the extension class.');\n }\n\n foreach (['code', 'name', 'description', 'author', 'icon'] as $item) {\n if (!array_key_exists($item, $config)) {\n throw new SystemException(sprintf(\n Lang::get('system::lang.missing.config_key'),\n $item, File::localToPublic($configFile)\n ));\n }\n }\n\n return $this->config = $config;\n }", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "public function getConfig()\n {\n $config = [\n 'payment' => [\n 'ccform' => [\n 'availableTypes' => [\n self::CODE => $this->getCardTypes()\n ],\n 'months' => [\n self::CODE => $this->getMonths()\n ],\n 'years' => [\n self::CODE => $this->getYears()\n ],\n 'hasVerification' => [\n self::CODE => $this->config->getValue('enable_cvv') ? true : false\n ],\n 'cvvImageUrl' => [\n self::CODE => $this->getCvvImageUrl()\n ],\n 'testMode' => [\n self::CODE => $this->config->getValue('test')\n ],\n 'jsToken' => [\n self::CODE => $this->config->getValue('js_token')\n ]\n ]\n ]\n ];\n return $config;\n }", "private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = '';\r\n }\r\n $response = Configuration::updateValue($this->name . '_TITLE', $title);\r\n $response &= Configuration::updateValue($this->name . '_MAXITEM', 5);\r\n $response &= Configuration::updateValue($this->name . '_MINITEM', 2);\r\n $response &= Configuration::updateValue($this->name . '_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue($this->name . '_AUTOSCROLLDELAY', 5000);\r\n $response &= Configuration::updateValue($this->name . '_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue($this->name . '_PAGINATION', 0);\r\n $response &= Configuration::updateValue($this->name . '_NAVIGATION', 0);\r\n $response &= Configuration::updateValue($this->name . '_MANTITLE', 0);\r\n\r\n return $response;\r\n }", "protected abstract static function getConfig(): array;", "public function getConfig()\n {\n return [\n 'payment' => [\n EWallet::CODE => [\n 'redirectUrl' => $this->helperData->getEWalletRedirectUrl(),\n 'subtypes' => [\n [\n 'name' => 'pagseguro',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/pagseguro-logo.png')\n ],\n [\n 'name' => 'paypal',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/paypal-logo.png')\n ],\n ]\n ]\n ]\n ];\n }", "public function getConfigFromZk()\n {\n $content = '';\n $path = rtrim($this->options['path'], '/');\n if (strtolower($this->options['val_type']) == static::VALUE_TYPE_JSON) {\n $content = $this->getNodeValue($path);\n } else {\n $content = $this->getChildNodes($path);\n }\n return new Config($this->app, $content);\n }", "protected function load_addon_config() {\n\t\t$config = [\n\t\t\t'gist' => [\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Git Updater - Gist', 'git-updater' ),\n\t\t\t\t\t'author' => __( 'Andy Fragen' ),\n\t\t\t\t\t'description' => __( 'Add GitHub Gist hosted repositories to the Git Updater plugin.', 'git-updater' ),\n\t\t\t\t\t'host' => 'github',\n\t\t\t\t\t'slug' => 'git-updater-gist/git-updater-gist.php',\n\t\t\t\t\t'uri' => 'afragen/git-updater-gist',\n\t\t\t\t\t'branch' => 'main',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'api' => 'gist',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'bitbucket' => [\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Git Updater - Bitbucket', 'git-updater' ),\n\t\t\t\t\t'author' => __( 'Andy Fragen' ),\n\t\t\t\t\t'description' => __( 'Add Bitbucket and Bitbucket Server hosted repositories to the Git Updater plugin.', 'git-updater' ),\n\t\t\t\t\t'host' => 'github',\n\t\t\t\t\t'slug' => 'git-updater-bitbucket/git-updater-bitbucket.php',\n\t\t\t\t\t'uri' => 'afragen/git-updater-bitbucket',\n\t\t\t\t\t'branch' => 'main',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'api' => 'bitbucket',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'gitlab' => [\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Git Updater - GitLab', 'git-updater' ),\n\t\t\t\t\t'author' => __( 'Andy Fragen' ),\n\t\t\t\t\t'description' => __( 'Add GitLab hosted repositories to the Git Updater plugin.', 'git-updater' ),\n\t\t\t\t\t'host' => 'github',\n\t\t\t\t\t'slug' => 'git-updater-gitlab/git-updater-gitlab.php',\n\t\t\t\t\t'uri' => 'afragen/git-updater-gitlab',\n\t\t\t\t\t'branch' => 'main',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'api' => 'gitlab',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'gitea' => [\n\t\t\t\t[\n\t\t\t\t\t'name' => __( 'Git Updater - Gitea', 'git-updater' ),\n\t\t\t\t\t'author' => __( 'Andy Fragen' ),\n\t\t\t\t\t'description' => __( 'Add Gitea hosted repositories to the Git Updater plugin.', 'git-updater' ),\n\t\t\t\t\t'host' => 'github',\n\t\t\t\t\t'slug' => 'git-updater-gitea/git-updater-gitea.php',\n\t\t\t\t\t'uri' => 'afragen/git-updater-gitea',\n\t\t\t\t\t'branch' => 'main',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'api' => 'gitea',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\treturn $config;\n\t}", "public function getConfig(array $defaults = []);", "public function getConfig()\n { // Try the template specific path first\n $fname = APPLICATION_PATH.$this->_paths['pkg_template'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Next try the domain common path\n $fname = APPLICATION_PATH.$this->_paths['pkg_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // Finally, try the app common path\n $fname = APPLICATION_PATH.$this->_paths['app_common'].'/config.json';\n if( file_exists($fname) ) {\n return json_decode(file_get_contents($fname));\n }\n // If none of these files were found, return false to indicate failure\n if( !$this->_config) throw new CException('Configuration not found');\n }", "function zarinpalwg_config() {\n $configarray = array(\n \"FriendlyName\" => array(\"Type\" => \"System\", \"Value\"=>\"زرین پال - وب گیت\"),\n \"merchantID\" => array(\"FriendlyName\" => \"merchantID\", \"Type\" => \"text\", \"Size\" => \"50\", ),\n \"Currencies\" => array(\"FriendlyName\" => \"Currencies\", \"Type\" => \"dropdown\", \"Options\" => \"Rial,Toman\", ),\n\t \"MirrorName\" => array(\"FriendlyName\" => \"نود اتصال\", \"Type\" => \"dropdown\", \"Options\" => \"آلمان,ایران,خودکار\", \"Description\" => \"چناانچه سرور شما در ایران باشد ایران دا انتخاب کنید و در غیر اینصورت آلمان و یا خودکار را انتخاب کنید\", ),\n \"afp\" => array(\"FriendlyName\" => \"افزودن کارمزد به قیمت ها\", \"Type\" => \"yesno\", \"Description\" => \"در صورت انتخاب 2.5 درصد به هزینه پرداخت شده افزوده می شود.\", ),\n );\n\treturn $configarray;\n}", "protected function _getConfig()\n {\n if (Zend_Registry::isRegistered('Zend_Cache_Manager') && Zend_Registry::get('Zend_Cache_Manager')->hasCache('navigation')) {\n $cache = Zend_Registry::get('Zend_Cache_Manager')->getCache('navigation');\n Core_Module_Config_Xml::setCache($cache);\n }\n $moduleConfig = new Core_Module_Config_Xml($this->_options);\n $config = $moduleConfig->readConfigs(true);\n return $config;\n }", "function get_listener_config_data() {\n $config_file = file_get_contents('config.xml');\n $config_xml = new SimpleXMLElement($config_file);\n $location = $config_xml->path;\n if (empty($location)) {\n //try using a default\n $location = '/opt/php_listeners';\n }\n $services = $config_xml->services->service;\n return array('location' => $location, 'services' => $services);\n}", "protected function _initConfig()\n\t{\n\t\t$this->_config = new Zend_Config_Xml($this->_configFile);\n\t\t!empty($this->_config) || trigger_error('Config file not found.', E_USER_ERROR);\n\t\treturn $this->_config;\n\t}", "public function getConfigFilePath();", "function wfRtConfigExtension() {\n\tglobal $wgParser;\n\t$wgParser->setHook( \"rtconfig\", \"parseRtConfig\" );\n}", "private function getConfig()\n\t{\n\t\t$apiKey = $this->getApiKey();\n\t\t$configArray = array('api_key'=> $apiKey,'outputtype'=>Wp_WhitePages_Model_Api::API_OUTPUT_TYPE);\n\t\t\n\t\treturn $configArray;\n\t}", "public function getConfig()\r\n {\r\n return $this->_file;\r\n }", "function monitis_addon_config() {\n $configarray = array(\n \"name\" => \"Monitis Addon\",\n \"description\" => \"Integration with Monitis\",\n \"version\" => \"1.0\",\n \"author\" => \"Monitis\",\n \"language\" => \"english\",\n \"fields\" => array(\n \"apikey\" => array (\"FriendlyName\" => \"API Key\", \"Type\" => \"text\", \"Size\" => \"25\", \"Description\" => \"Monitis API Key\", \"Default\" => \"\", ),\n \"secretkey\" => array (\"FriendlyName\" => \"Secret Key\", \"Type\" => \"password\", \"Size\" => \"25\", \"Description\" => \"Monitis Secret Key\", ),\n \"endpoint\" => array (\"FriendlyName\" => \"API Endpoint\", \"Type\" => \"text\", \"Size\" => \"25\", \"Description\" => \"API Endpoint\", \"Default\" => \"https://www.monitis.com/api\", ),\n ));\n return $configarray;\n}", "protected function _getSettingFile()\n {\n $settingFile = Globals::getDataFilePath(self::API_SETTING_FILE);\n \n // If file no exist\n if (!file_exists($settingFile)) {\n $config = new Zend_Config(array(), true);\n $this->_write2Json($config, $settingFile);\n }\n \n return $settingFile;\n }", "public static function getConfig() {\n\t\tif (self::$temp_config !== null) {\n\t\t\treturn self::$temp_config;\n\t\t}\n\n\t\t$config_file = self::getConfigFile();\n\t\treturn (!file_exists($config_file)) ? array() : json_decode(file_get_contents($config_file), true);\n\t}", "function getConfig()\n {\n return $this->_api->doRequest(\"GET\", \"{$this->getBaseApiPath()}/config\");\n }", "public function getConfig()\n {\n return [\n 'payment' => [\n self::CODE => [\n // get setting values using events.xml section/group/field ids for path\n 'apiKey' => $this->helper->getConfig('payment/payio/integration/api_key'),\n 'apiTransactionPath' => $this->helper->getApiTransactionPath(),\n 'apiSettingsPath' => $this->helper->getApiSettingPath(),\n 'gatewayPath' => $this->helper->getGatewayPath(),\n 'checkoutUrl' => $this->helper->getCheckoutUrl(),\n 'paymentSuccessUrl' => $this->helper->getPaymentSuccessUrl(),\n 'currency' => $this->helper->getCurrentCurrencyCode(),\n 'cartTax' => $this->helper->getUKTaxRate(),\n 'shippingMethods' => $this->helper->getActiveShippingMethods()\n ]\n ]\n ];\n }", "protected function _getConfigFile()\n {\n $moduleName = get_class($this);\n $moduleName = strtolower(substr($moduleName, 0, strpos($moduleName, '_')));\n\n if(!in_array($moduleName,\n array_keys(Zend_Controller_Front::getInstance()->getControllerDirectory())))\n {\n $moduleName = \"\";\n }\n\n $loader = null;\n\n foreach(Zend_Loader_Autoloader::getInstance()->getAutoloaders() as $autoloader)\n {\n if(strtolower($autoloader->getNamespace()) == $moduleName)\n {\n $loader = $autoloader;\n break;\n }\n }\n\n $moduleName = get_class($this);\n $path = $loader->getResourceTypes();\n\n $path = $path['configs']['path'];\n if(substr($path, -1) != '/' && substr($path, -1) != '\\\\')\n {\n $path .= '/';\n }\n\n $pathPart = str_replace(\n \"_\", \"/\",\n substr(\n stristr($moduleName, $this->_namespaceMapper),\n (strlen($this->_namespaceMapper) + 1)\n )\n );\n\n $config = array();\n\n foreach(array('ini' => 'Ini', 'yml' => 'Yaml', 'xml' => 'Xml') as $configExt => $parserType)\n {\n if(file_exists($path . $pathPart . '.' . $configExt))\n {\n $parser = 'Zend_Config_' . $parserType;\n $parser = new $parser($path . $pathPart . '.' . $configExt);\n $config = $parser->toArray();\n }\n }\n return $config;\n }", "public function getConfig()\n {\n return $this->_getConfigFile();\n }", "public function getConfig() {\r\n \t\t$url = './iot_config.json'; \r\n\t\t$data = file_get_contents($url); \r\n\t\t$characters = json_decode($data); \r\n\r\n \t\treturn $characters;\r\n \t\t// return 'test';\r\n \t}", "function addNewsConfig($params, &$pObj) {\n\t\t\treturn array_merge_recursive($params['config'], array(\n\t\t 'fileName' => array (\n\t\t 'index' => array (\n\t\t 'rss.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '100'\n\t\t ),\n\t\t ),\n\t\t 'rss091.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '101'\n\t\t ),\n\t\t ),\n\t\t 'rdf.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '102'\n\t\t ),\n\t\t ),\n\t\t 'atom.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '103'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t\t\t'postVarSets' => array (\n\t\t '_DEFAULT' => array (\n\t\t 'archive' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[year]'\n\t\t ),\n\t\t '1' => array (\n\t\t 'GETvar' => 'tx_ttnews[month]',\n\t\t 'valueMap' => array (\n\t\t 'jan' => '01',\n\t\t 'feb' => '02',\n\t\t 'mar' => '03',\n\t\t 'apr' => '04',\n\t\t 'may' => '05',\n\t\t 'jun' => '06',\n\t\t 'jul' => '07',\n\t\t 'aug' => '08',\n\t\t 'sep' => '09',\n\t\t 'oct' => '10',\n\t\t 'nov' => '11',\n\t\t 'dec' => '12'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'browse' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[pointer]',\n\t\t ),\n\t\t ),\n\t\t 'select_category' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[cat]',\n\t\t ),\n\t\t ),\n\t\t 'article' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[tt_news]',\n\t\t 'lookUpTable' => array (\n\t\t 'table' => 'tt_news',\n\t\t 'id_field' => 'uid',\n\t\t 'alias_field' => 'title',\n\t\t 'addWhereClause' => ' AND NOT deleted',\n\t\t 'useUniqueCache' => '1',\n\t\t 'useUniqueCache_conf' => array (\n\t\t 'strtolower' => '1',\n\t\t 'spaceCharacter' => '-'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t '1' => array (\n\t\t 'GETvar' => 'tx_ttnews[swords]'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t )\n\t\t\t));\n\t\t\n\t\t}", "public function getConfig(): array;", "protected function addConfigParameterNode()\n {\n \t$builder = new TreeBuilder();\n \t$node = $builder->root('config');\n \n \t$node\n \t\t->treatTrueLike(array('form' => array(\n \t\t\t'type' => \"ASF\\WebsiteBundle\\Form\\Type\\ConfigType\",\n \t\t\t'name' => 'website_config_type'\n \t\t)))\n \t\t->treatFalseLike(array('form' => array(\n \t\t\t'type' => \"ASF\\WebsiteBundle\\Form\\Type\\ConfigType\",\n \t\t\t'name' => 'website_config_type'\n \t\t)))\n \t\t->addDefaultsIfNotSet()\n \t\t->children()\n \t\t\t->arrayNode('form')\n \t\t\t\t->addDefaultsIfNotSet()\n \t\t\t\t->children()\n \t\t\t\t\t->scalarNode('type')\n \t\t\t\t\t\t->defaultValue('ASF\\WebsiteBundle\\Form\\Type\\ConfigType')\n \t\t\t\t\t->end()\n \t\t\t\t\t->scalarNode('name')\n \t\t\t\t\t\t->defaultValue('website_config_type')\n \t\t\t\t\t->end()\n \t\t\t\t\t->arrayNode('validation_groups')\n \t\t\t\t\t\t->prototype('scalar')->end()\n \t\t\t\t\t\t->defaultValue(array(\"Default\"))\n \t\t\t\t\t->end()\n \t\t\t\t->end()\n \t\t\t->end()\n \t\t->end()\n \t;\n \n \treturn $node;\n }", "private function getConfig() {\n // call the GetConfig API\n $args = array('hostname' => $this->hostname);\n $api = new \\xmlAPI('GetConfig', $this->_default_key, 'xml', $args);\n $api->server_url = $this->_default_server;\n $api->send();\n\n // change hostname if found by custom_name\n $this->hostname = $api->hostname;\n \n // save fields in metadata\n $this->key = $api->api_key ? $api->api_key : $this->_default_key;\n $this->server = $api->api_server ? $api->api_server : $this->_default_server;\n $this->controller_path = $api->controller_path;\n $this->controller = $api->controller;\n $this->error_page = $api->error_page ? $api->error_page : '404';\n $this->mode = $api->mode ? $api->mode : 'test';\n $this->site_path = $api->site_path ? $api->site_path : $this->hostname;\n $this->default_site_path = $api->default_site_path;\n $this->secure_domain = $api->secure_domain;\n \n // set the list of controllers this site can use\n $this->setRights($api->row);\n }", "function loadXMLParamMulti($config)\r\n {\r\n global $jname;\r\n $option = JRequest::getCmd('option');\r\n //Load current Parameter\r\n $value = JRequest::getVar('params');\r\n if (empty($value)) {\r\n $value = array();\r\n } else if (!is_array($value)) {\r\n $value = base64_decode($value);\r\n $value = unserialize($value);\r\n if (!is_array($value)) {\r\n $value = array();\r\n }\r\n }\r\n $task = JRequest::getVar('jfusion_task');\r\n if ($task == 'add') {\r\n \t$newPlugin = JRequest::getVar('jfusionplugin');\r\n\t\t\tif ($newPlugin) {\r\n\t if (!array_key_exists($newPlugin, $value)) {\r\n\t $value[$newPlugin] = array('jfusionplugin' => $newPlugin);\r\n\t } else {\r\n\t $this->assignRef('error', JText::_('NOT_ADDED_TWICE'));\r\n\t }\r\n } else {\r\n\t\t\t\t$this->assignRef('error', JText::_('MUST_SELLECT_PLUGIN'));\r\n }\r\n } else if ($task == 'remove') {\r\n $rmPlugin = JRequest::getVar('jfusion_value');\r\n if (array_key_exists($rmPlugin, $value)) {\r\n unset($value[$rmPlugin]);\r\n } else {\r\n $this->assignRef('error', JText::_('NOT_PLUGIN_REMOVE'));\r\n }\r\n }\r\n\r\n foreach (array_keys($value) as $key) {\r\n if ($this->isJ16) {\r\n $jname = $value[$key]['jfusionplugin'];\r\n\r\n if (isset($this->configArray[$config]) && !empty($jname)) {\r\n $path = JFUSION_PLUGIN_PATH . DS . $jname . DS . $this->configArray[$config][1];\r\n $defaultPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'views' . DS . 'advancedparam' . DS . 'paramfiles' . DS . $this->configArray[$config][1];\r\n $xml_path = (file_exists($path)) ? $path : $defaultPath;\r\n $xml = JFactory::getXMLParser('Simple');\r\n if ($xml->loadFile($xml_path)) {\r\n if ($fields = $xml->document->getElementByPath('fields')) {\r\n $data = $xml->document->fields[0]->toString();\r\n //make sure it is surround by <form>\r\n if (substr($data, 0, 5) != \"<form>\") {\r\n $data = \"<form>\" . $data . \"</form>\";\r\n }\r\n $form = &JForm::getInstance($jname, $data, array('control' => \"params[$jname]\"));\r\n //add JFusion's fields\r\n $form->addFieldPath(JPATH_COMPONENT.DS.'fields');\r\n //bind values\r\n $form->bind($value[$key]);\r\n $value[$key][\"params\"] = $form;\r\n }\r\n $this->loadLanguage($xml);\r\n }\r\n }\r\n } else {\r\n $params = new JParameter('');\r\n $params->loadArray($value[$key]);\r\n $params->addElementPath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jfusion' . DS . 'elements');\r\n $jname = $params->get('jfusionplugin', '');\r\n if (isset($this->configArray[$config]) && !empty($jname)) {\r\n $path = JFUSION_PLUGIN_PATH . DS . $jname . DS . $this->configArray[$config][1];\r\n $defaultPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . $option . DS . 'views' . DS . 'advancedparam' . DS . 'paramfiles' . DS . $this->configArray[$config][1];\r\n $xml_path = (file_exists($path)) ? $path : $defaultPath;\r\n $xml = JFactory::getXMLParser('Simple');\r\n if ($xml->loadFile($xml_path)) {\r\n $params->setXML($xml->document->params[0]);\r\n $this->loadLanguage($xml);\r\n }\r\n }\r\n $value[$key][\"params\"] = $params;\r\n }\r\n }\r\n return $value;\r\n }", "public function getDefaultConfiguration();", "function default_configuration()\r\n {\r\n return array();\r\n }", "function getConfiguration() ;", "private static function defaultConfig(): array\n {\n return [\n 'base_uri' => self::$baseUri,\n 'http_errors' => false,\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n 'User-Agent' => 'evoliz-php/' . Config::VERSION,\n ],\n 'verify' => true,\n ];\n }", "abstract public function getConfigName();", "public static function getJsonConfig()\n {\n return file_get_contents(self::fixtureDir().'/fixture_config.json');\n }", "public function getJsonConfigfile(){\n $json = file_get_contents( $this->config_base_path.$this->jsonFile);\n //Decode JSON\n $array = json_decode($json,true);\n return $array;\n }", "public function getJsonConfigfile(){\n $json = file_get_contents( $this->config_base_path.$this->jsonFile);\n //Decode JSON\n $array = json_decode($json,true);\n return $array;\n }", "function plugin_load_configuration_nexcontent($pi_name)\r\n{\r\n global $_CONF;\r\n\r\n $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/';\r\n\r\n require_once $_CONF['path_system'] . 'classes/config.class.php';\r\n require_once $base_path . 'install_defaults.php';\r\n\r\n return plugin_initconfig_nexcontent();\r\n}", "public function getJsonSettings()\n {\n return Mage::helper('core')->jsonEncode($this->_settings);\n }", "public function get_default_config() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'key' => 'name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'label' => esc_html__( 'Name', 'themeisle-companion' ),\n\t\t\t\t'requirement' => 'required',\n\t\t\t\t'placeholder' => esc_html__( 'Name', 'themeisle-companion' ),\n\t\t\t\t'field_width' => '100',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'email',\n\t\t\t\t'type' => 'email',\n\t\t\t\t'label' => esc_html__( 'Email', 'themeisle-companion' ),\n\t\t\t\t'requirement' => 'required',\n\t\t\t\t'placeholder' => esc_html__( 'Email', 'themeisle-companion' ),\n\t\t\t\t'field_width' => '100',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'phone',\n\t\t\t\t'type' => 'number',\n\t\t\t\t'label' => esc_html__( 'Phone', 'themeisle-companion' ),\n\t\t\t\t'requirement' => 'optional',\n\t\t\t\t'placeholder' => esc_html__( 'Phone', 'themeisle-companion' ),\n\t\t\t\t'field_width' => '100',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'message',\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'label' => esc_html__( 'Message', 'themeisle-companion' ),\n\t\t\t\t'requirement' => 'required',\n\t\t\t\t'placeholder' => esc_html__( 'Message', 'themeisle-companion' ),\n\t\t\t\t'field_width' => '100',\n\t\t\t),\n\t\t);\n\t}", "function acapi_get_option_file() {\n $defaults = acapi_common_options();\n return drush_get_option('ac-config', $defaults['ac-config']['default_value']);\n}", "private function returnConfig(){\n\t\techo '<reply action=\"ok\">';\n\t\techo $this->data->asXML();\n\t\techo '</reply>';\n\t}", "protected function defaults() {\n\t\t\t$config = array(\n\t\t\t\t'version' => $this->version,\n\t\t\t\t'autoshowpt' => array(\n\t\t\t\t\t//'post'=> true\n\t\t\t\t),\n\t\t\t\t'usept' => array(\n\t\t\t\t\t'post' => true\n\t\t\t\t),\n\t\t\t\t'usetax' => array(),\n\t\t\t\t'autoshowrss' => false,\n\t\t\t\t'do_c2c' => 1,\n\t\t\t\t'do_t2t' => 0,\n\t\t\t\t'do_t2c' => 0,\n\t\t\t\t'do_k2c' => 0,\n\t\t\t\t'do_k2t' => 0,\n\t\t\t\t'do_x2x' => 1,\n\t\t\t\t'minscore' => 50,\n\t\t\t\t'maxresults' => 5,\n\t\t\t\t'cachetime' => 60,\n\t\t\t\t'filterpriority' => 10,\n\t\t\t\t'log' => false,\n\t\t\t\t'loglevel' => false,\n\t\t\t\t'storage' => 'postmeta',\n\t\t\t\t'storage_id' => 'better-related-',\n\t\t\t\t'querylimit' => 1000,\n\t\t\t\t't_querylimit' => 10000,\n\t\t\t\t'mtime' => time(),\n\t\t\t\t'relatedtitle' => sprintf(\n\t\t\t\t\t\"<strong>%s</strong>\",\n\t\t\t\t\t__( 'Related content:', 'better-related' )\n\t\t\t\t),\n\t\t\t\t'relatednone' => sprintf(\n\t\t\t\t\t\"<p>%s</p>\",\n\t\t\t\t\t__( 'No related content found.', 'better-related' )\n\t\t\t\t),\n\t\t\t\t'thanks' => 'below',\n\t\t\t\t'stylesheet' => true,\n\t\t\t\t'showdetails' => false\n\t\t\t);\n\t\t\treturn $config;\n\t\t}", "public static function config();", "public function getConfig()\n {\n return parse_ini_file(__DIR__ . \"/../php.ini\", true);\n }", "function getConfig() {\n\t\tif($this->_oConfig === null) {\n\t\t\tif(isset($this->_options['cacheConfig']) && $this->_options['cacheConfig']) {\n\t\t\t\t$this->_oConfig = $this->cacheConfig();\n\t\t\t} else {\n\t\t\t\t$this->_oConfig = $this->parseConfig();\n\t\t\t}\n\t\t}\n\t\treturn $this->_oConfig;\n\t}", "private function getExtensionSystemXml() \n\t{\n\n\t\t// path to the extensions config.xml\n\t\t$extension_system_xml_path = parent::$extension_base_dir . '/etc/system.xml';\n\n\t\tif (!file_exists($extension_system_xml_path)) {\n\t\t\t$this->displayError('Cant find path to extension system xml.');\n\t\t}\n\n\t\t$extension_system_xml = simplexml_load_file($extension_system_xml_path);\n\n\t\tparent::$extension_system_xml = $extension_system_xml;\n\n\t}", "public function get_default_list_config()\n {\n return '[[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_id\",false,\"LC__CMDB__OBJTYPE__ID\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_id\"]],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_title\",false,\"LC__UNIVERSAL__TITLE_LINK\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_title\"]],' . '[' . C__PROPERTY_TYPE__STATIC . ',\"its_type\",\"isys_its_type__title\",\"LC__CMDB__CATG__TYPE\",\"isys_cmdb_dao_category_g_its_type::get_properties\",false],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_created\",false,\"LC__TASK__DETAIL__WORKORDER__CREATION_DATE\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_created\"]],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_changed\",false,\"LC__CMDB__LAST_CHANGE\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_changed\"]],' . '[' . C__PROPERTY_TYPE__STATIC . ',\"purpose\",\"isys_purpose__title\",\"LC__CMDB__CATG__GLOBAL_PURPOSE\",\"isys_cmdb_dao_category_g_global::get_properties\",false],' . '[' . C__PROPERTY_TYPE__STATIC . ',\"category\",\"isys_catg_global_category__title\",\"LC__CMDB__CATG__GLOBAL_CATEGORY\",\"isys_cmdb_dao_category_g_global::get_properties\",false],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_cmdb_status\",false,\"LC__UNIVERSAL__CMDB_STATUS\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_cmdb_status\"]]]';\n }", "public static function getGeneralConfig(){\n\t\tif(CoreConfig::$config == null){\n\t\t\tCoreConfig::getConfig();\n\t\t\tCoreConfig::$config['Core']['url'] = CoreConfig::getUrl();\n\t\t\tCoreConfig::$config['Core']['localUrl'] = CoreConfig::getLocalUrl();\n\t\t}\n\t\tif(!empty(CoreConfig::$config['Core'])) {\n\n\t\t\treturn CoreConfig::$config['Core'];\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}", "abstract protected function getConfigPath();", "public function getConfig()\r\n {\r\n return Zend_Registry::get('config');\r\n }", "public function getConfig()\r\n {\r\n $configFile = GeneralUtility::getFileAbsFileName(\"EXT:centauri_core/Configuration/core.php\");\r\n return (include $configFile);\r\n }", "private function getExtensionConfiguration($key)\n {\n static $configuration;\n if (!$configuration) {\n if (isset($GLOBALS['TYPO3_CONF_VARS'])\n && isset($GLOBALS['TYPO3_CONF_VARS']['EXT'])\n && isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'])\n && isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['rest'])\n ) {\n $configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['rest']);\n }\n }\n\n return isset($configuration[$key]) ? $configuration[$key] : null;\n }", "public function prepare_json() { \n return json_encode($this->get_settings()); \n }", "function getRailpageConfig() {\n return json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . \"config.railpage.json\"));\n }", "private static function getConfig(){\n return parse_ini_file(__DIR__ . \"/../config/config.ini\");\n }", "private static function getConfig(){\n return parse_ini_file(__DIR__ . \"/../config/config.ini\");\n }", "public function getConfigDefaults()\n {\n // $file = realpath(__DIR__ . '/../../data/distribution/config.dist.php');\n $file = __DIR__ . '/../../data/distribution/config.dist.php';\n\n return $this->getConfigFromFile($file);\n }", "public function getDefaultConfiguration() {}", "public function getMFConfig() {\n\t\treturn MediaWikiServices::getInstance()->getService( 'Minerva.Config' );\n\t}" ]
[ "0.6670564", "0.6449308", "0.621892", "0.6124415", "0.6037059", "0.5984011", "0.5984011", "0.5984011", "0.5984011", "0.5984011", "0.5984011", "0.5984011", "0.5984011", "0.5974457", "0.59510475", "0.5871761", "0.5832706", "0.5805999", "0.578876", "0.5780655", "0.56892586", "0.567921", "0.56474555", "0.56359124", "0.5580602", "0.5568356", "0.55142087", "0.54771185", "0.54704714", "0.5468801", "0.5465507", "0.5454105", "0.54434246", "0.5443195", "0.5431348", "0.53957814", "0.5395731", "0.5379492", "0.5366877", "0.5366823", "0.5353955", "0.53498316", "0.5345221", "0.53341454", "0.5332145", "0.5327037", "0.5325671", "0.5273603", "0.5271639", "0.52662665", "0.5256617", "0.5253833", "0.5250234", "0.5249175", "0.5248851", "0.52479655", "0.52458215", "0.52439046", "0.5237133", "0.52340573", "0.52332884", "0.5226436", "0.5224918", "0.5216483", "0.52119887", "0.52097577", "0.52071", "0.5204945", "0.5202792", "0.52001244", "0.5184833", "0.5180171", "0.5178727", "0.5173662", "0.516541", "0.5151643", "0.51475227", "0.51475227", "0.51434773", "0.51346105", "0.51331496", "0.51322186", "0.51050097", "0.51046515", "0.5103285", "0.51026374", "0.5100757", "0.5096106", "0.5089487", "0.5080273", "0.50753224", "0.50706625", "0.5070475", "0.5068379", "0.5054401", "0.50543016", "0.505256", "0.505256", "0.5051217", "0.5049646", "0.5047582" ]
0.0
-1
Method to load the sample data into the database.
private function loadSamples($parent) { try { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select($db->quoteName('id'))->from($db->quoteName('#__clm_turniere_grand_prix')); $db->setQuery($query); $db->execute(); if ($db->getNumRows() == 0) { $element = new SimpleXMLElement('<sql><file driver="mysql" charset="utf8">sql/samples.sql</file></sql>'); if ($parent->getParent()->parseSQLFiles($element) > 0) { $this->enqueueMessage(JText::_('COM_CLM_TURNIER_INSTALL_SAMPLES'), 'notice'); } } } catch (Exception $e) { $this->enqueueMessage($e->getMessage(), 'warning'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function importDatabaseData() {}", "public function loadFromDB()\n {\n }", "abstract public function loadData();", "public function loadSampleData()\n\t{\n\t\tJRequest::checkToken('request') or $this->sendResponse(new JException(JText::_('JINVALID_TOKEN'), 403));\n\n\t\t// Get the posted config options.\n\t\t$vars = JRequest::getVar('jform', array());\n\n\t\t// Get the setup model.\n\t\t$model = $this->getModel('Setup', 'JInstallationModel', array('dbo' => null));\n\n\t\t// Get the options from the session.\n\t\t$vars = $model->storeOptions($vars);\n\n\t\t// Get the database model.\n\t\t$database = $this->getModel('Database', 'JInstallationModel', array('dbo' => null));\n\n\t\t// Attempt to load the database sample data.\n\t\t$return = $database->installSampleData($vars);\n\n\t\t// If an error was encountered return an error.\n\t\tif (!$return) {\n\t\t\t$this->sendResponse(new JException($database->getError(), 500));\n\t\t} else {\n\t\t\t// Mark sample content as installed\n\t\t\t$data = array(\n\t\t\t\t'sample_installed' => '1'\n\t\t\t);\n\t\t\t$dummy = $model->storeOptions($data);\n\t\t}\n\n\t\t// Create a response body.\n\t\t$r = new JObject();\n\t\t$r->text = JText::_('INSTL_SITE_SAMPLE_LOADED');\n\n\t\t// Send the response.\n\t\t$this->sendResponse($r);\n\t}", "private function load()\r\n {\r\n $this->dbFields = MySQL::fetchRecord(MySQL::executeQuery('SELECT * FROM training_slideshow WHERE ts_id='.(int)$this->id),MySQL::fmAssoc);\r\n }", "protected function load()\n\t{\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "public function testLoad()\n {\n $fixture = new Mad_Test_Fixture_Base($this->_conn, 'unit_tests');\n $this->assertEquals('0', $this->_countRecords());\n\n $fixture->load();\n $this->assertEquals('6', $this->_countRecords());\n }", "private function _load_db()\n {\n $json_string = file_get_contents(\"dbtv.json\");\n $this->_db = json_decode($json_string, true);\n $this->_ep_list = $this->_flatten_episodes();\n }", "public function load()\n {\n $pdo = $this->getDbConnection();\n $query = \"SELECT * FROM {$this->dbTable}\";\n $data = $pdo->query($query)->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach ($data as ['key' => $key, 'value' => $value]) {\n $this->setData($key, $value);\n }\n }", "public function load()\n\t{\n\t\t$this->list_table->load();\n\t}", "public function doLoad()\n {\n $this->DataSourceInstance->doLoad();\n }", "private function _load_db()\n {\n $json_string = file_get_contents(\"dbmov.json\");\n $this->_db = json_decode($json_string, true);\n }", "function loadSampleData()\n{\n $moduleDirName = basename(dirname(__DIR__));\n $helper = Cellar\\Helper::getInstance();\n $utility = new Cellar\\Utility();\n $configurator = new Common\\Configurator();\n // Load language files\n $helper->loadLanguage('admin');\n $helper->loadLanguage('modinfo');\n $helper->loadLanguage('common');\n if (!$wineData = \\Xmf\\Yaml::readWrapped('wine.yml')) {\n throw new \\UnexpectedValueException('Could not read the win.yml file');\n }\n \\Xmf\\Database\\TableLoad::truncateTable($moduleDirName . '_wine');\n \\Xmf\\Database\\TableLoad::loadTableFromArray($moduleDirName . '_wine', (array)$wineData);\n\n // --- COPY test folder files ---------------\n if (count($configurator->copyTestFolders) > 0) {\n // $file = __DIR__ . ' /../testdata / images / ';\n foreach (array_keys($configurator->copyTestFolders) as $i) {\n $src = $configurator->copyTestFolders[$i][0];\n $dest = $configurator->copyTestFolders[$i][1];\n $utility::xcopy($src, $dest);\n }\n }\n redirect_header(' ../admin / index . php', 1, AM_CELLAR_SAMPLEDATA_SUCCESS);\n}", "public function loadDatabase(){\n $table = new Table('Textarea_Widgets');\n $table->add_column('Title', 'text');\n $table->add_column('Content', 'text');\n $table->add_column('WidgetName', 'text');\n $table->create();\n }", "public function seed()\n\t{\n\t\t$this->createDataType();\n\t\t$this->createDataRowForColumns();\n\t}", "public function load()\n {\n $this\n ->objectManager\n ->createQuery('DELETE FROM ' . Member::class)\n ->execute()\n ;\n Fixtures::load(\n __DIR__ . '/../../fixtures/members.yml',\n $this->objectManager\n );\n }", "public function load() {\r\n\t\t$this->includes();\r\n\t\t$this->inits();\r\n\t}", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "private function _loadDataToTemporaryTable(){\n\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "abstract function loadDbData($compid);", "protected function importData()\n\t{\n\t\tinclude_once \"./Services/ADN/ED/classes/class.adnSubobjective.php\";\n\t\t$subobjectives = adnSubobjective::getAllSubobjectives($this->objective_id);\n\n\t\t$this->setData($subobjectives);\n\t\t$this->setMaxCount(sizeof($subobjectives));\n\t}", "protected function loadData()\n {\n\n $this->jsonUrl = 'https://api.srgssr.ch/audiometadata/v2/livestreams';\n parent::loadData();\n\n }", "private function loadData(): void\n {\n $modules = BackendExtensionsModel::getModules();\n\n // split the modules in 2 separate data grid sources\n foreach ($modules as $module) {\n if ($module['installed']) {\n $this->installedModules[] = $module;\n } else {\n $this->installableModules[] = $module;\n }\n }\n }", "public function initDatabaseStructure( );", "public function testLoad()\r\n\t{\r\n\t\t// Load table\r\n\t\t$table = Table::model()->findByPk(array(\r\n\t\t\t'TABLE_SCHEMA' => 'indextest',\r\n\t\t\t'TABLE_NAME' => 'table1',\r\n\t\t));\r\n\r\n\t\t// Check index count\r\n\t\t$this->assertEquals(4, count($table->indices));\r\n\r\n\t\t// Check index 1\r\n\t\t$index = $table->indices[0];\r\n\t\t$this->assertEquals($table->TABLE_NAME, $index->table->TABLE_NAME);\r\n\t\t$this->assertEquals('PRIMARY', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('PRIMARY', $index->getType());\r\n\r\n\t\t// Check index 2\r\n\t\t$index = $table->indices[1];\r\n\t\t$this->assertEquals('unique', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('UNIQUE', $index->getType());\r\n\r\n\t\t// Check index 2\r\n\t\t$index = $table->indices[2];\r\n\t\t$this->assertEquals('index', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('INDEX', $index->getType());\r\n\r\n\t\t// Check index 2\r\n\t\t$index = $table->indices[3];\r\n\t\t$this->assertEquals('fulltext', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('FULLTEXT', $index->getType());\r\n\t}", "protected function initDatabaseRecord() {}", "function loadFromDb()\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy WHERE obj_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getId())\n\t\t);\n\t\tif ($result->numRows() == 1) \n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t$this->setSurveyId($data[\"survey_id\"]);\n\t\t\t$this->setAuthor($data[\"author\"]);\n\t\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t\t$this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc($data[\"introduction\"], 1));\n\t\t\tif (strcmp($data[\"outro\"], \"survey_finished\") == 0)\n\t\t\t{\n\t\t\t\t$this->setOutro($this->lng->txt(\"survey_finished\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->setOutro(ilRTE::_replaceMediaObjectImageSrc($data[\"outro\"], 1));\n\t\t\t}\n\t\t\t$this->setInvitation($data[\"invitation\"]);\n\t\t\t$this->setInvitationMode($data[\"invitation_mode\"]);\n\t\t\t$this->setShowQuestionTitles($data[\"show_question_titles\"]);\n\t\t\t$this->setStartDate($data[\"startdate\"]);\n\t\t\t$this->setEndDate($data[\"enddate\"]);\n\t\t\t$this->setAnonymize($data[\"anonymize\"]);\n\t\t\t$this->setEvaluationAccess($data[\"evaluation_access\"]);\n\t\t\t$this->loadQuestionsFromDb();\n\t\t\t$this->setStatus($data[\"status\"]);\n\t\t\t$this->setMailNotification($data['mailnotification']);\n\t\t\t$this->setMailAddresses($data['mailaddresses']);\n\t\t\t$this->setMailParticipantData($data['mailparticipantdata']);\n\t\t\t$this->setTemplate($data['template_id']);\n\t\t\t$this->setPoolUsage($data['pool_usage']);\n\t\t\t// 360°\n\t\t\t$this->set360Mode($data['mode_360']);\n\t\t\t$this->set360SelfEvaluation($data['mode_360_self_eval']);\n\t\t\t$this->set360SelfRaters($data['mode_360_self_rate']);\n\t\t\t$this->set360SelfAppraisee($data['mode_360_self_appr']);\n\t\t\t$this->set360Results($data['mode_360_results']);\n\t\t\t$this->set360SkillService($data['mode_360_skill_service']);\n\t\t\t// reminder/notification\n\t\t\t$this->setReminderStatus($data[\"reminder_status\"]);\n\t\t\t$this->setReminderStart($data[\"reminder_start\"] ? new ilDate($data[\"reminder_start\"], IL_CAL_DATE) : null);\n\t\t\t$this->setReminderEnd($data[\"reminder_end\"] ? new ilDate($data[\"reminder_end\"], IL_CAL_DATE) : null);\n\t\t\t$this->setReminderFrequency($data[\"reminder_frequency\"]);\n\t\t\t$this->setReminderTarget($data[\"reminder_target\"]);\n\t\t\t$this->setReminderLastSent($data[\"reminder_last_sent\"]);\n\t\t\t$this->setTutorNotificationStatus($data[\"tutor_ntf_status\"]);\n\t\t\t$this->setTutorNotificationRecipients(explode(\";\", $data[\"tutor_ntf_reci\"]));\n\t\t\t$this->setTutorNotificationTarget($data[\"tutor_ntf_target\"]);\n\t\t\t\n\t\t\t$this->setViewOwnResults($data[\"own_results_view\"]);\n\t\t\t$this->setMailOwnResults($data[\"own_results_mail\"]);\n\t\t}\n\t\t\n\t\t// moved activation to ilObjectActivation\n\t\tif($this->ref_id)\n\t\t{\n\t\t\tinclude_once \"./Services/Object/classes/class.ilObjectActivation.php\";\n\t\t\t$activation = ilObjectActivation::getItem($this->ref_id);\t\t\t\n\t\t\tswitch($activation[\"timing_type\"])\n\t\t\t{\t\t\t\t\n\t\t\t\tcase ilObjectActivation::TIMINGS_ACTIVATION:\t\n\t\t\t\t\t$this->setActivationLimited(true);\n\t\t\t\t\t$this->setActivationStartDate($activation[\"timing_start\"]);\n\t\t\t\t\t$this->setActivationEndDate($activation[\"timing_end\"]);\n\t\t\t\t\t$this->setActivationVisibility($activation[\"visible\"]);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\t\t\t\n\t\t\t\t\t$this->setActivationLimited(false);\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "private function initDatabase() {\n \n \n \n }", "public function _load()\n {\n $query = new Query(\n \"SELECT *\n FROM `\" . Leder::TABLE . \"`\n WHERE `arrangement_fra` = '#fra'\n AND `arrangement_til` = '#til'\",\n [\n 'fra' => $this->getArrangementFraId(),\n 'til' => $this->getArrangementTilId()\n ]\n );\n\n $res = $query->getResults();\n while( $row = Query::fetch($res) ) {\n $this->add(\n Leder::loadFromDatabaseRow( $row )\n );\n }\n }", "public function setUp() {\n\t\t$this->getConnection();\n\t\tforeach($this->fixtureData() as $row) {\n\t\t\t$record = new ExampleSolrActiveRecord();\n\t\t\tforeach($row as $attribute => $value) {\n\t\t\t\t$record->{$attribute} = $value;\n\t\t\t}\n\t\t\t$this->assertTrue($record->save());\n\t\t}\n\t}", "public function load() { }", "protected function _loadFixture($fixture)\n {\n $this->db->query(file_get_contents(\n NL_TEST_DIR.\"/tests/migration/fixtures/$fixture.sql\"\n ));\n }", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }", "private function load() {\n\n $db = Database::getInstance(); \n\t $con = $db->getConnection();\n \n $query = \"SELECT * FROM Products ORDER by ID DESC\";\n \n if ($result = $con->query($query)) {\n \t/* fetch object array */\n \t while ($prod = $result->fetch_object(\"Product\")) {\n\t\t\t \tarray_push($this->products, $prod);\n \t}\n \t/* free result set */\n \t$result->close();\n }\n\t}", "public function load()\n {\n $input = $this->getCleanInput();\n $this->populate($input);\n }", "private function populateDummyTable() {}", "function loadData()\n\t{\n\t\tstatic $data;\n\t\t\n\t\tif(!$data)\n\t\t\t$data=self::getData();\n\n\t\tif(isset($data[$this->id]))\n\t\t\t$this->setValues((array)$data[$this->id]);\t\t\t\n\t}", "function loadFileFromDB() {\n\t\t// If file contents are in bin_data column, fetch data and store in file.\n\t\tif (isset($this->data_array[\"bin_data\"]) && \n\t\t\ttrim($this->data_array[\"bin_data\"]) != \"\") {\n\n\t\t\t// Need to decode the string first.\n\t\t\t$theFileContent = base64_decode($this->data_array[\"bin_data\"]);\n\n\t\t\t$theDir = dirname($this->getFile());\n\t\t\tif (!file_exists($theDir)) {\n\t\t\t\t// Its parent directory does not exist yet. Create it.\n\t\t\t\tmkdir($theDir);\n\t\t\t}\n\n\t\t\t// Create the file for future use.\n\t\t\t$fp = fopen($this->getFile(), \"w+\");\n\t\t\tfwrite($fp, $theFileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "protected function load(){\r\n\t\r\n\t$qq1 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->tableName.\" WHERE \".$this->fieldName.\" = \".(int)$this->id);\r\n\t$this->profileData = count($qq1)>0 ? $qq1[0]: null; \r\n\t\r\n\tif($this->metaUse){\r\n\t\t$qq2 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaTypesTableName.\" WHERE active = 1 ORDER BY public_ord, id\");\r\n\t\t$this->metaData = count($qq2)>0 ? $qq2: array(); \r\n\t}\r\n}", "private function createMainDatabaseRecords()\n {\n // get the .sql file\n $sql = (string) @file_get_contents( $this->plugin->getPath() . \"/Setup/install.sql\" );\n\n // insert it\n $this->db->exec( $sql );\n }", "public function load()\n {\n $data = $this->storage->load();\n $this->collection->load($data);\n\n $this->refresh();\n }", "public function load($data);", "protected function loadData(){\n\t\t//SELECT from \".self::TABLE_NAME.\"_data WHERE \".self::TABLE_NAME.\"_id=\".$this->id.\"\n\t\t\n\t\t//return the data\n\t\treturn array();\n\t}", "abstract public function loadAll();", "public function testSampleData()\n {\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n $types = [\n 'boolean' => 'false',\n 'integer' => self::INT_NUMBER,\n 'double' => self::INT_NUMBER,\n 'int' => self::INT_NUMBER,\n 'tinyint' => self::TINY_INT_NUMBER,\n 'string' => \"'behat-test-string-\" . self::TYPE_STRING_TIME . \"'\",\n 'text' => \"'behat-test-string-\" . self::TYPE_STRING_TIME . \"'\",\n 'varchar' => \"'behat-test-string-\" . self::TYPE_STRING_TIME . \"'\",\n 'character varying' => \"'behat-test-string-\" . self::TYPE_STRING_TIME . \"'\",\n 'tinytext' => \"'behat-test-string-\" . self::TYPE_STRING_TIME . \"'\",\n 'char' => \"'f'\",\n 'timestamp' => 'NOW()',\n 'timestamp with time zone' => 'NOW()',\n 'null' => null,\n 'longtext' => \"'behat-test-string-\" . self::TYPE_STRING_TIME . \"'\",\n 'randomness' => \"'behat-test-string-\" . self::TYPE_STRING_TIME . \"'\"\n ];\n\n // Assert\n foreach ($types as $type => $val) {\n // Execute\n $result = $this->testObject->sampleData($type);\n\n $this->assertEquals($val, $result);\n }\n }", "function loadQuestionsFromDb() \n\t{\n\t\tglobal $ilDB;\n\t\t$this->questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s ORDER BY sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t{\n\t\t\t$this->questions[$data[\"sequence\"]] = $data[\"question_fi\"];\n\t\t}\n\t}", "public function load()\n {\n return $this->loadData();\n }", "protected function loadData()\n\t{\n\t\t$delimiter = \"|||---|||---|||\";\n\t\t$command = 'show --pretty=format:\"%an'.$delimiter.'%ae'.$delimiter.'%cd'.$delimiter.'%s'.$delimiter.'%B'.$delimiter.'%N\" ' . $this->hash;\n\n\t\t$response = $this->repository->run($command);\n\n\t\t$parts = explode($delimiter,$response);\n\t\t$this->_authorName = array_shift($parts);\n\t\t$this->_authorEmail = array_shift($parts);\n\t\t$this->_time = array_shift($parts);\n\t\t$this->_subject = array_shift($parts);\n\t\t$this->_message = array_shift($parts);\n\t\t$this->_notes = array_shift($parts);\n\t}", "private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}", "public function load($data_folder)\n {\n $this->_provider->load($data_folder);\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }", "public function load(): void;", "public function load(): void;", "protected function _prepareDataSource()\n {\n $studentDbTable = new Admin_Db_Table_Student();\n $this->setDataSource($studentDbTable->getByClasses(array($this->_options->classesId)));\n }", "protected function loadFromFile() {\n $columns = [];\n\n while ( ! $this->file->eof()) {\n $row = (array)$this->file->fgetcsv();\n\n if (empty($columns)) {\n $columns = $row;\n continue;\n }\n\n $row = array_filter($row);\n\n if (empty($row)) {\n continue;\n }\n\n $attributes = array_fill_keys($columns, null);\n\n foreach ($row as $index => $value) {\n $attributes[$columns[$index]] = $value;\n }\n\n $model = $this->model->newInstance($attributes, true);\n\n $this->records[$model->id] = $model;\n }\n }", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "protected function loadRow() {}", "public function loadData(){\r\n $this->host = Team::find($this->host);\r\n $this->guest = Team::find($this->guest);\r\n $this->winner = Team::find($this->winner);\r\n $this->tournament = Tournament::find($this->tournamentID); \r\n }", "private function loadBasicData()\n\t{\n\t\t$this->filename = basename($this->filepath);\n\t\t$this->title = $this->filename;\n\t\t$this->description = $this->filename;\n\t\t$this->mimetype = mime_content_type($this->filepath);\n\t\t$this->dateGathered = date('Y-m-d').'T'.date('h:i:s');\n\t\t$this->filesize = filesize($this->filepath);\n\n\t\t$this->data['path'] = $this->filepath;\n\t\t$this->data['name'] = basename($this->data['path']);\n\n\t\t$this->data['sizeExact'] = filesize($this->data['path']);\n\t\t$this->data['size'] = Utilities::filesizeInterpreter($this->data['sizeExact']);\n\n\t\t$this->data['accessDateExact'] = fileatime($this->data['path']);\n\t\t$this->data['accessDate'] = date(\"F d Y H:i:s.\", $this->data['accessDateExact']);\n\n\t\t$this->data['modifyDateExact'] = filemtime($this->data['path']);\n\t\t$this->data['modifyDate'] = date(\"F d Y H:i:s.\", $this->data['modifyDateExact']);\n\n\t\t$this->data['mimetype'] = mime_content_type($this->data['path']);\n\t\t$this->data['mimetypeType'] = explode(\"/\", $this->data['mimetype'])[0];\n\n\n\t}", "public function loadDataFromId(){\r\n\t\t\t$this -> loadFromId();\r\n\t }", "protected function reloadDataFixtures()\n {\n $em = $this->getEntityManager();\n $loader = new Loader;\n foreach ($this->dataFixturePaths as $path) {\n $loader->loadFromDirectory($path);\n }\n $purger = new ORMPurger($em);\n $executor = new ORMExecutor($em, $purger);\n $executor->execute($loader->getFixtures());\n $this->fixturesReloaded = true;\n }", "abstract protected function load(Connection $db);", "public function setUp()\n {\n $this->reloadSchema();\n $this->reloadDataFixtures();\n }", "function _load()\n\t{\n\t\tif($this->primary_key)\n\t\t{\n\t\t\t$row = $this->db->get_where($this->table_name, array(\n\t\t\t\t$this->primary_key => $this->{$this->primary_key},\n\t\t\t))->result();\n\t\t\t\n\t\t\tif(count($row))\n\t\t\t\t$this->load_db_values($row[0]);\n\t\t}\n\t}", "function load() {\n $statement = $this->db->prepare('SELECT * FROM favs WHERE id = :id');\n $statement->execute(array(':id' => $this->get('id')));\n $data = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setMultiple($data);\n }", "public function init()\n {\n $this->setSource('blobs');\n $this->setDbRef(true);\n }", "private function loadReadDataIntoMDR() {\r\n \r\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function run()\n {\n $data = \\App\\Http\\Controllers\\Utility\\CsvController::importToArray('data/property-data.csv'); // data array from csv file\n \\App\\House::insert($data);\n }", "protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }", "public function run()\n {\n Skill::query()->insert($this->demoData());\n }", "public static function required_sample_data() {\n return null;\n }", "protected function load_csv_data() {\n $dataset = $this->createCsvDataSet(array(\n usermoodle::TABLE => elispm::file('tests/fixtures/user_moodle.csv')\n ));\n $this->loadDataSet($dataset);\n }", "public abstract function load();", "public function readDatabase() {\n\t\t$q = $this->pdo->query(\"SELECT count(*) FROM `Articles`\");\n\t\t$count = $q->fetch(PDO::FETCH_ASSOC)[\"count(*)\"];\n\t\t$numFetched = 0;\n\t\t$start = 0;\n\t\t// Fetch only 50 articles at a time to limit the memory impact\n\t\twhile($numFetched < $count){\n\t\t\t$q = $this->pdo->query(\"SELECT \".$this->columns.\" FROM `Articles` LIMIT $start,100\");\n\t\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t\t$this->articles[] = $this->makeArticleFromDB($a);\n\t\t\t\t$numFetched += 1;\n\t\t\t}\n\t\t\t$start += 100;\n\t\t}\n\t}", "abstract public function load();", "abstract public function load();", "public function LoadRecords()\n {\n \t$this->SetCulture();\n \t$this->subscriptions_records = $this->GetSubscriptionsRecords();\n }", "function InitLibraryData()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::InitLibraryData();\" . \"<HR>\";\n if ($this->listSettings->HasItem(\"MAIN\", \"DB_USE_ABSTRACTTABLE\"))\n $this->use_abstracttable = $this->listSettings->GetItem(\"MAIN\", \"DB_USE_ABSTRACTTABLE\");\n\n $use_db_columns = false;\n //--check if defined flag use database columns definition\n if ($this->listSettings->HasItem(\"MAIN\", \"DB_USE_COLUMNDEFINITION\"))\n $use_db_columns = $this->listSettings->GetItem(\"MAIN\", \"DB_USE_COLUMNDEFINITION\");\n\n if (! $this->use_abstracttable) { //--if dont use abstracttable class (use storage class)\n $this->Kernel->ImportClass(\"data.\" . strtolower($this->Table), $this->Table);\n if (! class_exists($this->Table)) { //check if class-table exists\n user_error(\"Can't find table class <b>$this->Table</b> for library $this->library_ID\", E_USER_ERROR);\n die();\n }\n else {\n $this->Storage = new $this->Table($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"database\", $this->Table), $use_db_columns);\n }\n }\n else { //--else (use abstracttable class)\n $this->Storage = new AbstractTable($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"database\", $this->Table), true);\n }\n\n //--check if defined flag use database columns definition\n if ($this->listSettings->HasItem(\"MAIN\", \"DB_USE_COLUMNDEFINITION\"))\n $use_db_columns = $this->listSettings->GetItem(\"MAIN\", \"DB_USE_COLUMNDEFINITION\");\n if ($use_db_columns)\n TableHelper::prepareColumnsDB($this->Storage, true, false);\n\n if ($this->listSettings->HasItem(\"LIST\", \"FIELDS_COUNT\")) {\n $fields_count = $this->listSettings->GetItem(\"LIST\", \"FIELDS_COUNT\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_RECORDCOUNT_SETTINGS\", array(), true);\n }\n $this->ProcessMainSection();\n\n for ($i = 0; $i < $fields_count; $i ++) {\n \tif ($this->CheckFieldPackage($i))\n \t$this->GetFieldSettings($i);\n } // for\n\n\n }", "abstract protected function initDB();" ]
[ "0.67357564", "0.6647245", "0.65206015", "0.64395577", "0.63348806", "0.6322491", "0.6247782", "0.62475324", "0.6203178", "0.59996563", "0.59902376", "0.59504414", "0.59341663", "0.58865255", "0.5826445", "0.58241576", "0.5820393", "0.5814762", "0.5794247", "0.5747002", "0.57467276", "0.57460886", "0.57460886", "0.57460886", "0.5709108", "0.5688202", "0.5670482", "0.56668884", "0.5649313", "0.5641699", "0.5638574", "0.5624718", "0.5611536", "0.5605429", "0.5601127", "0.55969334", "0.55969006", "0.55847156", "0.55750275", "0.55646104", "0.55539995", "0.5538814", "0.5536857", "0.55362725", "0.5524152", "0.55241126", "0.54990405", "0.54982597", "0.5493455", "0.54916334", "0.5484912", "0.5455895", "0.5453959", "0.5450911", "0.5440204", "0.5435183", "0.5435183", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5427609", "0.5426025", "0.54187727", "0.54187727", "0.5417633", "0.5417516", "0.5401801", "0.53995925", "0.53979445", "0.5393163", "0.5389337", "0.538726", "0.5387103", "0.5376072", "0.53665733", "0.5365879", "0.53407854", "0.5338134", "0.53337723", "0.533301", "0.53265417", "0.5325698", "0.53110284", "0.5309157", "0.52969235", "0.52903277", "0.5287389", "0.5287389", "0.52834505", "0.5283012", "0.5276757" ]
0.5860523
14
Method to generate the changelog data.
private function getChangelog($parent) { $file = $parent->getParent()->getPath('extension_administrator') . '/changelog.txt'; if (! file_exists($file)) { return ''; } $changelog = file_get_contents($file); $changelog = preg_replace("#\r#s", '', $changelog); $parts = explode("\n\n", $changelog); if (empty($parts)) { return ''; } $version = ''; $changelog = array (); foreach ($parts as $part) { $part = trim($part); // changeloh eintrag ?! if (! preg_match('#.*(\d+\.\d+\.\d+ - \[.*\]).*#i', $part)) { continue; } // changelog version ermitteln if (preg_match('#.*(\d+\.\d+\.\d+) - \[.*\].*#i', $part, $version)) { $version = $version[1]; } if (version_compare($version, $this->fromVersion, '<=')) { break; } $part = preg_replace('#.*(\d+\.\d+\.\d+ - \[.*\]).*#', '<b>$1</b><pre style="line-height: 1.6em;">', $part); $changelog[] = $part . '</pre>'; } $changelog = implode("\n\n", $changelog); // Change Type: @see changelog.txt $change_types = [ '+' => [ 'Addition', 'success' ], '-' => [ 'Removed', 'danger' ], '^' => [ 'Change', 'warning' ], '*' => [ 'Security Fix', 'info' ], '#' => [ 'Bug Fix', 'info' ], '!' => [ 'Note', 'info' ], '$' => [ 'Language fix or change', 'info' ] ]; foreach ($change_types as $char => $type) { $changelog = preg_replace('#\n' . preg_quote($char, '#') . ' #', "\n" . '<span class="label label-sm label-' . $type[1] . '" title="' . $type[0] . '">' . $char . '</span> ', $changelog); } $changelog = preg_replace('#\n #', "\n ", $changelog); $title = JText::sprintf('COM_CLM_TURNIER_CHANGELOG', $this->fromVersion); return '<div style="max-height: 240px; padding-right: 20px; margin-right: -20px; overflow: auto;">' . '<p><b>' . $title . '</b></p>' . $changelog . '</div>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createChangeLog() {}", "function changelog()\n\t{\n\t\t?>\n\t\t<pre>\n\t\t\t<?php\n\t\t\treadfile( JPATH_SITE.'/CHANGELOG.php' );\n\t\t\t?>\n\t\t</pre>\n\t\t<?php\n\t}", "public function get_change_log()\n\t{\n\t\treturn '';\n\t}", "public function getChangeLogDescription()\r\n {\r\n $hide = array(\r\n \"revision\",\r\n \"uname\",\r\n \"num_comments\",\r\n \"num_attachments\",\r\n );\r\n $buf = \"\";\r\n foreach ($this->changelog as $fname=>$log)\r\n {\r\n $oldVal = $log['oldval'];\r\n $newVal = $log['newval'];\r\n\r\n $field = $this->def->getField($fname);\r\n\r\n // Skip multi key arrays\r\n if ($field->type == \"object_multi\" || $field->type == \"fkey_multi\")\r\n continue;\r\n\r\n if ($field->type == \"bool\")\r\n {\r\n if ($oldVal == 't') $oldVal = \"Yes\";\r\n if ($oldVal == 'f') $oldVal = \"No\";\r\n if ($newVal == 't') $newVal = \"Yes\";\r\n if ($newVal == 'f') $newVal = \"No\";\r\n }\r\n\r\n if (!in_array($field->name, $hide))\r\n {\r\n $buf .= $field->title . \" was changed \";\r\n if ($oldVal)\r\n $buf .=\"from \\\"\" . $oldVal . \"\\\" \";\r\n $buf .= \"to \\\"\" . $newVal . \"\\\" \\n\";\r\n }\r\n }\r\n\r\n if (!$buf)\r\n $buf = \"No changes were made\";\r\n\r\n return $buf;\r\n }", "public function change()\n {\n $this->table('change_history')\n ->setComment('数据修改记录')\n ->setEngine('InnoDB')\n ->addColumn('model_type','string', ['comment' => '数据模型类名'])\n ->addColumn('model_id', 'integer', ['comment' => '数据ID'])\n ->addColumn('before', 'text', ['comment' => '修改前内容'])\n ->addColumn('after', 'text', ['comment' => '修改后内容'])\n ->addColumn('method', 'string', ['comment' => '请求方式'])\n ->addColumn('url', 'text', ['comment' => '请求url'])\n ->addColumn('param', 'text', ['comment' => '请求参数'])\n ->addFingerPrint()\n ->create();\n }", "public function getVersionLog();", "public function run()\n {\n $data = [\n \t\t\t'Company-Updated',\n \t\t\t'Project-Updated',\n 'User-Updated'\n \t\t];\n\n foreach($data as $key => $value) {\n\t\t\tLog::create(['name'=>$value]);\n\t\t}\t\t\n }", "private function syslog_write_changelog ($changelog) {\n\t\t# fetch user id\n\t\t$this->get_active_user_id ();\n\t\t# set update id based on action\n\t\tif ($this->object_action==\"add\")\t{ $obj_id = $this->object_new['id']; }\n\t\telse\t\t\t\t\t\t\t\t{ $obj_id = $this->object_old['id']; }\n\n\t\t# format\n\t\t$changelog = str_replace(\"<br>\", \",\",$changelog);\n\t\t$changelog = str_replace(\"<hr>\", \",\",$changelog);\n\n\t\t# formulate\n\t\t$log = array();\n if(isset($changelog)) {\n if (is_array($changelog)) {\n \t\tforeach($changelog as $k=>$l) {\n \t \t\t$log[] = \"$k: $l\";\n \t\t }\n\t\t }\n\n \t\t# open syslog and write log\n \t\topenlog('phpipam-changelog', LOG_NDELAY | LOG_PID, LOG_USER);\n \t\tsyslog(LOG_DEBUG, \"changelog | $this->log_username | $this->object_type | $obj_id | $this->object_action | \".date(\"Y-m-d H:i:s\").\" | \".implode(\", \",$log));\n \t\t# close\n \t\tcloselog();\n }\n\t}", "private function changelog_write_to_db ($changelog) {\n\t\t# log to array\n\t\t$changelog = str_replace(\"<br>\", \"\\r\\n\", $this->array_to_log ($changelog, true));\n\t\t# fetch user id\n\t\t$this->get_active_user_id ();\n\n\t\t# null and from cli, set admin user\n\t\tif ($this->user===null && php_sapi_name()==\"cli\") { $this->user_id = 1; }\n\n # if user is not specify dont write changelog\n if (!isset($this->user) || $this->user == false || $this->user == null) {\n return true;\n }\n\n\t\t# set update id based on action\n\t\tif ($this->object_action==\"add\")\t{ $obj_id = $this->object_new['id']; }\n\t\telse\t\t\t\t\t\t\t\t{ $obj_id = $this->object_old['id']; }\n\t # set values\n\t $values = array(\n\t \t\t\t\"ctype\"\t => $this->object_type,\n\t \t\t\t\"coid\"\t => $obj_id,\n\t \t\t\t\"cuser\"\t => $this->user_id,\n\t \t\t\t\"caction\"=> $this->object_action,\n\t \t\t\t\"cresult\"=> $this->object_result,\n\t \t\t\t\"cdate\"\t => date(\"Y-m-d H:i:s\"),\n\t \t\t\t\"cdiff\"\t => $changelog\n\t\t\t\t\t);\n\t\t# null empty values\n\t\t$values = $this->reformat_empty_array_fields ($values, null);\n\n\t\t# execute\n\t\ttry { $this->Database->insertObject(\"changelog\", $values); }\n\t\tcatch (Exception $e) {\n\t\t\t$this->Result->show(\"danger\", _(\"Error: \").$e->getMessage(), false);\n\t\t\treturn false;\n\t\t}\n\t\t# mail\n\t\tif ($this->mail_changelog)\n\t\t$this->changelog_send_mail ($changelog);\n\t\t# ok\n\t\treturn true;\n\t}", "public function parseChangelog()\n\t\t{\n\t\t\t// Set the versioning array\n\t\t\t$info = array();\n\n\t\t\t// Set the Changelog file path\n\t\t\t$filename = file_get_contents(HOME_URI . '/CHANGELOG.md');\n\t\t\t$versions = explode(\"##\", $filename);\n\t\t\tarray_shift($versions);\n\t\t\t$idx = 0;\n\n\t\t\t// Get the version informations\n\t\t\tforeach($versions as $row => $item)\n\t\t\t{\n\t\t\t\t// Check if the data refers to the version and date or description\n\t\t\t\tif($row % 2 == 0) {\n\t\t\t\t\t// Separate version and date\n\t\t\t\t\t$temp = delete_all_between('(', ')', $item);\n\t\t\t\t\t$temp = explode('-', $temp, 2);\n\n\t\t\t\t\t// Version\n\t\t\t\t\t$info[$idx]['version'] = $temp[0];\n\n\t\t\t\t\t// Date\n\t\t\t\t\t$info[$idx]['date'] = $temp[1];\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\t// Clean-up the description\n\t\t\t\t\t$temp = trim(str_replace('# Commits', '', $item));\n\t\t\t\t\t$temp = preg_split('/(- |])/', $temp);\n\n\t\t\t\t\t// Initialize the description\n\t\t\t\t\t$info[$idx]['description'] = '';\n\n\t\t\t\t\tfor ($i = 1; $i < sizeof($temp); $i+=2) {\n\t\t\t\t\t\t// Link to commit\n\t\t\t\t\t\t$link = str_replace('(', '', $temp[($i + 1)]);\n\t\t\t\t\t\t$link = str_replace(')', '', $link);\n\n\t\t\t\t\t\t// Description\n\t\t\t\t\t\t$info[$idx]['description'] .= \"<a href=\" . $link . \" target='_blank'>- \" . $temp[$i] . \"]</a></br>\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add the index\n\t\t\t\t\t$idx += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if there is some version\n\t\t\tif ( isset($info[0]) && strcmp($info[0]['description'], \"\") != 0 )\n\t\t\t{\n\t\t\t\treturn $info;\n\t\t\t} else {\n\t\t\t\treturn 'No activity available yet.';\n\t\t\t}\n\n\t\t}", "function getChangeLog(\\PDO $dbh, $naIndex, $stDate = \"\", $endDate = \"\") {\r\n if ($stDate == \"\" && $endDate == \"\" && $naIndex < 1) {\r\n return \"Set a Start date. \";\r\n }\r\n\r\n $logDates = \"\";\r\n $whDates = \"\";\r\n $whereName = \"\";\r\n\r\n if ($stDate != \"\") {\r\n $logDates = \" and Date_Time >= '$stDate' \";\r\n $whDates = \" and a.Effective_Date >= '$stDate' \";\r\n }\r\n\r\n if ($endDate != \"\") {\r\n $logDates .= \" and Date_Time <= '$endDate' \";\r\n $whDates .= \" and a.Effective_Date <= '$endDate' \";\r\n }\r\n\r\n $whereName = ($naIndex == 0) ? \"\" : \" and idName = \" . $naIndex;\r\n\r\n $result2 = $dbh->query(\"SELECT * FROM name_log WHERE 1=1 \" . $whereName . $logDates . \" order by Date_Time desc limit 200;\");\r\n\r\n $data = \"<table id='dataTbl' class='display'><thead><tr>\r\n <th>Date</th>\r\n <th>Type</th>\r\n <th>Sub-Type</th>\r\n <th>User Id</th>\r\n <th>Member Id</th>\r\n <th>Log Text</th></tr></thead><tbody>\";\r\n\r\n while ($row2 = $result2->fetch(\\PDO::FETCH_ASSOC)) {\r\n\r\n $data .= \"<tr>\r\n <td>\" . date(\"Y-m-d H:i:s\", strtotime($row2['Timestamp'])) . \"</td>\r\n <td>\" . $row2['Log_Type'] . \"</td>\r\n <td>\" . $row2['Sub_Type'] . \"</td>\r\n <td>\" . $row2['WP_User_Id'] . \"</td>\r\n <td>\" . $row2['idName'] . \"</td>\r\n <td>\" . $row2['Log_Text'] . \"</td></tr>\";\r\n }\r\n\r\n\r\n // activity table has volunteer data\r\n $query = \"select a.idName, a.Effective_Date, a.Action_Codes, a.Other_Code, a.Source_Code, g.Description as Code, g2.Description as Category, ifnull(g3.Description, '') as Rank\r\nfrom activity a left join gen_lookups g on substring_index(Product_Code, '|', 1) = g.Table_Name and substring_index(Product_Code, '|', -1) = g.Code\r\nleft join gen_lookups g2 on g2.Table_Name = 'Vol_Category' and substring_index(Product_Code, '|', 1) = g2.Code\r\nleft join gen_lookups g3 on g3.Table_Name = 'Vol_Rank' and g3.Code = a.Other_Code\r\n where a.Type = 'vol' $whereName $whDates order by a.Effective_Date desc limit 100;\";\r\n\r\n $result3 = $dbh->query($query);\r\n\r\n while ($row2 = $result3->fetch(\\PDO::FETCH_ASSOC)) {\r\n\r\n $data .= \"<tr>\r\n <td>\" . date(\"Y-m-d H:i:s\", strtotime($row2['Effective_Date'])) . \"</td>\r\n <td>Volunteer</td>\r\n <td>\" . $row2['Action_Codes'] . \"</td>\r\n <td>\" . $row2['Source_Code'] . \"</td>\r\n <td>\" . $row2['idName'] . \"</td>\r\n <td>\" . $row2['Category'] . \"/\" . $row2[\"Code\"] . \", Rank = \" . $row2[\"Rank\"] . \"</td></tr>\";\r\n }\r\n\r\n\r\n return $data . \"</tbody></table>\";\r\n}", "public function changeLogs()\n {\n return $this->hasMany(ChangeLog::class, 'package_id');\n }", "function GetChangeLog()\n {\n return $this->Lang('changelog');\n }", "public function dataRevisionsTable();", "function appendTableChangeFile($tableName, $alterations, $alteration_descriptions)\n{\n\n static $overwrite = true;\n if($overwrite){\n $writemode = 'w';\n $overwrite = false;\n $content = \"<?php \\$alterations_moduleID = '{$this->ModuleID}';\\n\";\n $content .= \"\\$alterations = array();\\n\";\n $content .= \"\\$alteration_descriptions = array();?>\\n\";\n } else {\n $writemode = 'a';\n $content = \"\\n\";\n }\n\n $outFile = GEN_LOG_PATH . '/'.$this->ModuleID.'_dbChanges.gen';\n\n $content .= \"<?php \\$alterations['$tableName'] = unserialize('\".escapeSerialize($alterations).\"');\\n\";\n $content .= \"\\$alteration_descriptions['$tableName'] = unserialize('\".escapeSerialize($alteration_descriptions).\"');?>\\n\";\n\n $fh = fopen($outFile, $writemode);\n fwrite($fh, $content);\n fclose($fh);\n\n return true;\n}", "public function get_daily_update(){\n\t\t$date = date(\"Y-m-d\");\n\n\t\tif(!Storage::disk('local')->exists(explode(\"\\\\\",__METHOD__)[3])){\n\t\t\tStorage::disk('local')->put(explode(\"\\\\\",__METHOD__)[3],\"\");\n\t\t}\n\t\t$log = explode(\"\\n\",Storage::disk('local')->get(explode(\"\\\\\",__METHOD__)[3]))[0]; // __CLASS__.\"@\".__FUNCTION__\n\n\t\tif($log == \"\")\n\t\t\t$new_date = \"\" ;\n\t\telse\n\t\t\t$new_date = json_decode(explode(\"\\n\",$log)[0],true)[0];\n\n\t\tif($new_date != $date){\n\n\t\t\tif($new_date == \"\"){\n\n\t\t\t\t/** first message */\n\t\t\t\t$detail = $this->get_update_range(\"dda_update\",0,\"#\",\"\");\n\n\t\t\t}else{\n\n\t\t\t\t$log_arr = json_decode($log,true);\n\t\t\t\t$last_line_title = array_values(array_slice($log_arr, -1))[0];\n\t\t\t \t$detail = $this->get_update_range(\"dda_update\",-1,\"#\",$last_line_title);\n\t\t\t\tarray_unshift($detail,$last_line_title);\n\n\t\t\t}\n\n\t\t\tarray_unshift($detail, $date);\n\n\t\t\tStorage::disk('local')->prepend(explode(\"\\\\\",__METHOD__)[3], json_encode($detail,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));\n\n\t\t}else{\n\n\t\t\t$detail = json_decode($log,true);\n\t\t}\n\n\t\t/**\n\t\t * process: change detail suit for wechat\n\t\t */\n\t\tforeach ($detail as $key => &$value) {\n\n\t\t\tif (strpos($value, '##') !== false && $key == 1) {\n\t\t\t\t$value = str_replace(array('#'), '',$value);\n\t\t\t\t$value = \"Section Title:\".$value;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (strpos($value, '##') !== false && $key == count($detail)-1) {\n\t\t\t\t$value = str_replace(array('#'), '',$value);\n\t\t\t\t$value = \"Next Section: \".$value;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$value = explode(\":*\",$value);\n\n\t\t\tif(isset($value[1])){\n\t\t\t\t$value = $value[1];\n\t\t\t}else{\n\t\t\t\t$value = $value[0];\n\t\t\t}\n\t\t}\n\n\n\t\treturn implode(\"\\n\",$detail);\n\n\t\t\n\t}", "public static function display_changelog(){\r\n if($_REQUEST[\"plugin\"] != self::$slug)\r\n return;\r\n\r\n //loading upgrade lib\r\n if(!class_exists(\"RGConstantContactUpgrade\"))\r\n require_once(self::get_base_path().\"plugin-upgrade.php\");\r\n\r\n RGConstantContactUpgrade::display_changelog(self::$slug, self::get_key(), self::$version);\r\n }", "public static function generate_debug_log( $data = [] ) {\n\t\t$debug_log = '';\n\t\t$debug_content = '';\n\t\t$debug_file_path = WP_CONTENT_DIR . '/avada-migration-debug.log';\n\t\tif ( defined( 'AVADA_MIGRATION_DEBUG_LOG' ) && AVADA_MIGRATION_DEBUG_LOG ) {\n\t\t\tif ( ! empty( $data ) ) {\n\t\t\t\t$final_data = [];\n\t\t\t\tforeach ( $data as $item ) {\n\t\t\t\t\t$final_data[] = ( is_array( $item ) ) ? wp_json_encode( $item ) : $item;\n\t\t\t\t}\n\t\t\t\t$debug_log .= 'Old Setting: ' . $final_data[0] . \"\\r\\n\";\n\t\t\t\t$debug_log .= 'New Setting: ' . $final_data[1] . \"\\r\\n\";\n\t\t\t\t$debug_log .= 'Old Value: ' . $final_data[2] . \"\\r\\n\";\n\t\t\t\t$debug_log .= 'New Value: ' . $final_data[3] . \"\\r\\n\";\n\t\t\t\t$debug_log .= \"\\r\\n\";\n\t\t\t}\n\t\t\t// Write debug file contents.\n\t\t\tif ( file_exists( $debug_file_path ) ) {\n\t\t\t\t$debug_content = file_get_contents( $debug_file_path );\n\t\t\t}\n\t\t\t$debug_content .= $debug_log;\n\t\t\tfile_put_contents( $debug_file_path, $debug_content ); // phpcs:ignore WordPress.WP.AlternativeFunctions\n\t\t}\n\t}", "public function run()\n {\n $history_data = array(\n array(\n 'from' => 'AUD',\n 'to' => 'SEK',\n 'from_amount' => '1343',\n 'to_amount' => '8664.357274',\n 'created' => '2017-08-07 12:33:06'\n ),\n array(\n 'from' => 'BRL',\n 'to' => 'AUD',\n 'from_amount' => '1',\n 'to_amount' => '0.403363',\n 'created' => '2017-08-07 12:59:20'\n ),\n array(\n 'from' => 'AUD',\n 'to' => 'BRL',\n 'from_amount' => '1',\n 'to_amount' => '2.479155',\n 'created' => '2017-08-07 12:59:22'\n ),\n array(\n 'from' => 'AUD',\n 'to' => 'CHF',\n 'from_amount' => '2213',\n 'to_amount' => '1685.768881',\n 'created' => '2017-08-11 03:13:26'\n ),\n array(\n 'from' => 'CZK',\n 'to' => 'AUD',\n 'from_amount' => '11100',\n 'to_amount' => '631.796367',\n 'created' => '2017-08-11 03:18:36'\n )\n );\n\n $history = $this->table('history');\n $history->insert($history_data)->save();\n }", "public function change()\n {\n $table = $this->table('notifications');\n $table->addColumn('destination', 'enum', [\n 'values' => [\n 'Global',\n 'Role',\n 'User'\n ]\n ]);\n $table->addColumn('role_id', 'string', [\n 'default' => '',\n 'limit' => 32\n ]);\n $table->changeColumn('user_id', 'string', [\n 'default' => '',\n 'limit' => 36\n ]);\n $table->removeColumn('seen');\n $table->removeColumn('deleted');\n $table->update();\n\n $tableLogs = $this->table('admin_l_t_e_notification_logs');\n $tableLogs->addColumn('notification_id', 'integer');\n $tableLogs->addColumn('user_id', 'string', [\n 'default' => null,\n 'limit' => 36,\n 'null' => false\n ]);\n $tableLogs->addColumn('created', 'datetime');\n $tableLogs->create();\n }", "function createAdminDepositChangeLogsWebGenerator()\n{\n\treturn new AdminDepositChangeLogsWebReportGenerator();\n}", "public function main() {\n\t\t$content = '';\n\t\t/** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n\t\t$objectManager = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\n\t\t// Clear the class cache\n\t\t/** @var \\SJBR\\StaticInfoTables\\Cache\\ClassCacheManager $classCacheManager */\n\t\t$classCacheManager = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Cache\\\\ClassCacheManager');\n\t\t$classCacheManager->reBuild();\n\n\t\t// Update the database\n\t\t/** @var \\SJBR\\StaticInfoTables\\Utility\\DatabaseUpdateUtility $databaseUpdateUtility */\n\t\t$databaseUpdateUtility = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Utility\\\\DatabaseUpdateUtility');\n\t\t$databaseUpdateUtility->doUpdate('static_info_tables_it');\n\n\t\t$content.= '<p>' . LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables') . ' static_info_tables_it.</p>';\n\t\treturn $content;\n\t}", "function pm_demo_install() {\t\t\n\t\t//create llog\n\t\t$array = array();\n\t\t//add log to database\n\t\tself::createLog($array);\n }", "public function run()\n {\n //\n $cons=[\n\t\t\t['cons'=>\"East batteries! On-off switch too easy to maneuver.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Eats...no, GULPS batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Awkward ergonomics, no optical viewfinder, short battery life, slow, gets hot\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery eating beast/slow to recharge\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"power runs out before pictures do\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Slow, high battery consumption rate.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"image size and quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Memory too small, slow charge between shots.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Case design, included software\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No Optical Viewfinder, No Carry Case\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"poor image quality, flash that thinks it's &amp;quot;intelligent,&amp;quot; awkward to handle.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"I haven't discovered any!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"That little on/off switch sucks\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Low light photography, blinding flash\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"a little expensive, but it's worth it\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor picture quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Can only hold so many options, the software is lacking in options\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Pics can sometimes be a bit yellowish\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It needs reliable batteries, not cheap ones.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Low battery life, Smart Media not as popular as Compact Flash\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"hard to see view screen, hard to find\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Maybe the price could be 400 dollars.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None that I've found\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"battery life\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Short battery life\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Takes a second or two to actually take the picture after the button is pushed, eats batteries. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Occasionally mis-focuses some subjects in autofocus mode\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"eats batteries, carry several mem cards\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Viewing screen in bright light.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No viewfinder, no lens cap\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"no support CompactFlash, a little slow, poor batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"battery consumption, warm up time.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Sucks batteries like there's no tomorrow\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It uses a lot of batteries.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"falls apart way too easy\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Needs batteries all the time\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Software instructions difficult to understand and implement\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"image quality is less than perfect\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery hog\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Memory size (needs upgrade)\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"it only works sometimes, poor picture quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"???\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Eats batteries. Not enough space for quality pictures.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Low battery life with standard batteries.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Green light in viewfinder, eats AA batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"As listed above\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hard on batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"no Zoom!! price, heavy/bulky, \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor quality pictures, High power consumption, Low memory size\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery life, green light in viewfinder annoying\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No USB connection\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Missing zoom, few zippy features\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Carbon unit accessory sometimes takes bad pictures with it; 640x480 res has its limits\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery drain, com port only, NO ZOOM, \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery Killer, A little bulky\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Instructions should be more user friendly. Manual assumes computer skills that a beginner may not have\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Doesn't have a swivel body. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Problems with software, lack of instructions, lack of troubleshooting help, easy to delete pics\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"uses batteries very quick\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"when the computer is down, it won't work\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"uses batteries fast\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"High battery drain, Distracting flash indicator\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Manual is on Software and not as separate item.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Only loads into computer half the time with associated software\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No zoom!!!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"battery eater\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Options are $$$$$$$\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"performance\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Eats batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Harder to use in low light\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Durabilty, lack of zoom\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"battery hog\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"bad indoor pics.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"no zoom\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Continues to break down\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None yet\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Malfunctioned twice, goes quickly through batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"battery cost a little high\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Good, but not serious quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery eater, have to connect to computer every time you download pictures\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Eats up batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Flash not too 'smart', software\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"you have to buy a battery charger and rechargeables\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery life stinks, flash overexposes closeups, no zoom\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Devours batteries, white out on closeups with flash\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"short battery life\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Lack of Windows2000 Drivers, No Zoom\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"LCD hard to see in the sun, LCD freezes\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Eats batteries, plan on shelling out more money, Not very high res\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Very Poor customer service.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"The camera I have can only be connected to your computer via a serial port, and as I have a serial mouse and a serial modem, I have no spare ports while online, forcing me to disconnect to upload new pictures. :-( [Update: I now have a PS/2 mouse and can p\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Potentially weak LCD screen\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Slightly dated technology\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No Auto-Focus, Weak Flash\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Rechargeable batteries are a must!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"low quality pictures, drains batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery life when using LCD, no zoom\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"printing photos is hard for me\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"eats batteries quickly, viewfinder too far from lens, sporadic LCD window\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"As with all digital cam's...eats batteries.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Batteries can go fast if you dont get good ones\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Has flaws which are made worse by bad service policy.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"battery life (just buy lithium or rechargeable and it's GREAT); storage capacity (upgradeable)\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"does not have zoom\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery Life\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Serial cable only (No USB capabilities), Slow Uploading time.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"An absolute battery hog\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"cam broke/wont upload battery drainer NOT MAC/usb supported\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Eats batteries like crazy; frustrating problems, no USB\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"uses a lot of batteries, and doesn't take good close ups\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"ITS YOUR FIRST DIGITAL CAMERA TO PLAY WITH!!!! :)\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Camera is slow, batteries rattle and delete settings, uses batteries up VERY fast.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"8 months later I still have not received the $40. rebate that I was promised\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"almost non-existent tech support\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It's easy to use even for children.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"The camera kept breaking.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Holding the camera steady for 5 seconds after taking picture, Not XP compatible\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Too little space to answer\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"quality and customer service\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It ain't a $1600 Olympus!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Tech support virtually non-existent; \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Pictures only good for email.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"You only get what you pay for.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"VERY low resolution. Will not take good enough pics for eBay or email\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Weak flash, no memory expansion slot, customer service\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none, just be aware of what it was made for\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No LCD. Menus are less than clear.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"flash not great\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No expandable memory. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No memory upgrade or color LCD display.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"If you want to spend more, you can get more resolution and memory.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Flaky hardware, *extremely* sensitive to motion during picture taking, mediocre picture quality.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Photos are mediocre. Lighting can effect web camera adversely\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"7-second wait time in between pictures.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Flash-Range\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No-LCD, so-so image quality, batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Flash kills batteries, bad with low light, no macro mode.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"no zoom\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Picture quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No LCD, No Video Out, Batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Flash distance, poor results in room light\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery life, flimsy USB cover\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Short battery life, so-so indoor pic quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"turns off after about 15-30 seconds w/o use\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"battery life, flash too strong with artificial lights, long time between shots.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"weak flash, video-conferencing feature is kinda crummy too\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"not great resolution, IT BROKE!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery life is very limited\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery use &amp;amp; Mac compatability\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"batteries go dead after a short time\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery Consumption\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"uses a lot of batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"no optical zoom, slightly bulky, odd battery gauge.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"shutter delay, slow flash charge, low battery life\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Does not meet advertised specifications.&amp;#13;&amp;#10;No support.&amp;#13;&amp;#10;\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Tiny button for people with large hands\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"eats batteries, difficulty downloading\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not easy to operate, eats batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"poor to no customer service, not for MAC despite claims\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery use/Design\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"short battery life, annoying glare, need to restart Mac every time you want to transfer pictures\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Little memory, excessive battery usage\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery drainer\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Eats batteries, have to buy optional power supply\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Somewhat flimsy, no flash memory, media more difficult to acquire.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"price\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"eats batteries!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Battery hog, poor LCD screen\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Miserable battery life, poor battery cover lock integrity\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Latency between pics, size, construction flaws\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No Continuous Zoom, Lens doesn't swivel, Long warm-up time, Photowise 2.1.2 lacks features of earlier versions, LCD has slow scan rate\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"USB connection to my Mac doesn't work most of the time, Usability design\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Needs computer to retain some settings; may not be Y2K compatible\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"can't think of any except eats batteries but I think all digital cameras do that. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor Quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"bulky for today's standards\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"doesn't always work\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"all else\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"camera breaks, Agfa does nothing except tell lies\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"A little big for small hands.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Bad quality in low light, bulky case, slow LCD\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Everything else\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"everything\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It was free...\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor image quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"picture quality, no USB interface\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Low resolution, quirky file transfer\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"grainy images, distortion, poor quality images\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"extremely poor images\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"low quality pictures, eats up batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"bad bad bad pictures\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"I kind of feel bad for the person that bought it.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"all-should be taken off market\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Lack of quality customer service.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"extremely poor image quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"You get what you paid for.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Horrible image quality, pathetic battery life, no focus, the list goes on...\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"poor clarity\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"adapter and battery usage\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"just about everything about it\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"feels junky\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Substandard image quality, confusing software\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"dont like it \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"everything about it!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"poor image resolution; high battery usage; not upgradable\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Limited capabilities, shaky software\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Just plain doesn't work.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Where shall I begin?\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"waste of money\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Quality of Pictures, and the Company's lack of service to this customer\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"ahhh....it died!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"EVERYTHING\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"stupid stupid stupid, don't buy it, i beg you!!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Doesn't produce decent photos without incredible effort\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"very expensive for a piece of junk\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Low quality, not for taking important pictures.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Still not a good deal\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Bad quality, doesn't work sometimes.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Needs $50 power adapter not included. Poor resolution of picture.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"bad quality, poorly made\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"picture quality, battery use, no view\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Everything from its hard instillation, too is unacceptable performance\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"image quality, battery life, usability\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"read all opinions for the cons\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"quit working, poor quality pictures\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Pixellation in photos, some software troubles, hard on batteries\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"agfa lies about product specs\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"EVERYTHING\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"EVERYTHING\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Horrible quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"bad picture quality/ battery drainage issue\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"fuzzy pics, connection problems, list goes on ...\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Picture quality is useless\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"not the best quality sucks battery power\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"TAKES BAD PICTURES\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"SUCKS,SUCKS, SUCKS!!!!!!!!!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Low quality service, pictures, software, and warranty\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"problems with software and batteries, low resolution\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Picture quality is utterly awful\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"everything\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"the fact that it exists\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"poor quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"buy a battery for every photo you plan on taking, don't plan on the photos being very good\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Very low end\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"battery life, ease of use\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Absolutely everything. Terrible picture, battery life\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Short battery life, awful image quality, poor construction, terrible software\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It is a battery eating machine!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Pictures are very grainy and seem out of focus\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Smile is very low-end, not for the serious digital photo lover.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hard to use, poor quality pictures, battery life.. ha ha.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"or you can say there's nothing good about it.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"short battery life, poor resolution, no&amp;#13;&amp;#10;customer service, badly constructed\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Lens distorts, resolution is low, needs lots of light, gobbles AAs, looks toylike\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Serial port, only 2mb memory ( 16 pics is not enough ), ugly pictures\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"poor image quality, no display\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Resolution ... 1.2 mp is the base for most graphic work... but ..just enough\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"no flash, annoying beep when buttons pressed, shutter button in an uncomfortable spot\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor low light/indoor picture quality.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor low light performance, drains batteries, no flash.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Cheap plastic hardware&amp;#13;&amp;#10;No flash\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It likes a lot of light, but for the money I have no complaints.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Needs a lot of light.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Software does not allow conversion from bitmap to jpeg formatting. Fragile. Low light problems\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Takes getting used to because of small size., , Some trouble installing due to missing files.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No flash, bad as a webcam, no customer support.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Short battery life, low end picture quality, no flash, beeping noise\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"design flaws and missing features, marginal image quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Why would a spy camera BEEP when pictures are taken?\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"low image quality, can be flimsy \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Image quality is poor without good lighting, may break if dropped, \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Irritating beep when camera takes a picture, no flash on camera.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No flash, marginal lens.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"OK Image Quality, No Flash, Battery Drainer, Few Features, Spoils-the-Fun Beep when Taking Pictures\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No flash, Not for low light situations\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"no flash &amp; you lose all your pix if the battery goez dead . \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"cheap plastic parts&amp;#13;&amp;#10;poor low-light performance&amp;#13;&amp;#10;marginal image quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"drains batteries, bad photo quality, software only works with Windows 98 and above\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor picture quality and no flash.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor picture quality\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not the best digital camera available. No flash.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"marginal image quality; limited storage; inadequate product support\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Image quality is so-so. No flash.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"poor quality photos, battery problems, no flash, endless cons\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"clip on it does not stay hooked to what ever you clip it on\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Bad pictures, flimsy, not worth the money.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Won't take pictures in low light.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"quirky software\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"You need lots and lots of light to use this one.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Noisy, costly, grainy plain paper printouts, ease of changing cartridges\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Slow and noisy, uses a lot of ink.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Probably not for photos; loud.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Are there any?\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"need to clean print head occasionally\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"noisy, big\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"takes a few moments to change ink cartridges\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Loud, cartridges have to be cleaned for real quality color\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"can't print, lousy support, bad communications, never again\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hard to find replacement cartridges\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"As always, expensive inks.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Expensive running costs, noisy, large, problems with non-Epson consumables.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"somewhat noisy\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hmmm..... No cons come to mind !\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"cartridges are still expensive (shop around)\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Price, constant maintenance\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Ink cartridges are pricey\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Ink cartridge monitor system leaves something to be desired.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not a one\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"slow for photos, expensive ink costs, loud\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"medium quality on regular paper, ink hog\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Epson does not support: has lines in output\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"haven't found any\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Minor nozzle clogging issue in some situations\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"blurred picture, price\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"if you use paper less that 24lb, the printer will misfeed the paper\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"price, cartridges are expensive\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Macintosh LocalTalk needs an optional interface card. Some information only in electronic version of the manual.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Loud\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Unacceptable black text.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hard to find ink\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"A bit loud and shakes when printing\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Printer may shake desktop. Black text rendition poor. See opinion for work-around.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Pretty loud\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Very noisy! Design is bigger and clunkier!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"loud, takes a long time to warm up/print a page\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Loud, high priced, and not that great on black text.&amp;#13;&amp;#10;\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Noisy, does not allow for stiff copy.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"lack of a LCD\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"a little pricey\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"warmup takes longer than the &amp;quot;ready&amp;quot; light indicates\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"That paper tray!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Price is high for most consumers, size\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"nod LCD screen, drivers can conflict.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Lack of Flash and Focusing Ability\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Pictures not the best.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Pictures not the best.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Your best photo's will be bad.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Your best photo's will be bad.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor quality photo's\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Horrible picture quality; no flash. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor quality, no flash, outdoor pictures only.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"You get what you pay for\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Low pic quality. not hold many pic's on High Resoultion (20) Low resolution (80)\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Drivers not XP compatible&amp;#13;&amp;#10;Product Support Minimal&amp;#13;&amp;#10;Product Doesn't Work\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Eats batteries up so fast that they must be removed after use!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Where should I begin? No flash, no removable memory\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Picture quality is very poor. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Low quality pictures, no flash\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"does not work... get what ya paid for\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"very vague instructions, pictures arent very high quality, not much memory\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"You get what you pay for\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"poor quality photos, cheap, no lcd screen\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Your best photo's will be bad.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not cheap enough, found better stuff in Cracker Jack boxes\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No removable memory, no flash\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor quality pictures\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"no flash, hard to understand directions, cheap construction\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Picture quality isn't that good, cheap design and construction, no flash makes lighting necessary\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Mine is under the Vivitar brand name ,but the same camera !\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor optics, puny internal memory, \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"USB problems, Problems powering up, didn't operate properly\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not worth the money\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Little built in memory, short range\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"about .5mb of internal memory, battery &amp; CF doors are hard to open/close\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"grainy LCD preview; poor picture quality; flash broken\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Defective and the quality?\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"a little difficult to fold down\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"A little bit expensive for those new mothers.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\" Can't push it while lying on the couch.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Expensive, can tip over\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hard to travel with.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"The price, and its bulky\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Kind-of Bulky in Malls\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"baby pushing up can cause it to topple backwards\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None found yet\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Price. Size. Does not fold up easily. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Expensive\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Almost too big for everyday use.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Its hard to manipulate if you take it in large crowds\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Doesn't fold, unless you disassemble it, and is still extremely bulky. Only one seat position.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"I don't know of any\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Bulky when folded, doesn't lock in the folded position\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"expensive, lacking all the cutesy gadgets others have\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"That it can sometimes get a little out of control\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Cost, takes some adjustment getting used to pushing while jogging.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Stroller doesn't turn easily, rear wheel alignment problems cause it to drift\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"doesn't fold up the best\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Too large\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Cheaply made, uncomfortable, no head support or cushioning. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"expensive, brake hard to set\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hard to store and travel with, not very comfortable for toddlers\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"not made for people over 6'2&amp;quot;\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No more excuses for not running\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"May not fit into small car\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Expensive\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not good on rough terrain\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Spendy, Balance and Design Issues\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"A little hard to get up curbs.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"wheels are too big\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Kind of bulky\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Like a bike, tires can go flat easily.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Baby can't recline, access to basket is small, brakes don't engage on the first try\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"lacks parking brake, sun shield is too small, somewhat awkward to fold\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"somewhat bulky in size \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"basket on bottom is small\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Bulky to transport\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No adjustable recline position\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"You can't use it to go shopping at the mall.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"3 wheels are better than 4\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"higher price\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No stationary brakes. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None, this is the 'perfect' sports stroller\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hard to get., Pricey\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Takes a little while to get the hang of putting together\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"A little bulky to get into a small car\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Balance problem and it's hard to put away\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Price Can Be a Drawback\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not reclining seat\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"more pricey than other joggers\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"seat doesn't recline - minor issue.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"One sitting position\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Folding it can take some getting used to\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"pricey, small baskets\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"just alittle pricey but worth it!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"expensive and not for infants\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"too wide to use indoors, expensive\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"breaks easily with a little wear and tare.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"somewhat heavy\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"took awhile to get used to\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Expensive\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"less than eight wheels\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Break down is a little awkward.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It's a bit pricey, but well worth every penny\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"price, wheels \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"you need a large trunk, minivan, or truck\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It has tipped over on occasion, only once with baby inside!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Straps caused minor discomfort, but otherwise no complaints!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"The turning is not that easy\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Needs a parking break; strap between the legs is too long (can be remedied); retracted canopy brushes against an older childs head.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor canopy design.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Canopy, Bottom Mesh Basket\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"See Review for product comparisons\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"NOT for babies, huge, expensive\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Won't replace the need for a small stroller.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"A little steep in price(but worth it)\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"the attachment bar then makes it hard to fit into some vehicles \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Folding and unfolding is akward and there is no cup holder\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"too minor to mention\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Like most double strollers, it squeaks from time to time\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Squeaky, and quite flimsy after 20 months of heavy use.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"not easy to transport, takes up a lot of room in car, can't use basket with back seat reclined\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"reliability, size\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"small basket, no leg room in rear\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Missing storage, hard to collapse\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hard to lift in the trunk.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"basket not accessible when used as travel system\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"As of yet, I've not found any!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"High price\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"engineering\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Front rider gets kicked and seats do not sit straight up.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Basket inaccessible when back seat is fully reclined\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Gets squeaky and flimsy on the long run\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"doesn't wear well, \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Basket is hard to reach when car seat is attached\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Bulky\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Baby Trend difficult to reach by phone\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"small storage area, no handle height adjustment\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Like pushing an Explorer through the mall. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Yeah, I'd like to see YOU keep MY toddler in the standing position!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Too heavy, somewhat flimsy\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Storage basket can't hold very much, no cup holders.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"hard to push and turn\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"When using infant carrier, older child cannot sit; somewhat heavy; manuvering in stores takes practice!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Fairly large and heavy, small basket.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"bulky, storage difficult to access\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"basket hard to reach\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"May not allow enough room for taller child in weight range\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Too big, heavy and hard to manuver\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"long distance catapulting of occupant due to lack of brakes\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"bulky for storage\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"heavy\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Outgrow fast\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Hard to maneuver\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Folding up a BIG hassle, heavy, feels cheap. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Small storage basket\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"strong and reliable\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not realistic.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Too big and cumbersome\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"flimsiness\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"front pops out\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"basket location\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Front seat doesn't recline much\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"not designed for young children, expensive\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"a little pricey\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"very awkward to collapse\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"lots of repair problems, hard to steer, heavy\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"harder to fold\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"seat positions\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"infant part needs more padding\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"My children don't like to stand when the front seat is reclined\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"not as small as normal one child strollers, not a great harness system for older child\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"can't sit on back while front is reclined fully\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"can't think of any\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Storage access!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Infant seat attachment makes stroller bulky!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Maneuverability\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"not suitable for 2 pretoddlers\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Too heavy, hard to fold and unfold, safety concerns for standing child.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Poor design\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"toddler not restrained enough\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not enough room on jumpseat, not a good seatbelt, very heavy\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Heavy, Basket inaccessible, Probably was not the best choice for our needs\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"not for wanderers\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"not for 2 small children\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"bulky and hard to maneuver when closed\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"seat only has 2 reclining positions\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Can be pushed by child sitting in back\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"HEAVY\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"worst stroller I have ever used\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Toddler cannot always sit\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"child in the front seat will grow out of it fast.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"hard to push and turn\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Size\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"child can fall off when standing\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"heavy - awkward to fold up and basket hard to access.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Basket is not easy to get too! Needs a cup and bag holder for parents.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Heavy,and hard to turn.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Software not XP compatible, scanner is slow and scan quality not up to par\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Too bad it doesn't do color printing. Slow on the hi-res color scanning otherwise great.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Needs linux drivers.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none so far\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Horrible customer service\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Slow First Copy, Not Color (inkjet), Small Document Bed\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Slow scanner.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Edges of copies may bend on output tray\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Drum unit gave out after 13 months of light home use.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Driver could be better, sometimes has errors\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No network port. No color. No cable in box\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"only 2mb (enough for normal duty)\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Needs more documentation on CD\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Short drum life, obtrusive software\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"USB, Power Consumption\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"USB setup is difficult. Very still cardstock may be a problem.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Quite large\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Crappy software\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None that i can think of!\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not a Postscript printer\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Memory is not upgrade able.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Could have better quality.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Limited expansion possibilities\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Limited On Board Memory, Slightly Hard To Find In Stores and On The Web\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"USB installation could be more seamless\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No automatic envelope feeder, the paper tray fits both letter and legal which makes it stick out beyond the printer body in the rear of the machine.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Only 2MB memory, nonexpandable or networkable.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"manual feeding a touch tricky, beige\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Somewhat large\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"print quality not a crisp black color\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"inability to increase RAM\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"the name isn't HP\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"NONE\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"buggy USB driver\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None yet\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Bare-bones Mac driver; PostScript not available\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Paper tray sticks out back\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Won't work well with older computers, support is difficult\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"The toner cartridge is difficult to find.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Fairly large, 2MB memory may not be enough for some\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Can't be networked.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"doesn't work well in network environments\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not good for printing envelopes\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"High-Res graphics are a little fuzzy.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None yet.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Square design, 4MB memory not enough for some image printing, supplied drivers not excellent\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Susceptible to jamming\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It glitches on occasion, but doesn't everything. This does it less, though.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"print shade\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Annoying Quick Setup Dialog Box - Doesn't work well with Win XP\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None so far.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Paper Handling could be better.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Just prints b&amp;w, toners are costly\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Feeding heavy stock from paper tray, incorrect instructions for printing a test page.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Clearing paper jams can be tricky, requires significant component replacement periodically.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No print density control: prints too light with some fonts.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Can only load one piece at a time in manual loader\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Unreliable USB interface.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Drum Unit Assembly\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Setup - possible hitch.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Relatively_long warm-up time. It_needs more memory for graphics. Replacing_the drum unit will hurt (financially).... \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Can't print a lot of graphics; customer service isn't great.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Buggy software drivers.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Tray can be tricky to slide out\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"I tis not a color Printer (Joking)Can't think of any\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Noisy when operating\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Windows XP users may have to download additional software to use this product\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"The drum kit burns light weight glossy paper, too high of heat.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Low memory means restrictions on printing graphics\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"The tray should be bigger to hold more paper.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Approx 70 pct of time it will not print an address on an envelope. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Not for graphic or color prints jobs.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Nothing really\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"You must download drivers for windows xp\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Trouble with graphics.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"toner cartridge problems - gray background after 500-750 pages new machine\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"smell of cartridge ink; inconsistent manual feed\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"It continually jams when printing envelopes. \",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Too cheap to keep\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"As loud as my paper shredder, Dimmed the lights in my room, Slow to print\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No USB or Parallel cable included.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"none so far\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"many jams, awkward to clear; streaking; sucky documentation\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Some paper jams, computer freeze-ups, software takes a while to figure out. Somewhat slow.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Annoying paper jams.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"No phone handset\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Multiple Sending at the same time has problems\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Zero customer service\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"The paper port does not have writer capabilities.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"SLOW and mine may have defective print heads\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"Address book\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t\t['cons'=>\"None so far.\",'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')],\n\t\t];\n\n\t\t\\App\\Cons::insert($cons);\n }", "function main() {\n\t\t$content = '';\n\t\t$objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\n\t\t/** @var ClassCacheManager $classCacheManager */\n\t\t$classCacheManager = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Cache\\\\ClassCacheManager');\n\t\t$classCacheManager->reBuild();\n\n\t\t/** @var DatabaseUpdateUtility $databaseUpdateUtility */\n\t\t$databaseUpdateUtility = $objectManager->get('SJBR\\\\StaticInfoTables\\\\Utility\\\\DatabaseUpdateUtility');\n\t\t$databaseUpdateUtility->doUpdate('static_info_tables_zh');\n\n\t\t$content .= '<p>' . \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables', ['static_info_tables_zh']) . '.</p>';\n\t\treturn $content;\n\t}", "public function formatData(){\n $from = $this->dataObject->getFrom();\n\n // prepare array for counterxmlbuild with vendor informations\n $data = array(\n 'Report' => array (\n 0 => array(\n // Report attributes\n 'Created' => date('Y-m-d\\TH:i:s'),\n 'ID' => 'ID01', //TODO\n 'Version' => $this->dataObject->getVersion(),\n 'Name' => $this->dataObject->getReportName(),\n 'Title' => $this->dataObject->getReportTitle(),\n // Vendor node\n 'Vendor' => array(\n 'Name' => VENDOR_NAME,\n 'ID' => VENDOR_ID,\n 'Contact' => array(\n 0 => array(\n 'Contact' => VENDOR_CONTACT_NAME,\n 'E-mail' => VENDOR_CONTACT_MAIL\n ),\n ),\n 'WebSiteUrl' => VENDOR_WEBSITEURL,\n 'LogoUrl' => VENDOR_LOGOURL,\n ),\n ),\n ),\n );\n\n // prepare with customer informations\n $data['Report'][0]['Customer'][0] = $this->dataObject->getCustomerInfo();\n\n $j=0; // ReportItem\n $y=0; // ItemPerfomance\n $previousIdentifier = '';\n $count = 0;\n\n foreach ($this->dataObject->getData() as $row) {\n if (!($row['identifier'] == $previousIdentifier)) {\n // next Reportitem\n $j++;\n // reset ItemPerfomance\n $y=0;\n\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPlatform'] = 'TODO'; //TODO\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemDataType'] = 'TODO'; //TODO\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemName'] = $row['identifier'];\n }\n\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Period']['Begin'] = date('Y-m-d', strtotime($row['date']));\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Period']['End'] = date('Y-m-d', strtotime('last day of this month', strtotime($row['date'])));\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Category'] = 'TODO'; //TODO\n\n // check for different counts\n $x=0; // Instance\n\n // TODO: implement/translate format for different metric types\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Instance'][$x]['MetricType'] = 'ft_total';\n $data['Report'][0]['Customer'][0]['ReportItems'][$j]['ItemPerformance'][$y]['Instance'][$x]['Count'] = $row['counter'];\n\n $y++; //next ItemPerformance\n $previousIdentifier = $row['identifier'];\n $count++;\n }\n\n $counterxmlbuild = new CounterXMLBuilder();\n $counterxmlbuild->setIndentString(\"\\t\");\n $counterxmlbuild->start();\n $counterxmlbuild->add_reports($data);\n $counterxmlbuild->done();\n return $this->formattedData = $counterxmlbuild->outputMemory();\n }", "public function run()\n {\n DB::table('AuditModels')->insert([\n 'codice' => \"001\",\n 'descrizione' => \"Audit Fornitore\",\n 'versione' => \"Rev. 03 del 06-04-2012\",\n ]);\n\n DB::table('AuditModels')->insert([\n 'codice' => \"002\",\n 'descrizione' => \"Audit Preliminare\",\n 'versione' => \"1.5.3\",\n ]);\n }", "public function change()\n {\n \\magein\\php_tools\\extra\\Migrate::create(\n $this->table('system_log'),\n [\n ['uid', 'integer', ['limit' => 11, 'comment' => '管理员']],\n ['controller', 'string', ['comment' => '控制器']],\n ['action', 'string', ['comment' => '行为']],\n ['get', 'string', ['limit' => 1500, 'comment' => 'get参数']],\n ['post', 'text', ['comment' => 'post参数']],\n ['ip', 'string', ['limit' => 30, 'comment' => 'IP地址']]\n ]\n );\n }", "protected function createMigrationHistoryTable()\n {\n $tableName = $this->db->schema->getRawTableName($this->migrationTable);\n $this->stdout(\"Creating migration history table \\\"$tableName\\\"...\", Console::FG_YELLOW);\n\n $this->db->createCommand()->createTable($this->migrationTable, [\n 'version' => 'String',\n 'apply_time' => 'DateTime',\n ], 'ENGINE = MergeTree() PRIMARY KEY (version) ORDER BY (version)')->execute();\n\n $this->addMigrationHistory(self::BASE_MIGRATION);\n\n $this->stdout(\"Done.\\n\", Console::FG_GREEN);\n }", "public function generate() {\n\n $this->Menu = ClassRegistry::init(\"Cms.Menu\");\n\n $aDados = $this->Menu->find('all');\n\n if (!$this->isUpToDate($aDados)) {\n \n App::import(\"Helper\", \"Xml\");\n App::import(\"File\");\n\n $oXml = new XmlHelper();\n\n $oXml->header();\n $oXml->serialize($aDados);\n\n $oFile = new File(Configure::read('Cms.CheckPoint.menus') . time() . \".xml\", true, 0777);\n \n $oFile->append($oXml->header());\n $oFile->append(\"<menus>\");\n $oFile->append($oXml->serialize($aDados));\n $oFile->append(\"</menus>\");\n \n return true; \n }\n\n return false;\n }", "public function history()\n\t{\n\t\t$migration = new \\Hubzero\\Content\\Migration();\n\t\t$history = $migration->history();\n\t\t$items = [];\n\t\t$maxFile = 0;\n\t\t$maxUser = 0;\n\t\t$maxScope = 0;\n\n\n\t\tif ($history && count($history) > 0)\n\t\t{\n\t\t\t$items[] = [\n\t\t\t\t'File',\n\t\t\t\t'By',\n\t\t\t\t'Direction',\n\t\t\t\t'Date'\n\t\t\t];\n\n\t\t\tforeach ($history as $entry)\n\t\t\t{\n\t\t\t\t$items[] = [\n\t\t\t\t\t$entry->scope . DS . $entry->file,\n\t\t\t\t\t$entry->action_by,\n\t\t\t\t\t$entry->direction,\n\t\t\t\t\t$entry->date\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t$this->output->addTable($items, true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->addLine('No history to display.');\n\t\t}\n\t}", "function generate_cash_v2($param)\r\n\t{\r\n\t\t$this->view = false;\r\n\t\t$this->layout_name = false;\r\n\t\t//debug($param);\r\n\r\n\t\t$_SQL = Singleton::getInstance(SQL_DRIVER);\r\n\r\n\t\t// get list of lines to be updated in audit_tree_v2\r\n\t\t$sql = \"SELECT * from audit_tree_v2 where '1'\";\r\n\t\tif ( !empty($param[0]) )\r\n\t\t{\r\n\t\t\t$sql .= \" and table_name='\" . $param[0] . \"'\";\r\n\t\t}\r\n\t\tif ( !empty($param[1]) )\r\n\t\t{\r\n\t\t\t$sql .= \" and field_name='\" . $param[1] . \"'\";\r\n\t\t}\r\n\t\tif ( !empty($param[2]) )\r\n\t\t{\r\n\t\t\t$sql .= \" and error_name='\" . $param[2] . \"'\";\r\n\t\t}\r\n\t\t$sql .= \" order by table_name, field_name, error_name asc\";\r\n\r\n\t\t$_SQL->sql_query($sql);\r\n\t\t$res = $_SQL->sql_query($sql);\r\n\t\t//debug($res);\r\n\t\t// get ARKADI_AUDIT mssql server infos\r\n\t\t$sql2 = \"SELECT * FROM data_dictionary_server where id=1\";\r\n\t\t$res2 = $_SQL->sql_query($sql2);\r\n\r\n\t\twhile ( $ob = $_SQL->sql_fetch_object($res2) ) // only 1 line\r\n\t\t{\r\n\t\t\t//open connection to ARKADIN_AUDIT DB\r\n\t\t\t$db = @mssql_connect($ob->ip, $ob->login, $ob->password);\r\n\r\n\t\t\tif ( !$db )\r\n\t\t\t{\r\n\t\t\t\techo(\"ERROR : impossible to connect to \" . $ob->ip . \" - (mx : \" . $ob->mx . \")\\n\");\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tmssql_select_db(\"ARKADIN_AUDIT\");\r\n\r\n\t\t\t// process list of lines to be updated in audit_tree_v2\r\n\t\t\twhile ( $to_be_updated = $_SQL->sql_fetch_object($res) )\r\n\t\t\t{\r\n\t\t\t\t//debug($to_be_updated);\r\n\t\t\t\t$output = array();\r\n\r\n\t\t\t\t//total: get count of all element for the given table in ARKADIN_AUDIT related PIV\r\n\t\t\t\t$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"]\";\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\t\t\t\t$ob2 = mssql_fetch_object($res3);\r\n\t\t\t\t$output['total'] = $ob2->cpt;\r\n\r\n\t\t\t\t// total number of lines in error in current run\r\n\t\t\t\t//$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN=\" . $_GET['run_current'] . \"\r\n\t\t\t\t$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN=2\r\n\t\t\t\t\tAND ERROR_\" . $to_be_updated->field_name . \"_\" . $to_be_updated->error_name . \" is not null\";\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\t\t\t\t$ob2 = mssql_fetch_object($res3);\r\n\t\t\t\t$output['run_current'] = $ob2->cpt;\r\n\r\n\t\t\t\t// total number of lines in error in reference run\r\n\t\t\t\t//$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN=\" . $_GET['run_reference'] . \"\r\n\t\t\t\t$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN=1\r\n\t\t\t\t\tAND ERROR_\" . $to_be_updated->field_name . \"_\" . $to_be_updated->error_name . \" is not null\";\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\t\t\t\t$ob2 = mssql_fetch_object($res3);\r\n\t\t\t\t$output['run_reference'] = $ob2->cpt;\r\n\r\n\t\t\t\t// added number of lines in error in current run (nb of new lines)\r\n\t\t\t\t// deleted number of lines in error from reference run (nb of deleted lines)\r\n\t\t\t\t//$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN in (\" . $_GET['run_current'] . \",\" .\r\n\t\t\t\t// $_GET['run_reference'] . \")\r\n\t\t\t\t// where t.ID_RUN in ($_GET['run_current'],$_GET['run_refernce'])\r\n\t\t\t\t$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] t\r\n\t\t\t\t\tjoin [HASH_\" . $to_be_updated->table_name . \"_V2] h on t.AUDIT_OID=h.AUDIT_OID\r\n\t\t\t\t\twhere t.ID_RUN in (1,2)\r\n\t\t\t\t\tAND t.ERROR_\" . $to_be_updated->field_name . \"_\" . $to_be_updated->error_name . \" is not null\r\n\t\t\t\t\tGROUP BY h.HASH HAVING COUNT(1)=2\";\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\t\t\t\t$total_in_both_run = mssql_fetch_object($res3);\r\n\t\t\t\t$output['add'] = $output['run_current'] - $total_in_both_run;\r\n\t\t\t\t$output['del'] = $output['run_reference'] - $total_in_both_run;\r\n\r\n\t\t\t\t// total number of lines in current run with accepted status\r\n\t\t\t\t// total number of lines in current run with to_be_corrected status\r\n\t\t\t\t// total number of lines in current run with in_wait status\r\n\t\t\t\t// AND t.ID_RUN = \"2\" . $_GET['run_current'] . \"\r\n\t\t\t\t$sql3 = \"SELECT f.STATUS, count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] t\r\n\t\t\t\t\tjoin [HASH_\" . $to_be_updated->table_name . \"_V2] h on t.AUDIT_OID=h.AUDIT_OID\r\n\t\t\t\t\tleft join [AUDIT_BLUESKY_FOLLOWED] f on h.HASH=f.HASH\t\t\t\t\r\n\t\t\t\t\twhere t.ERROR_\" . $to_be_updated->field_name . \"_\" . $to_be_updated->error_name . \" is not null\r\n\t\t\t\t\t\tAND t.ID_RUN = 2\r\n\t\t\t\t\tGROUP BY f.STATUS\";\r\n\t\t\t\tdebug($sql3);\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\r\n\t\t\t\t$output['accpeted'] = 0;\r\n\t\t\t\t$output['to_be_corrected'] = 0;\r\n\t\t\t\t$output['in_wait'] = 0;\r\n\t\t\t\twhile ( $ob2 = mssql_fetch_object($res3) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( ($ob2->STATUS == 2 ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$output['accpeted'] += $ob2->cpt;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( ($ob2->STATUS == 2 ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$output['accpeted'] += $ob2->cpt;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( is_null($ob2->STATUS) || ($ob2->STATUS == 1) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$output['in_wait'] += $ob2->cpt;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdie('unexpected status found in ARKADIN_AUDIT..AUDIT_BLUESKY_FOLLOWED table');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t$sql4=\"UPDATE audit_tree_v2 a set\r\n\t\t\t\t total=\".$output['total'].\",\r\n\t\t\t\t run_current=\".$output['run_current'].\",\r\n\t\t\t\t run_reference=\".$output['run_reference'].\",\r\n\t\t\t\t run_reference=\".$output['run_reference'].\",\r\n\t\t\t\t add=\".$output['add'].\",\r\n\t\t\t\t del=\".$output['del'].\",\r\n\t\t\t\t accpeted=\".$output['accpeted'].\",\r\n\t\t\t\t to_be_corrected=\".$output['to_be_corrected'].\",\r\n\t\t\t\t in_wait=\".$output['in_wait'].\"\r\n\t\t\t\t where a.table_name=\" . $to_be_updated->table_name . \" AND\r\n\t\t\t\t a.field_name=\" . $to_be_updated->field_name . \" AND\r\n\t\t\t\t a.error_name=\" . $to_be_updated->error_name;\r\n\t\t\t\t\r\n\t\t\t\tdebug($sql4);\r\n\t\t\t\tdebug($output);\r\n\t\t\t}\r\n\t\t\t//close connection to ARKADIN_AUDIT DB\r\n\t\t\tmssql_close();\r\n\t\t}\r\n\t}", "function changeLogs() {\n\n }", "public function buildChangedMessage() {\n\t\t\tvar_dump(array_diff($this->data, $this->original_data));\n\t\t\t$message = array();\n\t\t\t$this->changed_message = implode(' ', $message);\n\t\t}", "private function generateNewsData() {\n require_once 'WebsiteNewsModel.php';\n $model = new WebsiteNewsModel();\n $this->newsData = $model->getData();\n }", "function main()\t{\n\n\t\t$content = '';\n\n\t\t$content .= '<br /><b>Change table tx_realurl_redirects:</b><br />\n\t\tRemove the field url_hash from the table tx_realurl_redirects, <br />because it\\'s not needed anymore and it\\'s replaced by the standard TCA field uid as soon as you do <br />the DB updates by the extension manager in the main view of this extension.<br /><br />ALTER TABLE tx_realurl_redirects DROP url_hash<br />ALTER TABLE tx_realurl_redirects ADD uid int(11) auto_increment PRIMARY KEY';\n\t\t\n\t\t$import = t3lib_div::_GP('update');\n\n\t\tif ($import == 'Update') {\n\t\t\t$result = $this->updateRedirectsTable();\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<p>Result: '.$result.'</p>';\n\t\t\t$content2 .= '<p>Done. Please accept the update suggestions of the extension manager now!</p>';\n\t\t} else {\n\t\t\t$content2 = '</form>';\n\t\t\t$content2 .= '<form action=\"'.htmlspecialchars(t3lib_div::linkThisScript()).'\" method=\"post\">';\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<input type=\"submit\" name=\"update\" value=\"Update\" />';\n\t\t\t$content2 .= '</form>';\n\t\t} \n\n\t\treturn $content.$content2;\n\t}", "public function logData() {\n\t\t/* Implement in subclasses */\n\t}", "function neolog($changes, $data = array()) {\n $toolkit = systemToolkit::getInstance();\n $neologMapper = $toolkit->getMapper('neolog', 'message');\n $err_content = \"\";\n\n if(count($data)) {\n if(count($data) == 2) {\n ob_start();\n $i = 1;\n foreach($data as $d) {\n var_dump($d);\n if($i < count($data)) {\n echo \"\\n\\nVS.\\n\\n\";\n }\n $i++;\n }\n $err_content = ob_get_contents();\n ob_end_clean();\n } else {\n ob_start();\n $i = 1;\n foreach($data as $d) {\n var_dump($d);\n if($i < count($data)) {\n echo \"\\n===\\n\";\n }\n $i++;\n }\n $err_content = ob_get_contents();\n ob_end_clean();\n }\n }\n\n $err_content = str_replace(\"\\n\", \"<br />\", str_replace(\"\\r\", \"\", str_replace(\"\\t\", \"&nbsp;&nbsp;&nbsp;&nbsp;\", str_replace(\" \", \"&nbsp;\", $err_content))));\n\n $neolog = $neologMapper->create();\n $neolog->setTime(new SQLFunction('UNIX_TIMESTAMP'));\n $neolog->setModule($toolkit->getRequest()->getModule());\n $neolog->setAction($toolkit->getRequest()->getAction());\n $neolog->setUserId($toolkit->getUser()->getId());\n $neolog->setUsername($toolkit->getUser()->getName());\n $neolog->setChanges($changes);\n $neolog->setExtendedInfo($err_content);\n $neologMapper->save($neolog);\n}", "public function testGetChangesData()\n {\n $change = new Change;\n try {\n $change->getChangesData();\n $this->assertFalse(true, \"Expected exception\");\n } catch (\\P4\\Spec\\Exception\\Exception $e) {\n $this->assertTrue(true);\n }\n\n $file = new File;\n $file->setFilespec(\"//depot/file\")\n ->add()\n ->setLocalContents(\"one\")\n ->submit(\"test\");\n\n $change = Change::fetch(1);\n $data = $change->getChangesData();\n\n $this->assertSame('1', $data['change']);\n $this->assertSame('tester', $data['user']);\n $this->assertSame('//depot/*', $data['path']);\n\n // ensure it doesn't take any more commands to get the change path\n // and original id -- we verify this by peeking at the log\n $original = Logger::hasLogger() ? Logger::getLogger() : null;\n $logger = new ZendLogger;\n $mock = new MockLog;\n $logger->addWriter($mock);\n Logger::setLogger($logger);\n\n $this->assertSame('//depot', $change->getPath());\n $this->assertSame(1, $change->getOriginalId());\n $this->assertSame(0, count($mock->events));\n\n // restore original logger if there is one.\n Logger::setLogger($original);\n }", "function getRecentChanges()\r\n\t{\r\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPage.php\");\r\n\t\t$changes = ilWikiPage::getRecentChanges(\"wpg\", $this->wiki_id);\r\n\t\t$this->setDefaultOrderField(\"date\");\r\n\t\t$this->setDefaultOrderDirection(\"desc\");\r\n\t\t$this->setData($changes);\r\n\t}", "public function run()\n {\n App\\Observercode::create([\n 'name' => '1-01',\n 'description' => 'Entra y sale con autorización del salón de clase.',\n ]);\n App\\Observercode::create([\n 'name' => '1-02',\n 'description' => 'Puntualidad en la asistencia al colegio, clases y actividades programadas.',\n ]);\n App\\Observercode::create([\n 'name' => '1-03',\n 'description' => 'Inasistencia al colegio con justificación.',\n ]);\n App\\Observercode::create([\n 'name' => '1-04',\n 'description' => 'Porta correctamente el uniforme.',\n ]);\n App\\Observercode::create([\n 'name' => '1-05',\n 'description' => 'Mantiene hábitos de higiene y aseo personal.',\n ]);\n App\\Observercode::create([\n 'name' => '1-06',\n 'description' => 'Mantiene orden, aseo y cuidados con el entorno.',\n ]);\n App\\Observercode::create([\n 'name' => '1-07',\n 'description' => 'Utiliza un vocabulario oral y escrito adecuado.',\n ]);\n App\\Observercode::create([\n 'name' => '1-08',\n 'description' => 'Manifiesta respeto por sí mismo y por el otro.',\n ]);\n App\\Observercode::create([\n 'name' => '1-09',\n 'description' => 'Respeta y hace respetar el buen nombre del colegio velando por su prestigio.',\n ]);\n App\\Observercode::create([\n 'name' => '1-10',\n 'description' => 'Muestra un comportamiento adecuado en el aula.',\n ]);\n App\\Observercode::create([\n 'name' => '1-11',\n 'description' => 'Permanece en sitios indicados de acuerdo a la actividad.',\n ]);\n App\\Observercode::create([\n 'name' => '1-12',\n 'description' => 'Cumple con tareas y actividades asignadas.',\n ]);\n App\\Observercode::create([\n 'name' => '1-13',\n 'description' => 'Respeta los principios de la doctrina Cristiana Católica y su práctica en el Colegio.',\n ]);\n App\\Observercode::create([\n 'name' => '1-14',\n 'description' => 'Respeta las instalaciones no masticando ni comiendo chicles.',\n ]);\n App\\Observercode::create([\n 'name' => '1-15',\n 'description' => 'Cuida su entorno no arrojando basura al piso.',\n ]);\n App\\Observercode::create([\n 'name' => '1-16',\n 'description' => 'Se abstiene de consumir alimento en sitios no indicados.',\n ]);\n App\\Observercode::create([\n 'name' => '1-17',\n 'description' => 'Acata las instrucciones e indicaciones de Docentes y Directivos.',\n ]);\n App\\Observercode::create([\n 'name' => '1-18',\n 'description' => 'Se presenta al colegio con los implementos indicados.',\n ]);\n App\\Observercode::create([\n 'name' => '1-19',\n 'description' => 'Se abstiene de traer materiales diferentes a los necesarios de clases.',\n ]);\n App\\Observercode::create([\n 'name' => '1-20',\n 'description' => 'Presenta las circulares firmadas por el acudiente.',\n ]);\n App\\Observercode::create([\n 'name' => '1-21',\n 'description' => 'Cumple con los turnos de aseo y acompañamiento.',\n ]);\n App\\Observercode::create([\n 'name' => '1-22',\n 'description' => 'Se abstiene de realizar actividades ajenas a su compromiso escolar.',\n ]);\n App\\Observercode::create([\n 'name' => '1-23',\n 'description' => 'Respeta y cumple con los protocolos para el uso de todas y cada una de las dependencias y espacios de formación.',\n ]);\n App\\Observercode::create([\n 'name' => '1-24',\n 'description' => 'Mantiene comportamientos adecuados con el uniforme dentro o fuera del plantel.',\n ]);\n App\\Observercode::create([\n 'name' => '1-25',\n 'description' => 'Porta diariamente la agenda escolar, el carnet, el cuaderno de procur y demás requerimientos para el desarrollo de la cátedra Cemista.',\n ]);\n App\\Observercode::create([\n 'name' => '1-26',\n 'description' => 'Se abstiene de cometer fraude.',\n ]);\n\n //Tipo 2\n App\\Observercode::create([\n 'name' => '2-01',\n 'description' => 'Agresión verbal o física a un compañero, directamente o a través de terceras personas.',\n ]);\n App\\Observercode::create([\n 'name' => '2-02',\n 'description' => 'Traer al Colegio o inducir la presencia de terceras personas, bandas o grupos juveniles, especialmente a las horas de ingreso,salida de clases o de cualquier actividad escolar, con el fin de agredir de palabra o de hecho a cualquier miembro de la institución.',\n ]);\n App\\Observercode::create([\n 'name' => '2-03',\n 'description' => 'Consumo o distribución de licor o cigarrillos dentro o fuera del colegio.',\n ]);\n App\\Observercode::create([\n 'name' => '2-04',\n 'description' => 'Apropiarse indebidamente de bienes ajenos.',\n ]);\n App\\Observercode::create([\n 'name' => '2-05',\n 'description' => 'Amenazas o agresión de palabra y/o hecho a las directivas del colegio, profesores, empleados o compañeros.',\n ]);\n App\\Observercode::create([\n 'name' => '2-06',\n 'description' => 'Practicar ritos satánicos, espiritismo, brujería, juegos (ouija) y otros actos que atenten contra la dignidad de la persona humana.',\n ]);\n App\\Observercode::create([\n 'name' => '2-07',\n 'description' => 'Incitar al desorden, a la anarquía y al caos por cualquier medio.',\n ]);\n App\\Observercode::create([\n 'name' => '2-08',\n 'description' => 'Realizar cualquier forma de acoso escolar o ciberacoso determinados como la conducta negativa, intencional metódica y sistemática de agresión, intimidación, humillación, ridiculización, difamación, coacción, aislamiento deliberado, amenaza o incitación a la violencia o cualquier forma de maltrato psicológico, verbal, físico o por medios electrónicos contra un miembro de la comunidad educativa.',\n ]);\n\n // Tipo 3\n App\\Observercode::create([\n 'name' => '3-01',\n 'description' => 'Presentarse al colegio o a una actividad del mismo en estado de embriaguez, o bajo efectos de sustancias psicoactivas.',\n ]);\n App\\Observercode::create([\n 'name' => '3-02',\n 'description' => 'Falsificar recibos de pago de pensión, firmas, sellos y cualquier tipo de documento que sirva de prueba o que se exhiba en el Colegio.',\n ]);\n App\\Observercode::create([\n 'name' => '3-03',\n 'description' => 'El hurto comprobado por parte del estudiante, directamente o en complicidad, dentro o fuera del Colegio.',\n ]);\n App\\Observercode::create([\n 'name' => '3-04',\n 'description' => 'Portar, consumir o distribuir bebidas embriagantes, estupefacientes o sustancias psicotrópicas o psicoactivas dentro o fuera del Colegio.',\n ]);\n App\\Observercode::create([\n 'name' => '3-05',\n 'description' => 'Porte o uso de armas, cualquiera que sea su clase o denominación, dentro o fuera del Colegio con o sin el uniforme.',\n ]);\n App\\Observercode::create([\n 'name' => '3-06',\n 'description' => 'Inducir e incitar a los compañeros o asumir conductas inmorales, pervertidas o que conlleven al acoso sexual.',\n ]);\n App\\Observercode::create([\n 'name' => '3-07',\n 'description' => 'Utilización de artículos detonantes, sustancias químicas o incendiarias que atenten contra la salud e integridad de las personas o a las instalaciones del Colegio.',\n ]);\n App\\Observercode::create([\n 'name' => '3-08',\n 'description' => 'Realizar acciones que se constituyan en presuntos delitos establecidos en la legislación penal colombiana.',\n ]);\n \n \n \n App\\Observercode::create([\n 'name' => '4-01',\n 'description' => '02 Suministra al estudiante los recursos necesarios y solicitados',\n ]);\n App\\Observercode::create([\n 'name' => '4-02',\n 'description' => '03 Cumple oportunamente con las obligaciones contractuales de matrícula',\n ]);\n App\\Observercode::create([\n 'name' => '4-03',\n 'description' => '04 Evidencia su identificación con el Horizonte Institucional y acompañamiento en la formación del estudiante: Asistencia, puntualidad, presentación de excusas, presentación personal del estudiante, etc..',\n ]);\n App\\Observercode::create([\n 'name' => '4-04',\n 'description' => 'SANCIÓN',\n ]);\n \n }", "public function main()\n {\n $this->processUpdates();\n return $this->generateOutput();\n }", "public function showChangelog()\n {\n $news_view = ee('Model')->get('MemberNewsView')\n ->filter('member_id', ee()->session->userdata('member_id'))\n ->first();\n\n if (! $news_view) {\n $news_view = ee('Model')->make(\n 'MemberNewsView',\n ['member_id' => ee()->session->userdata('member_id')]\n );\n }\n\n $news_view->version = APP_VER;\n $news_view->save();\n\n ee()->functions->redirect(\n ee()->cp->makeChangelogLinkForVersion(APP_VER)\n );\n }", "public function getChanges();", "public function getChanges();", "public function change()\n {\n $table = $this->table('tbl_branches');\n $table->addColumn('id', 'integer', [\n 'autoIncrement' => true,\n 'default' => null,\n 'limit' => 5,\n 'null' => false,\n ]);\n $table->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 120,\n 'null' => false,\n ]);\n $table->addColumn('description', 'text', [\n 'default' => null,\n 'null' => true,\n ]);\n $table->addColumn('college_id', 'integer', [\n 'default' => null,\n 'limit' => 5,\n 'null' => false,\n ]);\n $table->addColumn('start_date', 'string', [\n 'default' => null,\n 'limit' => 50,\n 'null' => false,\n ]);\n $table->addColumn('end_date', 'string', [\n 'default' => null,\n 'limit' => 50,\n 'null' => false,\n ]);\n $table->addColumn('total_seats', 'integer', [\n 'default' => null,\n 'limit' => 11,\n 'null' => false,\n ]);\n $table->addColumn('total_durations', 'integer', [\n 'default' => null,\n 'limit' => 5,\n 'null' => false,\n ]);\n $table->addColumn('status', 'integer', [\n 'default' => 1,\n 'limit' => 5,\n 'null' => false,\n ]);\n $table->addColumn('created_at', 'datetime', [\n 'default' => 'CURRENT_TIMESTAMP',\n 'null' => false,\n ]);\n $table->addPrimaryKey([\n 'id',\n ]);\n $table->create();\n }", "public function toLogEntry();", "function prepareModificationLog() {\n try {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n DB::execute(\"CREATE TABLE IF NOT EXISTS \" . TABLE_PREFIX . \"modification_logs (\n id bigint(20) unsigned NOT NULL auto_increment,\n type varchar(50) NOT NULL default 'ApplicationObjectModification',\n parent_type varchar(50) NOT NULL default '',\n parent_id int(11) unsigned NOT NULL default '0',\n created_on datetime default NULL,\n created_by_id int(10) unsigned NOT NULL default '0',\n created_by_name varchar(100) default NULL,\n created_by_email varchar(150) default NULL,\n is_first tinyint(1) NOT NULL default '0',\n PRIMARY KEY (id),\n KEY parent_type (parent_type,parent_id),\n KEY created_on (created_on)\n ) ENGINE=$engine DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE IF NOT EXISTS \" . TABLE_PREFIX . \"modification_log_values (\n modification_id bigint(20) unsigned NOT NULL default '0',\n field varchar(50) NOT NULL default '',\n value longtext,\n PRIMARY KEY (modification_id,field)\n ) ENGINE=$engine DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function fetchAllZf1Changelogs()\n {\n $filters = $this->xmlRpc->getFavouriteFilters($this->jiraAuth);\n \n $versions = array();\n foreach ($filters as $filter) {\n if (preg_match('/fix.*?(\\d+\\.\\d+\\.\\d+)/i', $filter['name'], $m)) {\n $versions[$m[1]] = $filter['id'];\n }\n }\n \n $issues = array();\n foreach ($versions as $version => $filterId) {\n $issues[$version] = $this->fetchZf1ChangelogByJiraFilter($version, $filterId);\n }\n \n $this->console->writeLine(\"Writing to {$this->zf1DataFile}\");\n $fileContent = \"<\" . \"?php\\n\\$tags = \" \n . var_export($issues, 1) \n . \";\\nreturn \\$tags;\";\n file_put_contents($this->zf1DataFile, $fileContent);\n \n $this->console->writeLine('[DONE]', Color::GREEN);\n }", "protected function buildTimestampFields(): void\n {\n //====================================================================//\n // Creation Date\n $this->fieldsFactory()->create(SPL_T_DATETIME)\n ->identifier(\"createdAt\")\n ->name(\"Created\")\n ->group(\"Meta\")\n ->microData(\"http://schema.org/DataFeedItem\", \"dateCreated\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Last Change Date\n $this->fieldsFactory()->create(SPL_T_DATETIME)\n ->identifier(\"updatedAt\")\n ->name(\"Updated\")\n ->group(\"Meta\")\n ->microData(\"http://schema.org/DataFeedItem\", \"dateModified\")\n ->isReadOnly()\n ;\n }", "function writeReadme() \n {\n $file = new CodeGen_Tools_Outbuf($this->dirpath.\"/README\");\n\n $title = $this->archivePrefix.\"-\".$this->name.\" \".$this->release->getVersion();\n\n echo \"$title\\n\";\n echo str_repeat(\"=\", strlen($title)).\"\\n\\n\";\n\n if (isset($this->summary)) {\n echo $this->summary.\"\\n\\n\";\n }\n\n if (isset($this->description)) {\n echo $this->description.\"\\n\\n\";\n }\n\n echo \"See the INSTALL file for installation instruction\\n\\n\";\n\n echo \"-- \\nThis UDF extension was created using CodeGen_Mysql_UDF \".self::version().\"\\n\\n\";\n\n echo \"http://codegenerators.php-baustelle.de/trac/wiki/CodeGen_MySQL_UDF\\N\";\n\n return $file->write();\n }", "function heartbeat_install() {\n global $wpdb;\n global $heartbeat_db_version;\n $table_name = $wpdb->prefix . 'heartbeattimelogger';\n $table_name_logs = $wpdb->prefix . 'heartbeattimelogger_logs';\n \n $charset_collate = $wpdb->get_charset_collate();\n\n $sql_log = \"CREATE TABLE $table_name_logs (\n id int NOT NULL AUTO_INCREMENT,\n userid int NOT NULL,\n ip_add VARCHAR(64) default '0.0.0.0',\n datetime DATETIME,\n PRIMARY KEY (id),\n KEY SEC (userid, datetime)\n ) $charset_collate;\";\n\n $sql = \"CREATE TABLE $table_name (\n id int NOT NULL AUTO_INCREMENT,\n userid int NOT NULL,\n minutes int default 0,\n pageid int NOT NULL,\n PRIMARY KEY (id),\n KEY SEC (userid, pageid)\n ) $charset_collate;\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta( $sql );\n dbDelta( $sql_log );\n\n add_option( 'heartbeattimelogger_db_version', $heartbeat_db_version );\n }", "public function ReportesData(){\n\t\t$this->status=\"1\";\n\t\t$this->created_at = \"NOW()\";\n\t}", "function procMenuAdminMakeXmlFile()\n\t{\n\t\t// Check input value\n\t\t$menu_srl = Context::get('menu_srl');\n\t\t// Get information of the menu\n\t\t$oMenuAdminModel = getAdminModel('menu');\n\t\t$menu_info = $oMenuAdminModel->getMenu($menu_srl);\n\t\t$menu_title = $menu_info->title;\n\t\t// Re-generate the xml file\n\t\t$xml_file = $this->makeXmlFile($menu_srl);\n\t\t// Set return value\n\t\t$this->add('menu_title',$menu_title);\n\t\t$this->add('xml_file',$xml_file);\n\t}", "private function make()\n {\n \n $file = database_path().'/migrations/'.$this->fileName.'.php';\n \n $content = $this->blueprint();\n \n $this->file_write( $file, $content );\n \n }", "public function run()\n {\n LogCategory::create([\n 'name' => 'API',\n 'description' => ''\n ]);\n\n LogCategory::create([\n 'name' => 'Admin',\n 'description' => ''\n ]);\n\n LogCategory::create([\n 'name' => 'Moderátor',\n 'description' => ''\n ]);\n\n LogCategory::create([\n 'name' => 'Felhasználó',\n 'description' => ''\n ]);\n\n LogCategory::create([\n 'name' => 'Riddle',\n 'description' => ''\n ]);\n }", "public function display_changelog(){\r\n if ($_REQUEST[\"plugin\"] != $this->_slug)\r\n return;\r\n $key = $this->get_key();\r\n $body = \"key=$key\";\r\n $options = array('method' => 'POST', 'timeout' => 3, 'body' => $body);\r\n $options['headers'] = array(\r\n 'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'),\r\n 'Content-Length' => strlen($body),\r\n 'User-Agent' => 'WordPress/' . get_bloginfo(\"version\"),\r\n 'Referer' => get_bloginfo(\"url\")\r\n );\r\n\r\n $raw_response = GFCommon::post_to_manager(\"changelog.php\", $this->get_remote_request_params($this->_slug, $key, $this->_version), $options);\r\n if ( is_wp_error( $raw_response ) || 200 != $raw_response['response']['code']){\r\n $page_text = sprintf(__(\"Oops!! Something went wrong.%sPlease try again or %scontact us%s.\", 'gravityforms'), \"<br/>\", \"<a href='http://www.gravityforms.com'>\", \"</a>\");\r\n }\r\n else{\r\n $page_text = $raw_response['body'];\r\n if(substr($page_text, 0, 10) != \"<!--GFM-->\")\r\n $page_text = \"\";\r\n }\r\n echo stripslashes($page_text);\r\n\r\n exit;\r\n }", "public function run()\n {\n $current_invoice_number = [\n 'DCB0008320',\n 'DCB0008322',\n 'DCB0008323',\n 'DCB0008324',\n 'DCB0008325',\n 'DCB0008326'\n ];\n\n $new_invoice_number = [\n 'DBA26390',\n 'DBA26391',\n 'DBA26392',\n 'DBA26393',\n 'DBA26394',\n 'DBA26395'\n ];\n\n for ($counter=0; $counter < count($current_invoice_number); $counter++) {\n if(ModelFactory::getInstance('TxnSalesOrderHeader')->where('salesman_code','=','C06')->where('invoice_number','=',$current_invoice_number[$counter])->count()){\n $sales_order_header = ModelFactory::getInstance('TxnSalesOrderHeader')->where('salesman_code','=','C06')->where('invoice_number','=',$current_invoice_number[$counter])->first();\n $sales_order_header_id = $sales_order_header->sales_order_header_id;\n ModelFactory::getInstance('TxnSalesOrderHeader')->where('sales_order_header_id','=',$sales_order_header_id)->update([\n 'invoice_number' => $new_invoice_number[$counter],\n 'updated_by' => 1\n ]);\n\n ModelFactory::getInstance('TableLog')->insert([\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n 'table' => 'txn_sales_order_header',\n 'column' => 'invoice_number',\n 'value' => $new_invoice_number[$counter],\n 'pk_id' => $sales_order_header_id,\n 'updated_by' => 1,\n 'before' => $current_invoice_number[$counter],\n 'comment' => 'wrong invoice number and inconsistent data upon migration',\n 'report_type' => 'Sales & Collection - Report'\n ]);\n }\n }\n }", "public function getLogData(){\n\t\treturn $this->getNewsletterTemplateId();\n\t}", "private function buildBuildHistory()\n {\n foreach ($this->xml->entry as $entry) {\n $infos = $this->extractBuildInfos((string) $entry->title);\n $uri = (string) $entry->link['href'];\n $date = (string) $entry->published;\n\n $build = new Build($infos['number'], $infos['status'], $uri, $date, $this->isBuildSuccessfull($infos['status']));\n\n $this->builds[] = $build;\n }\n }", "public function getCreationAudit();", "private function create_migration(){\n $file = $this->path('migrations') . date('Y_m_d_His') . '_create_slender_table.php';\n $this->write_file($file, static::$migrationCode);\n }", "public function table()\n {\n if (!$this->cfg['collect']) {\n return;\n }\n $args = \\func_get_args();\n $meta = $this->internal->getMetaVals(\n $args,\n array('channel' => $this->cfg['channelName'])\n );\n $event = $this->methodTable->onLog(new Event($this, array(\n 'method' => __FUNCTION__,\n 'args' => $args,\n 'meta' => $meta,\n )));\n $this->appendLog(\n $event['method'],\n $event['args'],\n $event['meta']\n );\n }", "protected function createMigrationFile()\n {\n $fieldObjects = $this->getFields();\n\n if (@$fieldObjects['id']) {\n unset($fieldObjects['id']);\n }\n\n if (@$fieldObjects['created_at'] && @$fieldObjects['updated_at']) {\n $this->addGenericCall((new Base())->timestamps());\n\n unset($fieldObjects['created_at'], $fieldObjects['updated_at']);\n } // if\n\n if (@$fieldObjects['deleted_at']) {\n $this->addGenericCall((new Base())->softDeletes());\n\n unset($fieldObjects['deleted_at']);\n } // if\n\n $schema = implode(', ', $fieldObjects);\n\n if (strpos($schema, 'enum') !== false) {\n $this->getCommand()->info(sprintf('Please change the enum field of table \"%s\" manually.',\n $this->getName()));\n }\n\n if ($this->isPivotTable()) {\n $tables = array_keys($this->getForeignKeys());\n\n Artisan::call(\n 'make:migration:pivot',\n [\n 'tableOne' => $tables[0],\n 'tableTwo' => $tables[1]\n ]\n );\n } else {\n Artisan::call(\n 'make:migration:schema',\n [\n 'name' => \"create_{$this->getName()}_table\",\n '--model' => $this->needsLaravelModel(),\n '--schema' => $fieldObjects ? $schema : ''\n ]\n );\n\n $migrationFiles = glob(\n database_path('migrations') . DIRECTORY_SEPARATOR . \"*_create_{$this->getName()}_table.php\"\n );\n }\n\n return @$migrationFiles ? end($migrationFiles) : '';\n }", "public function get_logs()\n {\n }", "public function createData()\n {\n // TODO: Implement createData() method.\n }", "public function definition()\n {\n $orgVersion = OrganisationVersion::factory()->create();\n $project = Programme::factory()->create(['organisation_id' => $orgVersion->organisation_id]);\n $when = $this->faker->dateTimeBetween('-2 months', 'now');\n\n return [\n 'uuid' => $this->faker->uuid,\n 'status' => $this->faker->randomElement(EditHistory::$statuses),//EditHistory::$statuses ),\n 'content' => json_encode(Programme::factory()->make(['organisation_id' => $orgVersion->organisation_id])),\n\n 'organisation_id' => $orgVersion->organisation_id,\n 'projectable_type' => 'App\\Models\\Programme',\n 'projectable_id' => $project->id,\n 'project_name' => $project->name,\n 'editable_id' => $project->id,\n 'editable_type' => 'App\\Models\\Programme',\n 'framework_id' => 1,\n 'created_by_user_id' => User::factory()->create()->id,\n 'created_at' => $when,\n 'updated_at' => $when,\n ];\n }", "public function run()\n {\n\t\tVersion::truncate();\n\n $Version \t\t\t\t\t\t= new Version;\n\n $Version['version_name']\t\t= 'kidzo';\n $Version['domain'] = 'kidzo.id';\n $Version['is_active']\t\t\t= true;\n $Version['admin'] = 'Admin';\n\n $Version->save();\n\n $Version \t\t\t\t\t\t= new Version;\n\n $Version['version_name']\t\t= 'sewa Mainan Anak';\n $Version['domain']\t\t\t\t= 'sewamainananak.com';\n $Version['is_active'] = true;\n $Version['admin'] = 'Admin Satunya';\n\n $Version->save(); \n }", "public function get_description() {\r\n\t\t$text = 'Change to ' . Cast::string($this->get_params());\r\n\t\t$transmods = array('app', 'status');\r\n\t\t$inst = $this->get_instance();\r\n \t\tif ($inst instanceof IDataObject) {\r\n \t\t\tarray_unshift($transmods, $inst->get_table_name());\r\n \t\t}\r\n\t\treturn tr(\r\n\t\t\t$text, \r\n\t\t\t$transmods\r\n\t\t);\t\r\n\t}", "public function index()\n {\n $changes = ChangeLog::with('user', 'loggable')->orderBy('created_at', 'desc');\n\n if (request()->has('filters')) {\n $filters = collect(request('filters'))->reject(function($v) { return !strlen($v); });\n\n if ($filters->has('model')) {\n $changes = $changes->where('model', $filters->get('model'));\n }\n\n if ($filters->has('created')) {\n $changes = $changes->where('created', $filters->get('created'));\n }\n\n if ($filters->has('start_at')) {\n $changes = $changes->whereDate('created_at', '>=', date($filters->get('start_at')));\n }\n\n if ($filters->has('end_at')) {\n $changes = $changes->whereDate('created_at', '<=', date($filters->get('end_at')));\n }\n }\n\n return $this->response->view('historiae::changes.index', [\n 'changes' => $changes->paginate(15),\n 'models' => ChangeLog::distinct('model')->get(['model'])->flatMap(function($change) {\n return [$change->getOriginal('model') => $change->model];\n })\n ]);\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $data = [];\n foreach (range( 1, 10 ) as $key => $value) {\n $data[] = [ 'name' => 'tag' . $faker->randomNumber(),\n 'hot'=>$faker->randomNumber(),\n 'create_at'=>\\Carbon\\Carbon::now()->toDateTimeString(),\n 'update_at'=>\\Carbon\\Carbon::now()->toDateTimeString()\n ];\n }\n }", "public function caseLogAction()\n {\n $applicationUuId = $this->getSymfonyRequest()->query->get('uuid');\n\n $application = $this\n ->getIrisAgentContext()\n ->getReferencingApplicationClient()\n ->getReferencingApplication(array(\n 'referencingApplicationUuId' => $applicationUuId,\n ))\n ;\n\n $entries = array();\n\n $activities = $this\n ->getIrisAgentContext()\n ->getActivityClient()\n ->getActivities(array(\n 'referencingApplicationUuId' => $applicationUuId,\n ))\n ;\n\n $notes = $this\n ->getIrisAgentContext()\n ->getNoteClient()\n ->getReferencingApplicationNotes(array(\n 'applicationUuId' => $applicationUuId,\n ))\n ;\n\n $i = 0;\n\n foreach ($activities as $activity) {\n $entries[sprintf('%s-activity-%d', date('U', strtotime($activity->getRecordedAt())), $i)] = array(\n 'content' => $activity->getNote(),\n 'recordedAt' => $activity->getRecordedAt(),\n 'type' => 'activity',\n );\n $i ++;\n }\n\n foreach ($notes as $note) {\n $entries[sprintf('%s-note-%d', date('U', strtotime($note->getRecordedAt())), $i)] = array(\n 'content' => $note->getNote(),\n 'recordedAt' => $note->getRecordedAt(),\n 'createdBy' => $note->getCreatedBy(),\n 'creatorType' => $note->getCreatorType(),\n 'type' => 'note',\n );\n $i ++;\n }\n\n $this->knatsort($entries);\n\n $this->renderTwigView('/iris-referencing/case-log.html.twig', array(\n 'application' => $application,\n 'entries' => $entries,\n ));\n }", "protected function generateSemVer()\n {\n $this->semver = $this->version;\n\n if ($this->pre_release) {\n $this->semver .= '-'.$this->pre_release;\n }\n\n if ($this->meta) {\n $this->semver .= '+'.$this->meta;\n }\n }", "public function getVersionRecord() {}", "public abstract function getNewMonitoringData();", "public function generateAction()\n {\n $logger = $this->get('activity_log');\n $logger->log('test the service.');\n \n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('LOCKSSOMaticLoggingBundle:LogEntry')\n ->findOneBy(array(), array('id' => 'DESC'), 1);\n \n return $this->render('LOCKSSOMaticLoggingBundle:LogEntry:show.html.twig',\n array(\n 'entity' => $entity,\n ));\n }", "private function createControllerData() : void\n {\n //Get the current url.\n $url = current_url();\n\n //Only get the part that interests us (CalculIP/Path/OtherPath..)\n $menu_path = substr($url, strpos($url, 'CalculIP'));\n\n //If the path ends with a / like for the index, remove it.\n if ($menu_path[strlen($menu_path) - 1] === '/') {\n $menu_path = substr($menu_path, 0, -1);\n }\n\n //Split the path into an array to create our link.\n $path_array = explode('/', $menu_path);\n\n //This array is only used for the menu.\n $menu_data = [\n \"path_array\" => $path_array,\n \"title\" => $this->controller_data[self::DATA_TITLE]\n ];\n\n //If the user is connected then append the right information to the menu view.\n if (isset($_SESSION[\"connect\"])) {\n $menu_data[\"user_name\"] = $this->session->get(\"phpCAS\")['attributes']['displayName'];\n $menu_data[\"user_id\"] = $this->session->get(\"connect\");\n }\n\n //Build the data for all controllers.\n $this->controller_data = [\n self::DATA_TITLE => \"Please set the title in the right controller\",\n \"menu_view\" => view('Templates/menu', $menu_data),\n ];\n }", "public function publishDocs()\n {\n if (strpos(\\Codeception\\Codecept::VERSION, self::STABLE_BRANCH) !== 0) {\n $this->say(\"The \".\\Codeception\\Codecept::VERSION.\" is not in release branch. Site is not build\");\n return;\n }\n $this->say('building site...');\n\n $this->cloneSite();\n $this->taskCleanDir('docs')\n ->run();\n $this->taskFileSystemStack()\n ->mkdir('docs/reference')\n ->mkdir('docs/modules')\n ->run();\n\n chdir('../..');\n\n $this->taskWriteToFile('package/site/changelog.markdown')\n ->line('---')\n ->line('layout: page')\n ->line('title: Codeception Changelog')\n ->line('---')\n ->line('')\n ->line(\n '<div class=\"alert alert-warning\">Download specific version at <a href=\"/builds\">builds page</a></div>'\n )\n ->line('')\n ->line('# Changelog')\n ->line('')\n ->line($this->processChangelog())\n ->run();\n\n $docs = Finder::create()->files('*.md')->sortByName()->in('docs');\n\n $modules = [];\n $api = [];\n $reference = [];\n foreach ($docs as $doc) {\n $newfile = $doc->getFilename();\n $name = substr($doc->getBasename(), 0, -3);\n $contents = $doc->getContents();\n if (strpos($doc->getPathname(), 'docs'.DIRECTORY_SEPARATOR.'modules') !== false) {\n $newfile = 'docs/modules/' . $newfile;\n $modules[$name] = '/docs/modules/' . $doc->getBasename();\n $contents = str_replace('## ', '### ', $contents);\n $buttons = [\n 'source' => self::REPO_BLOB_URL.\"/\".self::STABLE_BRANCH.\"/src/Codeception/Module/$name.php\"\n ];\n // building version switcher\n foreach (['master', '2.2', '2.1', '2.0', '1.8'] as $branch) {\n $buttons[$branch] = self::REPO_BLOB_URL.\"/$branch/docs/modules/$name.md\";\n }\n $buttonHtml = \"\\n\\n\".'<div class=\"btn-group\" role=\"group\" style=\"float: right\" aria-label=\"...\">';\n foreach ($buttons as $link => $url) {\n if ($link == self::STABLE_BRANCH) {\n $link = \"<strong>$link</strong>\";\n }\n $buttonHtml.= '<a class=\"btn btn-default\" href=\"'.$url.'\">'.$link.'</a>';\n }\n $buttonHtml .= '</div>'.\"\\n\\n\";\n $contents = $buttonHtml . $contents;\n } elseif (strpos($doc->getPathname(), 'docs'.DIRECTORY_SEPARATOR.'reference') !== false) {\n $newfile = 'docs/reference/' . $newfile;\n $reference[$name] = '/docs/reference/' . $doc->getBasename();\n } else {\n $newfile = 'docs/'.$newfile;\n $api[substr($name, 3)] = '/docs/'.$doc->getBasename();\n }\n\n copy($doc->getPathname(), 'package/site/' . $newfile);\n\n $highlight_languages = implode('|', ['php', 'html', 'bash', 'yaml', 'json', 'xml', 'sql']);\n $contents = preg_replace(\n \"~```\\s?($highlight_languages)\\b(.*?)```~ms\",\n \"{% highlight $1 %}\\n$2\\n{% endhighlight %}\",\n $contents\n );\n $contents = str_replace('{% highlight %}', '{% highlight yaml %}', $contents);\n $contents = preg_replace(\"~```\\s?(.*?)```~ms\", \"{% highlight yaml %}\\n$1\\n{% endhighlight %}\", $contents);\n // set default language in order not to leave unparsed code inside '```'\n\n $matches = [];\n $title = $name;\n $contents = \"---\\nlayout: doc\\ntitle: \".($title!=\"\" ? $title.\" - \" : \"\")\n .\"Codeception - Documentation\\n---\\n\\n\".$contents;\n\n file_put_contents('package/site/' .$newfile, $contents);\n }\n chdir('package/site');\n $guides = array_keys($api);\n foreach ($api as $name => $url) {\n $filename = substr($url, 6);\n $doc = file_get_contents('docs/'.$filename).\"\\n\\n\\n\";\n $i = array_search($name, $guides);\n if (isset($guides[$i+1])) {\n $next_title = $guides[$i+1];\n $next_url = $api[$guides[$i+1]];\n $next_url = substr($next_url, 0, -3);\n $doc .= \"\\n* **Next Chapter: [$next_title >]($next_url)**\";\n }\n\n if (isset($guides[$i-1])) {\n $prev_title = $guides[$i-1];\n $prev_url = $api[$guides[$i-1]];\n $prev_url = substr($prev_url, 0, -3);\n $doc .= \"\\n* **Previous Chapter: [< $prev_title]($prev_url)**\";\n }\n\n $this->taskWriteToFile('docs/'.$filename)\n ->text($doc)\n ->run();\n }\n\n\n $guides_list = '';\n foreach ($api as $name => $url) {\n $url = substr($url, 0, -3);\n $name = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\\\1 \\\\2', $name);\n $name = preg_replace('/([a-z\\d])([A-Z])/', '\\\\1 \\\\2', $name);\n $guides_list .= '<li><a href=\"'.$url.'\">'.$name.'</a></li>';\n }\n file_put_contents('_includes/guides.html', $guides_list);\n\n $this->say(\"Building Guides index\");\n $this->taskWriteToFile('_includes/guides.html')\n ->text($guides_list)\n ->run();\n\n $this->taskWriteToFile('docs/index.html')\n ->line('---')\n ->line('layout: doc')\n ->line('title: Codeception Documentation')\n ->line('---')\n ->line('')\n ->line(\"<h1>Codeception Documentation Guides</h1>\")\n ->line('')\n ->text($guides_list)\n ->run();\n\n /**\n * Align modules in two columns like this:\n * A D\n * B E\n * C\n */\n $modules_cols = 2;\n $modules_rows = ceil(count($modules) / $modules_cols);\n $module_names_chunked = array_chunk(array_keys($modules), $modules_rows);\n $modules_list = '';\n for ($i = 0; $i < $modules_rows; $i++) {\n for ($j = 0; $j < $modules_cols; $j++) {\n if (isset($module_names_chunked[$j][$i])) {\n $name = $module_names_chunked[$j][$i];\n $url = substr($modules[$name], 0, -3);\n $modules_list .= '<li><a href=\"'.$url.'\">'.$name.'</a></li>';\n }\n }\n }\n file_put_contents('_includes/modules.html', $modules_list);\n\n $reference_list = '';\n foreach ($reference as $name => $url) {\n if ($name == 'Commands') {\n continue;\n }\n if ($name == 'Configuration') {\n continue;\n }\n\n $url = substr($url, 0, -3);\n $reference_list .= '<li><a href=\"'.$url.'\">'.$name.'</a></li>';\n }\n file_put_contents('_includes/reference.html', $reference_list);\n\n $this->say(\"Writing extensions docs\");\n $this->taskWriteToFile('_includes/extensions.md')\n ->textFromFile(__DIR__.'/ext/README.md')\n ->run();\n\n $this->publishSite();\n $this->taskExec('git add')->args('.')->run();\n }", "public function getLogTable() {}", "public static function bootHistoryTrait() {\n// parent::boot();\n\n foreach (static::getRecordActivityEvents() as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n try {\n $modelRevisionObj = self::getRevisionObject($model);\n \n $diff = static::getDiff($model);\n\n if (!$diff['before'] && !$diff['after']) {\n return true;\n }\n\n $relations = $model->getRelations();\n \n foreach ($diff['before'] as $key => $value) {\n\n if (static::isRelated($key)) {\n $relatedModel = static::getRelatedModel($model, $key);\n \n //check related model need to be logged\n if(!$relatedModel)\n continue;\n \n //load related model and get old value\n $relatedModelObj = new $relatedModel;\n $relModel = $relatedModelObj::find($value);\n\n $relations = static::getRelatedModelRelations($model, $key);\n\n $modelBefore = $relModel->load($relations);\n\n //get new value\n $relModel = $relatedModelObj::find($diff['after'][$key]);\n $modelAfter = $relModel->load($relations);\n\n $accessColumnValue = static::getRelatedModelColumn($model, $key);\n\n $row['old_value'] = array_get($modelBefore->toArray(), $accessColumnValue);\n $row['new_value'] = array_get($modelAfter->toArray(), $accessColumnValue);\n } else {\n $row['old_value'] = $value;\n $row['new_value'] = $diff['after'][$key];\n }\n\n $mutator = 'get' . studly_case($key) . 'Attribute';\n \n if (method_exists($model, $mutator)) {\n $key = $model->$mutator($key);\n }\n \n $row['column'] = $key;\n\n $foreign_key = $model->foreign_key;\n// \n// //set history relation col to appropriate value\n $row['revisionable_id'] = $model->$foreign_key;\n $row['user_id'] = \\Auth::user()->id;\n\n $modelRevisionObj::create($row);\n }\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n });\n \n return true;\n }\n }", "public function change()\r\n {\r\n $table = $this->table('financialv2');\r\n $table->addColumn('output_template', 'string', ['after'=>'csvbody'])\r\n ->addColumn('graph1', 'string', ['after'=>'output_template'])\r\n ->addColumn('graph2', 'string', ['after'=>'graph1'])\r\n ->addColumn('graph1_data', 'text', ['after'=>'graph2','limit'=>MysqlAdapter::TEXT_LONG,'null'=>true])\r\n ->addColumn('graph2_data', 'text', ['after'=>'graph1_data','limit'=>MysqlAdapter::TEXT_LONG,'null'=>true])\r\n ->addColumn('table1', 'string', ['after'=>'graph2'])\r\n ->addColumn('table2', 'string', ['after'=>'table1'])\r\n ->update();\r\n }", "public function GenerateStructure() {\n // WRITE CONSTRUCTOR\n $this->writeLine(\n sprintf(\n '$return = new pdoMap_Dao_Metadata_Table(\n \\'%1$s\\',\\'%2$s\\',\\'%3$s\\',\n \\'%4$s\\',\\'%5$s\\',\\'%6$s\\');',\n $this->name, // adapter name\n $this->getTableName(), // table name\n $this->entity->getClassName(), // entity class name\n $this->getInterface(), // interface service name\n $this->getAdapterClassName(), // adapter class name (if set)\n $this->getUse() // database connection\n )\n );\n // WRITE PROPERTIES\n $this->entity->GenerateProperties(); \n $this->writeLine('return $return;');\n }", "function create_run_log() {\n\n\t\t$this->log = new Log();\n\t\t$this->log->set_workflow_id( $this->get_id() );\n\t\t$this->log->set_date( new DateTime() );\n\n\t\tif ( $this->is_tracking_enabled() ) {\n\t\t\t$this->log->set_tracking_enabled( true );\n\n\t\t\tif ( $this->is_conversion_tracking_enabled() ) {\n\t\t\t\t$this->log->set_conversion_tracking_enabled( true );\n\t\t\t}\n\t\t}\n\n\t\t$this->log->save();\n\t\t$this->log->store_data_layer( $this->data_layer() );\n\n\t\tdo_action( 'automatewoo_create_run_log', $this->log, $this );\n\t}", "public function getAllRevisions()\n {\n // Retrieves username associated with an id. \n $this->ui_ids = array();\n\n /**\n * Retrieves list of previous versions of data dictionary.\n */\n $pid = $_GET[\"pid\"];\n $previous_versions = array();\n $sql = \"select p.pr_id, p.ts_approved, p.ui_id_requester, p.ui_id_approver,\n if(l.description = 'Approve production project modifications (automatic)',1,0) as automatic\n from redcap_metadata_prod_revisions p left join redcap_log_event l\n on p.project_id = l.project_id and p.ts_approved*1 = l.ts\n where p.project_id = $pid and p.ts_approved is not null order by p.pr_id\";\n\n if ($result = $this->query($sql))\n {\n // Cycle through results\n $rev_num = 0;\n $num_rows = $result->num_rows;\n while ($row = $result->fetch_object())\n {\n if ($rev_num == 0)\n {\n $previous_versions[] = array(\n \"id\" => $row->pr_id,\n \"label\" => \"Moved to Production\",\n \"requester\" => $this->getUsernameFirstLast($row->ui_id_requester),\n \"approver\" => $this->getUsernameFirstLast($row->ui_id_approver),\n \"automatic_approval\" => $row->automatic,\n \"ts_approved\" => $row->ts_approved,\n );\n }\n else\n {\n $previous_versions[] = array(\n \"id\" => $row->pr_id,\n \"label\" => \"Production Revision #$rev_num\",\n \"requester\" => $this->getUsernameFirstLast($row->ui_id_requester),\n \"approver\" => $this->getUsernameFirstLast($row->ui_id_approver),\n \"automatic_approval\" => $row->automatic,\n \"ts_approved\" => $row->ts_approved\n );\n }\n\n if ($rev_num == $num_rows - 1)\n {\n // Current revision will be mapped to timestamp and approver of last row\n $current_revision_ts_approved = $row->ts_approved;\n $current_revision_approver = $this->getUsernameFirstLast($row->ui_id_approver);\n $current_revision_requester = $this->getUsernameFirstLast($row->ui_id_requester);\n $current_revision_automatic = $row->automatic;\n }\n\n $rev_num++;\n }\n\n $result->close();\n \n // Sort by most recent version.\n $previous_versions = array_reverse($previous_versions);\n }\n\n // Shift timestamps, approvers, requesters, and automatic approval down by one,\n // as the correct info for each one is when the previous version was archived. \n $last_key = null;\n foreach($previous_versions as $key => $version)\n {\n if ($last_key !== null)\n {\n $previous_versions[$last_key][\"ts_approved\"] = $previous_versions[$key][\"ts_approved\"];\n $previous_versions[$last_key][\"requester\"] = $previous_versions[$key][\"requester\"];\n $previous_versions[$last_key][\"approver\"] = $previous_versions[$key][\"approver\"];\n $previous_versions[$last_key][\"automatic_approval\"] = $previous_versions[$key][\"automatic_approval\"];\n }\n $last_key = $key;\n }\n\n // Get correct production timestamp,\n // and the person who moved it to production\n if (!empty($previous_versions))\n {\n // Get correct production timestamp\n $sql = \"select production_time from redcap_projects where project_id = $pid\";\n if ($result = $this->query($sql))\n {\n while ($row = $result->fetch_object()){\n $timestamp = $row->production_time;\n $previous_versions[sizeof($previous_versions)-1][\"ts_approved\"] = $timestamp;\n }\n $result->close();\n }\n\n if (!empty($timestamp))\n {\n // Retrieve person who moved to production, as it's stored separately. \n $sql = \"select u.ui_id from redcap_user_information u, redcap_log_event l\n where u.username = l.user and l.description = 'Move project to production status' and l.project_id = $pid \n and l.ts = '\" . str_replace(array(' ',':','-'), array('','',''), $timestamp) . \"' order by log_event_id desc limit 1\";\n\n if ($result = $this->query($sql))\n {\n while ($row = $result->fetch_object()){\n $previous_versions[sizeof($previous_versions)-1][\"approver\"] = $this->getUsernameFirstLast($row->ui_id);\n }\n $result->close();\n }\n }\n }\n\n // Add current revision\n if (isset($current_revision_approver) && \n isset($current_revision_ts_approved) && \n isset($current_revision_automatic) && \n isset($current_revision_requester))\n {\n array_unshift($previous_versions, array(\n \"id\" => \"current\",\n \"label\" => \"Production Revision #$rev_num <b>(Current Revision)</b>\",\n \"requester\" => $current_revision_requester,\n \"approver\" => $current_revision_approver,\n \"automatic_approval\" => $current_revision_automatic,\n \"ts_approved\" => $current_revision_ts_approved\n ));\n }\n\n return $previous_versions;\n }", "function source_handle_on_daily() {\n \n require_once(ANGIE_PATH.'/classes/xml/xml2array.php');\n \n $results = 'Repositories updated: ';\n \n $repositories = Repositories::findByUpdateType(REPOSITORY_UPDATE_DAILY);\n foreach ($repositories as $repository) {\n // don't update projects other than active ones\n $project = Projects::findById($repository->getProjectId());\n if ($project->getStatus() !== PROJECT_STATUS_ACTIVE) {\n continue;\n } // if\n \n $repository->loadEngine();\n $repository_engine = new RepositoryEngine($repository, true);\n \n $last_commit = $repository->getLastCommit();\n $revision_to = is_null($last_commit) ? 1 : $last_commit->getRevision();\n \n $logs = $repository_engine->getLogs($revision_to);\n \n if (!$repository_engine->has_errors) {\n $repository->update($logs['data']);\n $total_commits = $logs['total'];\n \n $results .= $repository->getName().' ('.$total_commits.' new commits); ';\n \n if ($total_commits > 0) {\n $repository->sendToSubscribers($total_commits, $repository_engine);\n $repository->createActivityLog($total_commits);\n } // if\n } // if\n \n } // foreach\n \n return is_foreachable($repositories) && count($repositories) > 0 ? $results : 'No repositories for daily update';\n }", "protected function getLogEntries() {}", "function generateCreateTableSQL($targetDB = 'MySQL', $makeLogTable = true)\n{\n if (!$makeLogTable){\n //create the main table statement\n $SQL = $this->_generateBasicCreateTable(\n $targetDB,\n $this->ModuleID,\n $this->ModuleFields,\n $this->PKFields,\n $this->Indexes\n );\n\n } else { //make changes from basic structure for audit trail table\n //table name for the log table is Module ID + \"_l\"\n $logTableName = $this->ModuleID . '_l';\n\n //copy module table fields to a local array\n $logTableFields = $this->ModuleFields;\n\n //copy primary key fields to a local array\n $logPKfields = $this->PKFields;\n\n //copy indexes to a local array\n $logIndexes = $this->Indexes;\n\n //remove 'auto_increment' from any primary key field\n foreach($logPKfields as $value){\n $logTableFields[$value]->dbFlags =\n str_replace('auto_increment', '',\n $logTableFields[$value]->dbFlags\n );\n }\n\n //prepend a special recordID to the beginning of the array\n $logPKfield = MakeObject(\n $this->ModuleID,\n '_RecordID',\n 'TableField',\n array(\n 'name' => '_RecordID',\n 'type' => 'int',\n 'dbFlags' => 'unsigned not null auto_increment',\n 'phrase' => 'LogID'\n )\n );\n\n array_unshift($logTableFields, $logPKfield);\n\n //also prepend it to the primary key list\n array_unshift($logPKfields, '_RecordID');\n\n //build the CREATE TABLE statement\n $SQL = $this->_generateBasicCreateTable(\n $targetDB,\n $logTableName,\n $logTableFields,\n $logPKfields,\n $logIndexes\n );\n\n //dispose of the log table array\n unset($logTableFields);\n }\n return $SQL;\n}", "public function organizeData()\n {\n $this->data = [\n \"thing2\" => ['value'=>'申请通过'],\n \"date1\" => ['value'=>date(\"Y-m-d H:i:s\",time())],\n ];\n }", "protected function generate()\n {\n // first of all we will get the version, so we will later know about changes made DURING indexing\n $this->version = $this->findVersion();\n\n // get the iterator over our project files and create a regex iterator to filter what we got\n $recursiveIterator = $this->getProjectIterator();\n $regexIterator = new \\RegexIterator($recursiveIterator, '/^.+\\.php$/i', \\RecursiveRegexIterator::GET_MATCH);\n\n // get the list of enforced files\n $enforcedFiles= $this->getEnforcedFiles();\n\n // if we got namespaces which are omitted from enforcement we have to mark them as such\n $omittedNamespaces = array();\n if ($this->config->hasValue('enforcement/omit')) {\n $omittedNamespaces = $this->config->getValue('enforcement/omit');\n }\n\n // iterator over our project files and add array based structure representations\n foreach ($regexIterator as $file) {\n // get the identifiers if any.\n $identifier = $this->findIdentifier($file[0]);\n\n // if we got an identifier we can build up a new map entry\n if ($identifier !== false) {\n // We need to get our array of needles\n $needles = array(\n Invariant::ANNOTATION,\n Ensures::ANNOTATION,\n Requires::ANNOTATION,\n After::ANNOTATION,\n AfterReturning::ANNOTATION,\n AfterThrowing::ANNOTATION,\n Around::ANNOTATION,\n Before::ANNOTATION,\n Introduce::ANNOTATION,\n Pointcut::ANNOTATION\n );\n\n // If we have to enforce things like @param or @returns, we have to be more sensitive\n if ($this->config->getValue('enforcement/enforce-default-type-safety') === true) {\n $needles[] = '@var';\n $needles[] = '@param';\n $needles[] = '@return';\n }\n\n // check if the file has contracts and if it should be enforced\n $hasAnnotations = $this->findAnnotations($file[0], $needles);\n\n // create the entry\n $this->map[$identifier[1]] = array(\n 'cTime' => filectime($file[0]),\n 'identifier' => $identifier[1],\n 'path' => $file[0],\n 'type' => $identifier[0],\n 'hasAnnotations' => $hasAnnotations,\n 'enforced' => $this->isFileEnforced(\n $file[0],\n $identifier[1],\n $hasAnnotations,\n $enforcedFiles,\n $omittedNamespaces\n )\n );\n }\n }\n\n // save for later reuse.\n $this->save();\n }", "public function generateArray()\r\n\t{\t\r\n\t\t$data = array('logID'=>$this->logID,'text'=>$this->Text,'timestamp'=>$this->timestamp, 'textid'=>$this->textID);\r\n\t\tif($this->user!=null)\r\n\t\t\t$data['user'] = $this->user->generateArray();\r\n\t\tif($this->building!=null)\r\n\t\t\t$data['building'] = $this->building->generateArray('normal');\r\n\t\tif($this->card!=null)\r\n\t\t\t$data['card']=$this->card->generateArray();\r\n\t\tif($this->location!=null)\r\n\t\t\t$data['location']=$this->location->generateArray();\r\n\t\tif($this->icon!=null)\r\n\t\t\t$data['icon']=$this->icon;\r\n\t\tif($this->game!=null)\r\n\t\t\t$data['game']=$this->game;\r\n\t\treturn $data;\r\n\t\r\n\t}", "public function actionGeneratorall() {\n //$sql = \"select hoscode from chospital_amp where already = 1\";\n $sql = \"select hoscode from chospital_amp where already = 1\";\n $hosData = $this->query_all_db2($sql);\n\n //find cumulative table from mas_mapp_main table with comment value 2\n $sql = \"select * from mas_mapp_main\";\n $cuTable = $this->query_all_db2($sql);\n\n foreach ($cuTable as $cData) {\n $table = $cData['MAIN_TABLE'];\n $sql = \"truncate $table\";\n $this->exec_sql($sql, 2);\n }\n\n foreach ($hosData as $hData) {\n $db_name = 'jhcisdb_' . $hData['hoscode'];\n $db = 'db' . $hData['hoscode'];\n \n $sql = \"call create_f43_table()\";\n $this->exec_sql_db($sql, $db);\n \n foreach ($cuTable as $cData) {\n $table = $cData['MAIN_TABLE'];\n $DATE_START = $cData['DATESTART'];\n $DATE_END = $cData['DATEEND'];\n $mapp_sql = trim($cData['MAPP_QUERY']);\n\n if ($table == 'f43_dental') {\n $sql = \"call cal_table_dental_tmp('$table')\";\n $this->exec_sql_db($sql, $db);\n }else if($table == 'f43_appointment'){\n $sql = \"call cal_table_appointment_tmp('$table')\";\n $this->exec_sql_db($sql, $db);\n }else {\n //generate data from jhcis version to f43 version\n $sql = \"call cal_table_tmp_newver1(\\\"\" . $table . \"\\\",\\\"(\" . $mapp_sql . \")\\\",\\\"\" . $DATE_START . \"\\\",\\\"\" . $DATE_END . \"\\\")\";\n $this->exec_sql_db($sql, $db);\n }\n\n //insert f43 from jhcis database to 43f_generate database\n $sql = \"call replace_into_table('$db_name','$table')\";\n $this->exec_sql($sql, 2);\n\n //drop f43 table in jhcis database\n //$sql = \"call cal_table_tmp_drop('$table','$db_name')\";\n //$this->exec_sql($sql, 2);\n }\n }\n\n return 'All';\n }", "public function renderChangesTable($revision_one, $revision_two)\n {\n $this->setMetadataVariables($revision_one, $revision_two);\n $details = $this->getDetails();\n $headers = array_keys(current($this->latest_metadata));\n ?>\n <div class=\"row\">\n <div class=\"col-sm-12 col-md-3\" style=\"margin-bottom:20px\">\n <u><b>Details regarding changes between versions</b></u>\n <?php\n if (!empty($details))\n {\n print \"<ul>\";\n print \"<li style='color: green'>Fields added: \" . $details[\"num_fields_added\"] . \"</li>\";\n print \"<li style='color: red'>Fields deleted: \" . $details[\"num_fields_deleted\"] . \"</li>\";\n print \"<li>Fields modified: \" . $details[\"num_fields_modified\"] . \"</li>\";\n print \"<li>Total fields <b>BEFORE</b> changes: \" . $details[\"total_fields_before\"] . \"</li>\";\n print \"<li>Total fields <b>AFTER</b> changes: \" . $details[\"total_fields_after\"] . \"</li>\";\n print \"</ul>\";\n }\n ?>\n </div>\n <div class=\"col-sm-12 col-md-3\" style=\"margin-bottom:20px\">\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"1\">\n <tbody>\n <tr>\n <td style=\"padding: 5px; text-align: left; background-color: black !important; color: white !important; font-weight: bold;\">\n KEY for Comparison Table below\n </td>\n </tr>\n <tr>\n <td style=\"padding: 5px; text-align: left;\">\n White cell = no change\n </td>\n </tr>\n <tr>\n <td style=\"padding: 5px; text-align: left; background-color: #FFFF80 !important;\">\n Yellow cell = field changed (Black text = current value, <font color=\"#909090\">Gray text = old value</font>)\n </td>\n </tr>\n <tr>\n <td style=\"padding: 5px; text-align: left; background-color: #7BED7B !important;\">\n Green cell = new project field\n </td>\n </tr>\n <tr>\n <td style=\"padding: 5px; text-align: left; background-color: #FE5A5A !important;\">\n Red cell = deleted project field\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div>\n <?php if (empty($this->metadata_changes)) :?>\n <h4>Table of Changes</h4>\n <p>The data dictionaries are identical</p>\n <?php else: ?>\n <form action=\"<?php print $this->getUrl(\"DownloadTable.php\"); ?>\" method=\"post\">\n <h4>Table of Changes <button class=\"btn btn-link\" type=\"submit\" data-toggle=\"tooltip\" title=\"There are two new columns in the CSV: changed_fields (which contains a short list of all changes made in a field), and change_details (which stores the old values for the field, while new values are contained in the associated column). These columns may be hard to see when using Excel. If so, please wrap your text.\">Download</button></h4>\n <input name=\"revision_one\" type=\"hidden\" value=\"<?php print $revision_one;?>\"></input><input name=\"revision_two\" type=\"hidden\" value=\"<?php print $revision_two;?>\"></input>\n </form>\n <table>\n <thead>\n <tr>\n <?php foreach($headers as $header) { print \"<th><b>$header</b></th>\"; } ?>\n </tr>\n </thead>\n <?php \n foreach($this->metadata_changes as $field => $metadata) {\n $html = \"\";\n\n if (is_null($this->furthest_metadata[$field])) // New field\n {\n $html .= \"<tr style='background-color:#7BED7B'>\";\n }\n else if (is_null($this->latest_metadata[$field])) // Deleted field\n {\n $html .= \"<tr style='background-color:#FE5A5A'>\";\n }\n else\n {\n $html =\"<tr>\";\n }\n\n foreach($metadata as $key => $attr)\n {\n $attr = strip_tags($attr);\n if (is_null($this->furthest_metadata[$field]) || is_null($this->latest_metadata[$field]))\n { \n $html .= \"<td>\" . ($attr ? $attr : \"n/a\") . \"</td>\";\n }\n else // Modified field\n {\n $old_value = strip_tags($this->furthest_metadata[$field][$key]);\n if ($attr != $old_value)\n {\n $html .= \"<td style='background-color:#FFFF80'><p>\" . ($attr ? $attr : \"(no value)\") . \"</p><p style='color:#aaa'>\" . ($old_value ? $old_value : \"(no value)\"). \"<p></td>\";\n }\n else\n {\n $html .= \"<td name='row[]'>\" . ($attr ? $attr : \"n/a\") . \"</td>\";\n }\n }\n }\n\n $html .= \"</tr>\";\n print $html;\n }\n ?>\n </table>\n <?php endif?>\n </div>\n <?php\n }", "public function generate()\n\t{\n\t\t$this->import('Database');\n\n\t\t$arrButtons = array('copy', 'up', 'down', 'delete');\n\t\t$strCommand = 'cmd_' . $this->strField;\n\n\t\t// Change the order\n\t\tif ($this->Input->get($strCommand) && is_numeric($this->Input->get('cid')) && $this->Input->get('id') == $this->currentRecord)\n\t\t{\n\t\t\tswitch ($this->Input->get($strCommand))\n\t\t\t{\n\t\t\t\tcase 'copy':\n\t\t\t\t\t$this->varValue = array_duplicate($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'up':\n\t\t\t\t\t$this->varValue = array_move_up($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'down':\n\t\t\t\t\t$this->varValue = array_move_down($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'delete':\n\t\t\t\t\t$this->varValue = array_delete($this->varValue, $this->Input->get('cid'));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Get all modules from DB\n\t\t$objModules = $this->Database->execute(\"SELECT id, name FROM tl_module ORDER BY name\");\n\t\t$modules = array();\n\n\t\tif ($objModules->numRows)\n\t\t{\n\t\t\t$modules = array_merge($modules, $objModules->fetchAllAssoc());\n\t\t}\n\n\t\t$objRow = $this->Database->prepare(\"SELECT * FROM \" . $this->strTable . \" WHERE id=?\")\n\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t ->execute($this->currentRecord);\n\n\t\t// Columns\n\t\tif ($objRow->numRows)\n\t\t{\n\t\t\t$cols = array();\n\t\t\t$count = count(explode('x',$objRow->sc_type));\n\n\t\t\tswitch ($count)\n\t\t\t{\n\t\t\t\tcase '2':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '3':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\t$cols[] = 'third';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '4':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\t$cols[] = 'third';\n\t\t\t\t\t$cols[] = 'fourth';\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase '5':\n\t\t\t\t\t$cols[] = 'first';\n\t\t\t\t\t$cols[] = 'second';\n\t\t\t\t\t$cols[] = 'third';\n\t\t\t\t\t$cols[] = 'fourth';\n\t\t\t\t\t$cols[] = 'fifth';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\t\t// Get new value\n\t\tif ($this->Input->post('FORM_SUBMIT') == $this->strTable)\n\t\t{\n\t\t\t$this->varValue = $this->Input->post($this->strId);\n\t\t}\n\n\t\t// Make sure there is at least an empty array\n\t\tif (!is_array($this->varValue) || !$this->varValue[0])\n\t\t{\n\t\t\t$this->varValue = array('');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t// Initialize sorting order\n\t\t\tforeach ($cols as $col)\n\t\t\t{\n\t\t\t\t$arrCols[$col] = array();\n\t\t\t}\n\n\t\t\tforeach ($this->varValue as $v)\n\t\t\t{\n\t\t\t\t// Add only modules of an active section\n\t\t\t\tif (in_array($v['col'], $cols))\n\t\t\t\t{\n\t\t\t\t\t$arrCols[$v['col']][] = $v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->varValue = array();\n\n\t\t\tforeach ($arrCols as $arrCol)\n\t\t\t{\n\t\t\t\t$this->varValue = array_merge($this->varValue, $arrCol);\n\t\t\t}\n\t\t}\n\n\t\t// Save the value\n\t\tif ($this->Input->get($strCommand) || $this->Input->post('FORM_SUBMIT') == $this->strTable)\n\t\t{\n\t\t\t$this->Database->prepare(\"UPDATE \" . $this->strTable . \" SET \" . $this->strField . \"=? WHERE id=?\")\n\t\t\t\t\t\t ->execute(serialize($this->varValue), $this->currentRecord);\n\n\t\t\t// Reload the page\n\t\t\tif (is_numeric($this->Input->get('cid')) && $this->Input->get('id') == $this->currentRecord)\n\t\t\t{\n\t\t\t\t$this->redirect(preg_replace('/&(amp;)?cid=[^&]*/i', '', preg_replace('/&(amp;)?' . preg_quote($strCommand, '/') . '=[^&]*/i', '', $this->Environment->request)));\n\t\t\t}\n\t\t}\n\n\t\t// Add label and return wizard\n\t\t$return .= '<table cellspacing=\"0\" cellpadding=\"0\" id=\"ctrl_'.$this->strId.'\" class=\"tl_modulewizard\" summary=\"Module wizard\">\n <thead>\n <tr>\n <td>'.$GLOBALS['TL_LANG'][$this->strTable]['module'].'</td>\n <td>'.$GLOBALS['TL_LANG'][$this->strTable]['column'].'</td>\n <td>&nbsp;</td>\n </tr>\n </thead>\n <tbody>';\n\n\t\t// Load tl_article language file\n\t\t$this->loadLanguageFile('tl_article');\n\n\t\t// Add input fields\n\t\tfor ($i=0; $i<count($this->varValue); $i++)\n\t\t{\n\t\t\t$options = '';\n\n\t\t\t// Add modules\n\t\t\tforeach ($modules as $v)\n\t\t\t{\n\t\t\t\t$options .= '<option value=\"'.specialchars($v['id']).'\"'.$this->optionSelected($v['id'], $this->varValue[$i]['mod']).'>'.$v['name'].'</option>';\n\t\t\t}\n\n\t\t\t$return .= '\n <tr>\n <td><select name=\"'.$this->strId.'['.$i.'][mod]\" class=\"tl_select\" onfocus=\"Backend.getScrollOffset();\">'.$options.'</select></td>';\n\n\t\t\t$options = '';\n\n\t\t\t// Add column\n\t\t\tforeach ($cols as $v)\n\t\t\t{\n\t\t\t\t$options .= '<option value=\"'.specialchars($v).'\"'.$this->optionSelected($v, $this->varValue[$i]).'>'. ((isset($GLOBALS['TL_LANG']['CTE'][$v]) && !is_array($GLOBALS['TL_LANG']['CTE'][$v])) ? $GLOBALS['TL_LANG']['CTE'][$v] : $v) .'</option>';\n\t\t\t}\n\n\t\t\t$return .= '\n <td><select name=\"'.$this->strId.'['.$i.'][col]\" class=\"tl_select_column\" onfocus=\"Backend.getScrollOffset();\">'.$options.'</select></td>\n <td>';\n\n\t\t\tforeach ($arrButtons as $button)\n\t\t\t{\n\t\t\t\t$return .= '<a href=\"'.$this->addToUrl('&amp;'.$strCommand.'='.$button.'&amp;cid='.$i.'&amp;id='.$this->currentRecord).'\" title=\"'.specialchars($GLOBALS['TL_LANG'][$this->strTable]['wz_'.$button]).'\" onclick=\"Backend.moduleWizard(this, \\''.$button.'\\', \\'ctrl_'.$this->strId.'\\'); return false;\">'.$this->generateImage($button.'.gif', $GLOBALS['TL_LANG'][$this->strTable]['wz_'.$button], 'class=\"tl_listwizard_img\"').'</a> ';\n\t\t\t}\n\n\t\t\t$return .= '</td>\n </tr>';\n\t\t}\n\n\t\treturn $return.'\n </tbody>\n </table>';\n\t}", "public function history()\n\t{\n $orders = $this->history->get_history();\n foreach($orders as $order)\n {\n if($order->added_by=='customer')\n {\n $agency_id = $this->Common->get_details('agency_orders',array('order_id'=>$order->order_id))->row()->agency_id;\n $agency_check = $this->Common->get_details('agencies',array('agency_id'=>$agency_id));\n if($agency_check->num_rows()>0)\n {\n $order->agency = $agency_check->row()->agency_name;\n }\n else\n {\n $order->agency = '';\n }\n }\n }\n $data['orders'] = $orders;\n\t\t$this->load->view('admin/bill/history',$data);\n\t}", "function createUpdate($versionUpdate){\n \n $db_params = OpenContext_OCConfig::get_db_config();\n $db = new Zend_Db_Adapter_Pdo_Mysql($db_params);\n\t$db->getConnection();\n \n\t$data = array(//\"noid\" => $this->noid,\n\t\t \"project_id\" => $this->projectUUID,\n\t\t \"source_id\" => $this->sourceID,\n\t\t \"property_uuid\" => $this->itemUUID,\n\t\t \"variable_uuid\" => $this->varUUID,\n\t\t \"value_uuid\" =>$this->valUUID,\n\t\t \"val_num\" =>$this->valNumeric,\n\t\t \"val_date\" => $this->valCalendric,\n\t\t \"prop_des\" => $this->propDescription,\n\t\t \"created\" => $this->createdTime\n\t\t );\n\t\n\tif(strlen($this->varUUID)<1){\n\t unset($data[\"variable_uuid\"]);\n\t}\n\tif(strlen($this->valUUID)<1){\n\t unset($data[\"value_uuid\"]);\n\t}\n\tif(strlen($this->valNumeric)<1){\n\t unset($data[\"val_num\"]);\n\t}\n\tif(strlen($this->valCalendric)<1){\n\t unset($data[\"val_date\"]);\n\t}\n\t\n\tif($versionUpdate){\n\t $this->versionUpdate($this->itemUUID, $db); //save previous version history\n\t unset($data[\"created\"]);\n\t}\n\t\n\tif(OpenContext_OCConfig::need_bigString($this->archaeoML)){\n\t /*\n\t This gets around size limits for inserting into MySQL.\n\t It breaks up big inserts into smaller ones, especially useful for HUGE strings of XML\n\t */\n\t $bigString = new BigString;\n\t $bigString->saveCurrentBigString($this->itemUUID, \"archaeoML\", \"property\", $this->archaeoML, $db);\n\t $data[\"prop_archaeoml\"] = OpenContext_OCConfig::get_bigStringValue();\n\t}\n\telse{\n\t $data[\"prop_archaeoml\"] = $this->archaeoML;\n\t}\n\t\n\tif(OpenContext_OCConfig::need_bigString($this->atomFull)){\n\t /*\n\t This gets around size limits for inserting into MySQL.\n\t It breaks up big inserts into smaller ones, especially useful for HUGE strings of XML\n\t */\n\t $bigString = new BigString;\n\t $bigString->saveCurrentBigString($this->itemUUID, \"atomFull\", \"property\", $this->atomFull, $db);\n\t $data[\"prop_atom\"] = OpenContext_OCConfig::get_bigStringValue();\n\t}\n\telse{\n\t $data[\"prop_atom\"] = $this->atomFull;\n\t}\n\n\n\n\t$success = false;\n\ttry{\n\t $db->insert(\"properties\", $data);\n\t $success = true;\n\t}catch(Exception $e){\n\t //echo $e;\n\t $success = false;\n\t $where = array();\n\t $where[] = 'property_uuid = \"'.$this->itemUUID.'\" ';\n\t $db->update(\"properties\", $data, $where);\n\t $success = true;\n\t}\n\n\tif($success){\n\t $varData = array(\"project_id\" => $this->projectUUID,\n\t\t\t \"source_id\" => $this->sourceID,\n\t\t\t \"variable_uuid\" => $this->varUUID,\n\t\t\t \"var_type\" => $this->varType,\n\t\t\t \"var_label\" => $this->varLabel,\n\t\t\t \"var_des\" => $this->varDescription,\n\t\t\t \"var_sort\" => $this->varSort,\n\t\t\t \"created\" => $this->createdTime\n\t\t\t );\n\t try{\n\t \t$db->insert(\"var_tab\", $varData);\n\t }catch(Exception $e){\n\t\t//do nothing, it's probably in\n\t }\n\n\t if($this->valUUID != \"number\"){ //don't do inserts on numeric data\n\t\t$valData = array(\"project_id\" => $this->projectUUID,\n\t\t\t\t \"source_id\" => $this->sourceID,\n\t\t\t\t \"value_uuid\" => $this->valUUID,\n\t\t\t\t \"val_text\" => $this->value,\n\t\t\t\t \"created\" => $this->createdTime\n\t\t\t\t );\n\t\ttry{\n\t\t $db->insert(\"val_tab\", $valData);\n\t\t}catch(Exception $e){\n\t\t //do nothing, it's probably in\n\t\t}\n\t }\n\t \n\t}\n\n\t$db->closeConnection();\n\treturn $success;\n }", "private function saveHistory()\n {\n ksort($this->migrations);\n foreach ($this->migrations as $k => $migration) {\n if ($migration['id'] === 0) {\n // new\n $prep = $this->db->prepare(\"INSERT INTO `{$this->table}` (`created_at`,`name`,`author`,`status`) \"\n . \"VALUES (:time, :name, :author, :status)\");\n $prep->execute([\n ':time' => $migration['time'],\n ':name' => $migration['name'],\n ':author' => $migration['author'],\n ':status' => $migration['status'],\n ]);\n // get inserted id\n $sth = $this->db->query('SELECT LAST_INSERT_ID()');\n $newId = $sth->fetchColumn();\n $this->migrations[$k]['id'] = $newId;\n } else if ($migration['id'] === -100) {\n // delete\n $prep = $this->db->prepare(\"DELETE FROM `{$this->table}` WHERE `id` = :id\");\n $prep->execute([':id' => $migration['id']]);\n } else {\n // update\n $prep = $this->db->prepare(\"UPDATE `{$this->table}` SET `status` = :status WHERE `id` = :id\");\n $prep->execute([':id' => $migration['id'], ':status' => $migration['status']]);\n }\n }\n }", "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}", "function generateTableDef($createLogTable = false)\n{\n $fieldDefs = array();\n $table_comment = $this->Name;\n if($createLogTable){\n $table_comment .= ' (log table)';\n\n //length should be at least as long as regular table's PK\n $fieldDefs['_RecordID'] = array(\n 'type' => 'integer',\n 'length' => 4,\n 'autoincrement' => 1,\n 'notnull' => 1,\n 'unsigned' => 1\n );\n }\n\n foreach($this->ModuleFields as $fieldName => $field){\n if('tablefield' == strtolower(get_class($field))){\n $def = $field->getMDB2Def();\n if($createLogTable && isset($def['autoincrement'])){\n unset($def['autoincrement']);\n }\n $fieldDefs[$fieldName] = $def;\n }\n }\n\n $indexDefs = array();\n $constraintDefs = array();\n foreach($this->Indexes as $indexName => $index){\n if($index->unique){\n $constraintDefs[$indexName] = $index->getMDB2Def();\n } else {\n $indexDefs[$indexName] = $index->getMDB2Def();\n }\n }\n\n $tableOptions = array();\n if(defined('DB_TYPE')){\n switch(DB_TYPE){\n case 'MySQL':\n $tableOptions = array(\n 'comment' => $table_comment,\n /* 'charset' => 'utf8',\n 'collate' => 'utf8_unicode_ci', */\n 'type' => 'innodb'\n );\n break;\n default:\n break;\n }\n }\n\n return array('fields' => $fieldDefs, 'indexes' => $indexDefs, 'constraints' => $constraintDefs, 'table_options' => $tableOptions);\n}", "public function generate()\n\t{\n\t\tif ($this->init == false)\n\t\t\tthrow new Exception('Generator Error: Data must be initialized.');\n\t\t\n\t\t// table view\n\t\t$table = new Table($this->model->get_name(), $this->model->get_columns());\n\t\t$template = $this->files->read($this->tableTemplate->get_template());\n\t\t$table->set_body($template);\n\t\t$tbl = $table->generate();\n\t\t$table_view = $this->compiler->compile($tbl, $this->data);\n\t\t$table_view_path = $this->tableTemplate->get_path();\n\t\tif ($this->files->write($table_view_path, $table_view))\n\t\t\t$this->filenames[] = $table_view_path;\n\n\t\t// controller\n\t\t$template = $this->files->read($this->controllerTemplate->get_template());\n\t\t$controller = $this->compiler->compile($template, $this->data);\n\t\t$controller_path = $this->controllerTemplate->get_path();\n\t\tif ($this->files->write($controller_path, $controller))\n\t\t\t$this->filenames[] = $controller_path;\n\n\t\t// main view\n\t\t$template = $this->files->read($this->viewTemplate->get_template());\n\t\t$view = $this->compiler->compile($template, $this->data);\n\t\t$view_path = $this->viewTemplate->get_path();\n\t\tif ($this->files->write($view_path, $view))\n\t\t\t$this->filenames[] = $view_path;\n\n\t\t// model\n\t\t$template = $this->files->read($this->modelTemplate->get_template());\n\t\t$model = $this->compiler->compile($template, $this->data);\n\t\t$model_path = $this->modelTemplate->get_path();\n\t\tif ($this->files->write($model_path, $model))\n\t\t\t$this->filenames[] = $model_path;\n\t}" ]
[ "0.76300544", "0.63956743", "0.59811586", "0.5801661", "0.5796929", "0.5771337", "0.57061535", "0.5700675", "0.55793875", "0.55781454", "0.5571829", "0.5477851", "0.5457062", "0.5447352", "0.5422149", "0.5408971", "0.53963464", "0.5347316", "0.5328131", "0.5327048", "0.5299126", "0.52885544", "0.52785933", "0.52641004", "0.52621615", "0.52467036", "0.524581", "0.5240272", "0.5231241", "0.5221328", "0.52123535", "0.5198027", "0.5167953", "0.516569", "0.5161713", "0.5149707", "0.5132904", "0.5101789", "0.5044628", "0.50405806", "0.5037714", "0.5030744", "0.502835", "0.5012161", "0.5012161", "0.5010865", "0.5008978", "0.5005884", "0.49990803", "0.49793178", "0.49780825", "0.49722928", "0.49721947", "0.4967386", "0.49671862", "0.49667194", "0.49517587", "0.4947014", "0.49375027", "0.4934803", "0.49297568", "0.49205643", "0.49171558", "0.4906483", "0.49053505", "0.48978782", "0.48974285", "0.48930916", "0.48838416", "0.4883113", "0.48787326", "0.4878218", "0.48765403", "0.48755577", "0.48748848", "0.48730227", "0.48642483", "0.48601395", "0.48601085", "0.48590553", "0.4847291", "0.48386618", "0.48372385", "0.48337048", "0.48281908", "0.48242864", "0.4824097", "0.4806968", "0.47959927", "0.4785253", "0.47784308", "0.47777483", "0.4772187", "0.47702718", "0.47662574", "0.4766207", "0.47601283", "0.4758216", "0.47565517", "0.4752319" ]
0.59542745
3
Display a listing of the resource.
public function index(Request $request) { //用户列表 $user = User::orderBy('id','asc') ->where(function ($query) use ($request){ $username = $request->input('username'); $email = $request->input('email'); if(!empty($username)){ $query->where('username','like','%'.$username.'%'); } if(!empty($email)){ $query->where('email','like','%'.$email.'%'); } }) ->paginate($request->input('num')?$request->input('num'):5); // foreach ($user['id'] as $k=>$v){ // $user['id']['aaa'][$k] = 123456; // } return view('admin.user.list',compact('user','request')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { //添加用户页面 return view('admin.user.add'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }" ]
[ "0.75921303", "0.75921303", "0.7586987", "0.75781953", "0.756992", "0.7498765", "0.7435984", "0.74298537", "0.7385191", "0.7350131", "0.7336855", "0.73092943", "0.72943234", "0.72800833", "0.7271207", "0.7241119", "0.7229479", "0.7222803", "0.71828884", "0.7176647", "0.71718425", "0.7147017", "0.7141053", "0.7140619", "0.7135868", "0.71249235", "0.7119748", "0.7112556", "0.7112556", "0.7112556", "0.7109539", "0.7090914", "0.70832956", "0.70798624", "0.70769805", "0.7055401", "0.7055401", "0.7053132", "0.70386326", "0.7036245", "0.7033728", "0.70319915", "0.70278865", "0.7024346", "0.7024193", "0.7018092", "0.70155334", "0.70024955", "0.7001018", "0.69984865", "0.6992834", "0.69919723", "0.6991958", "0.698738", "0.6985118", "0.6963932", "0.6963807", "0.6954235", "0.6949909", "0.69488865", "0.6946491", "0.69428456", "0.6939259", "0.69382834", "0.6935725", "0.69354814", "0.69354814", "0.693212", "0.69308144", "0.6926547", "0.6924849", "0.69206136", "0.69165045", "0.69125223", "0.69093955", "0.6908298", "0.69078946", "0.69061583", "0.69020784", "0.6900573", "0.68988043", "0.689839", "0.6892676", "0.6891245", "0.6890285", "0.6890285", "0.6890134", "0.6890082", "0.6886797", "0.68860483", "0.68844056", "0.68816763", "0.6879666", "0.6876824", "0.6874674", "0.68706644", "0.6870515", "0.68691623", "0.68690854", "0.6868035", "0.6867788" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // $flight = new User(); // // $flight->username = $request->username; // $flight->password = $request->password; // $flight->email = $request->email; // // $res = $flight->save(); //执行添加操作 //1.接收表单提交的数据 $input = $request->all(); //2.判断用户名是否重复 $user = User::where('username','=',$input['username'])->get(); if($user){ $data = [ 'status'=>1, 'message'=>'用户名已存在' ]; return $data; } //3.添加到数据库 $username = $input['username']; $email = $input['email']; $password = md5($input['pass']); $info = ['username'=>$username,'email'=>$email,'password'=>$password]; $res = User::create($info); //4.根据是否添加成功,给客户端返回一个json格式的反馈 if($res){ $data = [ 'status'=>0, 'message'=>'添加成功' ]; }else{ $data = [ 'status'=>1, 'message'=>'添加失败' ]; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $user =User::find($id); return view('admin.user.edit',compact('user')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { //1.根据id获取要修改的记录 $user = User::find($id); $password = md5($request->input('pass')); $user->username = $request->input('username'); $user->password = $password; $user->email = $request->input('email'); $res = $user->save(); if($res){ $data=[ 'status'=>0, 'message'=>'修改成功' ]; }else{ $data=[ 'status'=>1, 'message'=>'修改失败' ]; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update($id);", "public function update($id);", "public function put($path, $data = null);", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7423347", "0.70622426", "0.70568657", "0.6896551", "0.65835553", "0.64519453", "0.6348333", "0.6212436", "0.61450946", "0.6122591", "0.6114199", "0.6101911", "0.60876113", "0.60528636", "0.60177964", "0.6006609", "0.59725446", "0.594558", "0.59395295", "0.5938792", "0.5893703", "0.5862337", "0.58523124", "0.58523124", "0.5851579", "0.5815571", "0.58067423", "0.5750728", "0.5750728", "0.5736541", "0.5723664", "0.5715135", "0.56949675", "0.5691129", "0.56882757", "0.5669375", "0.5655524", "0.56517446", "0.5647158", "0.5636521", "0.563466", "0.5632965", "0.56322825", "0.56291395", "0.56202215", "0.56087196", "0.56020856", "0.5591966", "0.5581127", "0.5581055", "0.558085", "0.5575458", "0.55706805", "0.55670804", "0.55629116", "0.5562565", "0.5558853", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.555572", "0.5555007", "0.5553948", "0.5553837", "0.5553147", "0.55429846", "0.5541925", "0.5540208", "0.5539145", "0.5536157", "0.55350804", "0.5534241", "0.5523782", "0.5518406", "0.55147856", "0.5513397", "0.550961", "0.55072165", "0.55067354", "0.5503418", "0.5501671", "0.55010796", "0.54998124", "0.5497327", "0.54942787", "0.54942036", "0.54942036", "0.54935455", "0.549267", "0.5491964", "0.5489983", "0.54833627", "0.54794145", "0.5478835", "0.5478348", "0.5465178", "0.54648995", "0.54607797", "0.54571307" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { //删除用户 $user = User::find($id); $res = $user->delete(); if($res){ $data=[ 'status'=>0, 'message'=>'删除成功' ]; }else{ $data=[ 'status'=>1, 'message'=>'删除失败' ]; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Display a listing of the resource.
public function index() { //dd($estados=Estado::all()); $ejercicio = new Ejercicio(); if($ejercicio->activo()>0 && strtotime(date('Y/m/d')) <= strtotime($ejercicio->ejercicioActivo())) { /*\Session::flash('message_success','Te recordamos que se encuentra ya abierta la convocatoria para el programa anual de evaluación'); \Session::flash('ultimo','AVISO El plazo para el registro y participar en la Convocatoria del Programa Anual de Evaluación 2019, concluye el día 05 de agosto de 2019.');*/ } $mosaicos = Mosaico::all(); $imagenes = Carrucel::all(); $sitios = SitioInteres::all(); $var = 0; $v = ""; return view('layouts.home.home') ->with('ejercicio', $ejercicio) ->with('mosaicos', $mosaicos) ->with('imagenes', $imagenes) ->with('var', $var) ->with('sitios', $sitios) ->with('v', $v); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.728708", "0.7144915", "0.7132209", "0.66401577", "0.66205436", "0.65682197", "0.6526531", "0.65085673", "0.6449452", "0.63749766", "0.63726056", "0.6364582", "0.6364582", "0.6364582", "0.6341498", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
User // User // User
public function login($params) { if($params['login'] && $params['password']) { return $this->user->login($params['login'], $params['password']); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function User ( ){\n }", "public function getUser()\n{\nreturn $this->user;\n}", "public function getUser(): User;", "public function user($user);", "public function testCreateUser()\n {\n }", "abstract public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function forUser($user);", "public function getUser()\n {\n }", "public function setUser($user)\n{\n$this->user = $user;\n\nreturn $this;\n}", "public\n function create(User $user)\n {\n //\n }", "function __construct(){\n\t\tparent::__construct('user');\n\t}", "public static function user()\n {\n\n }", "function getUser() : User {\n\treturn new User;\n}", "function __construct()\n {\n $this ->user = User::createInstance();\n }", "public function testUpdateUser()\n {\n }", "public function testAddUser()\n {\n }", "public function user()\n\t{\n\t\t//return $this->belongsTo('User');\n\t}", "public function __construct()\n {\n $this->user = new User();\n }", "public function user()\n {\n \treturn $this -> belongsTo( User :: class );\n }", "public function user(){\n\t\treturn $this->belongsto('App\\Entities\\User\\User');\n\t}", "public function testAddUser()\n {\n\n }", "public function user () {\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n \treturn $this->belongsTo('App\\User');\n }", "public function user() {\n \treturn $this->belongsTo('App\\Models\\User');\n }", "public function user()\n {\n \treturn $this->belongsTo(User::class);\n }", "public function user()\n {\n \treturn $this->belongsTo(User::class);\n }", "public function user() {\n \treturn $this->belongsTo(User::class);\n }", "public function user() {\n \treturn $this->belongsTo(User::class);\n }", "public function user() {\n \treturn $this->belongsTo('App\\User');\n }", "public function user() {\n \treturn $this->belongsTo('App\\User');\n }", "public function createUser()\n {\n }", "public function user() \n\t{\n\t\t#return $this->belongsTo('App\\Models\\User', 'email', 'email');\n\t\treturn $this->belongsTo('App\\Models\\User', 'user_id', 'id');\n\t}", "public function getUser(): UserInterface;", "public function getUser(): UserInterface;", "public function user()\n {\n return $this->belongsTo(\\App\\User::class);\n\t}", "abstract protected function getUser();", "public function __construct()\n\t{\n\t\tparent::__construct(\"user\");\n\t}", "public function GetisOwnerThisRecord(){\n return ($this->{$this->nameFieldUserId}==h::userId());\n}", "function save_user_object($user){\r\n\r\n}", "public function getUserAttribute()\n {\n return $this->user()->first();\n }", "public function getUser() {}", "public function user() \n { \n return $this->belongsTo('User'); \n }", "protected function model()\n {\n return User::class;\n }", "public function user() {\n \treturn $this->belongsTo(User::class, 'user_id');\n }", "function getUser($user, $id) {\n return $user->readByID($id);\n}", "function getByUser(User $user);", "public function class()\n {\n return User::class;\n }", "public function testGetUser()\n {\n }", "public function testAddUserStore()\n {\n\n }", "public function user(){\n return $this->hasOne('App\\User');\n }", "public function model()\n {\n return User::class;\n }", "public function user()\n\t{\n\t return $this->belongsTo(User::class);\n\t}", "function is_user( $user )\n {\n //Unimplemented\n }", "public function user(){\n \treturn $this->belongsTo(User::class);\n }", "public function user(){\n \treturn $this->belongsTo(User::class);\n }", "public function user() {\n return $this->belongsTo('App\\Models\\User');\n }", "public function user()\n {\n return $this->belongsTo('ScreenTec\\Models\\User');\n }", "public function user($store = null);", "public function user()\n {\n return $this->belongsTo(\"App\\User\");\n }", "public function user() {\n return $this->hasOne('App\\Models\\User', 'user_id');\n}", "function model()\n {\n return User::class;\n }", "public function user()\n {\n return $this->belongsTo(User::class);\n }", "public function user() { return $this->user; }", "public function testQuarantineFindOne()\n {\n\n }", "public function create(User $user)\n {\n\n }", "public function user()\n {\n return $this->belongsTo('App\\User');\n }", "public function user()\n {\n return $this->belongsTo('App\\User');\n }", "public function user()\n {\n return $this->belongsTo('App\\User');\n }", "public function user() {\n\t\treturn $this->belongsTo ( User::class );\n\t}", "public function user() {\n\t\treturn $this->belongsTo ( User::class );\n\t}", "public function user(){\n \treturn $this->belongsTo('App\\User');\n }", "public function user(){\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n return $this->belongsTo('App\\User');\n }", "public function user()\r\n {\r\n return $this->belongsTo('App\\User')->first();\r\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }" ]
[ "0.734372", "0.66564834", "0.66228276", "0.6596164", "0.65008944", "0.63762605", "0.63266647", "0.63266647", "0.63266647", "0.63266647", "0.63266647", "0.63266647", "0.63266647", "0.63266647", "0.6259807", "0.62507474", "0.6197047", "0.61921966", "0.6169621", "0.6153201", "0.6138437", "0.610922", "0.6103976", "0.60936314", "0.6093551", "0.60769236", "0.60733616", "0.6072408", "0.6066081", "0.6062881", "0.60368764", "0.60368764", "0.60368764", "0.60368764", "0.60310656", "0.602494", "0.602494", "0.60223144", "0.60223144", "0.6020849", "0.6020849", "0.60133696", "0.60125", "0.6000595", "0.6000595", "0.5983343", "0.5968661", "0.5964029", "0.59607804", "0.5949446", "0.59247255", "0.5917904", "0.5915241", "0.59135115", "0.5909608", "0.5908526", "0.5907704", "0.5865567", "0.5862556", "0.5858316", "0.5858207", "0.5855237", "0.5851469", "0.5850912", "0.5840803", "0.5840803", "0.5837663", "0.5833571", "0.58329034", "0.5832617", "0.58312356", "0.58312285", "0.58301806", "0.5827027", "0.5819632", "0.5814582", "0.58137697", "0.58137697", "0.58137697", "0.5813521", "0.5813521", "0.5810053", "0.5810053", "0.5808362", "0.5806087", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629", "0.5804629" ]
0.0
-1
Testdata, kan gebruikt worden voor (alle) gebruikers te importeren samen met gebruikersprofielen
public function __construct() { //Dit is niet nodig om te kunnen authenticeren! Autenticatie loopt enkel via LDAP. //Opmaak: geen header! naam; guid; gebruikersprofielnaam; (gebruikersprofiel)organogram functienaam;dienstnaam; (optioneel rolenaam) $this->gebruikercsv ="database/csv/Gebruikers.csv"; $this->delimiter = ';'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testData()\n {\n $output = $this->primer->getPatterns(array('components/test-group/data-autoload'), false);\n\n $this->assertEquals($output, '1.2');\n }", "protected function getTestData(){\n\t\treturn \"application/testdata/Pagers.php\" ;\n\t}", "public function testBasicTest()\n {\n $dataImport = new Controllers\\DataImportController();\n $dataImport->setSource(app_path('/tests/test.csv'));\n $dataImport->configureFields([\n 'Title'=>['field'=>'title','validators'=>'required|max:64'],\n 'Lat'=>['field'=>'lat','validators'=>'required|max:16'],\n 'Lon'=>['field'=>'lon','validators'=>'required|max:16'],\n 'Residents'=>['field'=>'residents','validators'=>'integer']\n ]);\n\n $result = $dataImport->import();\n $this->assertTrue($result);\n\n }", "public function test_prepare_import_grade_data() {\n global $DB;\n\n // Need to add one of the users into the system.\n $user = new stdClass();\n $user->firstname = 'Anne';\n $user->lastname = 'Able';\n $user->email = 'student7@example.com';\n // Insert user 1.\n $this->getDataGenerator()->create_user($user);\n $user = new stdClass();\n $user->firstname = 'Bobby';\n $user->lastname = 'Bunce';\n $user->email = 'student5@example.com';\n // Insert user 2.\n $this->getDataGenerator()->create_user($user);\n\n $this->csv_load($this->oktext);\n\n $importcode = 007;\n $verbosescales = 0;\n\n // Form data object.\n $formdata = new stdClass();\n $formdata->mapfrom = 5;\n $formdata->mapto = 'useremail';\n $formdata->mapping_0 = 0;\n $formdata->mapping_1 = 0;\n $formdata->mapping_2 = 0;\n $formdata->mapping_3 = 0;\n $formdata->mapping_4 = 0;\n $formdata->mapping_5 = 0;\n $formdata->mapping_6 = 'new';\n $formdata->mapping_7 = 'feedback_2';\n $formdata->mapping_8 = 0;\n $formdata->mapping_9 = 0;\n $formdata->map = 1;\n $formdata->id = 2;\n $formdata->iid = $this->iid;\n $formdata->importcode = $importcode;\n $formdata->forceimport = false;\n\n // Blam go time.\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport, $this->courseid, '', '',\n $verbosescales);\n // If everything inserted properly then this should be true.\n $this->assertTrue($dataloaded);\n }", "public function testImport()\n {\n \n $arrLists = array();\n \n $arrLists[]['name'] = \"Army\";\n $arrLists[]['name'] = \"Companies\";\n $arrLists[]['name'] = \"CEOs\";\n \n $ret =\\App\\Providers\\ListsServiceProvider::importData($arrLists);\n \n $this->assertNotEquals(0 ,$ret);\n }", "abstract protected function getTestData() : array;", "public function testCanBeCreatedFromGetData(): void\n {\n $this->assertEquals(\n 'C:\\Documents\\Word\\Work\\Current\\1\\2\\3<br>',\n (new Read)->getData('current')\n );\n $this->assertIsString((new Read)->getData('current'));\n\n $this->assertEquals(\n 'C:\\Documents\\Software Engineer\\Projects\\AnnualReport.xls<br>',\n (new Read)->getData('software engineer')\n );\n $this->assertIsString((new Read)->getData('software engineer'));\n\n $this->assertEquals(\n 'C:\\Documents\\Salary\\Accounting\\Accounting.xls<br>',\n (new Read)->getData('accounting')\n );\n $this->assertIsString((new Read)->getData('accounting'));\n }", "public function readTestData()\n {\n return $this->testData->get();\n }", "abstract public function getTestData(): array;", "public function setTestValues()\r\n {\r\n $fname = array(\"Jesper\", \"Nicolai\", \"Alex\", \"Stefan\", \"Helmut\", \"Elvis\");\r\n $lname = array(\"Gødvad\", \"Lundgaard\", \"Killing\", \"Meyer\", \"Schottmüller\", \"Presly\");\r\n $city = array(\"Copenhagen\", \"Århus\", \"Collonge\", \"Bremen\", \"SecretPlace\" );\r\n $country = array(\"Denmark\", \"Germany\", \"France\", \"Ümlaudia\", \"Graceland\");\r\n $road = array(\" Straße\", \" Road\", \"vej\", \" Boulevard\");\r\n \r\n $this->number = rand(1000,1010);\r\n $this->name = $fname[rand(0,5)] . \" \" . $lname[rand(0,5)];\r\n $this->email = \"noreply@ilias.dk\";\r\n $this->address= \"Ilias\" . $road[rand(0,3)] .\" \" . rand(1,100);\r\n $this->postalcode = rand(2000,7000);\r\n $this->city = $city[rand(0,3)];\r\n $this->country = $country[rand(0,4)];\r\n $this->phone = \"+\" . rand(1,45) . \" \" . rand(100,999) . \" \" . rand(1000, 9999);\r\n $this->ean = 0;\r\n $this->website = ilERPDebtor::website; \r\n }", "function deploytestdata() {\n $this->auth(SUPER_ADM_LEVEL);\n $this->load->model('m_testdata');\n if(!$this->m_step->isTestDataLoaded()){\n // inserts from file\n $docRoot = getenv(\"DOCUMENT_ROOT\");\n $filename = $docRoot . '/db/initial_data.sql';\n $lines = file($filename);\n $row_id = 0;\n $success = TRUE;\n foreach ($lines as $line_num => $line) {\n if(!strstr($line, '--')){\n $row_id = $this->m_testdata->runSqlInsert($line);\n }\n if($row_id < 0){\n echo \"problem with file $filename at row $line_num <br/> $line <br/>\";\n $success = FALSE;\n break;\n }\n }\n //create some more users\n $data = array('Filippa', 'Mimmi', 'Tobbe', 'Carlfelix', 'Simpan', 'Mogge', 'janbanan', 'BigRed', 'bigbird', 'Bjork', 'johanna', 'jwalker','Lapen', 'greengreen', 'M', 'tomtekalendern', 'loffe', 'Klaas', 'Kaniin');\n $this->m_testdata->creteUsers($data);\n // insert random steps\n // simulation of user is required to insert steps\n $users = $this->m_user->getAll(400);\n foreach ($users as $user) {\n $d = new JDate();\n $this->_simulate($user->id);\n for($i = 0; $i < 31; $i++ ){\n $this->m_step->create_x($user->id, 1, $this->_randomSteps(), $d->getDate());\n $d->subDays(1);\n }\n $this->_stopsimulate();\n }\n\n echo $success ? 'Success! hopefully ;)': '';\n } else {\n echo 'Testdata allready run';\n }\n }", "protected function fixtureData() {\n\t\t$rows = array();\n\t\tfor($i = 0; $i < 50; $i++) {\n\t\t\t$rows[] = array(\n\t\t\t\t\"name\" => \"Test Item \".$i,\n\t\t\t\t\"popularity\" => $i,\n\t\t\t\t\"author\" => \"Test Author \".$i,\n\t\t\t\t\"description\" => str_repeat(\"lorem ipsum dolor est \",rand(3,20)),\n\n\t\t\t);\n\t\t}\n\t\treturn $rows;\n\t}", "public function validateTestData()\n\t{\n\t\t$testDataFileName = $this->config->getTestData();\n\t\tif (!(realpath($testDataFileName) || realpath(Config::$testDataFile))){\n\t\t\t$this->errors['testData'][] = [\n\t\t\t\t'property' => 'testData',\n\t\t\t\t'message' => 'Test data file was not found.'\n\t\t\t];\n\t\t}\n\t}", "protected function setUp()\n {\n parent::setUp();\n $this->testData = ['test' => 'test'];\n }", "public function jsonViewTestData() {}", "private function getTestData()\n {\n return [\n 'url' => 'http://www.mystore.com',\n 'access-token' => 'thisisaccesstoken',\n 'integration-token' => 'thisisintegrationtoken',\n 'method' => \\Magento\\Framework\\HTTP\\ZendClient::POST,\n 'body'=> ['token' => 'thisisintegrationtoken','url' => 'http://www.mystore.com'],\n ];\n }", "public function getTestData()\n {\n return [\n 'user_id' => 1,\n 'status' => 1,\n 'created_at' => '2016-01-21 15:00:00',\n 'updated_at' => '2016-01-21 18:00:00'\n ];\n }", "public function setUp()\n {\n foreach (glob(__DIR__.'/../data/*.json') as $jsonFile) {\n if (basename($jsonFile) != 'json_output_test_json_fixed.json') {\n unlink($jsonFile);\n }\n }\n\n $this->data = [\n [1, 'PHP Developer', 'Mazen Kenjrawi'],\n [4, 'Dummy Classes', 'Foo Bar'],\n ];\n\n $this->headingFields = ['id', 'Title', 'Name'];\n\n $this->Loader = new Loader();\n }", "function setUp() {\n\t\t$this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');\n\t\t$this->dataShort = 'hats';\n\t\t$this->dataUrl = __DIR__ . '/../lib/crypt.php';\n\t\t$this->legacyData = __DIR__ . '/legacy-text.txt';\n\t\t$this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';\n\t\t$this->randomKey = Encryption\\Crypt::generateKey();\n\n\t\t$keypair = Encryption\\Crypt::createKeypair();\n\t\t$this->genPublicKey = $keypair['publicKey'];\n\t\t$this->genPrivateKey = $keypair['privateKey'];\n\n\t\t$this->view = new \\OC_FilesystemView('/');\n\n\t\t\\OC_User::setUserId(\\Test_Encryption_Keymanager::TEST_USER);\n\t\t$this->userId = \\Test_Encryption_Keymanager::TEST_USER;\n\t\t$this->pass = \\Test_Encryption_Keymanager::TEST_USER;\n\n\t\t$userHome = \\OC_User::getHome($this->userId);\n\t\t$this->dataDir = str_replace('/' . $this->userId, '', $userHome);\n\n\t\t// remember files_trashbin state\n\t\t$this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');\n\n\t\t// we don't want to tests with app files_trashbin enabled\n\t\t\\OC_App::disable('files_trashbin');\n\t}", "protected static function getDataFixtures()\n {\n return array(\n new LoadTestUser(),\n new LoadSuperUser(),\n );\n }", "private function testCollect() {\n $custom_data = array();\n\n // Collect all custom data provided by hook_insight_custom_data().\n $collections = \\Drupal::moduleHandler()->invokeAll('acquia_connector_spi_test');\n\n foreach ($collections as $test_name => $test_params) {\n $status = new TestStatusController();\n $result = $status->testValidate(array($test_name => $test_params));\n\n if ($result['result']) {\n $custom_data[$test_name] = $test_params;\n }\n }\n\n return $custom_data;\n }", "public function testData() {\n $subscription = $this->mockSubscription('test@example.com', (object) [\n 'fields' => [\n ['name' => 'FIRSTNAME'],\n ['name' => 'LASTNAME'],\n ],\n ]);\n\n // Test new item.\n list($cr, $api) = $this->mockProvider();\n $source1 = new ArraySource([\n 'firstname' => 'test',\n ]);\n $cr->method('getSource')->willReturn($source1);\n list($data, $fingerprint) = $cr->data($subscription, []);\n $this->assertEqual([\n 'FIRSTNAME' => 'test',\n ], $data);\n\n // Test item with existing data.\n list($cr, $api) = $this->mockProvider();\n $source2 = new ArraySource([\n 'lastname' => 'test',\n ]);\n $cr->method('getSource')->willReturn($source2);\n list($data, $fingerprint) = $cr->data($subscription, $data);\n $this->assertEqual([\n 'FIRSTNAME' => 'test',\n 'LASTNAME' => 'test',\n ], $data);\n }", "public function conversionTestingDataProvider() {}", "public function setUp()\n {\n $this->data = array(\n 'folder_name_1' => array(\n 'src' => 'source_1',\n 'dst' => 'destination_1',\n ),\n 'folder_name_2' => array(\n 'src' => 'source_2',\n 'dst' => 'destination_2',\n 'client' => 'test'\n )\n );\n }", "protected function importDatabaseData() {}", "public function test_force_import_option () {\n\n // Need to add users into the system.\n $user = new stdClass();\n $user->firstname = 'Anne';\n $user->lastname = 'Able';\n $user->email = 'student7@example.com';\n $user->id_number = 1;\n $user1 = $this->getDataGenerator()->create_user($user);\n $user = new stdClass();\n $user->firstname = 'Bobby';\n $user->lastname = 'Bunce';\n $user->email = 'student5@example.com';\n $user->id_number = 2;\n $user2 = $this->getDataGenerator()->create_user($user);\n\n // Create a new grade item.\n $params = array(\n 'itemtype' => 'manual',\n 'itemname' => 'Grade item 1',\n 'gradetype' => GRADE_TYPE_VALUE,\n 'courseid' => $this->courseid\n );\n $gradeitem = new grade_item($params, false);\n $gradeitemid = $gradeitem->insert();\n\n $importcode = 001;\n $verbosescales = 0;\n\n // Form data object.\n $formdata = new stdClass();\n $formdata->mapfrom = 5;\n $formdata->mapto = 'useremail';\n $formdata->mapping_0 = 0;\n $formdata->mapping_1 = 0;\n $formdata->mapping_2 = 0;\n $formdata->mapping_3 = 0;\n $formdata->mapping_4 = 0;\n $formdata->mapping_5 = 0;\n $formdata->mapping_6 = $gradeitemid;\n $formdata->mapping_7 = 'feedback_2';\n $formdata->mapping_8 = 0;\n $formdata->mapping_9 = 0;\n $formdata->map = 1;\n $formdata->id = 2;\n $formdata->iid = $this->iid;\n $formdata->importcode = $importcode;\n $formdata->forceimport = false;\n\n // Add last download from this course column to csv content.\n $exportdate = time();\n $newcsvdata = str_replace('{exportdate}', $exportdate, $this->csvtext);\n $this->csv_load($newcsvdata);\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertTrue($dataloaded);\n\n // We must update the last modified date.\n grade_import_commit($this->courseid, $importcode, false, false);\n\n // Test using force import disabled and a date in the past.\n $pastdate = strtotime('-1 day', time());\n $newcsvdata = str_replace('{exportdate}', $pastdate, $this->csvtext);\n $this->csv_load($newcsvdata);\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertFalse($dataloaded);\n $errors = $testobject->get_gradebookerrors();\n $this->assertEquals($errors[0], get_string('gradealreadyupdated', 'grades', fullname($user1)));\n\n // Test using force import enabled and a date in the past.\n $formdata->forceimport = true;\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertTrue($dataloaded);\n\n // Test importing using an old exported file (2 years ago).\n $formdata->forceimport = false;\n $twoyearsago = strtotime('-2 year', time());\n $newcsvdata = str_replace('{exportdate}', $twoyearsago, $this->csvtext);\n $this->csv_load($newcsvdata);\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertFalse($dataloaded);\n $errors = $testobject->get_gradebookerrors();\n $this->assertEquals($errors[0], get_string('invalidgradeexporteddate', 'grades'));\n\n // Test importing using invalid exported date.\n $baddate = '0123A56B89';\n $newcsvdata = str_replace('{exportdate}', $baddate, $this->csvtext);\n $this->csv_load($newcsvdata);\n $formdata->mapping_6 = $gradeitemid;\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertFalse($dataloaded);\n $errors = $testobject->get_gradebookerrors();\n $this->assertEquals($errors[0], get_string('invalidgradeexporteddate', 'grades'));\n\n // Test importing using date in the future.\n $oneyearahead = strtotime('+1 year', time());\n $oldcsv = str_replace('{exportdate}', $oneyearahead, $this->csvtext);\n $this->csv_load($oldcsv);\n $formdata->mapping_6 = $gradeitemid;\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertFalse($dataloaded);\n $errors = $testobject->get_gradebookerrors();\n $this->assertEquals($errors[0], get_string('invalidgradeexporteddate', 'grades'));\n }", "public function testImportBeforeCompile($data)\n {\n $import = [];\n\n foreach($data as $field)\n {\n $import[$field['name']] = $field['value'];\n }\n\n $this->collection->importFromArray([$import]);\n\n $routes = $this->collection->all();\n\n $this->assertCount(1, $routes);\n\n foreach($data as $field)\n {\n $this->assertEquals($field['value'], $routes[0]->{$field['method']}(), $field['name']);\n }\n }", "public function testAllData()\n {\n Runner::truncate();\n Runner::factory()->count(15)->create();\n\n $headers['Accept'] = 'application/json';\n\n $response = $this->get('/api/v1/runner/1/form-data', $headers);\n\n $response->assertStatus(200)->assertJsonStructure(['success', 'data', 'status']);\n }", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => UserFixture::className(),\n 'dataFile' => codecept_data_dir() . 'login_data.php',\n ],\n ];\n }", "public function testIndexData(){\n $allPrice = PriceModel::all();\n\n /*\n * Testing by comaparing the Model data\n * */\n $this->visit(\"admin/price\")->assertEquals($allPrice,$allPrice);\n }", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => TicketsFixture::className(),\n 'dataFile' => codecept_data_dir() . 'tickets.php'\n ]\n ];\n }", "public function metaImport($data);", "public function stringsTestDataProvider() {}", "public function testDataSort()\n {\n $obj = new CSVFileReader();\n $obj->loadFileContent('test/data/hotels.csv');\n\n $obj->dataSort('name');\n $res = $obj->getFileData();\n $this->assertEquals($res[0]['name'], 'Apartment Ruggiero Giordano');\n $this->assertEquals($res[1]['name'], 'Comfort Inn Reichel');\n $this->assertEquals($res[2]['name'], 'Diaz');\n $this->assertEquals($res[15]['name'], 'The Rolland');\n $this->assertEquals($res[16]['name'], 'The Zimmer');\n \n $obj->dataSort('stars');\n $res = $obj->getFileData();\n $this->assertEquals($res[0]['stars'], '1');\n $this->assertEquals($res[4]['stars'], '2');\n $this->assertEquals($res[7]['stars'], '3');\n $this->assertEquals($res[9]['stars'], '4');\n $this->assertEquals($res[16]['stars'], '5');\n \n $obj->dataSort('contact');\n $res = $obj->getFileData();\n $this->assertEquals($res[0]['contact'], 'Alex Henry');\n $this->assertEquals($res[1]['contact'], 'Arlene Hornig');\n $this->assertEquals($res[2]['contact'], 'Benedetta Caputo');\n $this->assertEquals($res[3]['contact'], 'Clémence Hoarau');\n $this->assertEquals($res[16]['contact'], 'Victor Bodin-Leleu');\n\n\n }", "function getTestFromJson($file = \"ressources/views/all_test.json\"){\n //$file = $_SERVER['STORAGE_BASE'] . \"/json_files/all_test.json\";\n \t $jsondata = file_get_contents($file);\n \t // converts json data into array\n \t $arr_data = json_decode($jsondata);\n $alltest = array();\n foreach ($arr_data as $test) {\n # code...\n $alltest [$test->id_test] = [\n \"id_test\" => $test->id_test,\n \"id_theme\" => $test->id_theme,\n \"id_rubrique\" => $test->id_rubrique,\n \"statut\" => $test->statut,\n \"titre_test\" => stripslashes((string)$test->titre_test),\n \"unique_result\" => $test->unique_result,\n \"url_image_test\" => $test->url_image_test,\n \"codes_countries\" => $test->codes_countries\n ];\n }\n\n return $alltest;\n }", "public function getTestAddAndGetData()\n {\n return [\n ['namespace_1', 'key_11'],\n ['namespace_2', 'key_21'],\n ];\n }", "public static function get_tests()\n {\n }", "public function setUp() {\n\t\t$this->getConnection();\n\t\tforeach($this->fixtureData() as $row) {\n\t\t\t$record = new ExampleSolrActiveRecord();\n\t\t\tforeach($row as $attribute => $value) {\n\t\t\t\t$record->{$attribute} = $value;\n\t\t\t}\n\t\t\t$this->assertTrue($record->save());\n\t\t}\n\t}", "public function testSubfleetImporter(): void\n {\n $fare_economy = factory(Fare::class)->create(['code' => 'Y', 'capacity' => 150]);\n $fare_business = factory(Fare::class)->create(['code' => 'B', 'capacity' => 20]);\n $airline = factory(Airline::class)->create(['icao' => 'VMS']);\n\n $file_path = base_path('tests/data/subfleets.csv');\n $status = $this->importSvc->importSubfleets($file_path);\n\n $this->assertCount(1, $status['success']);\n $this->assertCount(1, $status['errors']);\n\n // See if it imported\n $subfleet = Subfleet::where([\n 'type' => 'A32X',\n ])->first();\n\n $this->assertNotNull($subfleet);\n $this->assertEquals($airline->id, $subfleet->id);\n $this->assertEquals('A32X', $subfleet->type);\n $this->assertEquals('Airbus A320', $subfleet->name);\n\n // get the fares and check the pivot tables and the main tables\n $fares = $subfleet->fares()->get();\n\n $eco = $fares->where('code', 'Y')->first();\n $this->assertEquals(null, $eco->pivot->price);\n $this->assertEquals(null, $eco->pivot->capacity);\n $this->assertEquals(null, $eco->pivot->cost);\n\n $this->assertEquals($fare_economy->price, $eco->price);\n $this->assertEquals($fare_economy->capacity, $eco->capacity);\n $this->assertEquals($fare_economy->cost, $eco->cost);\n\n $busi = $fares->where('code', 'B')->first();\n $this->assertEquals($fare_business->price, $busi->price);\n $this->assertEquals($fare_business->capacity, $busi->capacity);\n $this->assertEquals($fare_business->cost, $busi->cost);\n\n $this->assertEquals('500%', $busi->pivot->price);\n $this->assertEquals(100, $busi->pivot->capacity);\n $this->assertEquals(null, $busi->pivot->cost);\n }", "public function test()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n \n $CSVIC = new CSVImportController();\n\n $CSVFolder = base_path() . '/tests/FilesForTesting/S16/';\n /* Here are we testing Succesful uploading of professors */\n $_FILES = array('ProfessorsCSV' => [\n 'name' => 'Professors.csv',\n 'type' => 'application/vnd.ms-excel',\n 'tmp_name' => $CSVFolder . 'professors.csv',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals(' All 4 Professors added successfully.', $CSVIC->csvUploadProfessorsToDB());\n\n\n /* ProfessorsLengthError */\n $_FILES = array('ProfessorsCSV' => [\n 'name' => 'Professors.csv',\n 'type' => 'application/vnd.ms-excel',\n 'tmp_name' => $CSVFolder . 'professorsLengthError.csv',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals('email is larger than the acceptable size. (wow '\n . 'that description is way to long and will not be able to be '\n . 'inserted into the database and will give an error when you '\n . 'try to upload this file its not good good thing we build the '\n . 'site to be able to stop this from braking the website! At '\n . 'row 3)', $CSVIC->csvUploadProfessorsToDB());\n\n /* ProfessorsMissingHeader */\n $_FILES = array('ProfessorsCSV' => [\n 'name' => 'ProfessorsMissingHeader.csv',\n 'type' => 'application/vnd.ms-excel',\n 'tmp_name' => $CSVFolder . 'professorsMissingHeader.csv',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals('Header userID, not present in the Comma-Seperated'\n . ' values file(may be spelt wrong).', $CSVIC->csvUploadProfessorsToDB());\n\n /* ProfessorsMissing any Entries */\n $_FILES = array('ProfessorsCSV' => [\n 'name' => 'ProfessorsNoEntires.csv',\n 'type' => 'application/vnd.ms-excel',\n 'tmp_name' => $CSVFolder . 'ProfessorsNoEntires.csv',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals('There are no Entries in the CSV File', $CSVIC->csvUploadProfessorsToDB());\n\n /* ProfessorNotCSV File test */\n $_FILES = array('ProfessorsCSV' => [\n 'name' => 'ProfessorsNotCSVFile.docx',\n 'type' => 'application/vnd.openxmlformats-officedocument.'\n . 'wordprocessingml.document',\n 'tmp_name' => $CSVFolder . 'ProfessorsNotCSVFile.docx',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals('ProfessorsNotCSVFile.docx is not a Comma-'\n . 'Seperated values file.', $CSVIC->csvUploadProfessorsToDB());\n\n //======================================================================\n // Students\n //======================================================================\n\n $_POST['Section'] = 'J03';\n\n $_POST['Classes'] = 'CDBM190';\n\n $sectionID = $CSVIC->createSectionForStudents();\n\n /* Testing Students Successful Upload */\n $_FILES = array('StudentsCSV' => [\n 'name' => 'Students.csv',\n 'type' => 'application/vnd.ms-excel',\n 'tmp_name' => $CSVFolder . 'students.csv',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals(' All 9 Students added successfully to the Database.<br/> All 9 Students added successfully to CDBM190 sec J03.', \n $CSVIC->csvUploadStudentToDB($sectionID));\n\n\n\n\n /* Testing Students Length Error */\n $_FILES = array('StudentsCSV' => [\n 'name' => 'StudentsLenghtError.csv',\n 'type' => 'application/vnd.ms-excel',\n 'tmp_name' => $CSVFolder . 'StudentsLenghtError.csv',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals('email is larger than the acceptable size. '\n . '(wow that description is way to long and will not be '\n . 'able to be inserted into the database and will give an '\n . 'error when you try to upload this file its not good good '\n . 'thing we build the site to be able to stop this from braking '\n . 'the website! At row 3)', $CSVIC->csvUploadStudentToDB($sectionID));\n\n /* Testing Students Missing Header */\n $_FILES = array('StudentsCSV' => [\n 'name' => 'StudentsMissingHeader.csv',\n 'type' => 'application/vnd.ms-excel',\n 'tmp_name' => $CSVFolder . 'StudentsMissingHeader.csv',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals('Header userID, not present in the Comma-Seperated'\n . ' values file(may be spelt wrong).', $CSVIC->csvUploadStudentToDB($sectionID));\n\n /* Testing Students Missing Required Rows */\n $_FILES = array('StudentsCSV' => [\n 'name' => 'StudentsMissingRequiredRows.csv',\n 'type' => 'application/vnd.ms-excel',\n 'tmp_name' => $CSVFolder . 'StudentsMissingRequiredRows.csv',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals('userID is required but is empty at row 2', $CSVIC->csvUploadStudentToDB($sectionID));\n\n /* Students Not CSV File */\n $_FILES = array('StudentsCSV' => [\n 'name' => 'StudentsNotCSVFile.docx',\n 'type' => 'application/vnd.openxmlformats-officedocument.'\n . 'wordprocessingml.document',\n 'tmp_name' => $CSVFolder . 'StudentsNotCSVFile.docx',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals('StudentsNotCSVFile.docx is not a Comma-Seperated '\n . 'values file.', $CSVIC->csvUploadStudentToDB($sectionID));\n\n\n /* Testing Students Missing Required Rows */\n $_FILES = array('StudentsCSV' => [\n 'name' => 'StudentsNoEntries.csv',\n 'type' => 'application/vnd.ms-excel',\n 'tmp_name' => $CSVFolder . 'StudentsNoEntries.csv',\n 'error' => 0,\n 'size' => 173\n ]);\n\n $this->assertEquals('There are no Entries in the CSV File', $CSVIC->csvUploadStudentToDB($sectionID));\n }", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnPersonalData.php\";\n\t\t$data = adnPersonalData::getData($this->filter, $this->mode);\n\t\t$this->setData($data);\n\t\t//$this->setMaxCount(sizeof($users));\n\t}", "public function provideTestData()\n {\n return [\n ['9141405', true],\n ['1709107983', true],\n ['0122116979', true],\n ['0121114867', true],\n ['9030101192', true],\n ['9245500460', true],\n\n ['9141406', false],\n ['1709107984', false],\n ['0122116970', false],\n ['0121114868', false],\n ['9030101193', false],\n ['9245500461', false],\n ];\n }", "public function testPutForAllData()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $faker = $this->getFaker();\n foreach ($all as $data) {\n $data['username'] = $faker->text(50);\n unset($data['passwordHash']);\n\n $this->putTest($data, $data, $data['user']);\n }\n }", "public function getTests();", "function test_import_base()\n\t{\n\t\t$testLib = 'joomla._testdata.loader-data';\n\t\t$this -> assertFalse(defined('JUNIT_DATA_JLOADER'), 'Test set up failure.');\n\t\t$r = JLoader::import($testLib, dirname(__FILE__));\n\t\tif ($this -> assertTrue($r)) {\n\t\t\t$this -> assertTrue(defined('JUNIT_DATA_JLOADER'));\n\t\t}\n\n\t\t// retry\n\t\t$r = JLoader::import($testLib, dirname(__FILE__));\n\t\t$this->assertTrue($r);\n\t}", "private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}", "public function testGetOrderPackData()\n {\n }", "function testImport() {\n // SupportTicket ID must be a number that is not in the database.\n $stids = \\Drupal::entityManager()->getStorage('support_ticket')->getQuery()\n ->sort('stid', 'DESC')\n ->range(0, 1)\n ->execute();\n $max_stid = reset($stids);\n $test_stid = $max_stid + mt_rand(1000, 1000000);\n $title = $this->randomMachineName(8);\n $support_ticket = array(\n 'title' => $title,\n 'body' => array(array('value' => $this->randomMachineName(32))),\n 'uid' => $this->webUser->id(),\n 'support_ticket_type' => 'ticket',\n 'stid' => $test_stid,\n );\n /** @var \\Drupal\\support_ticket\\SupportTicketInterface $support_ticket */\n $support_ticket = entity_create('support_ticket', $support_ticket);\n $support_ticket->enforceIsNew();\n\n $this->assertEqual($support_ticket->getOwnerId(), $this->webUser->id());\n\n $support_ticket->save();\n // Test the import.\n $support_ticket_by_stid = SupportTicket::load($test_stid);\n $this->assertTrue($support_ticket_by_stid, 'SupportTicket load by support_ticket ID.');\n\n $support_ticket_by_title = $this->supportTicketGetTicketByTitle($title);\n $this->assertTrue($support_ticket_by_title, 'SupportTicket load by support_ticket title.');\n }", "public function provideTestData()\n {\n return [\n // variant 1\n ['1016', true],\n ['26260', true],\n ['242243', true],\n ['242248', true],\n ['18002113', true],\n ['1821200043', true],\n ['1011', false],\n ['26265', false],\n ['18002118', false],\n ['6160000024', false],\n\n // variant 2\n ['1015', true],\n ['26263', true],\n ['242241', true],\n ['18002116', true],\n ['1821200047', true],\n ['3456789012', true],\n ['242249', false],\n ['1234567890', false],\n ];\n }", "public function setUp() {\n $this->databaseContents['profile_fields'] = $this->expectedResults;\n parent::setUp();\n }", "public function provideTestData()\n {\n return [\n // Variant 1\n ['6100272324', true],\n ['6100273479', true],\n\n ['6100272885', false],\n ['6100273377', false],\n ['6100274012', false],\n\n // Variant 2\n ['5700000000', true],\n ['5700000001', true],\n ['5799999998', true],\n ['5799999999', true],\n\n ['5699999999', false],\n ['5800000000', false],\n ];\n }", "function loadSampleData()\n{\n $moduleDirName = basename(dirname(__DIR__));\n $helper = Cellar\\Helper::getInstance();\n $utility = new Cellar\\Utility();\n $configurator = new Common\\Configurator();\n // Load language files\n $helper->loadLanguage('admin');\n $helper->loadLanguage('modinfo');\n $helper->loadLanguage('common');\n if (!$wineData = \\Xmf\\Yaml::readWrapped('wine.yml')) {\n throw new \\UnexpectedValueException('Could not read the win.yml file');\n }\n \\Xmf\\Database\\TableLoad::truncateTable($moduleDirName . '_wine');\n \\Xmf\\Database\\TableLoad::loadTableFromArray($moduleDirName . '_wine', (array)$wineData);\n\n // --- COPY test folder files ---------------\n if (count($configurator->copyTestFolders) > 0) {\n // $file = __DIR__ . ' /../testdata / images / ';\n foreach (array_keys($configurator->copyTestFolders) as $i) {\n $src = $configurator->copyTestFolders[$i][0];\n $dest = $configurator->copyTestFolders[$i][1];\n $utility::xcopy($src, $dest);\n }\n }\n redirect_header(' ../admin / index . php', 1, AM_CELLAR_SAMPLEDATA_SUCCESS);\n}", "function test_all () {\n\n\t\t$this->layout = 'test';\n\n\t\t$tests_folder = new Folder('../tests');\n\n\t\t$results = array();\n\t\t$total_errors = 0;\n\t\tforeach ($tests_folder->findRecursive('.*\\.php') as $test) {\n\t\t\tif (preg_match('/^(.+)\\.php/i', basename($test), $r)) {\n\t\t\t\trequire_once($test);\n\t\t\t\t$test_name = Inflector::Camelize($r[1]);\n\t\t\t\tif (preg_match('/^(.+)Test$/i', $test_name, $r)) {\n\t\t\t\t\t$module_name = $r[1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$module_name = $test_name;\n\t\t\t\t}\n\t\t\t\t$suite = new TestSuite($test_name);\n\t\t\t\t$result = TestRunner::run($suite);\n\n\t\t\t\t$total_errors += $result['errors'];\n\n\t\t\t\t$results[] = array(\n\t\t\t\t\t'name'=>$module_name,\n\t\t\t\t\t'result'=>$result,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this->set('success', !$total_errors);\n\t\t$this->set('results', $results);\n\t}", "private function test()\n {\n pr('hola');\n $json = $this->reporte_model->get_json();\n pr($json);\n //$resultado = $this->reporte_model->insert_data($json);\n pr('fin');\n pr($resultado);\n }", "protected function createTestData()\n {\n // Cleanup any old objects\n $this->deleteTestData();\n \n // Get datamapper\n $dm = $this->account->getServiceManager()->get(\"Entity_DataMapper\");\n \n // Create a campaign for filtering\n $obj = $this->account->getServiceManager()->get(\"EntityLoader\")->create(\"marketing_campaign\");\n $obj->setValue(\"name\", \"Unit Test Aggregates\");\n $this->campaignId = $dm->save($obj);\n if (!$this->campaignId)\n throw new \\Exception(\"Could not create campaign\");\n\n // Create first opportunity\n $obj = $this->account->getServiceManager()->get(\"EntityLoader\")->create(\"opportunity\");\n $obj->setValue(\"name\", \"Website\");\n $obj->setValue(\"f_won\", false);\n $obj->setValue(\"probability_per\", 50);\n $obj->setValue(\"campaign_id\", $this->campaignId);\n $obj->setValue(\"amount\", 100);\n $oid = $dm->save($obj);\n \n // Create first opportunity\n $obj = $this->account->getServiceManager()->get(\"EntityLoader\")->create(\"opportunity\");\n $obj->setValue(\"name\", \"Application\");\n $obj->setValue(\"f_won\", true);\n $obj->setValue(\"probability_per\", 75);\n $obj->setValue(\"campaign_id\", $this->campaignId);\n $obj->setValue(\"amount\", 50);\n $oid = $dm->save($obj);\n }", "public function testImport() {\n return true;\n }", "public function testGeTaskVariableData()\n {\n }", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function provideTestData()\n {\n return [\n // variant one\n ['1197423162', true],\n ['1000000606', true],\n\n // variant one\n ['8137423260', false],\n ['600000606', false],\n ['51234309', false],\n\n // variant two\n ['1000000406', true],\n ['1035791538', true],\n ['1126939724', true],\n ['1197423460', true],\n\n // variant two\n ['1000000405', false],\n ['1035791539', false],\n ['8035791532', false],\n ['535791830', false],\n ['51234901', false],\n ];\n }", "public function data()\n {\n return [\n 'name' => $this->faker->text,\n 'cast' => $this->faker->text,\n 'genere' => $this->faker->text,\n 'description' => $this->faker->paragraph,\n 'image' => $this->faker->text,\n ];\n }", "private function import_test_data( $option = NULL ){\n\t\tif ( 'skip' === $option )\n\t\t\treturn;\n\n\t\t$option = ( NULL === $option ) ? 'unit-test' : $option;\n\n\t\t$datafiles = array(\n\t\t\t'unit-test' => 'https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml',\n\t\t\t'wpcom-theme' => 'https://wpcom-themes.svn.automattic.com/demo/wordpress-com-theme-test.xml',\n\t\t\t'wpcom-demo' => 'https://wpcom-themes.svn.automattic.com/demo/demo-data.xml',\n\t\t\t'wptest' => 'https://raw.github.com/manovotny/wptest/master/wptest.xml',\n\t\t);\n\t\t$keys = array_values( array_keys( $datafiles ) );\n\n\t\tif ( in_array( $option, $keys ) ):\n\t\t\t$download_url = $datafiles[$option];\t\t\t\n\t\telseif ( false != $option ):\n\t\t\t$download_url = $option;\n\t\telse :\n\t\t\tWP_CLI::error( 'Missing WXR path/URL.' );\n\t\tendif;\n\n\t\tWP_CLI::line( 'WXR data URL: ' . $download_url );\n\t\t$silent = WP_CLI::get_config( 'quiet' ) ? '--silent ' : '';\n\t\t$cmdline = \"curl -f $silent $download_url -o /tmp/wp-cli-test-data.xml\";\n\n\t\tWP_CLI::launch( $cmdline );\n\t\tWP_CLI::launch( 'wp import /tmp/wp-cli-test-data.xml --authors=skip' );\n\t}", "public function setUp() {\n global $CFG, $DB;\n\n $this->resetAfterTest(true);\n $CFG->registerauth = 'email';\n\n $categoryid = $DB->insert_record('user_info_category', array('name' => 'Cat 1', 'sortorder' => 1));\n $this->field1 = $DB->insert_record('user_info_field', array(\n 'shortname' => 'frogname', 'name' => 'Name of frog', 'categoryid' => $categoryid,\n 'datatype' => 'text', 'signup' => 1, 'visible' => 1, 'required' => 1, 'sortorder' => 1));\n $this->field2 = $DB->insert_record('user_info_field', array(\n 'shortname' => 'sometext', 'name' => 'Some text in textarea', 'categoryid' => $categoryid,\n 'datatype' => 'textarea', 'signup' => 1, 'visible' => 1, 'required' => 1, 'sortorder' => 2));\n }", "function getAllTestJson2($lang){\n //$file = \"ressources/views/json_files/all_tests/\".$lang.\"_all_test.json\";\n $file = $_SERVER['STORAGE_BASE'] . \"/json_files/all_tests/\" . $lang . \"_all_test.json\";\n\n \t $jsondata = file_get_contents($file);\n \t // converts json data into array\n \t $arr_data = json_decode($jsondata);\n $alltest = array();\n foreach ($arr_data as $test) {\n # code...\n $alltest [$test->id_test] = [\n \"id_test\" => $test->id_test,\n \"id_theme\" => $test->id_theme,\n \"id_rubrique\" => $test->id_rubrique,\n \"statut\" => $test->statut,\n 'permissions' => $test->permissions,\n 'if_additionnal_info' => $test->if_additionnal_info,\n \"if_translated\" => $test->if_translated,\n \"has_treatment\" => $test->has_treatment,\n \"default_lang\" => $test->default_lang,\n \"titre_test\" => stripslashes((string)$test->titre_test),\n \"unique_result\" => $test->unique_result,\n \"url_image_test\" => $test->url_image_test,\n \"codes_countries\" => $test->codes_countries\n ];\n }\n\n return $alltest;\n }", "function setUp() {\n \n\t\t$this->wid = 1;\n $this->buildDatabases();\n \n $this->localName = \"testNameLocal\";\n $this->localValue = \"testValueLocal\";\n\t\t$this->testType = \"submit\";\n\t $this->globalValueForLocal = \"testGlobalValueForLocalSetting\";\n\t\t$this->localType = \"Text\";\n\t\t$this->localPossibleValues = null;\n\t\t$this->globalName = \"testNameGlobal\";\n $this->globalValue = \"testValueGlobal\";\n\t\t$this->globalType = \"text\";\n\t\t$this->globalPossibleValues = null;\n\t\t$this->testPossibleValues = array(\"val1\",\"val2\");\n\t\t$this->notExistingName = \"iDoNotExist\";\n\t\t$this->testValue = \"differentTestValue\";\n\t\t$this->testValue2 = \"yetAnotherTestValue\";\n\t\t$this->globalDescription = \"This is the description of the global setting\";\n\t\t$this->globalLongName = \"Long name of global setting\";\n Settings::setGLobal('admin_language',1,$this->wid); \n $vpdo = VPDO::getVDO(DB_PREFIX.$this->wid);\n\t\t$sql = \"INSERT INTO settings(name,value) VALUES (\".\n\t\t\t$vpdo->quote($this->localName).\",\".\n\t\t\t$vpdo->quote($this->localValue).\")\";\n\t\t\n $num = $vpdo->exec($sql);\n if($num != 1) {\n exit(1);\n }\n $vpdo = VPDO::getVDO(DB_METADATA);\n\t\t$sql = \"INSERT INTO settings(name,value,public,possible_values) VALUES (\".\n\t\t\t$vpdo->quote($this->globalName).\",\".\n\t\t\t$vpdo->quote($this->globalValue).\",\".\n\t\t\t$vpdo->quote(0).\",\".\n\t\t\t$vpdo->quote($this->globalPossibleValues).\")\";\n\t\t\n $num = $vpdo->exec($sql);\n if($num != 1) {\n exit(1);\n }\n $id = $vpdo->fetchOne('select id from settings where name = ?', array($this->globalName));\n $sql = \"INSERT INTO settings_descriptions(lang_id, settings_id, description, long_name) VALUES (\".\n $vpdo->quote(1).\",\".\n $vpdo->quote($id).\",\".\n \n $vpdo->quote($this->globalDescription).\",\".\n $vpdo->quote($this->globalLongName).\")\";\n \n $num = $vpdo->exec($sql);\n if($num != 1) {\n exit(1);\n }\n\t\t$sql = \"INSERT INTO settings(name,value,public,possible_values) VALUES (\".\n\t\t\t$vpdo->quote($this->localName).\",\".\n\t\t\t$vpdo->quote($this->globalValueForLocal).\",\".\n\t\t\t$vpdo->quote(1).\",\".\n\t\t\t$vpdo->quote($this->localPossibleValues).\")\";\n\t\t\n $num = $vpdo->exec($sql);\n if($num != 1) {\n exit(1);\n }\n $this->vpdo = $vpdo;\n $this->buildShopDatabase(3);\n }", "function testNameAndTitleGeneration() {\n\t\t$file = $this->objFromFixture('File', 'asdf');\n\t\t$this->assertEquals('FileTest.txt', $file->Name);\n\t\t$this->assertNull($file->Title);\n\t\t\n\t\t/* However, if Name is set instead of Filename, then Title is set */\n\t\t$file = $this->objFromFixture('File', 'setfromname');\n\t\t$this->assertEquals(ASSETS_DIR . '/FileTest.png', $file->Filename);\n\t\t$this->assertEquals('FileTest', $file->Title);\n\t}", "public function testGetData()\n {\n $this->getWeather->setUrl();\n $result = $this->getWeather->getData();\n\n $this->assertIsArray($result);\n }", "function pudla_ocdi_import_files() {\n return array(\n array(\n 'import_file_name' => 'Demo',\n 'import_file_url' => 'http://demo.awaikenthemes.com/pudla/dummy-data/pudla.wordpress.xml',\n 'import_widget_file_url' => 'http://demo.awaikenthemes.com/pudla/dummy-data/pudla-widgets.wie',\n 'import_customizer_file_url' => 'http://demo.awaikenthemes.com/pudla/dummy-data/pudla-export.dat',\n 'preview_url' => 'http://demo.awaikenthemes.com/pudla/',\n ),\n );\n}", "public function test_process_data() {\n global $DB, $CFG;\n\n $this->resetAfterTest(true);\n\n $course = $this->getDataGenerator()->create_course();\n\n // Create and enrol a student.\n $student = $this->getDataGenerator()->create_user(array('username' => 'Student Sam'));\n $role = $DB->get_record('role', array('shortname' => 'student'), '*', MUST_EXIST);\n $this->getDataGenerator()->enrol_user($student->id, $course->id, $role->id);\n\n // Test with limited grades.\n $CFG->unlimitedgrades = 0;\n\n $forummax = 80;\n $forum1 = $this->getDataGenerator()->create_module('forum', array('assessed' => 1, 'scale' => $forummax, 'course' => $course->id));\n // Switch the stdClass instance for a grade item instance.\n $forum1 = grade_item::fetch(array('itemtype' => 'mod', 'itemmodule' => 'forum', 'iteminstance' => $forum1->id, 'courseid' => $course->id));\n\n $report = $this->create_report($course);\n $testgrade = 60.00;\n\n $data = new stdClass();\n $data->id = $course->id;\n $data->report = 'grader';\n $data->timepageload = time();\n\n $data->grade = array();\n $data->grade[$student->id] = array();\n $data->grade[$student->id][$forum1->id] = $testgrade;\n\n $warnings = $report->process_data($data);\n $this->assertEquals(count($warnings), 0);\n\n $studentgrade = grade_grade::fetch(array('itemid' => $forum1->id, '' => $student->id));\n $this->assertEquals($studentgrade->finalgrade, $testgrade);\n\n // Grade above max. Should be pulled down to max.\n $toobig = 200.00;\n $data->grade[$student->id][$forum1->id] = $toobig;\n $data->timepageload = time();\n $warnings = $report->process_data($data);\n $this->assertEquals(count($warnings), 1);\n\n $studentgrade = grade_grade::fetch(array('itemid' => $forum1->id, '' => $student->id));\n $this->assertEquals($studentgrade->finalgrade, $forummax);\n\n // Grade below min. Should be pulled up to min.\n $toosmall = -10.00;\n $data->grade[$student->id][$forum1->id] = $toosmall;\n $data->timepageload = time();\n $warnings = $report->process_data($data);\n $this->assertEquals(count($warnings), 1);\n\n $studentgrade = grade_grade::fetch(array('itemid' => $forum1->id, '' => $student->id));\n $this->assertEquals($studentgrade->finalgrade, 0);\n\n // Test unlimited grades so we can give a student a grade about max.\n $CFG->unlimitedgrades = 1;\n\n $data->grade[$student->id][$forum1->id] = $toobig;\n $data->timepageload = time();\n $warnings = $report->process_data($data);\n $this->assertEquals(count($warnings), 0);\n\n $studentgrade = grade_grade::fetch(array('itemid' => $forum1->id, '' => $student->id));\n $this->assertEquals($studentgrade->finalgrade, $toobig);\n }", "public function loadSignatures(){\n $this->testFieldsSignature = [\n 'mandante' => 'teste',\n 'grupo' => 'xxx',\n ];\n }", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "public function testIsModelSavingDataToDatabase()\n {\n $modelId = $this->saveTestData();\n $newModel = $this->model->load($modelId);\n $testData = $this->getTestData();\n $newModelData = [];\n foreach (array_keys($testData) as $key) {\n $newModelData[$key] = $newModel->getData($key);\n }\n $this->assertEquals($testData, $newModelData);\n }", "public function testImportAfterCompile($data)\n {\n $import = [];\n\n foreach($data as $field)\n {\n $import[$field['name']] = $field['value'];\n }\n\n $this->collection->importFromArray([$import]);\n $this->collection->compile();\n\n $routes = $this->collection->all();\n\n $this->assertCount(1, $routes);\n\n foreach($data as $field)\n {\n $this->assertEquals($field['value'], $routes[0][$field['name']], $field['name']);\n }\n }", "public function test() {\n $results = [];\n $results[\"testAddUser\"] = $this->testAddUser();\n\n return $results;\n }", "public function test(){\n\n // 2. stavi stiklirane\n\n // 3. dodavanje i brisanje iz sesije vrednosti, stikli raj ili ne stikliraj\n\n // 4 pretraga vrednosti\n\n // 5 dodavanje niza iz sesije u bazu tacnije uzimanj idieva koji su stiklirani\n\n $lekovi = Drug::all();\n\n dd($lekovi);\n }", "public function setUp()\n\t{\n\t\tparent::setUp();\n if(is_array($this->fixtures)){\n foreach($this->fixtures as $fixtureName=>$modelClass)\n {\n $tableName=WF_Table::model($modelClass)->tableName();\n $this->resetTable($tableName);\n $rows=$this->loadFixtures($modelClass, $tableName);\n if(is_array($rows) && is_string($fixtureName))\n {\n $this->_rows[$fixtureName]=$rows;\n if(isset($modelClass))\n {\n foreach(array_keys($rows) as $alias)\n $this->_records[$fixtureName][$alias]=$modelClass;\n }\n }\n }\n }\n }", "public function testGetDataMulti()\n {\n $this->getWeather->setUrls();\n $result = $this->getWeather->getDataMulti();\n\n $this->assertIsArray($result);\n }", "public function _fixtures()\n\t{\n\t\treturn [\n\t\t\t'user' => [\n\t\t\t\t'class' => UserFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'login_data.php'\n\t\t\t],\n\t\t\t'models' => [\n\t\t\t\t'class' => ModelsFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'models.php'\n\t\t\t],\n\t\t\t'files' => [\n\t\t\t\t'class' => FilesFixture::className(),\n\t\t\t\t'dataFile' => codecept_data_dir() . 'files.php'\n\t\t\t]\n\n\t\t];\n\t}", "public function testCreateWithAllFields(): void\n {\n $this->doTestCreate('createWithAllFields.json');\n }", "public function getDatas()\n\t{\n\t\t$this->skeleton = $this->data[\"skeleton\"];\n\t\t$this->javascript = $this->data[\"javascript\"];\n\t\t$this->css = $this->data[\"css\"];\n\t\t$this->module = $this->data[\"module\"];\n\t\t$this->site = $this->data[\"site\"];\n\t}", "function store_testi_data($data){\n\t\t\n\n\t\t$insert_data['name'] = $data['name'];\n\t\t$insert_data['testimonial'] = $data['testimonial'];\n\t\t$insert_data['image'] = $data['banner_image'];\n\n\t\t$query = $this->db->insert('testimonials', $insert_data);\n\t}", "public function setUp(){\n $this->testCases = Files::listFilesInFolder(__DIR__.\"/../../examples/sections/components\",\"ExamplePanel.php\");\n }", "public static function loadFixture()\n {\n //include __DIR__ .'/../_files/customer.php';\n include __DIR__ .'/../_files/order_fee_variation.php';\n\n }", "protected function setUp() {\n\t\tob_start ();\n\t\t$this->object = new groupe_forks ( false, 'TESTS groupe_forks' );\n\t\t$this->object->setListeOptions($this->getListeOption());\n\t/********************************************/\n\t\t/* CLASS IMPOSSIBLE EN TESTS UNITAIRES */\n\t/********************************************/\n\t}", "protected function setUp()\n {\n $this->object = new DecorateExtension;\n include_once dirname(dirname(__DIR__)) . '/testData1.php';\n }", "protected function extract_formdata_from_taskfile_test($question, $test, $files, &$index) {\n switch ($test['id']) {\n case self::CHECKSTYLE:\n $config = $test->{'test-configuration'};\n // Get code (currently exactly one textfile is expected!!).\n foreach ($config->filerefs as $filerefs) {\n foreach ($filerefs->fileref as $fileref) {\n $refid = (string) $fileref['refid'];\n $fileobject = $files[$refid];\n $question->checkstylecode = (string) $fileobject['code'];\n }\n }\n // Switch to namespace 'cs'.\n $cs = $config->children('cs', true);\n $question->checkstyleversion = (string)$cs->attributes()->version;\n break;\n case self::COMPILER:\n // Nothing to be done for compiler.\n break;\n default: // JUNIT test.\n $config = $test->{'test-configuration'};\n // Switch to namespace 'unit'.\n $unittest = $config->children('unit', true)->{'unittest'};\n $question->testversion[$index] = (string)$unittest->attributes()->version;\n // Call parent function for setting testcode attribute.\n // Note that index will be increemented there, too.\n $originalindex = $index;\n parent::extract_formdata_from_taskfile_test($question, $test, $files, $index);\n if (!isset($question->testcode[$originalindex])) {\n // Only set entrypoint if code for editor is set.\n $question->testentrypoint[$originalindex] = $unittest->{'entry-point'};\n }\n break;\n }\n }", "protected function viewsData() {\n $data = parent::viewsData();\n $data['views_test_data']['uid'] = [\n 'title' => 'UID',\n 'help' => 'The test data UID',\n 'relationship' => [\n 'id' => 'standard',\n 'base' => 'users_field_data',\n 'base field' => 'uid',\n ],\n ];\n\n // Create a dummy field with no help text.\n $data['views_test_data']['no_help'] = $data['views_test_data']['name'];\n $data['views_test_data']['no_help']['field']['title'] = 'No help';\n $data['views_test_data']['no_help']['field']['real field'] = 'name';\n unset($data['views_test_data']['no_help']['help']);\n\n return $data;\n }", "public function testPropertyUsernameDataProvider()\n {\n $testData = [];\n\n $testModelKeys = ['username','AGAVE_USERNAME'];\n\n foreach ($testModelKeys as $testModelKey) {\n $testData[] = [$testModelKey, self::DEFAULT_CLIENT_NAME_VALUE . $testModelKey];\n }\n\n return $testData;\n }", "protected function setUp() {\r\n\t\t$this->cacheDatabaseEntryRepository = new Tx_StaticfilecacheMananger_Domain_Repository_CacheDatabaseEntryRepository ();\r\n\t\t$this->cacheDatabaseEntryRepository->setFileTable('tx_ncstaticfilecache_file');\r\n\t\t$this->assertTrue($this->createDatabase());\r\n\t\t$this->useTestDatabase();\r\n\t\t$this->importExtensions(array('nc_staticfilecache'));\r\n\t\t$path = dirname ( __FILE__ ) . DIRECTORY_SEPARATOR .'fixtures'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'tx_ncstaticfilecache_file.xml';\r\n\t\t$this->importDataSet($path);\r\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "function test_import_key()\n\t{\n\t\t// Remove the following line when you implement this test.\n\t\treturn $this -> markTestSkipped();\n\t}", "public function test_listCustomFields() {\n\n }", "public function get_proizvod_Test(){\r\n $this->unit->run($this->get_proizvod(0), TRUE, 'Testiranje ucitavanja jednog dela proizvoda');\r\n echo $this->unit->report();\r\n }", "public function testKojiPreskacem()\n {\n $this->markTestSkipped(\"ovaj test je namjerno prekocen\");\n }", "public function test_setup(){\n\t\t$listotron = new Listotron();\n\n\t\t$row = $listotron->getRow(4);\n\t\t$this->assertEqual($row[\"row_id\"], 4);\n\t\t$this->assertEqual($row[\"par\"], 1);\n\t\t$this->assertEqual($row[\"prev\"], 3);\n\t\t\n\t\t$row = $listotron->getRow(1);\n\t\t$this->assertEqual($row[\"row_id\"], 1);\n\t\t$this->assertEqual($row[\"par\"], null);\n\t\t$this->assertEqual($row[\"prev\"], null);\n\t\t\n\t\t$row = $listotron->getRow(2);\n\t\t$this->assertEqual($row[\"row_id\"], 2);\n\t\t$this->assertEqual($row[\"par\"], 1);\n\t\t$this->assertEqual($row[\"prev\"], null);\n\t\t\n\t\t$row = $listotron->getRow(6);\n\t\t$this->assertEqual($row[\"row_id\"], 6);\n\t\t$this->assertEqual($row[\"par\"], 1);\n\t\t$this->assertEqual($row[\"prev\"], 5);\n\t\t\n\t}", "public function getTestData()\n {\n yield [false, false, '-5 days', '+5 days', true];\n // changing before last dockdown period is not allowed with grace permission\n yield [false, true, '-5 days', '+5 days', true];\n // changing before last dockdown period is allowed with full permission\n yield [true, true, '-5 days', '+5 days', false];\n yield [true, false, '-5 days', '+5 days', false];\n // changing a value in the last lockdown period is allowed during grace period\n yield [false, false, '+5 days', '+5 days', false];\n // changing outside grace period is not allowed\n yield [false, false, '+5 days', '+11 days', true];\n // changing outside grace period is allowed with grace and full permission\n yield [false, true, '+5 days', '+11 days', false];\n yield [true, false, '+5 days', '+11 days', false];\n yield [true, true, '+5 days', '+11 days', false];\n }", "public function _fixtures()\n {\n return [\n\n 'base_date' => [\n 'class' => BaseDataFixture::class,\n 'dataFile' => codecept_data_dir() . 'base_data_data.php',\n ],\n\n ];\n }", "public function testListExperts()\n {\n }" ]
[ "0.6713851", "0.66269803", "0.63701767", "0.63161", "0.6258806", "0.622621", "0.60909796", "0.6058229", "0.60348266", "0.6005819", "0.5971404", "0.5928726", "0.5921921", "0.58959395", "0.58752555", "0.5871571", "0.58447963", "0.5804753", "0.5794079", "0.57823604", "0.5758661", "0.57567805", "0.575142", "0.5751386", "0.57406634", "0.57358444", "0.5726573", "0.5716672", "0.57121027", "0.57006145", "0.5672886", "0.5670261", "0.56578875", "0.56553286", "0.5629158", "0.56210715", "0.5615937", "0.5615105", "0.5609503", "0.5609221", "0.5608656", "0.5601525", "0.5588585", "0.5582406", "0.55761236", "0.5573298", "0.55723095", "0.55598253", "0.55579424", "0.5544739", "0.55344075", "0.5525753", "0.551904", "0.5505187", "0.5503555", "0.54989636", "0.5491455", "0.5487218", "0.5475951", "0.5454422", "0.54415846", "0.54412556", "0.5440191", "0.5428925", "0.54177743", "0.5408558", "0.5404601", "0.5394054", "0.5392747", "0.5390924", "0.53829527", "0.5382538", "0.5374427", "0.5373588", "0.5371367", "0.53622603", "0.53616685", "0.5361446", "0.53572947", "0.5355678", "0.5354997", "0.5350661", "0.5349823", "0.53482103", "0.53474003", "0.5345029", "0.53366953", "0.5335616", "0.5335436", "0.5335436", "0.5335436", "0.5335436", "0.5335436", "0.5334788", "0.53320223", "0.5330549", "0.5329832", "0.5329328", "0.53281385", "0.53237426", "0.5320169" ]
0.0
-1
Run the database seeds.
public function run() { if(($handle = fopen(base_path($this->gebruikercsv), 'r')) !== FALSE){ while(($row = fgetcsv($handle,255,$this->delimiter))!==FALSE){ $gebruiker = Gebruiker::firstOrCreate(['naam' => $row[0], 'objectguid' => $row[1] ]); $gebruikersprofielTeam = Team::where('naam',$row[4])->first(); $gebruikersprofiel = Gebruikersprofiel::firstOrCreate(['naam' => $row[2],'organogram_naam'=> $row[3]]); if(array_key_exists(5, $row)){ $role = Role::where('naam',$row[5])->first(); $gebruiker->roles()->attach($role); } $gebruikersprofiel->team()->associate($gebruikersprofielTeam); $gebruikersprofiel->save(); $gebruiker->gebruikersprofielen()->attach($gebruikersprofiel); $gebruiker->save(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Update the specified resource in storage.
public function update(Qstore $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.55944353
47
Remove the specified resource from storage.
public function destroy($id) { // dd(request()->all()); $parent = request('sourceModel')::find(request('sourceModelId')); $relation = request('relation'); // $model = request('relatedTo')::find(request('relatedToID')); $parent->$relation()->detach(request('id')); return response([ 'message' => 'Relation Removed Successfully', ], 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
RESTful GET route to fetch all currencies
public function fetchAllAction(Request $request, Application $app) { $results = $app['orm.em']->getRepository('Pfmgr\Entity\Currency')->findAll(); if (count($results) < 1) { throw new Exception("Currency data is empty."); } else { return $app->json($results); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCurrenciesAction()\n {\n $em = $this->getDoctrine()->getManager();\n $currencies = $em->getRepository('ApiBundle:Currency')->findAll();\n $view = $this->view($currencies);\n return $this->handleView($view);\n }", "public function getCurrenciesAction()\n {\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Shop\\Currency');\n\n $builder = $repository->createQueryBuilder('c');\n $builder->select(\n [\n 'c.id as id',\n 'c.name as name',\n 'c.currency as currency',\n 'c.symbol as symbol',\n 'c.factor as factor',\n 'c.default as default'\n ]\n );\n\n $query = $builder->getQuery();\n\n $total = Shopware()->Models()->getQueryCount($query);\n\n $data = $query->getArrayResult();\n\n $this->View()->assign(\n [\n 'success' => true,\n 'data' => $data,\n 'total' => $total\n ]\n );\n }", "public function index()\n {\n return Currency::all();\n }", "function GetCurrencies()\n\t{\n\t\t$result = $this->sendRequest(\"GetCurrencies\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function index()\n {\n $currencies=Currency::paginate(5);\n\n return response(['currencies'=>CurrencyResource::collection($currencies),'message'=>'Success'],200);\n }", "public function getCurrencies() {\n\t\t\t$currencies = CurrencyDenomination::all();\n\t\t\treturn response($currencies);\n\t\t}", "public function getListCurrency()\n\t{\n\t\t$params = [\n\t\t\t'verify' => false,\n\t\t\t'query' => [\n\t\t\t\t'output' => Config::get( 'response.format' )\n\t\t\t]\n\t\t];\n\n\t\t$baseUrl = sprintf( Config::get( 'endpoints.base_url' ), Config::get( 'settings.api' ) ) . Config::get( 'endpoints.general_list_currency' );\n\n\t\ttry {\n\t\t\t$response = parent::send( 'GET', $baseUrl, $params );\n\t\t} catch (TiketException $e) {\n\t\t\tthrow parent::convertException( $e );\n\t\t}\n\n\t\treturn $response;\n\t}", "public function index()\n {\n //\n $currencies = Currency::paginate(10);\n return response()->view('cms.Currencies.index', ['currencies' => $currencies]);\n }", "public function index()\n {\n $currencies = Currency::get();\n return view('admin.currencies.list')->with('currencies', $currencies);\n }", "public function getSupportedCurrencies()\n {\n return response()->json(Currency::all());\n }", "public function index()\n {\n $currencies = Currency::all();\n return view('backEnd.currencies.index',compact('currencies'));\n }", "public function currencies()\n {\n $currencies = Currencies::with('Countries:name')->get();\n // dd($currencies);\n return view('setup.currencies.index', compact('currencies'));\n }", "public function currencies(): CurrenciesResponse\n {\n $payload = Payload::list('currencies');\n\n $result = $this->transporter->get($payload->uri)->throw();\n\n return CurrenciesResponse::from(attributes: (array) $result->json('data'));\n }", "public function getCurrencies ()\n\t{\n\t\treturn $this->call ('public/getcurrencies');\n\t}", "public function index()\n {\n $currency = Currency::all();\n\n return view('currency.index', compact('currency'));\n }", "public function getCurrencies();", "public function index()\r\n {\r\n if (!Sentinel::hasAccess('currencies')) {\r\n Flash::warning(\"Permission Denied\");\r\n return redirect('/');\r\n }\r\n $data = TradeCurrency::all();\r\n return view('trade_currency.data', compact('data'));\r\n }", "public function index()\n {\n $currencies = Currency::all();\n return view('currencies.index', ['currencies'=>$currencies]);\n }", "public function currencies()\n {\n return $this->_call('public/getcurrencies', [], false);\n }", "public function index()\n {\n $elements = Currency::with('country')->get();\n return view('backend.modules.currency.index', compact('elements'));\n }", "public function index()\n {\n $currencies = Currency::all();\n\n return View::make('elshop::currencies.index', compact('currencies'));\n }", "public function getOrdersAction()\n {\n $em = $this->getDoctrine()->getManager();\n $currencies = $em->getRepository('ApiBundle:CurrencyOrder')->findBy(array(), array('id' => 'DESC'));\n $view = $this->view($currencies);\n return $this->handleView($view);\n }", "public function index()\n {\n $currencies = Currency::orderBy(\"base\", 'desc')->paginate(3);\n return view('admin.currencies.index', compact('currencies'));\n }", "public function actionIndex()\n {\n $searchModel = new CurrencySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n // Currency $currency\n $currencies = Currency::get();\n return view('admin.currencies.index',compact('currencies'));\n }", "public function indexAction()\n {\n $currencies = $this->getCurrencies();\n\n return $this->render('DufECommerceBundle:Admin\\Currencies:index.html.twig',\n \tarray(\n \t\t'currencies' => $currencies,\n \t)\n );\n }", "public function getCurrencies(): array\n {\n $out = $this->request('getCurrencies');\n return $out['result'];\n }", "public function index(): JsonResponse\n {\n $allCurrencies = $this->currencyRepository->findAll();\n $currencies = [];\n foreach ($allCurrencies as $currency) {\n $currencies[] = CurrencyPresenter::present($currency);\n }\n\n return response()->json($currencies);\n }", "public function index()\n\t{\n\t\t$currencies = $this->currency->all();\n return view('settings.currency.index', compact('currencies'));\n\t}", "public static function getAllCurrencies(){\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$query = ' SELECT\r\n\t\t\t\t\th.*\r\n\t\t\t\t\tFROM #__hotelreservation_currencies h\r\n\t\t\t\t\tORDER BY description asc';\r\n\t\t$db->setQuery( $query );\r\n\t\treturn $db->loadObjectList();\r\n\t}", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Currency::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function obtainCurrency()\r\n {\r\n return $this->performRequest('GET', '/currency');\r\n }", "public function cryptoCurrencies()\n {\n $cryptoCurrencies = CryptoCurrency::all();\n return view('front.crypto_currencies', compact('cryptoCurrencies'));\n }", "public function getCurrencies() {\n return $this->public([\n 'command' => 'returnCurrencies',\n ]);\n }", "public function index(Request $request)\n {\n $this->currencyRepository->pushCriteria(new RequestCriteria($request));\n\n $companyId = Auth::guard('company')->user()->companyUser()->first()->company_id;\n\n\n $currencies = Currency::where('company_id',$companyId)->get();\n\n return view('company.currencies.index')\n ->with('currencies', $currencies);\n }", "public function index()\n {\n $rates = Rate::all();\n\n return response()->json($rates, Response::HTTP_OK);\n }", "public function index()\n {\n $currencyExchange = CurrencyExchange::all();\n\n\n return view('currencyExchange.index',compact('currencyExchange'));\n }", "public function getCurrencies() {\n\n $currencies= array();\n $date = '';\n \n $client = \\Drupal::httpClient();\n $request = $client->get(self::LESSON3_RATES_SERVICE);\n $responseXML = $request->getBody();\n\n\n if (!empty($request) && isset($responseXML)) {\n\n $data = new \\SimpleXMLElement($responseXML);\n foreach ($data->Currency as $value) {\n $currencies[] = array(\n 'CharCode' => (string)$value->CharCode,\n 'Name' => (string)$value->Name,\n 'Rate' => (string)$value->Rate,\n );\n }\n\n foreach ($data->attributes() as $key => $val) {\n $date .= (string) $val;\n }\n \n \\Drupal::configFactory()\n ->getEditable('lesson3.settings')\n ->set('lesson3.currencies', $currencies)\n ->set('lesson3.date', $date)\n ->save();\n } \n\n return $currencies;\n }", "public function exchange_rates()\n {\n $exchangeRates = ExchangeRates::with('Currencies:name')->get();\n return view('setup.exchange_rates.index', compact('exchangeRates'));\n }", "public function listCurrenciesWithExchangeRate()\n {\n $service_response = $this->exchange_service\n ->getCurrenciesWithExchangeRate(\n auth()->user(),\n );\n return $service_response->success\n ? Responser::send(200, $service_response->data, $service_response->message)\n : Responser::sendError(400, $service_response->message, $service_response->message);\n }", "protected function getCurrenciesRequest()\n {\n $resourcePath = '/currencies';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getCurrencyRates()\n {\n return $this->curlCall();\n }", "public function postList(Request $request)\n {\n $sql = \"select \";\n $sql .=\" c.id, c.baseCode, c.baseCodeSymbol, c.code, c.symbol, c.name as currencyName, \";\n $sql .=\" r.id rateId, r.exchange as exchangeRate, r.surcharge surchargeRate, r.surcharge_percent \";\n $sql .=\" from currency c \";\n $sql .=\" inner join rates r \";\n $sql .=\" on c.id = r.currency_id \";\n $sql .=\" where c.baseCode = '\".$request->currencyCode.\"' \";\n\n $currencies = DB::select($sql); \n\n // $currencies = Currency::get();\n\n return $currencies;\n }", "public function index()\n {\n $contract = $this->contract->paginate('10');\n return response()->json($contract, 200);\n }", "public function index()\n {\n $cryptos = DB::table('cryptocurrencies')->get();\n\n return view('cryptocurrency.index',[\n 'cryptos' => $cryptos]);\n }", "public function viewCoins($method) {\n if ($method == \"GET\") {\n header(\"Content-Type: application/json; charset=UTF-8\");\n echo CryptoDB::getAll(); \n } else {\n header('HTTP/1.1 404 Not Found');\n }\n }", "public static function getRates() {\n $result = self::get(self::getPath('rates'));\n \n Return $result;\n }", "public function fetchRates()\n {\n $res = $this->_fetch($this->_cfg['ratesUri']);\n\n return $res;\n }", "public function index(CurrencyList $currencyList)\n {\n return CurrencyListResource::collection(CurrencyList::all());\n\n }", "function getTickersForCurrency($currency) {\n \n $this->requestUrl = $this->makeUrl('ticker/' . $currency);\n \n return $this->getData();\n }", "public function show(CurrencyList $currency)\n {\n return CurrencyListResource::collection(CurrencyList::where('id', $currency->id)->get());\n }", "public function get_currency() {\n\t\t$data['currency'] = $this->session->data['currency'];\n\t\t/* added by it-lab end */\n\n\t\t$this->response->setOutput(json_encode($data));\n\t}", "function GetOurCurrency()\n\t{\n\t\t$result = $this->sendRequest(\"GetOurCurrency\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function index()\n {\n //\n\n $market = Market::all();\n\n return $this->showAll($market); \n }", "public function getCurrency()\n {\n return \"/V1/directory/currency\";\n }", "function getAll($hide='')\n\t{\n\t\tif ($hide != '') {\n\t\t\treturn Currency::where('id', '!=', $hide)->orderBy('name', 'asc')->get();\n\t\t}\n\n\t\treturn Currency::orderBy('name', 'asc')->get();\n\t}", "public function show($id)\n {\n return Currency::find($id);\n }", "public function index()\n {\n $coinchecks = Coincheck::limit(600)->latest()->get();\n return CoincheckResources::collection($coinchecks);\n // $coincheck = DB::table('coinchecks')->latest()->first();\n // return response()->json([\n // 'name' => 'CoinCheck',\n // 'symbol' => $coincheck->symbol,\n // 'datetime'=> $coincheck->datetime,\n // 'bid'=> $coincheck->bid,\n // 'ask'=> $coincheck->ask,\n // 'baseVolume'=> $coincheck->baseVolume,\n // ]);\n }", "public function show(Currency $currency)\n {\n return response([ 'currency' => new CurrencyResource($currency), 'message' => 'Retrieved successfully'], 200);\n\n }", "public function index() : AnonymousResourceCollection\n {\n $rates = QueryBuilder::for(Rate::class)\n ->defaultSort('buy')\n ->allowedFilters('name')\n ->where('date', (new DateTime)->format('Y-m-d'))\n ->get();\n\n return IndexResource::collection($rates);\n }", "public function index()\n {\n return response()->json(['status' => 'success', 'data' => MerchantResource::collection($this->repository->all())], 20);\n }", "public function showCurrency($id)\n {\n return response()->json(Currency::find($id) ?? ['response' => 404], 404);\n }", "public function show( Currency $currency )\n\t{\n\t\treturn response()->json( $currency, 200 );\n\t}", "public function index()\n {\n return Contract::all();\n }", "protected function endpoint() : string\n {\n return 'currencies/';\n }", "public function index()\n {\n $siteCurrencyGrid = new SiteCurrencyDataGrid($this->repository->query());\n\n return view('avored-framework::system.site-currency.index')\n ->with('dataGrid', $siteCurrencyGrid->dataGrid);\n }", "function getRates($currencies){\n $response=array();\n $json = file_get_contents('https://blockchain.info/ticker');\n $result = json_decode($json, true);\n foreach ($currencies as $currency) {\n $response[$currency]=$result[$currency]['last'];\n }\n return $response;\n}", "public function index( Request $request )\n\t{\n\t\tif( !empty( $request->all() ) )\n\t\t{\n\t\t\treturn Currency::withCount( 'country' )\n\t\t\t\t->withCount( 'profile' )\n\t\t\t\t->get();\n\t\t} else\n\t\t{\n\t\t\treturn Currency::all();\n\t\t}\n\t}", "public function index()\n {\n return response([\n 'data' => CalculationUnit::all()->map(function ($unit) {\n return new CalculationResource($unit);\n })\n ]);\n }", "public function getPrices(Collection $currencies)\n {\n $currencies = $currencies\n ->pluck('id', 'currency_code')\n ->map(function($id){\n return [\n 'id' => $id,\n 'currency_id' => null\n ];\n })->toArray();\n\n // add currencyIds\n foreach($this->currencyIds() as $currencyCode => $currencyID){\n if($currencies[$currencyCode]) {\n $currencies[$currencyCode]['currency_id'] = $currencyID;\n }\n }\n\n\n // exchangeRate\n $exchangeRate = $this->getExchangeRate();\n\n\n // make api call\n $version = '';\n $url = $this->apiBase . $version . '/public/ticker/ALL';\n $res = null;\n\n try{\n $res = Http::request(Http::GET, $url);\n }\n catch (\\Exception $e){\n // Error handling\n echo($e->getMessage());\n exit();\n }\n\n\n // data from API\n $data = [];\n $dataOriginal = json_decode($res->content, true);\n $data = $dataOriginal['data'];\n\n\n // Finalize data. [id, currency_id, price]\n $currencies = array_map(function($currency) use($data, $exchangeRate){\n $dataAvailable = true;\n if(is_array($currency['currency_id'])){\n foreach($currency['currency_id'] as $i){\n if(!isset($data[$i])){\n $dataAvailable = false;\n }\n }\n } else {\n $dataAvailable = isset($data[$currency['currency_id']]);\n }\n\n\n if($dataAvailable){\n if(is_array($currency['currency_id'])){ // 2 step\n $level1 = doubleval($data[$currency['currency_id'][0]]['closing_price']) / $exchangeRate;\n $level2 = doubleval($data[$currency['currency_id'][1]]['closing_price']) / $exchangeRate;\n $currency['price'] = $level1 * $level2;\n }\n else { // 1 step: string\n $currency['price'] = doubleval($data[$currency['currency_id']]['closing_price']) / $exchangeRate;\n }\n\n }\n else {\n $currency['price'] = null;\n }\n\n return $currency;\n\n }, $currencies);\n\n\n return $currencies;\n\n\n }", "public function index(){\n return MarketInfo::all();\n }", "public function index()\n {\n return Stock::get();\n }", "public function index()\n {\n return OtherChargeResource::collection(OtherCharge::all());\n }", "function &getAll()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n \r\n $return_array = array();\r\n $currency_array = array();\r\n \r\n $db->array_query( $currency_array, \"SELECT ID FROM eZTrade_AlternativeCurrency ORDER BY Created\" );\r\n \r\n for ( $i=0; $i < count($currency_array); $i++ )\r\n {\r\n $return_array[$i] = new eZProductCurrency( $currency_array[$i][$db->fieldName( \"ID\" )], 0 );\r\n }\r\n \r\n return $return_array;\r\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\t $user = $this->getUser();\n\t //$test = $this->getDoctrine()->getRepository(charge::class)->selectCharge($user->getId());\n\t $conv = $this->getDoctrine()->getRepository(charge::class)->findAll();\n return $this->render('charges/index.html.twig', array(\n 'charges' => $conv,\n ));\n }", "public function returnCurrencies(): array\n {\n $currencies = [];\n foreach ($this->request('returnCurrencies') as $key => $response) {\n /* @var $currency Currency */\n $currencies[$key] = $this->factory(Currency::class, $response);\n }\n\n return $currencies;\n }", "public function index() {\r\n $userData = Auth::user();\r\n \r\n $data = CoinModel::where(['user_id' => $userData->id, 'transaction_mode' => 'CR'])->orderBy('ct_id', 'DESC')->get();\r\n \r\n if(count($data)) {\r\n $this->responseStatusCode = $this->statusCodes->success;\r\n $response = api_create_response($data, $this->successText, 'Transaction List.');\r\n }\r\n else {\r\n $this->responseStatusCode = $this->statusCodes->not_found;\r\n $response = api_create_response(2, $this->failureText, 'No Transaction Found.');\r\n }\r\n \r\n return response()->json($response, $this->responseStatusCode);\r\n }", "public function showAll(): string{\n $json = $this->money->all();\n return json_encode($json);\n }", "public function generate_currencies()\n {\n $this->load->model('Currency_model');\n $json = file_get_contents('https://free.currencyconverterapi.com/api/v6/currencies');\n $currencies = json_decode($json);\n foreach ($currencies->results as $currency) {\n echo json_encode($currency);\n $this->Currency_model->id_currency = $currency->id;\n $this->Currency_model->name = $currency->currencyName;\n if (property_exists($currency, \"currencySymbol\")) {\n $this->Currency_model->symbol = $currency->currencySymbol;\n } else {\n $this->Currency_model->symbol = null;\n }\n $this->Currency_model->insert();\n }\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n return view('admin.crud.rates.index');\n }", "public function getAll(): PriceListCollectionTransfer;", "public function index()\n {\n // Get transactions\n // Use Laravel’s pagination for showing Clients/Transactions list, 10 entries per page\n $transactions = Transaction::paginate(10);\n return TransactionResource::collection($transactions);\n }", "public function all()\n {\n $all = City::all();\n if($all->isEmpty()){\n return response()->json(['message' => 'No entries found in database'], 204);\n }\n\n return CityResource::collection($all); \n }", "public function show(Currency $currency)\n {\n //\n }", "public function show(Currency $currency)\n {\n //\n }", "public function show(Currency $currency)\n {\n //\n }", "public function getAllCurrencies()\n {\n $currencies = $this->repository->supplemental['codeMappings'];\n $datas = array();\n foreach (array_keys($currencies) as $currency_code) {\n if ($currency_code === 'XTS' || strlen($currency_code) !== 3) {\n continue;\n }\n $currency = $this->getCurrency($currency_code);\n $datas[] = array(\n 'name' => ucfirst($currency['name']).' ('.$currency_code.')',\n 'code' => $currency_code,\n 'iso_code' => $currency['iso_code']\n );\n }\n\n //sort array naturally\n uasort($datas, function ($x, $y) {\n return strnatcmp($x[\"name\"], $y[\"name\"]);\n });\n\n return $datas;\n }", "public function index()\n {\n $countries = Country::with('locations')->get();\n return Resource::collection($countries);\n }", "public function getRates()\n {\n $this->uri = \"/?section=shipping&action=getRates\";\n \n return $this->send();\n }", "public function index()\n {\n // return config('app.cash_in_hand');\n return Purchase::with('user', 'vendor')->get();\n }", "public function run()\n {\n $listCurrencies = [\n [\n 'id' => Str::uuid(),\n 'currency_name' => 'Australian Dollar',\n 'currency_code' => 'AUD',\n 'iso_code' => '032',\n 'symbol' => '$',\n 'created_at' => now(),\n 'updated_at' => now(),\n 'created_by' => 'System',\n 'updated_by' => 'System',\n ],\n [\n 'id' => Str::uuid(),\n 'currency_name' => 'Chinese Yuan',\n 'currency_code' => 'CNY',\n 'iso_code' => '156',\n 'symbol' => '¥',\n 'created_at' => now(),\n 'updated_at' => now(),\n 'created_by' => 'System',\n 'updated_by' => 'System',\n ],\n [\n 'id' => Str::uuid(),\n 'currency_name' => 'European Euro',\n 'currency_code' => 'EUR',\n 'iso_code' => '978',\n 'symbol' => '€',\n 'created_at' => now(),\n 'updated_at' => now(),\n 'created_by' => 'System',\n 'updated_by' => 'System',\n ],\n [\n 'id' => Str::uuid(),\n 'currency_name' => 'Indonesian Rupiah',\n 'currency_code' => 'IDR',\n 'iso_code' => '360',\n 'symbol' => 'Rp',\n 'created_at' => now(),\n 'updated_at' => now(),\n 'created_by' => 'System',\n 'updated_by' => 'System',\n ],\n [\n 'id' => Str::uuid(),\n 'currency_name' => 'Japanese Yen',\n 'currency_code' => 'JPY',\n 'iso_code' => '392',\n 'symbol' => '¥',\n 'created_at' => now(),\n 'updated_at' => now(),\n 'created_by' => 'System',\n 'updated_by' => 'System',\n ],\n [\n 'id' => Str::uuid(),\n 'currency_name' => 'US Dollar',\n 'currency_code' => 'USD',\n 'iso_code' => '840',\n 'symbol' => '$',\n 'created_at' => now(),\n 'updated_at' => now(),\n 'created_by' => 'System',\n 'updated_by' => 'System',\n ]\n ];\n\n Currency::insert($listCurrencies);\n }", "public function index()\n {\n $orders = Order::latest()->get();\n return OrderResource::collection($orders);\n }", "public function getAll()\n\t{\n $get_all = PaymentMethod::all()->toArray();\n return response()->json($get_all);\n\n\t//\treturn view('welcome');\n\t}", "function GetCurrencyList($currencyIds)\n\t{\n\t\t$result = $this->sendRequest(\"GetCurrencyList\", array(\"CurrencyIds\"=>$currencyIds));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function index()\n {\n $cities = City::all();\n return response([\n 'cities' => CityResource::collection($cities),\n 'message' => 'Retreive Succefully'\n ], 200);\n }", "public function index()\n {\n //\n $bankAccount = BankAccount::where('user_id',Auth::user()->id)->get();\n return BankAccountResource::collection($bankAccount);\n }", "public function index()\n {\n $title = \"Service Rates\";\n $rates = Rate::all();\n return view('rates.index', compact('title','rates') );\n }", "public function index()\n {\n try {\n return view('setting.currency.index');\n } catch (Exception $e) {\n return view('error.index')->with('error', $e->getMessage());\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CreditUnionFrontendBundle:Pricelist')->findAll();\n\n return array('entities' => $entities);\n }" ]
[ "0.8216026", "0.7993959", "0.7825248", "0.7693063", "0.75853026", "0.74716145", "0.73822737", "0.73727494", "0.73607457", "0.72174925", "0.71788573", "0.71675855", "0.71355706", "0.7128597", "0.71126556", "0.70763975", "0.7049064", "0.70437986", "0.7040263", "0.7029878", "0.70287126", "0.6977445", "0.6945278", "0.6936968", "0.693526", "0.69153446", "0.68588495", "0.68165684", "0.6804009", "0.67825276", "0.676608", "0.6719282", "0.67172307", "0.6698319", "0.6602386", "0.66015476", "0.6585521", "0.65819055", "0.6578387", "0.6577074", "0.6572185", "0.65029466", "0.6461191", "0.6460384", "0.6437012", "0.6432698", "0.64271694", "0.6370646", "0.6350759", "0.6339236", "0.63339293", "0.6310895", "0.63074464", "0.63005793", "0.6291273", "0.6282724", "0.6276383", "0.6253363", "0.62515765", "0.62480044", "0.6245833", "0.6228537", "0.62253314", "0.61912847", "0.61909115", "0.61892784", "0.61703646", "0.61491036", "0.6133283", "0.6132075", "0.6123835", "0.612025", "0.61138856", "0.61039287", "0.6090113", "0.6088865", "0.6073613", "0.6059469", "0.6057414", "0.6041732", "0.60415083", "0.6029099", "0.60271394", "0.60199517", "0.59928155", "0.59928155", "0.59928155", "0.5986346", "0.5983373", "0.59829974", "0.5966357", "0.596028", "0.59563756", "0.5950045", "0.5949604", "0.5948935", "0.5942499", "0.5941353", "0.59376943", "0.59153366" ]
0.6642236
34
Get The Default Language
public function getDefaultLanguage() { if ($this->defaultLanguage) return $this->defaultLanguage; else return 'en'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSiteDefaultLanguage();", "public function defaultLanguage()\r\n\t{\r\n\t\treturn $this->default_language;\r\n\t}", "public function getDefaultLanguage(){\n\t\treturn $this->_lang_default;\n\t}", "public static function getDefaultLanguage()\n {\n return DLanguage::getDefaultLanguageCode();\n }", "public function getDefaultLanguage(): string\n {\n $this->fetchLanguages();\n\n $language = collect($this->languages)->where('default', true)->first();\n self::$language = $language;\n\n return $language->name;\n }", "public function getDefaultLanguage() : ?string;", "public static function getDefaultLanguage()\n {\n $params = JComponentHelper::getParams('com_languages');\n return $params->get('site', 'en-GB');\n }", "function default_lang()\n {\n $browser_lang = !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ',') : '';\n $browser_lang = substr($browser_lang, 0,2);\n if(array_key_exists($browser_lang, $this->languages))\n return $browser_lang;\n else{\n reset($this->languages);\n return key($this->languages);\n }\n }", "public static function getDefaultLang() {\n return self::find()->where(['is_default' => self::LANGUAGE_IS_DEFAULT, 'status' => self::LANGUAGE_STATUS_ACTIVE])->one();\n }", "protected function _getDefaultLanguage()\n {\n \t$config = $this->getOptions();\n $languageList = array_keys($config['languages']);\n\n\n \t$defaultLanguage= '';\n \tif (array_key_exists('language', $_COOKIE)) {\n \t\t$defaultLanguage = $_COOKIE['language'];\n \t} else {\n \t$zl = new Zend_Locale();\n \t$defaultLanguage = $zl->getLanguage();\n \t}\n\n $defaultLanguage = in_array($defaultLanguage, $languageList)? $defaultLanguage: 'en';\n\n return $defaultLanguage;\n }", "public static function get_lang() {\n\t\t$language = \\Config::get ( 'language' );\n\t\tempty ( $language ) and $language = static::$fallback [0];\n\t\treturn $language;\n\t}", "function default_language()\n\t{\n\t\treturn 'en_US';\n\t}", "public function language()\n {\n if(is_null($this->defaultLanguage)) {\n $config = $this->settings('config');\n\n if(!isset($config['i18n'])) {\n $config['i18n'] = 'en_US';\n }\n\n $settings = $this->path('settings');\n $path = $settings.'/i18n/'.$config['i18n'].'.php';\n\n $translations = array();\n\n if(file_exists($path)) {\n $translations = $this->settings('i18n/'.$config['i18n']);\n }\n\n $this->defaultLanguage = $this('language', $translations);\n }\n\n return $this->defaultLanguage;\n }", "public function get_language()\n\t{\n\t\tif ($this->userdata['language'] != '')\n\t\t{\n\t\t\treturn $this->userdata['language'];\n\t\t}\n\t\tif (ee()->input->cookie('language'))\n\t\t{\n\t\t\treturn ee()->input->cookie('language');\n\t\t}\n\t\telse if (ee()->config->item('deft_lang') != '')\n\t\t{\n\t\t\treturn ee()->config->item('deft_lang');\n\t\t}\n\n\t\treturn 'english';\n\t}", "public static function find_default()\n\t{\n\t\t// All supported languages\n\t\t$langs = (array) Kohana::$config->load('lang');\n\n\t\t// Look for language cookie first\n\t\tif ($lang = Cookie::get(Lang::$cookie))\n\t\t{\n\t\t\t// Valid language found in cookie\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\n\t\t\t// Delete cookie with invalid language\n\t\t\tCookie::delete(Lang::$cookie);\n\t\t}\n\n\t\t// Parse HTTP Accept-Language headers\n\t\tforeach (Request::accept_lang() as $lang => $quality)\n\t\t{\n\t\t\t// Return the first language found (the language with the highest quality)\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\t\t}\n\n\t\t// Return the hard-coded default language as final fallback\n\t\treturn Lang::$default;\n\t}", "public function getLanguage() {}", "final public function getLang(): string {\n $this->init();\n return $this->language;\n }", "function getDefaultLanguage() {\n if( isset($_SERVER[\"HTTP_ACCEPT_LANGUAGE\"]) ){\n return parseDefaultLanguage($_SERVER[\"HTTP_ACCEPT_LANGUAGE\"]);\n } else{\n return parseDefaultLanguage(NULL);\n }\n}", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function get_language() {\n if (defined('WPLANG')) {\n $language = WPLANG;\n }\n\n if (empty($language)) {\n $language = get_option('WPLANG');\n }\n\n if (!empty($language)) {\n $languageParts = explode('_', $language);\n return $languageParts[0];\n }\n\n return 'en';\n }", "function GetDefaultLang() : string\n{\n return 'ar';\n}", "private function initDefaultLanguage()\r\n\t{\r\n\t\t$default_language = $this->xml->xpath(\"configuration/config[@name='languages']/language[position()=1]/@code\");\r\n\t\t\r\n\t\tif ( count($default_language) > 0)\r\n\t\t{\r\n\t\t\t$this->default_language = (string) $default_language[0][\"code\"];\r\n\t\t}\t\t\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->default_language = null;\r\n\t\t}\r\n\r\n\t\treturn $this->default_language;\r\n\t}", "private static function getLanguage()\n {\n if (isset($_COOKIE[\"language\"]))\n {\n return $_COOKIE[\"language\"];\n }\n else\n {\n // Default is Czech\n return \"cs\";\n }\n }", "public function getLanguage() {\n return $this->getValueOrDefault('Language');\n }", "public static function getLang()\n {\n return self::getInstance()->lang;\n }", "public static function getLanguage() {\n $settings = self::getSettings();\n \n return $settings->language;\n }", "public static function getCurrentLang() {\n if (is_null(self::$current)) {\n self::$current = self::getDefaultLang();\n }\n return self::$current;\n }", "static public function getLanguage() {\n\t\treturn self::$language;\n\t}", "function lang()\n {\n global $CFG; \n $language = $CFG->item('language');\n \n $lang = array_search($language, $this->languages);\n if ($lang)\n {\n return $lang;\n }\n \n return NULL; // this should not happen\n }", "public function getLang();", "static function getDefaultLocale()\r\n {\r\n return self::$defaultLocale;\r\n }", "public function getPrimaryLanguage();", "public static function getDefaultLanguageCode() {\n\t\t$oSprache = UnzerCw_VersionHelper::getInstance()->getDb()->executeQuery(\"SELECT kSprache, cISO FROM tsprache WHERE cShopStandard = 'Y'\", 1);\n\t\tif($oSprache->kSprache > 0) {\n\t\t\treturn UnzerCw_VersionHelper::getInstance()->convertISO2ISO639($oSprache->cISO);\n\t\t}\n\t\telse {\n\t\t\treturn 'de';\n\t\t}\n\t}", "public function getDefaultLanguageCode()\n {\n return $this->default_language_code;\n }", "public function getCurrentLanguage()\n {\n return self::$current_language;\n }", "public function get_language()\n {\n }", "function kulam_acf_set_default_language() {\n\n\t// return\n\treturn acf_get_setting( 'default_language' );\n\n}", "public function getDefaultLanguage() {\n\t $pathFile = storage_path(\"/json/languages.json\");\n\n\t if(!File::exists($pathFile)) {\n\t return null;\n\t }\n\n\t $languages = File::get($pathFile);\n\t $file = (array)json_decode(File::get($pathFile));\n\t return ['en' => $file['en']]; // return default languages is English\n\t}", "static function getDefaultLang() {\n if (self::$default_lang === NULL) {\n if (self::$list == NULL) {\n self::getList();\n }\n foreach (self::$list as $data) {\n if ($data->default == static::STATUS_KEY_ON) {\n self::$default_lang = $data;\n break;\n }\n }\n }\n return self::$default_lang;\n }", "function getLanguageName() {\n global $CONF, $member;\n\n if ($member && $member->isLoggedIn() ) {\n // try to use members language\n $memlang = $member->getLanguage();\n\n if (($memlang != '') && (checkLanguage($memlang) ) ) {\n return $memlang;\n }\n }\n\n // use default language\n if (checkLanguage($CONF['Language']) ) {\n return $CONF['Language'];\n } else {\n return 'english';\n }\n}", "public function getDefaultLocale()\n {\n return self::$defaultLocale;\n }", "public function getLanguage()\n {\n return self::$language;\n }", "public function get_language() {\r\n\t\treturn $this->language;\r\n\t}", "public function getBackOfficeLanguage();", "abstract public function get_app_language();", "public static function get() {\n\t\treturn self::$lang;\n\t}", "public function getLanguage()\n {\n if (array_key_exists(\"language\", $this->_propDict)) {\n return $this->_propDict[\"language\"];\n } else {\n return null;\n }\n }", "public function getDefaultLocale()\n {\n return $this->config->get('app.fallback_locale');\n }", "public function get_language() \n {\n return $this->language;\n }", "public function getLanguage() {\n\t\treturn $this->getParameter('app_language');\n\t}", "function _getLanguage() {\n global $basePath, $arrLanguages;\n\n $language = $this->defaultLanguage;\n\n if (isset($_SESSION['installer']['langId'])) {\n $language = $arrLanguages[$_SESSION['installer']['langId']]['lang'];\n } elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $browserLanguage = substr(strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']),0,2);\n\n foreach ($arrLanguages as $arrLang) {\n if ($browserLanguage == $arrLang['lang']) {\n $language;\n break;\n }\n }\n }\n\n if ($this->_checkLanguageExistence($language)) {\n return $language;\n } else {\n return $this->defaultLanguage;\n }\n }", "static function getLanguage (){\n return self::$language;\n }", "public function getLanguage()\n {\n return $this->preloadedLanguage;\n }", "public function get_current_lang() {\n return \\Drupal::languageManager()->getCurrentLanguage()->getId();\n }", "public function getLanguage()\n {\n if ($this->_language === null) {\n $this->_language = strtolower(Yii::$app->language);\n }\n return $this->_language;\n }", "protected function getLanguage()\n {\n return $this->localeHeper->getLanguage();\n }", "public function getDefaultLocale()\n {\n return $this->gedmoTranslatableListener->getDefaultLocale();\n }", "public function getLanguage(): string\n {\n return $this->language;\n }", "public function getLanguage(): string\n {\n return $this->language;\n }", "public function getDefault()\n {\n $this->_currentLocale = \\Locale::getDefault();\n return $this->_currentLocale;\n }", "public function getLang()\n {\n return $this->lang;\n }", "public function getLang()\n {\n return $this->lang;\n }", "public function getlanguage()\n {\n return $this->language;\n }", "public static function getLanguage()\r\n {\r\n return session()->get(self::$sessLanguageKey);\r\n }", "function fetch_default_language() {\n\tglobal $_OPENDB_DEFAULT_LANGUAGE;\n\n\tif (strlen($_OPENDB_DEFAULT_LANGUAGE) == 0) {\n\t\t$query = \"SELECT language FROM s_language WHERE default_ind = 'Y'\";\n\n\t\t$result = db_query($query);\n\t\tif ($result && db_num_rows($result) > 0) {\n\t\t\t$record_r = db_fetch_assoc($result);\n\t\t\tdb_free_result($result);\n\n\t\t\tif ($record_r) {\n\t\t\t\t$_OPENDB_DEFAULT_LANGUAGE = $record_r['language'];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $_OPENDB_DEFAULT_LANGUAGE;\n}", "public function GetLanguage()\n {\n return $this->language;\n }", "function get_locale() {\n \n global $CONF;\n \n if( isset( $CONF ) ) {\n \t\t$supported_languages\t\t= $CONF['supported_languages'];\n } else {\n \t\t$supported_languages\t\t= array ('de', 'de_DE', 'en', 'en_US');\t\n }\n \n $lang_array \t\t\t\t\t\t= preg_split ('/(\\s*,\\s*)/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n \n if (is_array ($lang_array)) {\n \n $lang_first \t\t\t\t\t= strtolower ((trim (strval ($lang_array[0]))));\n $lang_parts\t\t\t\t\t= explode( '-', $lang_array[0] );\n $count\t\t\t\t\t\t= count( $lang_parts );\n if( $count == 2 ) {\n \t\n \t\t$lang_parts[1]\t\t\t= strtoupper( $lang_parts[1] );\n \t\t$lang_first\t\t\t\t= implode( \"_\", $lang_parts );\n }\n \n if (in_array ($lang_first, $supported_languages)) {\n \n $lang \t\t\t\t\t\t= $lang_first;\n \n } else {\n \n $lang \t\t\t\t\t\t= $CONF['default_locale'];\n \n }\n \n } else {\n \n $lang\t\t\t\t\t\t\t = $CONF['default_locale'];\n \n }\n \n return $lang;\n}", "public function getLanguage()\n\t{\n\t\treturn $this->language ?: config('laraform.language');\n\t}", "public function getLanguage() : BaseLang {\n\t\treturn $this->baseLang;\n\t}", "public function getDefaultLocale();", "public function getLanguage() {\n\t\tif ($this->_language === null) {\n\t\t\t$this->analyzeURL();\n\t\t}\n\t\treturn $this->_language;\n\t}", "private function get_language ()\n {\n $lang = filter_input ( INPUT_COOKIE, 'lang', FILTER_CALLBACK, [ 'options' => [ $this, 'filter_lang' ] ] );\n\t$new_lang = filter_input ( INPUT_GET, 'lang', FILTER_CALLBACK, [ 'options' => [ $this, 'filter_lang' ] ] );\n\tif ( $new_lang ) {\n\t\t$lang = $new_lang;\n\t\tsetcookie( \"lang\", substr ( $lang, 0, 2 ), time() + 3600 * 24 * 365, '/' );\n\t}\n\t\n\treturn $lang ?? 'uk';\n }", "private function _getFallbackLanguage(): string\n {\n /** @var WebApplication|ConsoleApplication $this */\n // See if we have the CP translated in one of the user's browsers preferred language(s)\n if ($this instanceof WebApplication) {\n $languages = $this->getI18n()->getAppLocaleIds();\n return $this->getRequest()->getPreferredLanguage($languages);\n }\n\n // Default to the source language.\n return $this->sourceLanguage;\n }", "public function getLang()\n {\n return $this->_lang;\n }", "public function getLang(): string {\n return $this->lang;\n }", "protected function getLanguage() {\r\n\t\treturn $this->language;\r\n\t}", "public static function getLang(){\n\t\tif(!isset(self::$_config['lang'])) return null;\n\t\telse return $_COOKIE['lang'];\n\t}", "static function get()\n\t{\n\t\treturn self::$lang;\n\t}", "public function getLanguage()\n\t{\n\t\t$language = isset($this->session->data['language']) ? $this->session->data['language'] : $this->config->get('config_language');\n\n\t\t$language_code = substr($language, 0, 2);\n\n\t\t$this->bootstrap();\n\n\t\t$is_available = @constant('\\Genesis\\API\\Constants\\i18n::' . strtoupper($language_code));\n\n\t\tif ($is_available) {\n\t\t\treturn strtolower($language_code);\n\t\t} else {\n\t\t\treturn 'en';\n\t\t}\n\t}", "public function get_language() {\n return $this->_language;\n }", "public function getLanguage() : ?string ;", "public static function getDefaultLocale()\n {\n return static::$defaultFormatSettings['locale'];\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getLanguage()\n {\n return $this->language;\n }", "public function getSelectedLanguage()\n {\n return $this->selectedLanguage;\n }", "public function getLang()\n\t{\n\t\treturn $this->pageLanguage;\n\t}", "public function getLanguage()\n\t{\n\t\treturn $this->language;\n\t}" ]
[ "0.9142921", "0.906222", "0.9032783", "0.87443477", "0.87406117", "0.86152667", "0.8587521", "0.8480608", "0.84529954", "0.84299105", "0.84117603", "0.83105266", "0.8238253", "0.82085806", "0.82063454", "0.81774217", "0.8102275", "0.8075092", "0.8064894", "0.8064894", "0.8064894", "0.8064894", "0.8064894", "0.8064894", "0.8034038", "0.8018575", "0.8014694", "0.8005473", "0.79899687", "0.7983983", "0.7956026", "0.79421467", "0.79399055", "0.7939066", "0.7928766", "0.79188055", "0.79031503", "0.7899811", "0.78837454", "0.78741443", "0.7869085", "0.78625286", "0.78614026", "0.7856143", "0.7851788", "0.783156", "0.7829609", "0.7820885", "0.7815126", "0.78125304", "0.7783772", "0.77739096", "0.7773848", "0.77647424", "0.77316564", "0.7727557", "0.7724586", "0.77189034", "0.7715134", "0.7706682", "0.77056605", "0.77034515", "0.77025664", "0.77025664", "0.7700443", "0.7696371", "0.7696371", "0.76938385", "0.76885206", "0.7681358", "0.76657975", "0.76595545", "0.76540375", "0.7653535", "0.76506263", "0.7648718", "0.76406044", "0.76395357", "0.7635697", "0.76338977", "0.7632539", "0.76287055", "0.7625901", "0.7624542", "0.762049", "0.7616569", "0.76061314", "0.75890666", "0.75890666", "0.75890666", "0.75890666", "0.75890666", "0.75890666", "0.75890666", "0.75890666", "0.75890666", "0.75890666", "0.7560152", "0.755946", "0.7552892" ]
0.882692
3
Get the phrase of the $key index
public function phrase($key) { if (isset($this->phrases[$key])) return $this->phrases[$key]; else return $key; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function phpkd_vblvb_fetch_phrase_from_key($phrase_key)\n{\n\tglobal $vbphrase;\n\n\treturn (isset($vbphrase[\"$phrase_key\"])) ? $vbphrase[\"$phrase_key\"] : $phrase_key;\n}", "public function get_keyword($key = 0)\n {\n }", "final public function key(): string\n {\n $this->sort();\n\n return (string) key($this->index);\n }", "public static function get($key)\n {\n $a = self::getAll();\n return isset($a[$key]) ? $a[$key] : '';\n }", "public function getText($key)\n {\n $strings = $this->getTranslation('general');\n if (!is_array($strings) || !isset($strings[$key])) {\n return '';\n }\n return $strings[$key];\n }", "public static function retrieve($key){\n if(self::exists($key)){\n return self::$answers[strtolower($key)];\n }\n return \"ERROR\";\n }", "public function get_key_val($key){\n\t\t$key_val = explode('_', $key);\n\t\tif(in_array($key_val[0], array('title','first','last','email','designation','mobile',\n\t\t'phone','branch','status','id'))){\n\t\t\treturn ($key_val[0] == 'first' || $key_val[0] == 'last') ? $key_val[0].'_name' : $key_val[0];\n\t\t}\t\t\n\t\t\n\t}", "public function getPhraseByMethod($methodItem, $keyString = '')\n {\n $return = '';\n $getMethodInfo = $this->getPhrase($methodItem, ['paymentMethods']);\n\n if (!empty($keyString) && isset($getMethodInfo[$keyString]) && !empty($getMethodInfo[$keyString])) {\n $return = $getMethodInfo[$keyString];\n } elseif (!empty($getMethodInfo)) {\n $return = $getMethodInfo;\n }\n\n return $return;\n }", "public function localize($key) {\n\t\tif (!isset($this->_phrases[strtoupper($key)])) return $key;\n\n\t\t$match = $this->_phrases[strtoupper($key)];\n\n\t\tif (func_num_args() == 1) return $match;\n\n\t\t$args = func_get_args();\n\t\t$args[0] = $match;\n\n\t\treturn call_user_func_array('sprintf', $args);\n\t}", "public function offsetGet( $key );", "public function get_screen_reader_text($key)\n {\n }", "public function getTranslation($key = '')\n {\n return self::$translations[$key];\n }", "protected function translate($key) {\n\t\treturn $this->_viewHelper->translate($key);\n\t}", "public static function get_search_parameter($key){\n global $TFUSE;\n return $TFUSE->ext->seek->get_search_parameter($key);\n }", "public function getIndex($key)\n {\n return floor($key / $this->_patternRowsCount) + 1;\n }", "function L($key)\n{\n global $language;\n if (empty($key)) {\n return '';\n }\n if (isset($language[$key])) {\n return $language[$key];\n }\n return \"[[$key]]\";\n}", "public function translate($key)\n\t{\n\t\tif(array_key_exists($key, $this->_translations))\n\t\t{\n\t\t\treturn $this->_translations[$key];\n\t\t}\n\t\treturn $key;\n\t}", "public function get( $key ) {\n\t\treturn eval('return $this->items' . $this->nodelize($key) . ';');\n\t}", "public function getByKey($key);", "public function offsetGet($key)\n {\n return $this->getArgument($key);\n }", "public function key() {\n\t\tif(($this->endItemIdx !== null) && isset($this->lastItems[$this->endItemIdx])) {\n\t\t\treturn $this->lastItems[$this->endItemIdx][0];\n\t\t} else if(isset($this->firstItems[$this->firstItemIdx])) {\n\t\t\treturn $this->firstItems[$this->firstItemIdx][0];\n\t\t} else {\n\t\t\treturn $this->items->current()->{$this->keyField};\n\t\t}\n\t}", "function get($key)\r\n\t\t{\r\n\t\t\treturn @$this->lang[$key];\r\n\t\t}", "final public function getKey(): string\n {\n return (string)array_flip(static::getValues())[$this->value];\n }", "public function key() {\n return $this->keys[$this->index];\n }", "public function buildKey($key): string;", "public function get($strKey);", "public function getParamQuery(string $key): string\n {\n $result = $this->getQueryString();\n if (array_key_exists($key, $result))\n return $result[$key];\n else throw new InvalidQueryKeyException(\"This params is not valid!\");\n }", "public function offsetGet($key)\n {\n return $this->items[$key];\n }", "public function offsetGet($key)\n {\n return $this->items[$key];\n }", "public function getSegment($key);", "public function offsetGet($key)\n {\n return static::$origin[$key];\n }", "public function key() {\n $var = key($this->translations);\n return $var;\n }", "public function __get($key)\n\t{\n\t\treturn t($key);\n\t}", "function ST_index($ST_key) {\n\t$this->ST_head = $this->ST_indexR($this->ST_head, $ST_key, 0);\n\treturn $this->ST_val;\n\t}", "public function key($key) {\n return $this->options['prefix'] . $key;\n }", "public function getKey($key = '') {\n if (strlen($key) == 0) {\n return '';\n } else {\n if (array_key_exists($key, $this->keys)) {\n return $this->keys[$key];\n } else {\n return $key;\n }\n }\n }", "public function getData($key='', $index=null)\n\t{\n\t\treturn parent::getData(str_replace('-', '_', $key), $index);\n\t}", "protected function t($key)\n {\n return static::translate($this->lang, $key);\n }", "public function key()\n {\n return $this->keys[$this->index];\n }", "public function getArg($key)\n {\n return isset($this->args[$key]) ? $this->args[$key] : \"\";\n }", "public function key(){\n return $this->index;\n }", "public function offsetGet( $key )\n\t{\n\t\treturn $this->get( $key );\n\t}", "static function get($key = '') {\n if ($key !== '' && array_key_exists($key, self::$results)) {\n return self::$results[$key];\n }\n $results = self::getAllPendingResults();\n if (count($results) === 1 && $key === '') {\n $singleKey = array_keys($results);\n return $results[$singleKey[0]];\n }\n return $results[$key];\n }", "public function getPhrase($keyString, $subKey = [])\n {\n if ($this->isXml) {\n $return = $this->getPhraseByXml($keyString);\n } else {\n $return = $this->getPhraseByJson($keyString, $subKey);\n }\n\n return $return;\n }", "public function __( $sKey ) {\r\n return $this->get( $sKey );\r\n }", "protected function getPluralized($key)\n {\n return isset($this->plural[$key]) ? $this->plural[$key] : $key;\n }", "public function get_key ()\n {\n $_key = $this->key;\n\n if ( ! empty( $_key ) && is_array( $_key ) )\n {\n $_key = join( ':', $_key );\n }\n\n return sanitise_key( $_key );\n }", "public function getSearchKey(): string\n {\n return $this->getKey();\n }", "public static function offsetGet($key)\n {\n return self::get($key);\n }", "public function getKey(): string\n {\n return $this->resque->getKey(self::KEY . $this->statistic);\n }", "public function getKey(): string {\n return $this->getType() . $this->getId() . $this->getLang() . $this->getRevisionId() ?? '';\n }", "static public function getPhraseByGroup ($key, $group) {\n Assert::isString($key);\n Assert::isString($group, TRUE);\n \n /**\n * If no drivers have been loaded yet, the chances are that the application hasn't finished\n * booting yet or literals aren't in use\n */\n if (self::$_initialised == FALSE) {\n return $key;\n }\n\n $culture = Culture_Info::current();\n\n if (self::cultureExists($culture) == FALSE) {\n throw new Exception(\"Culture does not exist\");\n }\n\n $arguments = func_get_args();\n\n // Look in the current/selected language\n foreach (self::$_cultureDrivers[$culture] as $driver) {\n if (call_user_func_array(array($driver, 'phraseExists'), $arguments) == TRUE) {\n return call_user_func_array(array($driver, 'getPhrase'), $arguments);\n }\n }\n\n // Look in the invariant language\n foreach (self::$_cultureDrivers[Culture_Info::invariantCulture] as $driver) {\n if (call_user_func_array(array($driver, 'phraseExists'), $arguments) == TRUE) {\n return call_user_func_array(array($driver, 'getPhrase'), $arguments);\n }\n }\n\n return $key;\n }", "public function key() {\n return $this->keys[$this->pos];\n }", "public function getWordByLineIndex($line, $index) {\r\n\t\t$lines = $this->readAtLine ( $line );\r\n\t\t$words = explode ( \" \", $lines );\r\n\t\treturn $words [$index];\r\n\t\r\n\t}", "public function key()\n {\n if ( ! $this->isTranslated()) {\n return $this->key;\n }\n\n $parts = explode('.', $this->key);\n\n array_splice($parts, $this->localeIndex, 0, $this->getLocalePlaceholder());\n\n return trim(implode('.', $parts), '.');\n }", "function apc_cache_get_logindex($key) {\n\treturn APC_CACHE_LOG_INDEX . \"-\" . $key;\n}", "public function getTitle($index)\r\n {\r\n $examples = array(\r\n 'Ut tempor risus ante',\r\n 'Lorem ipsum dolor sit amet',\r\n 'Cras rutrum nibh et quam',\r\n 'Cras Rutrum',\r\n 'Lorem ipsum dolor',\r\n 'Sed tempor-malesuada',\r\n 'Congue tempus lectus',\r\n 'Phasellus congue tempus',\r\n 'Vestibulum ante ipsum primis',\r\n 'Proin tristique Phasellus',\r\n 'Proin laoreet magna quis Phasellus',\r\n 'Pellentesque semper',\r\n 'Class aptent taciti sociosqu ad',\r\n 'Aliquam at tortor',\r\n 'Aenean malesuada',\r\n );\r\n \r\n $key = $index % (count($examples ) - 1);\r\n return $examples[$key];\r\n }", "public function offsetGet($key) {\n\t\treturn $this->get($key);\n\t}", "public function get( $key );", "public function offsetGet($key)\n {\n return $this->rules[$key];\n }", "function offsetGet($key)\n\t{\n\t\tif (isset($this->fields[$key]))\n\t\t\treturn $this->fields[$key];\n\t}", "protected function key()\n {\n $value = $this->keyVal();\n return key($value);\n }", "public function offsetGet($key)\n {\n return $this->data[$key];\n }", "public function key ()\n {\n return key($this->tokens);\n }", "public function offsetGet($key)\r\n {\r\n return $this->get($key);\r\n }", "public function offsetGet($key)\n {\n return $this->elements[$key];\n }", "public static function getKey();", "public static function getKey();", "public function get(string $key): string\n {\n return $this->exists($key) ? $this->variables[$key] : '';\n }", "public function offsetGet($translateKey)\n {\n return $this->query($translateKey);\n }", "static public function getPhrase ($key, $group = NULL, $culture = NULL, $driver = NULL) {\n Assert::isString($key);\n Assert::isString($group, TRUE);\n Assert::isString($culture, TRUE);\n Assert::isString($driver, TRUE);\n \n /**\n * If no drivers have been loaded yet, the chances are that the application hasn't finished\n * booting yet or literals aren't in use\n */\n if (self::$_initialised == FALSE) {\n return $key;\n }\n\n if ($culture === NULL) {\n $culture = Culture_Info::current();\n }\n\n if (self::cultureExists($culture) == FALSE) {\n throw new Exception(\"Culture does not exist\");\n }\n\n if ($driver !== NULL && self::$_cultureDrivers[$culture][$driver]->phraseExists($key, $group) == TRUE) {\n return self::$_cultureDrivers[$culture][$driver]->getPhrase($key, $group);\n }\n\n // Look in the current/selected language\n foreach (self::$_cultureDrivers[$culture] as $driver) {\n if ($driver->phraseExists($key, $group) == TRUE) {\n return $driver->getPhrase($key, $group);\n }\n }\n\n // Look in the invariant language\n foreach (self::$_cultureDrivers[Culture_Info::invariantCulture] as $driver) {\n if ($driver->phraseExists($key, $group) == TRUE) {\n return $driver->getPhrase($key, $group);\n }\n }\n\n return $key;\n }", "public function offsetGet(mixed $key): mixed;", "protected function _toArrayOffset($key): string\n {\n assert(is_scalar($key), 'Invalid argument $key: string expected');\n return (string) $key;\n }", "public function query_get($key) {\n\t\t\treturn \\uri\\query::get($this->object, $key);\n\t\t}", "public function key()\n\t{\n\t\treturn $this->_keys[$this->_idx];\n\t}", "public function key() {\n\t\t\treturn $this->index;\n\t\t}", "public function offsetGet($key)\n {\n return $this->get($key);\n }", "public function offsetGet($key)\n {\n return $this->get($key);\n }", "public function offsetGet($key)\n {\n return $this->get($key);\n }", "public function offsetGet($key)\n {\n return $this->get($key);\n }", "public function offsetGet($key)\n {\n return $this->__get($key);\n }", "public function offsetGet($key)\n {\n return $this->__get($key);\n }", "public function query($key)\n {\n return $this->parameters['get']->get($key); \n }", "public function getParam(string $key): string\n\t{\n\t\tif (!isset($this->params)) {\n\t\t\t$this->params = \\vtlib\\Functions::getQueryParams($this->getUrl());\n\t\t}\n\t\treturn $this->params[$key] ?? '';\n\t}", "public function offsetGet(mixed $key): mixed\n {\n return $this->getArgument($key);\n }", "function t($key='', $decorate=TRUE)\n {\n global $aLanguage;\n\n if (empty($key)) return '';\n if (@array_key_exists($key, $aLanguage)) return $aLanguage[$key];\n\n if ($decorate) return '<span style=\"color: #f00; text-decoration: blink;\" title=\"['.$key.'] - not exist\">'. $key.'</span>';\n else return $key;\n }", "public function offsetGet($key)\n {\n return $this->$key;\n }", "public static function get($key);", "public static function get($key);", "public function findFirstByKey($key);", "private function get($key)\n {\n return $this->data[$key];\n }", "public function getKeyword() : string\n {\n return $this->getMatchedText();\n }", "public static function get($key){\n\t\tif(isset($_POST[$key])){\n\t\t\treturn $_POST[$key];\n\t\t}else if(isset($_GET[$key])){\n\t\t\treturn $_GET[$key];\n\t\t}\n\t\treturn '';\n\t}", "public function offsetGet($key)\n\t{\n\t\treturn $this->stack[$key];\n\t}", "public function getKey(): string;", "public function getKey(): string;", "public function get(string $key) {\n\t\treturn $this->data[$key];\n\t}", "public function key()\n {\n return $this->aliases[$this->position];\n }", "function get($key);", "protected function processKey($key)\n {\n if (!empty($this->keySuffix)) {\n return $key . '|' . $this->keySuffix;\n } else {\n return $key;\n }\n }" ]
[ "0.7205845", "0.61944443", "0.6101978", "0.5975041", "0.5945912", "0.5911684", "0.5908087", "0.5894694", "0.57735807", "0.5771883", "0.57632256", "0.57475144", "0.57296795", "0.57191443", "0.5714679", "0.5706119", "0.5691688", "0.56915486", "0.5674771", "0.56646717", "0.56438345", "0.56413174", "0.56040657", "0.5583525", "0.5578676", "0.55786324", "0.55746734", "0.55659854", "0.55659854", "0.5553357", "0.5537991", "0.55373037", "0.5534749", "0.55299705", "0.5524598", "0.55183053", "0.55182797", "0.55112076", "0.549692", "0.54961073", "0.5494764", "0.5488067", "0.5486668", "0.548072", "0.5473175", "0.5472414", "0.546179", "0.5459014", "0.5454139", "0.54425484", "0.5431743", "0.54303753", "0.5429545", "0.5420165", "0.54170614", "0.5388681", "0.5387423", "0.538193", "0.53725183", "0.5350648", "0.535006", "0.5349156", "0.5348171", "0.5345853", "0.5341883", "0.53369236", "0.5334478", "0.5334478", "0.532788", "0.5321481", "0.5318017", "0.5315828", "0.53150636", "0.53118825", "0.5308577", "0.5307054", "0.53036016", "0.53036016", "0.53036016", "0.53036016", "0.52989334", "0.52989334", "0.52946997", "0.5294626", "0.52939004", "0.5291011", "0.52881575", "0.5284246", "0.5284246", "0.5284149", "0.52772975", "0.5273592", "0.52603287", "0.525848", "0.52563524", "0.52563524", "0.5255237", "0.52547497", "0.5250106", "0.5249062" ]
0.7665775
0
Display a listing of the resource.
public function index() { $fixes = Fix::orderBy('id', 'DESC') ->paginate(20); $fix_admin = check_power('報修系統', 'A', auth()->user()->id); $data = [ 'fixes' => $fixes, 'fix_admin' => $fix_admin, ]; return view('fixes.index', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('fixes.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $att['type'] = $request->input('type'); $att['user_id'] = auth()->user()->id; $att['title'] = $request->input('title'); $att['content'] = $request->input('content'); $att['situation'] = "3"; Fix::create($att); $att2['email'] = $request->input('email'); $user = User::find(auth()->user()->id); $user->update($att2); //寄信給管理者 $user_powers = UserPower::where('name', '報修系統') ->where('type', 'A') ->get(); foreach ($user_powers as $user_power) { if (!empty($user_power->user->email)) { $subject = '學校網站中「' . auth()->user()->name . '」在「報修設備」寫了:' . $att['title']; $body = $att['content']; send_mail($user_power->user->email, $subject, $body); } } return redirect()->route('fixes.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.728708", "0.7144915", "0.7132209", "0.66401577", "0.66205436", "0.65682197", "0.6526531", "0.65085673", "0.6449452", "0.63749766", "0.63726056", "0.6364582", "0.6364582", "0.6364582", "0.6341498", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726" ]
0.0
-1
Display the specified resource.
public function show(Fix $fix) { $fix_admin = check_power('報修系統', 'A', auth()->user()->id); $data = [ 'fix' => $fix, 'fix_admin' => $fix_admin, ]; return view('fixes.show', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Fix $fix) { $fix->update($request->all()); $att['email'] = $request->input('email'); $user = User::find(auth()->user()->id); $user->update($att); //寄信 if (!empty($fix->user->email)) { $situation = ['2' => '處理中', '1' => '處理完畢']; $subject = '回覆「學校網站」中「報修設備」的問題'; $body = "您問到:\r\n"; $body .= $request->input('title') . "\r\n"; $body .= "\r\n系統管理員回覆:\r\n"; $body .= $situation[$request->input('situation')] . "\r\n"; $body .= $request->input('reply'); $body .= "\r\n-----這是系統信件,請勿回信-----"; send_mail($fix->user->email, $subject, $body); } return redirect()->route('fixes.show', $fix->id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Fix $fix) { $fix->delete(); return redirect()->route('fixes.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1